{"version":3,"file":"Examples.DO5OGb2w.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/JZreMQ2KPaifPK2yorkF/xuYL8Wj3Hyj3QuHL2RvG/Examples.js"],"sourcesContent":["export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";import{useScroll,useTransform}from\"framer-motion\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({background:\"#0099FF\",feature:\"none\",variant:\"\",workspaceId:\"\",channel:\"\",owner:\"\",proPlan:\"\"});export function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}const sendCheckoutEvent=priceId=>{window.parent.postMessage({type:\"OPEN_INLINE_CHECKOUT\",priceId},\"*\");};export function withWorkspaceId(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{if(window){const searchParams=new URLSearchParams(window.location.search);const workspace_id=searchParams.get(\"workspace_id\");const channel=searchParams.get(\"channel\");const owner=searchParams.get(\"is_owner\");const interactionType=searchParams.get(\"interaction_type\");// const premium_animation = searchParams.get(\"feature\")\nif(workspace_id){setStore({workspaceId:workspace_id});}if(channel){setStore({channel:channel});}if(owner){setStore({owner:owner});}if(interactionType){setStore({interactionType:interactionType});}// if (premium_animation) {\n//     setStore({ premiumAnimation: premium_animation })\n// }\n}},[]);// console.log(store.premiumAnimation)\n// console.log(store.channel)\nreturn /*#__PURE__*/_jsx(Component,{...props,onClick:e=>{e.preventDefault();const hrefURL=new URL(props.link);const priceId=hrefURL.searchParams.get(\"price_id\");// console.log(\"price_id\", priceId)\nif(store.interactionType===\"event\"){sendCheckoutEvent(priceId);}else{const linkUrl=`${props.link}&workspace_id=${store.workspaceId}&channel=${store.channel}&is_owner=${store.owner}`;window.open(linkUrl);}}});};}export function withDraggable(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,drag:true,// dragConstraints={{ top: -50, left: -50, right: 50, bottom: 50 }}\ndragTransition:{bounceStiffness:600,bounceDamping:20},whileTap:{cursor:\"grabbing\"}});};}export function withScrolledProgress(Component){const startY=0// scroll position when animation starts\n;const distance=1e3// scroll distance after which animation ends\n;const endY=startY+distance;return props=>{const{scrollY}=useScroll();const progress=useTransform(scrollY,[startY,endY],[0,1]);return /*#__PURE__*/_jsx(Component,{...props,progress:progress});};}// get the parameters from the url\nexport function setUseCase(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{if(window){const feature=new URLSearchParams(window.location.search).get(\"feature\");// console.log(feature)\nswitch(feature){case\"file-upload-limit\":case\"file-upload-limit-almost-reached\":case\"file-upload-limit-exceeded\":case\"file-upload-limit-exceeded-no-access\":case\"edit-limit\":case\"edit-limit-almost-reached\":case\"edit-limit-exceeded\":case\"file-export-limit-almost-reached\":case\"file-export-limit-exceeded\":setStore({feature:\"flex\",variant:feature});break;default:setStore({feature:\"none\"});}}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// set the banner component\nexport function getFeature(Component){return props=>{const[store]=useStore();const limit=typeof window!==\"undefined\"?new URLSearchParams(window.location.search).get(\"limit\")||\"5\":\"5\";useEffect(()=>{requestAnimationFrame(()=>{const root=document.querySelector('[data-limit-banner=\"true\"]');if(!root)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);let node;while(node=walker.nextNode()){node.nodeValue=node.nodeValue?.replace(/\\b\\d+(?=\\s+files\\b)/,limit);}});},[limit,store.variant]);return /*#__PURE__*/_jsx(Component,{...props,\"data-limit-banner\":\"true\",variant:store.variant,style:{display:store.feature,width:\"100%\"}});};}// Strapi API numbers\nexport function withStrapiNumbers(Component){return props=>{const[userCount,setUserCount]=useState(\"\");const[companyCount,setCompanyCount]=useState(\"\");useEffect(()=>{fetch(\"https://lottiefiles.com/api/settings\").then(response=>response.json()).then(data=>{const newUserCount=data.users_count.replace(/ million\\+/g,\"\");setUserCount(newUserCount);setCompanyCount(data.companies_count);}).catch(error=>console.error(error));},[]);const oriText=props.children.props.children.props.children;const oriCmsText=props.text;const strapiNumbers=typeof oriCmsText==\"undefined\"?oriText.replace(\"{users}\",userCount).replace(\"{companies}\",companyCount):oriCmsText.replace(\"{users}\",userCount).replace(\"{companies}\",companyCount);return /*#__PURE__*/_jsx(Component,{...props,text:strapiNumbers});};}export function withPremiumAnimation(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{if(window){const searchParams=new URLSearchParams(window.location.search);const premium_animation=searchParams.get(\"feature\");if(premium_animation==\"use-premium-assets\"){setStore({proPlan:\"none\"});}else{proPlan:\"flex\";}}},[]);const getDisplay=()=>{return store.proPlan;};// console.log(store.proPlan)\nreturn /*#__PURE__*/_jsx(Component,{...props,style:{display:getDisplay()}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withStrapiNumbers\":{\"type\":\"reactHoc\",\"name\":\"withStrapiNumbers\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setUseCase\":{\"type\":\"reactHoc\",\"name\":\"setUseCase\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getFeature\":{\"type\":\"reactHoc\",\"name\":\"getFeature\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDraggable\":{\"type\":\"reactHoc\",\"name\":\"withDraggable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrolledProgress\":{\"type\":\"reactHoc\",\"name\":\"withScrolledProgress\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPremiumAnimation\":{\"type\":\"reactHoc\",\"name\":\"withPremiumAnimation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWorkspaceId\":{\"type\":\"reactHoc\",\"name\":\"withWorkspaceId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"yPAAa,EA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