{"version":3,"file":"DataInput.B_3SaL4i.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","init_jsx_runtime","c","ce","_e","addPropertyControls","RenderTarget","ControlType","init_framer_BWFVvmND","init_FramerFormsShared","HiddenComponentLabel","DataInput","props","isCanvas","value","setValue","text","type","utms","key","init_DataInput"],"sources":["https:/framerusercontent.com/modules/Kuwa4LRQnmmppaTnEydr/hOjeEgRD7HbeoXLeV1zv/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/hMz2wp3CWZkNwPJFGPgQ/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\":setValue(new URLSearchParams(window.location.search).get(props.urlParameter)??\"\");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\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,oQAIG,SAAwBe,EAAU,EAAM,CAAC,GAAK,CAAC,QAAMC,EAAYC,EAASP,EAAa,QAAQ,IAAIA,EAAa,OAAY,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,CAC5G,OAD6GT,MAAc,CAAC,OAAOc,EAAP,CAAa,IAAI,MAAMF,EAASf,EAAO,SAAS,IAAI,EAAE,MAAM,IAAI,UAAU,IAAMkB,EAAK,CAAC,EAAgE,IAAxC,gBAAgBlB,EAAO,SAAS,MAAkB,CAAC,CAAC,SAAS,EAAM,IAAM,CACjjBmB,EAAI,WAAW,MAAM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