{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/Kuwa4LRQnmmppaTnEydr/OyCZglBxLZoJn5latIqw/DataInput.js", "ssg:https://framerusercontent.com/modules/utbBGg8QwoGwULhmbk0N/bV6KmhA408HRWRwFvaVv/FormatPhone.js", "ssg:https://framerusercontent.com/modules/YGxozdn8K6AmlBCncc2a/A9Zqp7cZuNiEpDDx567S/FormCookieCollect.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useState}from\"react\";import{HiddenComponentLabel}from\"https://framerusercontent.com/modules/DwWOdDzQZGCuvkNlbUjZ/p64C0n6xNEFY9NovSiJw/FramerFormsShared.js\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function DataInput(props){const{type}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[value,setValue]=useState(\"\");let text=\"\";switch(type){case\"url\":text=\"Current URL\";break;case\"utmTags\":text=\"UTM Tags\";break;case\"urlParameter\":text=`${props.urlParameter} URL Parameter`;break;case\"referrerUrl\":text=\"Referrer URL\";break;}useEffect(()=>{switch(type){case\"url\":setValue(window.location.href);break;case\"utmTags\":const utms={};const queryParams=new URLSearchParams(window.location.search);queryParams.forEach((value,key)=>{// Check if the key starts with 'utm_' (indicating it's a UTM parameter)\nif(key.startsWith(\"utm_\")){utms[key]=value;}});setValue(utms);break;case\"urlParameter\":var _get;setValue((_get=new URLSearchParams(window.location.search).get(props.urlParameter))!==null&&_get!==void 0?_get:\"\");break;case\"referrerUrl\":setValue(document.referrer);break;}},[type,props.urlParameter]);return /*#__PURE__*/_jsx(HiddenComponentLabel,{text:text,subtext:\"Hidden Field\",children:!isCanvas&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"hidden\"},children:type==\"utmTags\"?value?Object.keys(value).map(key=>/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:key,value:value[key],\"data-framerforms-no-prefill\":true})):null:/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:props.name,value:value,\"data-framerforms-no-prefill\":true})})});}DataInput.displayName=\"URL Data Collector\";addPropertyControls(DataInput,{type:{type:ControlType.Enum,options:[\"url\",\"utmTags\",\"referrerUrl\",\"urlParameter\"],optionTitles:[\"Current URL\",\"UTM Tags\",\"Referrer URL\",\"URL Parameter\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},name:{type:ControlType.String,defaultValue:\"Data\",preventLocalization:true,hidden:props=>props.type==\"utmTags\"},urlParameter:{type:ControlType.String,defaultValue:\"\",placeholder:\"Parameter Name\",title:\"URL Param\",preventLocalization:true,hidden:props=>props.type!==\"urlParameter\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DataInput\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}", "import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({phoneNumber:\"\",buttonstate:false});export function DKsavePhoneNumber(Component){return props=>{const[store,setStore]=useStore();// Handle the change event for input (e.g., phone number)\nconst handleChange=event=>{const phone=event.target.value.replace(/\\D/g,\"\")// Strip non-digit characters\n;setStore({phoneNumber:phone});// Get the reference to the input element\nconst inputElement=event.target;console.log(event.target.value);// Update buttonstate based on the length of the phone number\nif(phone.length===8){setStore({buttonstate:true});inputElement.setCustomValidity(\"\")// Clear any previous warnings\n;}else{setStore({buttonstate:false});inputElement.setCustomValidity(\"Telefonnummer skal v\\xe6re pr\\xe6cis 8 cifre.\")// Set warning\n;}// Trigger native validation check\ninputElement.reportValidity();};return /*#__PURE__*/_jsx(Component,{...props,onChange:handleChange,value:store.phoneNumber});};}export function ESsavePhoneNumber(Component){return props=>{const[store,setStore]=useStore();// Handle the change event for input (e.g., phone number)\nconst handleChange=event=>{const phone=event.target.value.replace(/\\D/g,\"\")// Strip non-digit characters\n;setStore({phoneNumber:phone});// Get the reference to the input element\nconst inputElement=event.target;console.log(event.target.value);// Update buttonstate based on the length of the phone number\nif(phone.length===9){setStore({buttonstate:true});inputElement.setCustomValidity(\"\")// Clear any previous warnings\n;}else{setStore({buttonstate:false});inputElement.setCustomValidity(\"El n\\xfamero de tel\\xe9fono debe tener 9 d\\xedgitos.\")// Set warning\n;}// Trigger native validation check\ninputElement.reportValidity();};return /*#__PURE__*/_jsx(Component,{...props,onChange:handleChange,value:store.phoneNumber});};}// The code override to control button state\nexport function buttonState(Component){return props=>{const[store]=useStore()// Get the store state\n;// Set disabled to true when buttonstate is false\nreturn /*#__PURE__*/_jsx(Component,{...props,disabled:!store.buttonstate});};}\nexport const __FramerMetadata__ = {\"exports\":{\"ESsavePhoneNumber\":{\"type\":\"reactHoc\",\"name\":\"ESsavePhoneNumber\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DKsavePhoneNumber\":{\"type\":\"reactHoc\",\"name\":\"DKsavePhoneNumber\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"buttonState\":{\"type\":\"reactHoc\",\"name\":\"buttonState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormatPhone.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import Cookies from\"js-cookie\";import{useEffect,useState}from\"react\";import{HiddenComponentLabel}from\"https://framer.com/m/FramerFormsShared-XPyb.js@sOR4rDkXf5t0ZrW4dhmB\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function DataInput(props){const keys=[\"tt_ref\",\"gclid\",\"paid\",\"pacid\",\"asclid\",\"_miid\",\"_fbc\",\"_fbp\",\"tt_ref\",\"fbclid\"];const{type}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const isOptimizing=typeof window===\"undefined\";const[cookies,setCookies]=useState({});let text=\"\";if(type===\"getCookies\"){text=\"Get specific cookies\";}useEffect(()=>{if(type===\"getCookies\"){const allCookies=Cookies.get();//const initialCookies = keys.reduce((obj, key) => {\n//    obj[key] = allCookies[key] || \"\"\n//    return obj\n//}, {})\nsetCookies(allCookies);}},[type]);return /*#__PURE__*/_jsx(HiddenComponentLabel,{text:text,children:!isCanvas&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"hidden\"},children:Object.keys(cookies).map(key=>/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:key,value:cookies[key],\"data-framerforms-no-prefill\":true},key))})});}DataInput.displayName=\"Cookie Data Collector\";addPropertyControls(DataInput,{type:{type:ControlType.Enum,options:[\"getCookies\"],optionTitles:[\"Get Cookies\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DataInput\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormCookieCollect.map"],
  "mappings": "8PAAAA,IAIkB,SAARC,EAA2BC,EAAM,CAAC,GAAK,CAAC,KAAAC,CAAI,EAAED,EAAYE,EAASC,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAACC,EAAMC,CAAQ,EAAEC,EAAS,EAAE,EAAMC,EAAK,GAAG,OAAON,EAAK,CAAC,IAAI,MAAMM,EAAK,cAAc,MAAM,IAAI,UAAUA,EAAK,WAAW,MAAM,IAAI,eAAeA,EAAK,GAAGP,EAAM,YAAY,iBAAiB,MAAM,IAAI,cAAcO,EAAK,eAAe,KAAM,CAAC,OAAAC,EAAU,IAAI,CAAC,OAAOP,EAAK,CAAC,IAAI,MAAMI,EAASI,EA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Label", "addPropertyControls", "ControlType", "init_ssg_sandbox_shims", "useStore", "createStore", "DKsavePhoneNumber", "Component", "props", "store", "setStore", "p", "event", "phone", "inputElement", "ESsavePhoneNumber", "buttonState", "init_ssg_sandbox_shims", "DataInput", "props", "keys", "type", "isCanvas", "RenderTarget", "isOptimizing", "window", "cookies", "setCookies", "ye", "text", "ue", "allCookies", "t", "p", "HiddenComponentLabel", "key", "addPropertyControls", "ControlType"]
}
