{"version":3,"file":"SignupButton.DefvV0vW.mjs","names":["useStore","useState","useState"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/Sm3iMbEMKMfudoHG3xjk/LwPUJMk2GHM0plC9tlQS/SignupButton.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","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{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{useEffect,useState}from\"react\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withTracking(Component){return props=>{const[fullUrl,setFullUrl]=useState(\"\");useEffect(()=>{const signupUrl=new URL(\"https://app.magicpost.in/signup\");// Vérifier s'il y a des paramètres UTM dans l'URL courante\nconst currentUrl=new URL(window.location.href);const urlParams=new URLSearchParams(currentUrl.search);const hasUrlUTMParams=Array.from(urlParams.keys()).some(key=>key.startsWith(\"utm_\"));let utmParams;if(hasUrlUTMParams){// Priorité 1: Utiliser les paramètres UTM de l'URL courante\nutmParams={};urlParams.forEach((value,key)=>{if(key.startsWith(\"utm_\")){utmParams[key]=value;}});}else{//Fallback sur les paramètres basés sur le referrer\nutmParams=getUTMParametersBasedOnReferrer();}Object.entries(utmParams).forEach(([key,value])=>{if(value){signupUrl.searchParams.append(key,value);}});// Mise à jour de l'URL complète dans l'état\nsetFullUrl(signupUrl.toString());},[]);return /*#__PURE__*/_jsx(Component,{...props,href:fullUrl,style:{textDecoration:\"none\",...props.style}});};}function getUTMParametersBasedOnReferrer(){var referrer=document.referrer||window.location.hostname;console.log(\"Referrer: \"+referrer);const currentHost=window.location.hostname;let utmSource=\"direct\"// Valeur par défaut si aucun referrer\n;let regex=new RegExp(`https?://${currentHost}([^?]*)`);let match=referrer.match(regex);let utmMedium=match?match[1]:\"none\";let currentPathName=window.location.pathname;let utmTerm=window.location.pathname;if(!sessionStorage.getItem(\"firstPage\")){// If not, set the key with the current URL\nsessionStorage.setItem(\"firstPage\",currentPathName);}// Retrieve the first page visited\nconst firstPage=sessionStorage.getItem(\"firstPage\");let utmContent=firstPage;// Gérer les référents externes\nconst refDomains={\"google.\":[\"google\",\"organic\"],\"bing.\":[\"bing\",\"organic\"],\"perplexity.\":[\"perplexity\",\"ai\"],\"chat.openai.\":[\"chatgpt\",\"ai\"],\"chatgpt.com\":[\"chatgpt\",\"ai\"],\"claude.ai\":[\"claude\",\"ai\"],\"facebook.\":[\"facebook\",\"social\"],\"instagram.\":[\"instagram\",\"social\"],\"twitter.\":[\"twitter\",\"social\"],\"x.com\":[\"twitter\",\"social\"],\"linkedin.\":[\"linkedin\",\"social\"],\"youtube.\":[\"youtube\",\"social\"],\"tiktok.\":[\"tiktok\",\"social\"],\"reddit.\":[\"reddit\",\"social\"],\"pinterest.\":[\"pinterest\",\"social\"],\"threads.net\":[\"threads\",\"social\"]};let found=false;for(const domain in refDomains){if(referrer.includes(domain)){[utmSource,utmMedium]=refDomains[domain];found=true;break;}}return{utm_source:utmSource,utm_medium:utmMedium,utm_campaign:\"referral_tracking\",utm_content:utmContent,utm_term:utmTerm};}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()});}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTracking\":{\"type\":\"reactHoc\",\"name\":\"withTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SignupButton.map"],"mappings":"4LAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,CAAC,CAClD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,MAAM,EAAE,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,EAAS,CAAC,EAChI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAW,EAAE,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC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