{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/Kuwa4LRQnmmppaTnEydr/ZQOrHhdF4pWagjJ7UWUH/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/XUxkHAMs2Mc4avb6Yezq/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\",hidden:props=>props.type==\"utmTags\"},urlParameter:{type:ControlType.String,defaultValue:\"\",placeholder:\"Parameter Name\",title:\"URL Param\",hidden:props=>props.type!==\"urlParameter\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DataInput\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DataInput.map"],
  "mappings": "kOAIkB,SAARA,EAA2BC,EAAM,CAAC,GAAK,CAAC,KAAAC,CAAI,EAAED,EAAYE,EAASC,EAAa,QAAQ,IAAIA,EAAa,OAAaC,EAAa,OAAOC,EAAS,IAAiB,CAACC,EAAMC,CAAQ,EAAEC,EAAS,EAAE,EAAMC,EAAK,GAAG,OAAOR,EAAK,CAAC,IAAI,MAAMQ,EAAK,cAAc,MAAM,IAAI,UAAUA,EAAK,WAAW,MAAM,IAAI,eAAeA,EAAK,GAAGT,EAAM,6BAA6B,MAAM,IAAI,cAAcS,EAAK,eAAe,KAAM,CAAC,OAAAC,EAAU,IAAI,CAAC,OAAOT,EAAK,CAAC,IAAI,MAAMM,EAASF,EAAO,SAAS,IAAI,EAAE,MAAM,IAAI,UAAU,IAAMM,EAAK,CAAC,EAAoB,IAAI,gBAAgBN,EAAO,SAAS,MAAM,EAAc,QAAQ,CAACC,EAAMM,IAAM,CAChmBA,EAAI,WAAW,MAAM,IAAGD,EAAKC,CAAG,EAAEN,EAAO,CAAC,EAAEC,EAASI,CAAI,EAAE,MAAM,IAAI,eAAe,IAAIE,EAAKN,GAAUM,EAAK,IAAI,gBAAgBR,EAAO,SAAS,MAAM,EAAE,IAAIL,EAAM,YAAY,KAAK,MAAMa,IAAO,OAAOA,EAAK,EAAE,EAAE,MAAM,IAAI,cAAcN,EAAS,SAAS,QAAQ,EAAE,KAAM,CAAC,EAAE,CAACN,EAAKD,EAAM,YAAY,CAAC,EAAsBc,EAAKC,EAAqB,CAAC,KAAKN,EAAK,QAAQ,eAAe,SAAS,CAACP,GAAuBY,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,QAAQ,EAAE,SAASb,GAAM,UAAUK,EAAM,OAAO,KAAKA,CAAK,EAAE,IAAIM,GAAkBE,EAAK,QAAQ,CAAC,KAAK,SAAS,KAAKF,EAAI,MAAMN,EAAMM,CAAG,EAAE,8BAA8B,EAAI,CAAC,CAAC,EAAE,KAAkBE,EAAK,QAAQ,CAAC,KAAK,SAAS,KAAKd,EAAM,KAAK,MAAMM,EAAM,8BAA8B,EAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAACP,EAAU,YAAY,qBAAqBiB,EAAoBjB,EAAU,CAAC,KAAK,CAAC,KAAKkB,EAAY,KAAK,QAAQ,CAAC,MAAM,UAAU,cAAc,cAAc,EAAE,aAAa,CAAC,cAAc,WAAW,eAAe,eAAe,EAAE,wBAAwB,GAAK,0BAA0B,UAAU,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,aAAa,OAAO,OAAOjB,GAAOA,EAAM,MAAM,SAAS,EAAE,aAAa,CAAC,KAAKiB,EAAY,OAAO,aAAa,GAAG,YAAY,iBAAiB,MAAM,YAAY,OAAOjB,GAAOA,EAAM,OAAO,cAAc,CAAC,CAAC",
  "names": ["DataInput", "props", "type", "isCanvas", "RenderTarget", "isOptimizing", "window", "value", "setValue", "ye", "text", "ue", "utms", "key", "_get", "p", "HiddenComponentLabel", "addPropertyControls", "ControlType"]
}
