{"version":3,"file":"Embed.CyWH3VCS.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/nFUgE5PFzWDJhPR19PmN/ByYm90xG4M0LH8SahI74/wPdToRDIO.js","https:/framer.com/m/framer/default-utils.js","https:/framerusercontent.com/modules/o1PI5S8YtkA5bP5g4dFz/9zLIz4fn80IR9zpOx18Q/Embed.js"],"sourcesContent":["// Generated by Framer (ceb690b)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 10 20 C 15.523 20 20 15.523 20 10 C 20 4.477 15.523 0 10 0 C 4.477 0 0 4.477 0 10 C 0 15.523 4.477 20 10 20\" fill-opacity=\"var(--42b6oa, 0.16)\" fill=\"var(--4i27ky, rgb(0, 0, 0))\" height=\"20px\" id=\"Fk1wwjhF7\" transform=\"translate(2 2)\" width=\"20px\"/><path d=\"M 5.757 14.243 L 14.243 5.757 M 14.243 14.243 L 5.757 5.757 M 20 10 C 20 15.523 15.523 20 10 20 C 4.477 20 0 15.523 0 10 C 0 4.477 4.477 0 10 0 C 15.523 0 20 4.477 20 10\" fill=\"transparent\" height=\"20px\" id=\"ju3uhBZd8\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--b8xnka, 2)\" stroke=\"var(--4i27ky, rgb(0, 0, 0))\" transform=\"translate(2 2)\" width=\"20px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,akr7Ge2dd:width1??props.akr7Ge2dd??2,PF8qIBMI7:alpha??props.PF8qIBMI7??.16,rm13cFo5g:color??props.rm13cFo5g??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,rm13cFo5g,akr7Ge2dd,PF8qIBMI7,...restProps}=getProps(props);const href=useSVGTemplate(\"4061669693\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-FX7AD\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--42b6oa\":PF8qIBMI7,\"--4i27ky\":rm13cFo5g,\"--b8xnka\":akr7Ge2dd,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-FX7AD { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"rm13cFo5g\":\"color\",\"akr7Ge2dd\":\"width1\",\"PF8qIBMI7\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Close Circle\",\"color\":{\"type\":\"variable\",\"value\":\"4i27ky\"},\"set\":{\"localId\":\"vectorSet/jIUXDd189\",\"id\":\"jIUXDd189\",\"moduleId\":\"mbMVkRB5lkkRzWT95l5L\"}}\n */const Icon=withCSS(Component,css,\"framer-FX7AD\");Icon.displayName=\"Close Circle\";export default Icon;addPropertyControls(Icon,{rm13cFo5g:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},akr7Ge2dd:{defaultValue:2,displayStepper:true,hidden:false,max:4,min:1,title:\"Width\",type:ControlType.Number},PF8qIBMI7:{defaultValue:.16,displayStepper:true,hidden:false,max:1,min:0,step:.01,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVariables\":\"{\\\"rm13cFo5g\\\":\\\"color\\\",\\\"akr7Ge2dd\\\":\\\"width1\\\",\\\"PF8qIBMI7\\\":\\\"alpha\\\"}\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Close Circle\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"4i27ky\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/jIUXDd189\\\",\\\"id\\\":\\\"jIUXDd189\\\",\\\"moduleId\\\":\\\"mbMVkRB5lkkRzWT95l5L\\\"}}\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","/*\n * index (framer/default-utils@0.45.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/G4IfyjvwmaeSBpdb4TWu/OIjZRBmWDcIE2B6qgG1j/index.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useIsOnCanvas,emptyStateStyle,containerStyles}from\"https://framer.com/m/framer/default-utils.js\";/**\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n *\n * @framerDisableUnlink\n */ export default function Embed({type,url,html}){if(type===\"url\"&&url){return /*#__PURE__*/ _jsx(EmbedURL,{url:url});}if(type===\"html\"&&html){return /*#__PURE__*/ _jsx(EmbedHTML,{html:html});}return /*#__PURE__*/ _jsx(Instructions,{});};addPropertyControls(Embed,{type:{type:ControlType.Enum,defaultValue:\"url\",displaySegmentedControl:true,options:[\"url\",\"html\"],optionTitles:[\"URL\",\"HTML\"]},url:{title:\"URL\",type:ControlType.String,description:\"Some websites don’t support embedding.\",hidden(props){return props.type!==\"url\";}},html:{title:\"HTML\",displayTextArea:true,type:ControlType.String,hidden(props){return props.type!==\"html\";}}});function Instructions(){return /*#__PURE__*/ _jsx(\"div\",{style:{...emptyStateStyle,overflow:\"hidden\"},children:/*#__PURE__*/ _jsx(\"div\",{style:centerTextStyle,children:\"To embed a website or widget, add it to the properties\\xa0panel.\"})});}function EmbedURL({url}){// Add https:// if the URL does not have a protocol.\nif(!/[a-z]+:\\/\\//.test(url)){url=\"https://\"+url;}const onCanvas=useIsOnCanvas();// We need to check if the url is blocked inside an iframe by the X-Frame-Options\n// or Content-Security-Policy headers on the backend.\nconst[state,setState]=useState(onCanvas?undefined:false);useEffect(()=>{// We only want to check on the canvas.\n// On the website we want to avoid the additional delay.\nif(!onCanvas)return;// TODO: We could also use AbortController here.\nlet isLastEffect=true;setState(undefined);async function load(){const response=await fetch(\"https://api.framer.com/functions/check-iframe-url?url=\"+encodeURIComponent(url));if(response.status==200){const{isBlocked}=await response.json();if(isLastEffect){setState(isBlocked);}}else{const message=await response.text();console.error(message);const error=new Error(\"This site can’t be reached.\");setState(error);}}load().catch(error=>{console.error(error);setState(error);});return()=>{isLastEffect=false;};},[url]);if(!url.startsWith(\"https://\")){return /*#__PURE__*/ _jsx(ErrorMessage,{message:\"Unsupported protocol.\"});}if(state===undefined){return /*#__PURE__*/ _jsx(LoadingIndicator,{});}if(state instanceof Error){return /*#__PURE__*/ _jsx(ErrorMessage,{message:state.message});}if(state===true){const message=`Can't embed ${url} due to its content security policy.`;return /*#__PURE__*/ _jsx(ErrorMessage,{message:message});}return /*#__PURE__*/ _jsx(\"iframe\",{src:url,style:iframeStyle,loading:\"lazy\",// @ts-ignore\nfetchPriority:onCanvas?\"low\":\"auto\",referrerPolicy:\"no-referrer\",sandbox:getSandbox(onCanvas)});}const iframeStyle={width:\"100%\",height:\"100%\",border:\"none\"};function getSandbox(onCanvas){const result=[\"allow-same-origin\",\"allow-scripts\"];if(!onCanvas){result.push(\"allow-downloads\",\"allow-forms\",\"allow-modals\",\"allow-orientation-lock\",\"allow-pointer-lock\",\"allow-popups\",\"allow-popups-to-escape-sandbox\",\"allow-presentation\",\"allow-storage-access-by-user-activation\",\"allow-top-navigation-by-user-activation\");}return result.join(\" \");}function EmbedHTML({html}){const ref=useRef();// If the HTML contains a script tag we can't use\n// dangerouslySetInnerHTML because it doesn't execute\n// scripts on the client. Otherwise, we can benefit\n// from SSG by using dangerouslySetInnerHTML.\nconst hasScript=html.includes(\"</script>\");useEffect(()=>{if(!hasScript)return;const div=ref.current;div.innerHTML=html;executeScripts(div);return()=>{div.innerHTML=\"\";};},[html,hasScript]);return /*#__PURE__*/ _jsx(\"div\",{ref:ref,style:htmlStyle,dangerouslySetInnerHTML:!hasScript?{__html:html}:undefined});}const htmlStyle={width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\"};// This function replaces scripts with executable ones.\n// https://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with-innerhtml\nfunction executeScripts(node){if(node instanceof Element&&node.tagName===\"SCRIPT\"){const script=document.createElement(\"script\");script.text=node.innerHTML;for(const{name,value}of node.attributes){script.setAttribute(name,value);}node.parentElement.replaceChild(script,node);}else{for(const child of node.childNodes){executeScripts(child);}}}// Generic components\nfunction LoadingIndicator(){return /*#__PURE__*/ _jsx(\"div\",{className:\"framerInternalUI-componentPlaceholder\",style:{...containerStyles,overflow:\"hidden\"},children:/*#__PURE__*/ _jsx(\"div\",{style:centerTextStyle,children:\"Loading…\"})});}function ErrorMessage({message}){return /*#__PURE__*/ _jsx(\"div\",{className:\"framerInternalUI-errorPlaceholder\",style:{...containerStyles,overflow:\"hidden\"},children:/*#__PURE__*/ _jsxs(\"div\",{style:centerTextStyle,children:[\"Error: \",message]})});}const centerTextStyle={textAlign:\"center\",minWidth:140};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Embed\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerDisableUnlink\":\"\",\"framerIntrinsicWidth\":\"600\",\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Embed.map"],"mappings":"uXAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,SAAS,CAAC,EAAG,CAAO,EAAU,EAAO,OAAO,EAAK,CAAO,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,WAAS,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,WAAS,CAAC,EAAG,CAAO,EAAI,kwBAAwwB,GAAU,CAAC,QAAM,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAQ,EAAM,WAAW,EAAE,UAAU,GAAO,EAAM,WAAW,IAAI,UAAU,GAAO,EAAM,WAAW,eAAe,EAS3lD,EAAK,EATsnD,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,YAAU,YAAU,GAAG,GAAW,EAAS,EAAM,CAAO,EAAK,EAAe,aAAa,EAAI,CAAC,OAAoB,EAAK,EAAI,CAAC,GAAG,EAAU,UAAU,EAAG,eAAe,EAAU,CAAU,W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