{"version":3,"file":"AppendQueryParams.DqTSwALs.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/bhIPhlIrtwp0lG3Fyog8/U78b22UksMYbVBlZI3Sy/AppendQueryParams.js"],"sourcesContent":["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\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});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()});}});};}import{useEffect}from\"react\";// Function to properly serialize objects into query parameters\nfunction serialize(obj,prefix){const str=[];for(const key in obj){if(obj.hasOwnProperty(key)){const value=obj[key];const paramName=prefix?`${prefix}[${key}]`:key;if(typeof value===\"object\"&&value!==null){// Recursively serialize nested objects\nstr.push(serialize(value,paramName));}else{str.push(`${encodeURIComponent(paramName)}=${encodeURIComponent(value)}`);}}}return str.join(\"&\");}// ✅ Correctly exported override function for Framer\nexport function appendJourneyParams(){useEffect(()=>{// Retrieve journey data from sessionStorage\nconst journeyData=sessionStorage.getItem(\"journey\");if(!journeyData)return;// Parse the journey data\nconst journeyObject=JSON.parse(journeyData);// Serialize the entire journey object into proper query parameters\nconst journeyParams=serialize(journeyObject);// Find all <a> tags linking to agent.koodoo.io\nconst buttons=document.querySelectorAll('a[href=\"https://agent.koodoo.io/\"]');buttons.forEach(button=>{const newUrl=button.href.includes(\"?\")?`${button.href}&${journeyParams}`:`${button.href}?${journeyParams}`;button.setAttribute(\"href\",newUrl);});console.log(\"Updated Framer button links:\",buttons);},[]);return{};// ✅ Return an empty object to satisfy \n}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withappendJourneyParams(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...appendJourneyParams(props)});};}withappendJourneyParams.displayName=\"appendJourneyParams\";\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withappendJourneyParams\":{\"type\":\"reactHoc\",\"name\":\"withappendJourneyParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"appendJourneyParams\":{\"type\":\"override\",\"name\":\"appendJourneyParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AppendQueryParams.map"],"mappings":"oWAEA,SAAS,EAAU,EAAI,EAAO,CAAC,IAAM,EAAI,EAAE,CAAC,IAAI,IAAM,KAAO,EAAK,GAAG,EAAI,eAAe,GAAK,CAAC,IAAM,EAAM,EAAI,GAAW,EAAU,EAAO,GAAG,EAAO,GAAG,EAAI,GAAG,EAAO,OAAO,GAAQ,UAAU,EAC9L,EAAI,KAAK,EAAU,EAAM,IAAkB,EAAI,KAAK,GAAG,mBAAmB,GAAW,GAAG,mBAAmB,KAAY,CAAC,OAAO,EAAI,KAAK,IAAM,CAC9I,SAAgB,GAAqB,CAI6Q,OAJ5Q,MAAc,CACpD,IAAM,EAAY,eAAe,QAAQ,WAAW,GAAG,CAAC,EAAY,OACpE,IAAM,EAAc,KAAK,MAAM,GACzB,EAAc,EAAU,GACxB,EAAQ,SAAS,iBAAiB,sCAAsC,EAAQ,QAAQ,GAAQ,CAAC,IAAM,EAAO,EAAO,KAAK,SAAS,KAAK,GAAG,EAAO,KAAK,GAAG,IAAgB,GAAG,EAAO,KAAK,GAAG,IAAgB,EAAO,aAAa,OAAO,EAAS,GAAE,QAAQ,IAAI,+BAA+B,EAAU,EAAC,EAAE,EAAQ,EAAE,AACzT,CAAmJ,SAAgB,EAAwB,EAAE,CAAC,MAAO,KAAQ,EAA+BA,GAAgDC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAoB,GAAO,EAAK,qCAR3U,EAAS,EAAY,CAAC,WAAW,UAAU,EAQgS,EAAwB,YAAY"}