{"version":3,"file":"DataInput.CUBpJDQs.mjs","names":["useState","value"],"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":"iPAIG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,EAAY,EAAS,EAAa,SAAS,GAAG,EAAa,OAA2D,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAK,EAAK,GAAG,OAAO,EAAP,CAAa,IAAI,MAAM,EAAK,cAAc,MAAM,IAAI,UAAU,EAAK,WAAW,MAAM,IAAI,eAAe,EAAK,GAAG,EAAM,aAAa,gBAAgB,MAAM,IAAI,cAAc,EAAK,eAAe,MAC3G,OADkH,MAAc,CAAC,OAAO,EAAP,CAAa,IAAI,MAAM,EAAS,EAAO,SAAS,KAAK,CAAC,MAAM,IAAI,UAAU,IAAM,EAAK,EAAE,CAAmB,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAa,SAAS,EAAM,IAAM,CAChmB,EAAI,WAAW,OAAO,GAAE,EAAK,GAAKC,IAAS,CAAC,EAAS,EAAK,CAAC,MAAM,IAAI,eAAwB,EAAe,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,IAAI,EAAM,aAAa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