{"version":3,"file":"DataInput.B5NnVHCx.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","init_jsx_runtime","c","ce","_e","addPropertyControls","RenderTarget","init_framer_BWFVvmND","ControlType","init_FramerFormsShared","HiddenComponentLabel","DataInput","props","isCanvas","value","setValue","text","type","utms","key","init_DataInput"],"sources":["https:/framerusercontent.com/modules/Kuwa4LRQnmmppaTnEydr/t3D5F7RKQIiLc0GJ57Tn/DataInput.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/y3zt4fv5F2ZtnBW8nZvn/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 isOptimizing=typeof window===\"undefined\";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\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DataInput.map"],"mappings":"A,4PAIG,SAAwBe,EAAU,EAAM,CAAC,GAAK,CAAC,QAAMC,EAAYC,EAASP,EAAa,QAAQ,IAAIA,EAAa,OAA2D,CAACQ,EAAMC,GAAUnB,EAAS,EAAE,EAAMoB,EAAK,GAAG,OAAOC,EAAP,CAAa,IAAI,MAAM,EAAK,cAAc,MAAM,IAAI,UAAU,EAAK,WAAW,MAAM,IAAI,eAAe,EAAK,GAAGL,EAAM,aAAa,gBAAgB,MAAM,IAAI,cAAc,EAAK,cAAqB,CACjH,OADkHT,MAAc,CAAC,OAAOc,EAAP,CAAa,IAAI,MAAMF,EAASf,EAAO,SAAS,IAAI,EAAE,MAAM,IAAI,UAAU,IAAMkB,EAAK,CAAC,EAAgE,IAAxC,gBAAgBlB,E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