{"version":3,"file":"HtmlInjector.rqdphO2p.mjs","names":["useMemo","__esmMin","pe","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","c","init_jsx_runtime","ce","addPropertyControls","init_framer_CN96F41L","ControlType","HtmlInjector","props","processedHTML","html","htmlContent","sanitize","allowScripts","javascriptCode","error","init_HtmlInjector"],"sources":["https:/framerusercontent.com/modules/uJ6MoqSaJoTtuTootMQc/5K3Fc0SpYr5nl8pWyrgJ/HtmlInjector.js"],"sourcesContent":["// HTML Injector component that renders custom HTML content\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function HtmlInjector(props){const{htmlContent=\"<p>Paste your HTML content here</p>\",allowScripts=false,sanitize=true,javascriptCode=\"\"}=props;const processedHTML=useMemo(()=>{let html=htmlContent;if(sanitize&&!allowScripts){// Remove script tags and event handlers for security\nhtml=html.replace(/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\"\");html=html.replace(/\\son\\w+=\"[^\"]*\"/gi,\"\");html=html.replace(/\\son\\w+='[^']*'/gi,\"\");html=html.replace(/javascript:/gi,\"\");}return html;},[htmlContent,allowScripts,sanitize]);// Execute JavaScript code when component loads\nuseEffect(()=>{if(javascriptCode&&typeof window!==\"undefined\"){try{// Create a function to execute the code in a controlled scope\nconst executeCode=new Function(javascriptCode);executeCode();}catch(error){console.error(\"Error executing JavaScript code:\",error);}}},[javascriptCode]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"auto\",position:\"relative\"},dangerouslySetInnerHTML:{__html:processedHTML}});}addPropertyControls(HtmlInjector,{htmlContent:{type:ControlType.String,title:\"HTML Content\",defaultValue:\"<p>Paste your HTML content here</p>\",displayTextArea:true,placeholder:\"Enter your HTML code...\"},javascriptCode:{type:ControlType.String,title:\"JavaScript Code\",defaultValue:\"\",displayTextArea:true,placeholder:\"console.log('Component loaded!');\"},allowScripts:{type:ControlType.Boolean,title:\"Allow Scripts\",defaultValue:false,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"},sanitize:{type:ControlType.Boolean,title:\"Sanitize HTML\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HtmlInjector\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HtmlInjector.map"],"mappings":"A,+LAIG,SAAwBY,EAAa,EAAM,CAAC,GAAK,CAAC,cAAY,sCAAsC,eAAa,GAAM,WAAS,GAAK,iBAAe,IAAIC,EAAYC,EAAcd,MAAY,CAAC,IAAIe,EAAKC,EACJ,OADmBC,GAAU,CAACC,IACrO,EAAKH,EAAK,QAAQ,sDAAsD,EAAE,EAAE,EAAKA,EAAK,QAAQ,oBAAoB,EAAE,EAAE,EAAKA,EAAK,QAAQ,oBAAoB,EAAE,EAAE,EAAKA,EAAK,QAAQ,gBAAgB,EAAE,GAAUA,CAAK,EAAE,CAACC,EAAYE,EAAaD,CAAQ,CAAC,EAE/F,OADzJT,MAAc,CAAC,GAAGW,GAAuBd,IAAS,OAAa,GAAG,CAC5C,SAASc,CAA0B,CAAC,CAAC,CAAE,OAAOC,EAAM,CAAC,QAAQ,MAAM,mCAAmCA,CAAK,CAAE,CAAE,EAAE,CAACD,CAAc,CAAC,EAAsB,gBAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,OAAO,SAAS,UAAU,EAAE,wBAAwB,CAAC,OAAOL,CAAa,CAAC,CAAC,CAAE,C,8CAACL,EAAoBG,EAAa,CAAC,YAAY,CAAC,KAAKD,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