{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/afBE9Yx1W6bY5q32qPxe/m3q7puE2tbo1S2C0s0CT/useRenderTarget.js", "ssg:https://framerusercontent.com/modules/trvggckC71we6KlQH0QS/05bihsYq25E4oN08oOsY/Embed_2.js"],
  "sourcesContent": ["import { useMemo } from \"react\";\nimport { RenderTarget } from \"framer\";\nexport function useRenderTarget() {\n  const currentRenderTarget = useMemo(() => RenderTarget.current(), []);\n  return currentRenderTarget;\n}\nexport function useIsInPreview() {\n  const inPreview = useMemo(() => RenderTarget.current() === RenderTarget.preview, []);\n  return inPreview;\n}\nexport function useIsOnCanvas() {\n  const onCanvas = useMemo(() => RenderTarget.current() === RenderTarget.canvas, []);\n  return onCanvas;\n}\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"useIsInPreview\": {\n      \"type\": \"function\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"useRenderTarget\": {\n      \"type\": \"function\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"useIsOnCanvas\": {\n      \"type\": \"function\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    }\n  }\n};\n//# sourceMappingURL=./useRenderTarget.map", "import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { useIsOnCanvas } from \"https://framer.com/m/framer/default-utils.js@0.44.0\";\nfunction Instructions(props) {\n  return /*#__PURE__*/_jsxs(\"div\", {\n    style: {\n      ...containerStyle,\n      background: \"rgba(136, 85, 255, 0.1)\"\n    },\n    children: [/*#__PURE__*/_jsx(\"p\", {\n      children: \" \uD83D\uDDBC \"\n    }), /*#__PURE__*/_jsxs(\"p\", {\n      style: {\n        margin: 0,\n        marginBottom: 5\n      },\n      children: [\" \", \"Add a URL in the properties panel\"]\n    }), /*#__PURE__*/_jsxs(\"p\", {\n      style: {\n        margin: 0,\n        fontWeight: 500,\n        opacity: 0.5,\n        fontSize: 14,\n        width: 440\n      },\n      children: [\"Make sure the given web address starts with \", /*#__PURE__*/_jsx(\"b\", {\n        children: \"http://\"\n      }), \" or\", \" \", /*#__PURE__*/_jsx(\"b\", {\n        children: \"https://\"\n      }), \".\"]\n    })]\n  });\n}\nfunction isUrlInvalid(text) {\n  const startsWithHttp = text.startsWith(\"http://\") || text.startsWith(\"https://\");\n  if (text === undefined || text === null || text === \"\" || !startsWithHttp) {\n    return true;\n  } else {\n    return false;\n  }\n}\nconst 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                                                                                                                                                                                                                       */\nexport default function Embed(props) {\n  const {\n    text,\n    renderOnCanvas\n  } = props;\n  const isOnCanvas = useIsOnCanvas();\n  if (isUrlInvalid(text)) {\n    return /*#__PURE__*/_jsx(Instructions, {\n      ...props\n    });\n  }\n  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 }} />\n  return /*#__PURE__*/_jsx(\"div\", {\n    style: {\n      ...containerStyle,\n      background: shouldRender ? \"none\" : \"rgba(136, 85, 255, 0.1)\"\n    },\n    children: shouldRender ? /*#__PURE__*/_jsx(\"iframe\", {\n      onError: e => console.log(\"meep\", e),\n      src: props.text,\n      frameBorder: 0,\n      style: {\n        width: \"100%\",\n        height: \"100%\"\n      }\n    }) : /*#__PURE__*/_jsx(\"h3\", {\n      children: \"Hidden\"\n    })\n  });\n}\n;\nEmbed.defaultProps = {\n  text: \"\",\n  // text: \"http://www.framer.com\",\n  renderOnCanvas: true,\n  width: 800,\n  height: 600\n};\naddPropertyControls(Embed, {\n  text: {\n    type: ControlType.String,\n    title: \"URL\",\n    defaultValue: Embed.defaultProps.text\n  },\n  renderOnCanvas: {\n    type: ControlType.Boolean,\n    title: \"On Canvas\",\n    enabledTitle: \"Show\",\n    disabledTitle: \"Hide\"\n  }\n});\nconst containerStyle = {\n  height: \"100%\",\n  width: \"100%\",\n  display: \"flex\",\n  overflow: \"hidden\",\n  borderRadius: \"8px\",\n  alignItems: \"center\",\n  justifyContent: \"center\",\n  fontSize: 16,\n  fontWeight: 600,\n  color: \"#BB88FF\",\n  flexDirection: \"column\",\n  textAlign: \"center\"\n};\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Embed\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerIntrinsicWidth\": \"800\",\n        \"framerSupportedLayoutWidth\": \"fixed\",\n        \"framerSupportedLayoutHeight\": \"fixed\",\n        \"framerContractVersion\": \"1\",\n        \"framerIntrinsicHeight\": \"600\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Embed_2.map"],
  "mappings": "8GAUO,SAASA,GAAgB,CAE9B,OADiBC,EAAQ,IAAMC,EAAa,QAAQ,IAAMA,EAAa,OAAQ,CAAC,CAAC,CAEnF,CCVA,SAASC,EAAaC,EAAO,CAC3B,OAA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BZ,EAAO,CACzB,KAAM,CACJ,KAAMa,EAAY,OAClB,MAAO,MACP,aAAcb,EAAM,aAAa,IACnC,EACA,eAAgB,CACd,KAAMa,EAAY,QAClB,MAAO,YACP,aAAc,OACd,cAAe,MACjB,CACF,CAAC,EACD,IAAMH,EAAiB,CACrB,OAAQ,OACR,MAAO,OACP,QAAS,OACT,SAAU,SACV,aAAc,MACd,WAAY,SACZ,eAAgB,SAChB,SAAU,GACV,WAAY,IACZ,MAAO,UACP,cAAe,SACf,UAAW,QACb",
  "names": ["useIsOnCanvas", "se", "RenderTarget", "Instructions", "props", "u", "containerStyle", "p", "isUrlInvalid", "text", "startsWithHttp", "Embed", "props", "text", "renderOnCanvas", "isOnCanvas", "useIsOnCanvas", "isUrlInvalid", "p", "Instructions", "shouldRender", "containerStyle", "e", "addPropertyControls", "ControlType"]
}
