{"version":3,"file":"SVGComponent.VbhmJweu.mjs","names":["useRef","useMemo"],"sources":["https:/framerusercontent.com/modules/gxeJqdc2FIMyGChZv6P5/S7BIKbu8xV5z15iYziLz/SVGComponent.js"],"sourcesContent":["// Instructions: make this rotate; fix issues with the component.\n// SVG component with customizable color\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useMemo,useRef}from\"react\";import{motion,useInView}from\"framer-motion\";/**\n * @framerIntrinsicWidth 120\n * @framerIntrinsicHeight 120\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SVGComponent(props){const{svgCode,color,stroke,strokeColor,rotate,duration,direction,style,renderMode,image}=props;const isStatic=useIsStaticRenderer();const ref=useRef(null);const inView=useInView(ref,{amount:.2});const processedSVG=useMemo(()=>{if(renderMode!==\"svg\")return\"\";if(!svgCode)return\"\";let processed=svgCode.trim();if(processed.startsWith(\"<svg\")){processed=processed.replace(/fill=\"[^\"]*\"/g,`fill=\"${color}\"`);if(stroke){processed=processed.replace(/stroke=\"[^\"]*\"/g,`stroke=\"${strokeColor}\"`);}else{processed=processed.replace(/\\sstroke=\"[^\"]*\"/g,\"\");}if(stroke&&!processed.includes(\"stroke=\")){processed=processed.replace(\"<svg\",`<svg stroke=\"${strokeColor}\"`);}if(!processed.includes(\"fill=\")&&!processed.includes(\"stroke=\")){processed=processed.replace(\"<svg\",`<svg fill=\"${color}\"`);}processed=processed.replace(/width=\"[^\"]*\"/,'width=\"100%\"');processed=processed.replace(/height=\"[^\"]*\"/,'height=\"100%\"');if(!processed.includes(\"width=\")){processed=processed.replace(\"<svg\",'<svg width=\"100%\"');}if(!processed.includes(\"height=\")){processed=processed.replace(\"<svg\",'<svg height=\"100%\"');}}return processed;},[svgCode,color,stroke,strokeColor,renderMode]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\",...style},children:renderMode===\"image\"?/*#__PURE__*/_jsx(motion.img,{src:image?.src,srcSet:image?.srcSet,alt:image?.alt||\"\",style:{width:\"100%\",height:\"100%\",objectFit:\"contain\",transformOrigin:\"50% 50%\",display:\"block\"},animate:rotate&&!isStatic&&inView?{rotate:direction===\"counter\"?-360:360}:{rotate:0},transition:rotate&&!isStatic&&inView?{repeat:Number.POSITIVE_INFINITY,duration:Math.max(.1,duration),ease:\"linear\"}:undefined}):/*#__PURE__*/_jsx(motion.div,{style:{width:\"100%\",height:\"100%\",transformOrigin:\"50% 50%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},animate:rotate&&!isStatic&&inView?{rotate:direction===\"counter\"?-360:360}:{rotate:0},transition:rotate&&!isStatic&&inView?{repeat:Number.POSITIVE_INFINITY,duration:Math.max(.1,duration),ease:\"linear\"}:undefined,dangerouslySetInnerHTML:{__html:processedSVG}})});}addPropertyControls(SVGComponent,{renderMode:{type:ControlType.Enum,title:\"Mode\",options:[\"image\",\"svg\"],optionTitles:[\"Image\",\"SVG\"],defaultValue:\"image\",displaySegmentedControl:true},image:{type:ControlType.ResponsiveImage,title:\"Image\",hidden:({renderMode})=>renderMode!==\"image\"},svgCode:{type:ControlType.String,title:\"SVG Code\",displayTextArea:true,defaultValue:'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z\"/></svg>',hidden:({renderMode})=>renderMode!==\"svg\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\",hidden:({renderMode})=>renderMode!==\"svg\"},stroke:{type:ControlType.Boolean,title:\"Stroke\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\",hidden:({renderMode})=>renderMode!==\"svg\"},strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#000000\",hidden:({stroke,renderMode})=>!stroke||renderMode!==\"svg\"},rotate:{type:ControlType.Boolean,title:\"Rotate\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2,min:.1,max:20,step:.1,unit:\"s\",hidden:({rotate})=>!rotate},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"clockwise\",\"counter\"],optionTitles:[\"Clockwise\",\"Counter\"],defaultValue:\"clockwise\",displaySegmentedControl:true,hidden:({rotate})=>!rotate}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SVGComponent\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"120\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"120\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SVGComponent.map"],"mappings":"iPAQG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,QAAM,SAAO,cAAY,SAAO,WAAS,YAAU,QAAM,aAAW,SAAO,EAAY,EAAS,GAAqB,CAAO,EAAIA,EAAO,KAAK,CAAO,EAAO,EAAU,EAAI,CAAC,OAAO,GAAG,CAAC,CAAO,EAAaC,MAAY,CAAgC,GAA5B,IAAa,OAAkB,CAAC,EAAQ,MAAM,GAAG,IAAI,EAAU,EAAQ,MAAM,CAA+wB,OAA3wB,EAAU,WAAW,OAAO,GAAE,EAAU,EAAU,QAAQ,gBAAgB,SAAS,EAAM,GAAG,CAAC,AAA0F,EAAvF,EAAkB,EAAU,QAAQ,kBAAkB,WAAW,EAAY,GAAG,CAAiB,EAAU,QAAQ,oBAAoB,GAAG,CAAK,GAAQ,CAAC,EAAU,SAAS,UAAU,GAAE,EAAU,EAAU,QAAQ,OAAO,gBAAgB,EAAY,GAAG,EAAK,CAAC,EAAU,SAAS,QAAQ,EAAE,CAAC,EAAU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