{"version":3,"file":"Embed.BToHMtql.mjs","names":[],"sources":["https:/framerusercontent.com/modules/cuQH4dmpDnV8YK1mSgQX/tTLhbOFToDhKcwOVmn8E/useFontControls.js","https:/framer.com/m/framer/default-utils.js@0.44.0","https:/framerusercontent.com/modules/9wD3PivBQLrOwsQi12c9/uPSwXLO1JCiWk5aMwrmT/Embed.js"],"sourcesContent":["// @ts-ignore\nimport { fontStore } from \"framer\";\nimport { useEffect } from \"react\";\n// @ts-ignore\nimport { fontStack } from \"https://framerusercontent.com/modules/VTUDdizacRHpwbkOamr7/AykinQJbgwl92LvMGZwu/constants.js\";\nconst fontWeights = {\n    100: \"Thin\",\n    200: \"Extra-light\",\n    300: \"Light\",\n    400: \"Regular\",\n    500: \"Medium\",\n    600: \"Semi-bold\",\n    700: \"Bold\",\n    800: \"Extra-bold\",\n    900: \"Black\"\n};\nexport function useFontControls(props) {\n    const { fontFamily , fontSize , fontWeight , font  } = props;\n    const fontWeightName = fontWeights[fontWeight];\n    const customFontStack = `\"${fontFamily} ${fontWeightName}\", \"${fontFamily}\", ${fontStack}`;\n    const fontFamilyStyle = fontFamily ? {\n        fontSize,\n        fontWeight,\n        fontFamily: customFontStack\n    } : {\n        fontSize,\n        fontWeight\n    };\n    const fetchCustomFonts = async ()=>{\n        await fontStore.loadWebFontsFromSelectors([\n            `CUSTOM;${fontFamily}`,\n            `CUSTOM;${fontFamily} ${fontWeightName}`,\n            `GF;${fontFamily}-${fontWeightName.toLowerCase()}`, \n        ]).catch((e)=>console.error(e)\n        );\n    };\n    useEffect(()=>{\n        if (font) fetchCustomFonts();\n    }, [\n        font,\n        fontFamily,\n        fontWeight\n    ]);\n    return fontFamilyStyle;\n}\n\nexport const __FramerMetadata__ = {\"exports\":{\"useFontControls\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useFontControls.map","import { defaultEvents, localeOptions, fontControls, fontSizeOptions, emptyStateStyle, containerStyles, fontStack } from \"https://framerusercontent.com/modules/VTUDdizacRHpwbkOamr7/AykinQJbgwl92LvMGZwu/constants.js\";\nimport { useOnEnter, useOnExit } from \"https://framerusercontent.com/modules/D4TWeLfcxT6Tysr2BlYg/iZjmqdxVx1EOiM3k1FaW/useOnNavigationTargetChange.js\";\nimport { useConstant } from \"https://framerusercontent.com/modules/ExNgrA7EJTKUPpH6vIlN/eiOrSJ2Ab5M9jPCvVwUz/useConstant.js\";\nimport { colorTokentoValue, colorFromToken } from \"https://framerusercontent.com/modules/D2Lz5CmnNVPZFFiZXalt/QaCzPbriZBfXWZIIycFI/colorFromToken.js\";\nimport { isMotionValue } from \"https://framerusercontent.com/modules/3mKFSGQqKHV82uOV1eBc/5fbRLvOpxZC0JOXugvwm/isMotionValue.js\";\nimport { useUniqueClassName, randomID } from \"https://framerusercontent.com/modules/xDiQsqBGXzmMsv7AlEVy/uhunpMiNsbXxzjlXsg1y/useUniqueClassName.js\";\nimport { getVariantControls } from \"https://framerusercontent.com/modules/ETACN5BJyFTSo0VVDJfu/NHRqowOiXkF9UwOzczF7/variantUtils.js\";\nimport { useIsBrowserSafari } from \"https://framerusercontent.com/modules/eMBrwoqQK7h6mEeGQUH8/GuplvPJVjmxpk9zqOTcb/isBrowser.js\";\nimport { useMultiOnChange, useOnChange } from \"https://framerusercontent.com/modules/v9AWX2URmiYsHf7GbctE/XxKAZ9KlhWqf5x1JMyyF/useOnChange.js\";\nimport { mstoMinAndSec, secondsToMinutes } from \"https://framerusercontent.com/modules/4zHZnO5JojN1PrIbu2jm/revv9QCWpkh8lPzi2jje/time.js\";\nimport { useAutoMotionValue } from \"https://framerusercontent.com/modules/kNDwabfjDEb3vUxkQlZS/fSIr3AOAYbGlfSPgXpYu/useAutoMotionValue.js\";\nimport { useFontControls } from \"https://framerusercontent.com/modules/cuQH4dmpDnV8YK1mSgQX/tTLhbOFToDhKcwOVmn8E/useFontControls.js\";\nimport { useRenderTarget, useIsInPreview, useIsOnCanvas } from \"https://framerusercontent.com/modules/afBE9Yx1W6bY5q32qPxe/m3q7puE2tbo1S2C0s0CT/useRenderTarget.js\";\nimport { useControlledState } from \"https://framerusercontent.com/modules/zGkoP8tPDCkoBzMdt5uq/0zFSjxIYliHxrQQnryFX/useControlledState.js\";\nimport { usePadding, useRadius, paddingControl, borderRadiusControl } from \"https://framerusercontent.com/modules/5SM58HxZHxjjv7aLMOgQ/WXz9i6mVki0bBCrKdqB3/propUtils.js\";\nimport { detectAutoSizingAxis } from \"https://framerusercontent.com/modules/8CkHAZatUz1UR8jNTcfD/HwbnIAZlUmQ2oTpcLkaH/detectAutoSizingAxis.js\";\nexport { useOnEnter, useOnExit, defaultEvents, isMotionValue, colorFromToken, colorTokentoValue, localeOptions, fontControls, fontSizeOptions, emptyStateStyle, containerStyles, fontStack, useUniqueClassName, getVariantControls, useIsBrowserSafari, randomID, useConstant, useMultiOnChange, useOnChange, usePadding, useRadius, paddingControl, borderRadiusControl, mstoMinAndSec, useFontControls, secondsToMinutes, useAutoMotionValue, useRenderTarget, useIsInPreview, useControlledState, detectAutoSizingAxis, useIsOnCanvas,  };\n\nexport const __FramerMetadata__ = {\"exports\":{\"usePadding\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fontControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useAutoMotionValue\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"mstoMinAndSec\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useConstant\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomID\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useOnChange\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useOnExit\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"colorFromToken\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useFontControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"borderRadiusControl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useControlledState\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useUniqueClassName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"paddingControl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useMultiOnChange\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getVariantControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"colorTokentoValue\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultEvents\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"detectAutoSizingAxis\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useRenderTarget\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"secondsToMinutes\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fontSizeOptions\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useOnEnter\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isMotionValue\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsInPreview\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"emptyStateStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fontStack\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsOnCanvas\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsBrowserSafari\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useRadius\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"localeOptions\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./index.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useIsOnCanvas}from\"https://framer.com/m/framer/default-utils.js@0.44.0\";function Instructions(props){return /*#__PURE__*/ _jsxs(\"div\",{style:{...containerStyle,background:\"rgba(136, 85, 255, 0.1)\"},children:[/*#__PURE__*/ _jsx(\"p\",{children:\" 🖼 \"}),/*#__PURE__*/ _jsxs(\"p\",{style:{margin:0,marginBottom:5},children:[\" \",\"Add a URL in the properties panel\"]}),/*#__PURE__*/ _jsxs(\"p\",{style:{margin:0,fontWeight:500,opacity:.5,fontSize:14,width:440},children:[\"Make sure the given web address starts with \",/*#__PURE__*/ _jsx(\"b\",{children:\"http://\"}),\" or\",\" \",/*#__PURE__*/ _jsx(\"b\",{children:\"https://\"}),\".\"]})]});}function isUrlInvalid(text){const startsWithHttp=text.startsWith(\"http://\")||text.startsWith(\"https://\");if(text===undefined||text===null||text===\"\"||!startsWithHttp){return true;}else{return false;}}const baseUrlBoxUrl=\"https://api.urlbox.io/v1/xsxnBMh5ojGp7MBU/f8ce112e84322e7122285a4b3f22e0f54c6c793a/png?wait_until=requestsfinished&retina=true&lowercase=86400&unique=2021-08-03T12%3A02%3A08.187Z&quality=95\";/**\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */ export default function Embed(props){const{text,renderOnCanvas}=props;const isOnCanvas=useIsOnCanvas();if(isUrlInvalid(text)){return /*#__PURE__*/ _jsx(Instructions,{...props});}const shouldRender=renderOnCanvas||!renderOnCanvas&&!isOnCanvas;// url=https%3A%2F%2Fframer.com%2Fshare%2Fp0ssjuuaq74QASXWVUqy%3Ffullscreen%3D1&width=700&height=525&\n// const placeholderImage = useMemo(() => {\n//     const url = new URL(baseUrlBoxUrl)\n//     url.searchParams.append(\"url\", encodeURIComponent(text))\n//     url.searchParams.append(\"height\", \"500\")\n//     url.searchParams.append(\"width\", \"500\")\n//     console.log(Array.from(url.searchParams.entries()))\n//     console.log(url.toString())\n//     return url.toString()\n// }, [text])\n//             <img src={placeholderImage} style={{ height: 50, width: 50 }} />\nreturn /*#__PURE__*/ _jsx(\"div\",{style:{...containerStyle,background:shouldRender?\"none\":\"rgba(136, 85, 255, 0.1)\"},children:shouldRender?/*#__PURE__*/ _jsx(\"iframe\",{onError:e=>console.log(\"meep\",e),src:props.text,frameBorder:0,style:{width:\"100%\",height:\"100%\"}}):/*#__PURE__*/ _jsx(\"h3\",{children:\"Hidden\"})});};Embed.defaultProps={text:\"\",// text: \"http://www.framer.com\",\nrenderOnCanvas:true,width:800,height:600};addPropertyControls(Embed,{text:{type:ControlType.String,title:\"URL\",defaultValue:Embed.defaultProps.text},renderOnCanvas:{type:ControlType.Boolean,title:\"On Canvas\",enabledTitle:\"Show\",disabledTitle:\"Hide\"}});const containerStyle={height:\"100%\",width:\"100%\",display:\"flex\",overflow:\"hidden\",borderRadius:\"20px\",alignItems:\"center\",justifyContent:\"center\",fontSize:16,fontWeight:600,color:\"#BB88FF\",flexDirection:\"column\",textAlign:\"center\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Embed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"600\",\"framerIntrinsicWidth\":\"800\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Embed.map"],"mappings":"2oBAIA,AAHA,GAAmC,CACnC,GAAkC,CAElC,GAAyH,YCUzH,AAdA,GAAwN,CACxN,GAAuJ,CACvJ,GAA6H,CAC7H,GAAsJ,CACtJ,GAAiI,CACj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