{"version":3,"file":"Query_Active_Dot.ClArqSy4.mjs","names":["useRef","useMemo","useState"],"sources":["https:/framerusercontent.com/modules/r2bDx7fghrpwIGaiuOqV/0hRvsu7DV6pGvxLP0tf0/Query_Active_Dot.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useLayoutEffect,useMemo,useRef,useState}from\"react\";function parseQueryParams(input){return input.split(\",\").map(item=>item.trim()).filter(Boolean);}function hasParamValue(params,key){const value=params.get(key);return value!==null&&value.trim()!==\"\";}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 18\n * @framerIntrinsicHeight 18\n */export default function QueryDot(props){const{queryParams=\"country\",matchMode=\"any\",size=18,radius=999,fill=\"#2F5BFF\"}=props;const rootRef=useRef(null);const watchedParams=useMemo(()=>parseQueryParams(queryParams),[queryParams]);const getVisibleFromUrl=()=>{if(typeof window===\"undefined\")return false;if(watchedParams.length===0)return false;const params=new URLSearchParams(window.location.search);if(matchMode===\"all\"){return watchedParams.every(key=>hasParamValue(params,key));}return watchedParams.some(key=>hasParamValue(params,key));};const[isVisible,setIsVisible]=useState(()=>getVisibleFromUrl());useEffect(()=>{if(typeof window===\"undefined\")return;let frame=0;let lastUrl=window.location.href;const sync=()=>{setIsVisible(getVisibleFromUrl());};const watchUrl=()=>{const currentUrl=window.location.href;if(currentUrl!==lastUrl){lastUrl=currentUrl;sync();}frame=requestAnimationFrame(watchUrl);};sync();frame=requestAnimationFrame(watchUrl);return()=>{cancelAnimationFrame(frame);};},[queryParams,matchMode,watchedParams]);useLayoutEffect(()=>{const root=rootRef.current;if(!root)return;const host=root.parentElement;if(!host)return;host.style.display=isVisible?\"\":\"none\";host.style.pointerEvents=isVisible?\"\":\"none\";},[isVisible]);return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:size,height:size,borderRadius:radius,background:fill}})});}addPropertyControls(QueryDot,{queryParams:{type:ControlType.String,title:\"Query Params\",defaultValue:\"country\"},matchMode:{type:ControlType.Enum,title:\"Match\",options:[\"any\",\"all\"],optionTitles:[\"Any\",\"All\"],defaultValue:\"any\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:18,min:1},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:999,min:0},fill:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#2F5BFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"QueryDot\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"18\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"18\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Query_Active_Dot.map"],"mappings":"qNAAoK,SAAS,EAAiB,EAAM,CAAC,OAAO,EAAM,MAAM,IAAI,CAAC,IAAI,GAAM,EAAK,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAE,SAAS,EAAc,EAAO,EAAI,CAAC,IAAM,EAAM,EAAO,IAAI,EAAI,CAAC,OAAO,IAAQ,MAAM,EAAM,MAAM,GAAG,GAKrW,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,cAAY,UAAU,YAAU,MAAM,OAAK,GAAG,SAAO,IAAI,OAAK,WAAW,EAAY,EAAQA,EAAO,KAAK,CAAO,EAAcC,MAAY,EAAiB,EAAY,CAAC,CAAC,EAAY,CAAC,CAAO,MAAsB,CAA6C,GAAlC,IAAS,QAA4B,EAAc,SAAS,EAAE,MAAO,GAAM,IAAM,EAAO,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAmF,OAA/E,IAAY,MAAc,EAAc,MAAM,GAAK,EAAc,EAAO,EAAI,CAAC,CAAS,EAAc,KAAK,G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