{"version":3,"file":"PartnerStackCookie.IB8XMt8D.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/XyQvJgY3fwd03y25ynlB/lh1VmY8ct6ITgdBtfHOD/PartnerStackCookie.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect}from\"react\";function getRootDomain(hostname){// Simple approach: take the last two segments as the root domain,\n// e.g., foo.bar.com -> bar.com\n// Note: this is not fully accurate for multi-level TLDs like example.co.uk.\n// Enhance as needed.\nconst parts=hostname.split(\".\");if(parts.length<=2){return hostname;}return parts.slice(-2).join(\".\");}function setPartnerStackCookie(partnerKey,clickId){const valueObj={partnerKey,clickId};const value=JSON.stringify(valueObj);const maxAgeSeconds=90*24*60*60// 90 days\n;const rootDomain=getRootDomain(window.location.hostname);const cookieParts=[`partner_stack_info=${value}`,`Domain=${rootDomain}`,\"Path=/\",`Max-Age=${maxAgeSeconds}`];document.cookie=cookieParts.join(\"; \");console.log(cookieParts.join(\"; \"));}export default function PartnerStack(props){useEffect(()=>{if(typeof window===\"undefined\")return;const searchParams=new URLSearchParams(window.location.search);const partnerKey=searchParams.get(\"ps_partner_key\");const clickId=searchParams.get(\"ps_xid\");// Only set the cookie if both parameters are present\nif(partnerKey&&clickId){setPartnerStackCookie(partnerKey,clickId);}},[]);// This component performs side effects only and renders nothing\nreturn /*#__PURE__*/_jsx(_Fragment,{});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PartnerStack\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PartnerStackCookie.map"],"mappings":"uIAC8F,SAAS,EAAc,EAAS,CAI9H,IAAM,EAAM,EAAS,MAAM,IAAI,CAAsC,OAAlC,EAAM,QAAQ,EAAU,EAAiB,EAAM,MAAM,GAAG,CAAC,KAAK,IAAI,CAAE,SAAS,EAAsB,EAAW,EAAQ,CAAC,IAAM,EAAS,CAAC,aAAW,UAAQ,CAAO,EAAM,KAAK,UAAU,EAAS,CAC3N,EAAW,EAAc,EAAO,SAAS,SAAS,CAAO,EAAY,CAAC,sBAAsB,IAAQ,UAAU,IAAa,SAAS,kBAA2B,CAAC,SAAS,OAAO,EAAY,KAAK,KAAK,CAAC,QAAQ,IAAI,EAAY,KAAK,KAAK,CAAC,CAAE,SAAwB,EAAa,EAAM,CAE9R,OAF+R,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAa,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAO,EAAW,EAAa,IAAI,iBAAiB,CAAO,EAAQ,EAAa,IAAI,SAAS,CAC5e,GAAY,GAAS,EAAsB,EAAW,EAAQ,EAAI,EAAE,CAAC,CACpD,EAAKA,EAAU,EAAE,CAAC,sBAP2B,IAA6B"}