{"version":3,"file":"VariantURLAppender.DJSa5tuR.mjs","names":[],"sources":["https:/framerusercontent.com/modules/tFZGQfPYoznfQdCswbff/aj3KWMtKzAINaAz8vRPk/VariantURLAppender.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function VariantURLSetter({enabled=true,parameter=\"s\",value=\"\",delay=0}){useEffect(()=>{if(!enabled||!parameter||!value)return;const updateURL=()=>{try{// Get current URL parameters\nconst urlParams=new URLSearchParams(window.location.search);// Convert value to lowercase\nconst lowercaseValue=value.toLowerCase();// Set or update the parameter\nurlParams.set(parameter,lowercaseValue);// Update URL without page reload\nconst newURL=`${window.location.pathname}?${urlParams.toString()}`;window.history.pushState({},\"\",newURL);}catch(error){console.error(\"VariantURLSetter error:\",error);}};// Execute after delay\nconst timer=setTimeout(updateURL,delay);return()=>clearTimeout(timer);},[enabled,parameter,value,delay]);// Return invisible div\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0,pointerEvents:\"none\"}});}VariantURLSetter.displayName=\"Variant URL Setter\";addPropertyControls(VariantURLSetter,{enabled:{type:ControlType.Boolean,title:\"Enabled\",defaultValue:true},parameter:{type:ControlType.String,title:\"Parameter\",defaultValue:\"s\",description:\"URL parameter name (e.g., 's' for ?s=value)\"},value:{type:ControlType.String,title:\"Value\",defaultValue:\"\",description:\"Parameter value (will be lowercased)\"},delay:{type:ControlType.Number,title:\"Delay (ms)\",defaultValue:0,min:0,max:5e3,step:100,description:\"Delay before setting URL parameter\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VariantURLSetter\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"1\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VariantURLAppender.map"],"mappings":"wLAKG,SAAwB,EAAiB,CAAC,UAAQ,GAAK,YAAU,IAAI,QAAM,GAAG,QAAM,GAAG,CAM1F,OAN2F,MAAc,CAAC,GAAG,CAAC,GAAS,CAAC,GAAW,CAAC,EAAM,OAK1I,IAAM,EAAM,eALyJ,CAAC,GAAG,CACzK,IAAM,EAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CACrD,EAAe,EAAM,aAAa,CACxC,EAAU,IAAI,EAAU,EAAe,CACvC,IAAM,EAAO,GAAG,EAAO,SAAS,SAAS,GAAG,EAAU,UAAU,GAAG,EAAO,QAAQ,UAAU,EAAE,CAAC,GAAG,EAAO,OAAQ,EAAM,CAAC,QAAQ,MAAM,0BAA0B,EAAM,GACrI,EAAM,CAAC,UAAU,aAAa,EAAM,EAAG,CAAC,EAAQ,EAAU,EAAM,EAAM,CAAC,CACpF,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,OAAO,CAAC,CAAC,sBAX9C,IAAoD,IAA6B,CAWjC,EAAiB,YAAY,qBAAqB,EAAoB,EAAiB,CAAC,QAAQ,CAAC,KAAK,EAAY,QAAQ,MAAM,UAAU,aAAa,GAAK,CAAC,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,IAAI,YAAY,8CAA8C,CAAC,MAAM,CAAC,KAAK,EAAY,OAAO,MAAM,QAAQ,aAAa,GAAG,YAAY,uCAAuC,CAAC,MAAM,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,aAAa,EAAE,IAAI,EAAE,IAAI,IAAI,KAAK,IAAI,YAAY,qCAAqC,CAAC,CAAC"}