{"version":3,"file":"LinkWithQueryParam.CyuK2iYg.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","_e","init_ssg_sandbox_shims","toLink","query","setQuery","Component","props","withMyCardLink","myCard","setMyCard","search","init_LinkWithQueryParam"],"sources":["https:/framerusercontent.com/modules/jMZzSc2nwRMT14xzskT1/81Op8XSmu2FXKZu7x2Z9/LinkWithQueryParam.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function toLink(Component){return props=>{const[query,setQuery]=useState();useEffect(()=>{if(document){setQuery(document.location.search);}},[]);return /*#__PURE__*/_jsx(Component,{...props,link:`${props.link}${query}`});};}export function withMyCardLink(Component){return props=>{const[myCard,setMyCard]=useState(null);useEffect(()=>{// Tenter window.location.search d'abord, puis le hash\nconst search=window.location.search||window.location.hash.split(\"?\")[1]||\"\";const params=new URLSearchParams(search);const myCard=params.get(\"my-card\");setMyCard(myCard);},[]);return /*#__PURE__*/_jsx(Component,{...props,link2:`${props.link2}/${myCard}`});};}/** \nexport function toHref(Component): ComponentType {\n    return (props) => {\n        const queryParams = document.location.search\n\n        return <Component {...props} href={`${props.href}${queryParams}`} />\n    }\n}\n*/\nexport const __FramerMetadata__ = {\"exports\":{\"toLink\":{\"type\":\"reactHoc\",\"name\":\"toLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMyCardLink\":{\"type\":\"reactHoc\",\"name\":\"withMyCardLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LinkWithQueryParam.map"],"mappings":"A,uIAAiF,SAAgBS,EAAO,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAACC,EAAMC,GAAUX,EAAS,EAAwE,OAAtEI,MAAc,CAAI,UAAUO,EAAS,SAAS,SAAS,MAAM,CAAG,EAAE,CAAC,CAAC,EAAsB,gBAAKC,EAAU,CAAC,GAAGC,EAAM,KAAK,GAAGA,EAAM,OAAOH,GAAO,CAAC,CAAE,CAAE,CAAC,SAAgBI,EAAe,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAACC,EAAOC,GAAWhB,EAAS,IAAI,EACtO,OADwOI,MAAc,CACta,IAAMa,EAAOd,EAAO,SAAS,QAAQA,EAAO,SAAS,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,GAAkDY,EAAO,IAArC,gBAAgBE,CAA0B,CAAC,CAAC,IAAI,SAAS,EAAED,EAAUD,CAAM,CAAE,EAAE,CAAC,CAAC,EAAsB,gBAAKH,EAAU,CAAC,GAAGC,EAAM,MAAM,GAAGA,EAAM,MAAM,GAAGE,GAAQ,CAAC,CAAE,CAAE,C"}