{"version":3,"file":"Twitter.DcljrO2Q.mjs","names":["defaultEmptyStateStyle","useRef","useState","Twitter","useMemo","id"],"sources":["https:/framerusercontent.com/modules/cuQH4dmpDnV8YK1mSgQX/tTLhbOFToDhKcwOVmn8E/useFontControls.js","https:/framerusercontent.com/modules/afBE9Yx1W6bY5q32qPxe/AAh30yXzt1DUsOi1YwUY/useRenderTarget.js","https:/framer.com/m/framer/default-utils.js@^0.43.0","https:/framer.com/m/framer/integrations-styles.js@0.2.0","https:/framerusercontent.com/modules/YLAIqVion55BUycOZr6e/0LSA6A2quEIy3gsR8bQ6/Twitter.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 { useMemo } from \"react\";\nimport { RenderTarget } from \"framer\";\nexport function useRenderTarget() {\n    const currentRenderTarget = useMemo(()=>RenderTarget.current()\n    , []);\n    return currentRenderTarget;\n}\nexport function useIsInPreview() {\n    const inPreview = useMemo(()=>RenderTarget.current() === RenderTarget.preview\n    , []);\n    return inPreview;\n}\n\nexport const __FramerMetadata__ = {\"exports\":{\"useIsInPreview\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useRenderTarget\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useRenderTarget.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 } from \"https://framerusercontent.com/modules/afBE9Yx1W6bY5q32qPxe/AAh30yXzt1DUsOi1YwUY/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,  };\n\nexport const __FramerMetadata__ = {\"exports\":{\"fontControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"mstoMinAndSec\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"colorTokentoValue\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useFontControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useUniqueClassName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"paddingControl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"localeOptions\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fontStack\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"detectAutoSizingAxis\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useRenderTarget\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useOnEnter\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"emptyStateStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsBrowserSafari\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getVariantControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useAutoMotionValue\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomID\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useOnExit\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsInPreview\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useRadius\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"usePadding\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useMultiOnChange\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fontSizeOptions\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultEvents\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useConstant\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isMotionValue\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useOnChange\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useControlledState\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"borderRadiusControl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"colorFromToken\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"secondsToMinutes\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}","import{containerStyles,emptyStateStyle as defaultEmptyStateStyle}from\"https://framer.com/m/framer/default-utils.js@^0.43.0\";export const emptyStateStyle={...containerStyles,...defaultEmptyStateStyle,textAlign:\"center\",padding:15,width:200,height:100,overflow:\"hidden\"};export const neutralStateStyle={...emptyStateStyle,color:\"#09f\",background:\"rgb(0, 153, 255, 0.1)\",borderColor:\"#09f\"};export const stateTitleStyle={fontSize:12,fontWeight:600,margin:0};export const stateParagraphStyle={fontSize:12,maxWidth:200,lineHeight:1.4,margin:\"5px 0 0 0\"};\nexport const __FramerMetadata__ = {\"exports\":{\"neutralStateStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"stateTitleStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"emptyStateStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"stateParagraphStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./styles.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{emptyStateStyle,stateParagraphStyle,stateTitleStyle}from\"https://framer.com/m/framer/integrations-styles.js@0.2.0\";import{ControlType,addPropertyControls,withCSS}from\"framer\";import{motion}from\"framer-motion\";import{useEffect,useMemo,useRef,useState}from\"react\";let isTwitterScriptLoading=false;let twitterScriptLoadPromise=null;function loadTwitterScript(){if(twitterScriptLoadPromise){return twitterScriptLoadPromise;}if(window.twttr?.widgets){return Promise.resolve();}twitterScriptLoadPromise=new Promise((resolve,reject)=>{const existingScript=document.querySelector('script[src=\"https://platform.twitter.com/widgets.js\"]');if(isTwitterScriptLoading||existingScript){const interval=setInterval(()=>{if(window.twttr?.widgets){clearInterval(interval);resolve();}},100);if(isTwitterScriptLoading||!existingScript)return;}isTwitterScriptLoading=true;const script=document.createElement(\"script\");script.src=\"https://platform.twitter.com/widgets.js\";script.async=true;script.charset=\"utf-8\";script.onload=()=>{isTwitterScriptLoading=false;const checkReadyInterval=setInterval(()=>{if(window.twttr?.widgets){clearInterval(checkReadyInterval);resolve();}},50);};script.onerror=error=>{console.error(\"Failed to load Twitter widgets script:\",error);isTwitterScriptLoading=false;twitterScriptLoadPromise=null;reject(error);};document.body.appendChild(script);});return twitterScriptLoadPromise;}function TweetEmbed({className,id,options}){const containerRef=useRef(null);const[error,setError]=useState(null);useEffect(()=>{let isMounted=true;async function render(){if(!containerRef.current)return;setError(null);containerRef.current.innerHTML=\"\";try{await loadTwitterScript();if(!isMounted||!containerRef.current||!window.twttr?.widgets){return;}const createdElement=await window.twttr.widgets.createTweet(id,containerRef.current,{dnt:true,theme:options.theme});if(isMounted){if(!createdElement){setError(\"Could not load Tweet.\");}else{setError(null);}}}catch(err){console.error(\"Error rendering Tweet:\",err);if(isMounted){setError(\"Error loading Tweet.\");}}}render();return()=>{isMounted=false;};},[id,options.theme]);return /*#__PURE__*/_jsx(\"div\",{className:className,ref:containerRef,children:error&&/*#__PURE__*/_jsx(\"div\",{style:{padding:\"20px\",color:options.theme===\"dark\"?\"#AAA\":\"#888\",textAlign:\"center\"},children:error})});}const twitterRegex=/^https?:\\/\\/(?:twitter\\.com|x\\.com)\\/[^\\/]+\\/status\\/(\\d+)/;/**\n * TWITTER\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 225\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any\n *\n * @framerComponentPresetProps theme\n */const Twitter=withCSS(function Twitter({url,style,theme,...props}){const id=useMemo(()=>{const[,id]=url.match(twitterRegex)??[null,null];return id;},[url]);return url&&id?/*#__PURE__*/_jsx(motion.div,{style:style,children:/*#__PURE__*/_jsx(TweetEmbed,{className:\"framer-twitter\",id:id,options:{theme}},`${id}.${theme}`)}):/*#__PURE__*/_jsxs(motion.div,{style:{...emptyStateStyle,...style},...props,children:[/*#__PURE__*/_jsx(\"h1\",{style:stateTitleStyle,children:\"Twitter\"}),url?/*#__PURE__*/_jsx(\"p\",{style:stateParagraphStyle,children:\"This tweet URL doesn’t seem correct.\"}):/*#__PURE__*/_jsx(\"p\",{style:stateParagraphStyle,children:\"Set a tweet URL in the Properties.\"})]});},[\".framer-twitter { display: flex; justify-content: center; }\",\".framer-twitter > .twitter-tweet { margin: 0 !important; }\"]);addPropertyControls(Twitter,{url:{title:\"URL\",type:ControlType.String,placeholder:\"https://twitter.com/***/status/1234\",defaultValue:\"https://twitter.com/jack/status/20\"},theme:{title:\"Theme\",type:ControlType.Enum,options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"],defaultValue:\"light\"}});export default Twitter;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Twitter\",\"slots\":[],\"annotations\":{\"framerComponentPresetProps\":\"theme\",\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"225\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//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