@tmf_ciclica/ciclicastorybook 1.1.11 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -48,7 +48,7 @@ object-assign
48
48
  */var Nr,Wo;function Za(){if(Wo)return Nr;Wo=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},l=0;l<10;l++)i["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(i).map(function(p){return i[p]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(p){u[p]=p}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Nr=o()?Object.assign:function(s,i){for(var l,c=r(s),u,p=1;p<arguments.length;p++){l=Object(arguments[p]);for(var d in l)t.call(l,d)&&(c[d]=l[d]);if(e){u=e(l);for(var h=0;h<u.length;h++)n.call(l,u[h])&&(c[u[h]]=l[u[h]])}}return c},Nr}var Ir,Ho;function go(){if(Ho)return Ir;Ho=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ir=e,Ir}var Dr,Ko;function Xs(){return Ko||(Ko=1,Dr=Function.call.bind(Object.prototype.hasOwnProperty)),Dr}var Fr,Yo;function Ga(){if(Yo)return Fr;Yo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=go(),n={},r=Xs();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,l,c,u){if(process.env.NODE_ENV!=="production"){for(var p in s)if(r(s,p)){var d;try{if(typeof s[p]!="function"){var h=Error((c||"React class")+": "+l+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=s[p](i,p,c,l,null,t)}catch(x){d=x}if(d&&!(d instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var v=u?u():"";e("Failed "+l+" type: "+d.message+(v??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Fr=o,Fr}var zr,Zo;function Ja(){if(Zo)return zr;Zo=1;var e=Js(),t=Za(),n=go(),r=Xs(),o=Ga(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return zr=function(l,c){var u=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function d(O){var A=O&&(u&&O[u]||O[p]);if(typeof A=="function")return A}var h="<<anonymous>>",v={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:j(),arrayOf:w,element:R(),elementType:_(),instanceOf:F,node:$(),objectOf:E,oneOf:y,oneOfType:T,shape:Q,exact:U};function x(O,A){return O===A?O!==0||1/O===1/A:O!==O&&A!==A}function f(O,A){this.message=O,this.data=A&&typeof A=="object"?A:{},this.stack=""}f.prototype=Error.prototype;function C(O){if(process.env.NODE_ENV!=="production")var A={},ee=0;function W(te,Y,K,V,G,re,be){if(V=V||h,re=re||K,be!==n){if(c){var P=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw P.name="Invariant Violation",P}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var xe=V+":"+K;!A[xe]&&ee<3&&(s("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+V+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),A[xe]=!0,ee++)}}return Y[K]==null?te?Y[K]===null?new f("The "+G+" `"+re+"` is marked as required "+("in `"+V+"`, but its value is `null`.")):new f("The "+G+" `"+re+"` is marked as required in "+("`"+V+"`, but its value is `undefined`.")):null:O(Y,K,V,G,re)}var z=W.bind(null,!1);return z.isRequired=W.bind(null,!0),z}function S(O){function A(ee,W,z,te,Y,K){var V=ee[W],G=ie(V);if(G!==O){var re=oe(V);return new f("Invalid "+te+" `"+Y+"` of type "+("`"+re+"` supplied to `"+z+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return C(A)}function j(){return C(i)}function w(O){function A(ee,W,z,te,Y){if(typeof O!="function")return new f("Property `"+Y+"` of component `"+z+"` has invalid PropType notation inside arrayOf.");var K=ee[W];if(!Array.isArray(K)){var V=ie(K);return new f("Invalid "+te+" `"+Y+"` of type "+("`"+V+"` supplied to `"+z+"`, expected an array."))}for(var G=0;G<K.length;G++){var re=O(K,G,z,te,Y+"["+G+"]",n);if(re instanceof Error)return re}return null}return C(A)}function R(){function O(A,ee,W,z,te){var Y=A[ee];if(!l(Y)){var K=ie(Y);return new f("Invalid "+z+" `"+te+"` of type "+("`"+K+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return C(O)}function _(){function O(A,ee,W,z,te){var Y=A[ee];if(!e.isValidElementType(Y)){var K=ie(Y);return new f("Invalid "+z+" `"+te+"` of type "+("`"+K+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return C(O)}function F(O){function A(ee,W,z,te,Y){if(!(ee[W]instanceof O)){var K=O.name||h,V=$e(ee[W]);return new f("Invalid "+te+" `"+Y+"` of type "+("`"+V+"` supplied to `"+z+"`, expected ")+("instance of `"+K+"`."))}return null}return C(A)}function y(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function A(ee,W,z,te,Y){for(var K=ee[W],V=0;V<O.length;V++)if(x(K,O[V]))return null;var G=JSON.stringify(O,function(be,P){var xe=oe(P);return xe==="symbol"?String(P):P});return new f("Invalid "+te+" `"+Y+"` of value `"+String(K)+"` "+("supplied to `"+z+"`, expected one of "+G+"."))}return C(A)}function E(O){function A(ee,W,z,te,Y){if(typeof O!="function")return new f("Property `"+Y+"` of component `"+z+"` has invalid PropType notation inside objectOf.");var K=ee[W],V=ie(K);if(V!=="object")return new f("Invalid "+te+" `"+Y+"` of type "+("`"+V+"` supplied to `"+z+"`, expected an object."));for(var G in K)if(r(K,G)){var re=O(K,G,z,te,Y+"."+G,n);if(re instanceof Error)return re}return null}return C(A)}function T(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var A=0;A<O.length;A++){var ee=O[A];if(typeof ee!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ke(ee)+" at index "+A+"."),i}function W(z,te,Y,K,V){for(var G=[],re=0;re<O.length;re++){var be=O[re],P=be(z,te,Y,K,V,n);if(P==null)return null;P.data&&r(P.data,"expectedType")&&G.push(P.data.expectedType)}var xe=G.length>0?", expected one of type ["+G.join(", ")+"]":"";return new f("Invalid "+K+" `"+V+"` supplied to "+("`"+Y+"`"+xe+"."))}return C(W)}function $(){function O(A,ee,W,z,te){return Z(A[ee])?null:new f("Invalid "+z+" `"+te+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return C(O)}function I(O,A,ee,W,z){return new f((O||"React class")+": "+A+" type `"+ee+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+z+"`.")}function Q(O){function A(ee,W,z,te,Y){var K=ee[W],V=ie(K);if(V!=="object")return new f("Invalid "+te+" `"+Y+"` of type `"+V+"` "+("supplied to `"+z+"`, expected `object`."));for(var G in O){var re=O[G];if(typeof re!="function")return I(z,te,Y,G,oe(re));var be=re(K,G,z,te,Y+"."+G,n);if(be)return be}return null}return C(A)}function U(O){function A(ee,W,z,te,Y){var K=ee[W],V=ie(K);if(V!=="object")return new f("Invalid "+te+" `"+Y+"` of type `"+V+"` "+("supplied to `"+z+"`, expected `object`."));var G=t({},ee[W],O);for(var re in G){var be=O[re];if(r(O,re)&&typeof be!="function")return I(z,te,Y,re,oe(be));if(!be)return new f("Invalid "+te+" `"+Y+"` key `"+re+"` supplied to `"+z+"`.\nBad object: "+JSON.stringify(ee[W],null," ")+`
49
49
  Valid keys: `+JSON.stringify(Object.keys(O),null," "));var P=be(K,re,z,te,Y+"."+re,n);if(P)return P}return null}return C(A)}function Z(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(Z);if(O===null||l(O))return!0;var A=d(O);if(A){var ee=A.call(O),W;if(A!==O.entries){for(;!(W=ee.next()).done;)if(!Z(W.value))return!1}else for(;!(W=ee.next()).done;){var z=W.value;if(z&&!Z(z[1]))return!1}}else return!1;return!0;default:return!1}}function q(O,A){return O==="symbol"?!0:A?A["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&A instanceof Symbol:!1}function ie(O){var A=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":q(A,O)?"symbol":A}function oe(O){if(typeof O>"u"||O===null)return""+O;var A=ie(O);if(A==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return A}function ke(O){var A=oe(O);switch(A){case"array":case"object":return"an "+A;case"boolean":case"date":case"regexp":return"a "+A;default:return A}}function $e(O){return!O.constructor||!O.constructor.name?h:O.constructor.name}return v.checkPropTypes=o,v.resetWarningCache=o.resetWarningCache,v.PropTypes=v,v},zr}var Br,Go;function Xa(){if(Go)return Br;Go=1;var e=go();function t(){}function n(){}return n.resetWarningCache=t,Br=function(){function r(i,l,c,u,p,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Br}var Jo;function Qa(){if(Jo)return Hn.exports;if(Jo=1,process.env.NODE_ENV!=="production"){var e=Js(),t=!0;Hn.exports=Ja()(e.isElement,t)}else Hn.exports=Xa()();return Hn.exports}var el=Qa();const a=Gs(el),Qs=({ambit:e,onClickCopy:t,onClickDelete:n,onClickFilters:r,onClickAmbit:o,isBeingProcessed:s,isActive:i,activeColor:l,fontColor:c,moreInfo:u})=>{const{name:p,date:d,id:h}=e;return m.jsxs("div",{className:Cn.ambitItem,style:{borderBottom:`1px solid ${c}`},children:[m.jsxs("div",{className:Cn.ambitNameDate,onClick:()=>o(h),children:[m.jsxs("div",{className:Cn.ambitName,children:[m.jsx("img",{src:i?Wa:Ha}),m.jsx("span",{style:{color:i?l:c},children:p})]}),m.jsx("div",{className:Cn.ambitDate,children:new Date(d).toLocaleDateString()})]}),m.jsxs("div",{className:Cn.ambitButtons,children:[s&&m.jsx("img",{src:Bo}),m.jsx("button",{onClick:()=>r(h),children:m.jsx("img",{src:Bo})}),m.jsx("button",{onClick:()=>t(h),children:m.jsx("img",{src:qa})}),m.jsx("button",{onClick:()=>n(h),children:m.jsx("img",{src:Va})})]})]})};Qs.propTypes={ambit:a.shape({name:a.string.isRequired,date:a.string.isRequired,id:a.string.isRequired}).isRequired,onClickCopy:a.func.isRequired,onClickDelete:a.func.isRequired,onClickFilters:a.func.isRequired,onClickAmbit:a.func.isRequired,isBeingProcessed:a.bool,isActive:a.bool,activeColor:a.string,fontColor:a.string,moreInfo:a.object};const tl="data:image/svg+xml,%3csvg%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1%201L13.9996%2013.9996'%20stroke='%23FDFDFD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M14%201L1.00044%2013.9996'%20stroke='%23FDFDFD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",ei=({ambitList:e,activeAmbitId:t,fontColor:n="#605B56",activeColor:r,nameLabel:o,dateLabel:s,onClickCopy:i=p=>console.log(`Copy ambit: ${p}`),onCLickDelete:l=p=>console.log(`Delete ambit: ${p}`),onClickFilters:c=p=>console.log(`Filters clicked: ${p}`),onClickAmbit:u=p=>console.log(`OnCLickAmbit: ${p}`)})=>{const{t:p}=Te.useTranslation();return m.jsxs("div",{className:Kt.ambitSelector,style:{color:n},children:[m.jsxs("div",{className:Kt.header,style:{borderBottom:`1px solid ${n}`},children:[m.jsxs("div",{className:Kt.nameDateContainer,children:[m.jsx("div",{className:Kt.ambitName,children:m.jsx("span",{children:p(o)})}),m.jsx("div",{className:Kt.ambitDate,children:m.jsx("span",{children:p(s)})})]}),m.jsx("div",{className:Kt.buttonsContainer})]}),e&&e.length>0&&e.map(d=>m.jsx(Qs,{isActive:t==d.id,ambit:d,fontColor:n,activeColor:r,onClickCopy:i,onClickDelete:l,onClickFilters:c,onClickAmbit:u},`ambitKey${d.id}`))]})};ei.propTypes={ambitList:a.arrayOf(a.shape({name:a.string.isRequired,date:a.string.isRequired,id:a.string.isRequired})).isRequired,activeAmbitId:a.string,fontColor:a.string,activeColor:a.string,onClickCopy:a.func.isRequired,onCLickDelete:a.func.isRequired,onClickFilters:a.func.isRequired,onClickAmbit:a.func.isRequired};const nl="_buttonsContainer_1audx_2",rl="_vertical_1audx_6",ol="_horizontal_1audx_9",sl="_button_1audx_2",il="_active_1audx_25",al="_buttonName_1audx_28",Mt={buttonsContainer:nl,vertical:rl,horizontal:ol,button:sl,active:il,buttonName:al},ll="_left_19lnt_3",cl="_top_19lnt_33",ul="_bottom_19lnt_66",fl="_right_19lnt_97",dl={left:ll,top:cl,bottom:ul,right:fl},yo=({text:e,position:t,styleCustom:n=null})=>{const{t:r}=Te.useTranslation();return m.jsx("div",{className:`tooltip ${dl[t]}`,style:n,children:r(e)})};yo.propTypes={text:a.string.isRequired,position:a.oneOf(["top","bottom","left","right"]).isRequired,styleCustom:a.object};const ti=({buttons:e=[],orientation:t="horizontal",showName:n=!0,namePosition:r="right",useTooltip:o=!1,tooltipPosition:s="top"})=>{const{t:i}=Te.useTranslation();return m.jsx("div",{className:`${Mt.buttonsContainer} ${t==="vertical"&&Mt.vertical}
50
50
  ${t==="horizontal"&&Mt.horizontal}`,children:e.map((l,c)=>{const{icon:u,activeIcon:p,isActive:d,name:h,onClick:v}=l,x=m.jsxs(m.Fragment,{children:[n&&r==="left"&&m.jsx("span",{className:Mt.buttonName,children:i(h)}),m.jsx("img",{src:d?p:u,alt:i(h)}),n&&r==="right"&&m.jsx("span",{className:Mt.buttonName,children:i(h)})]});return m.jsxs("div",{className:"tooltip-parent",children:[m.jsx("button",{onClick:v,className:`${Mt.button}
51
- ${d&&Mt.active}`,children:x}),o&&m.jsx(yo,{text:h,position:s})]},c)})})};ti.propTypes={buttons:a.arrayOf(a.shape({icon:a.node.isRequired,activeIcon:a.node,isActive:a.bool,name:a.string,onClick:a.func})).isRequired,orientation:a.oneOf(["horizontal","vertical"]),showName:a.bool,namePosition:a.oneOf(["left","right"]),useTooltip:a.bool,tooltipPosition:a.oneOf(["top","bottom","left","right"])};const pl="_indicatorsCategory_1cu33_2",hl="_title_1cu33_5",ml="_list_1cu33_11",Ur={indicatorsCategory:pl,title:hl,list:ml},Rt=({isOpen:e,onClick:t,children:n,color:r,activeColor:o="#F8A925",title:s="Title",height:i=53,titleFontStyles:l,showBottomBar:c=!0,titleMarginChildren:u=25})=>{const{t:p}=Te.useTranslation();return m.jsxs(mo.motion.div,{className:Ur.indicatorsCategory,initial:{height:`${i}px`},animate:{height:e?"auto":`${i}px`},transition:{duration:.4},style:{backgroundColor:"white",borderBottom:e&&c?`1px solid ${o}`:"0px",marginBottom:e?"20px":"0px"},children:[m.jsxs("h2",{style:{...l,marginBottom:u||"auto"},className:`${Ur.title}`,onClick:t,children:[m.jsx("span",{style:{color:e?o:r},children:e?"-":"+"}),m.jsx("span",{style:{marginLeft:12,color:e?o:r},children:p(s)})]}),m.jsx("div",{className:Ur.content,children:n})]})};Rt.propTypes={isOpen:a.bool,onClick:a.func,children:a.node,color:a.string,activeColor:a.string,title:a.string,height:a.number,showBottomBar:a.bool,titleFontStyles:a.object};const gl=()=>m.jsx("div",{children:"EditAmbit"}),yl="_AppliedFiltersContainer_s8ooe_2",vl="_AppliedFilterContent_s8ooe_10",Xo={AppliedFiltersContainer:yl,AppliedFilterContent:vl},Ue=Ta.create(e=>({activeCategory:"",activeSubCategory:"",selectedIndicator:"",tematicalFiltersSelected:[],fontColor:"#605B56",inputsColor:"#605B56"})),ni=({title:e,onClick:t,isOpen:n=!0,textColor:r="#ffffff",backgroundColor:o="#605B5680",activeColor:s})=>{const{t:i}=Te.useTranslation(),{tematicalFiltersSelected:l}=Ue(u=>u),c=u=>{Ue.setState(p=>({tematicalFiltersSelected:p.tematicalFiltersSelected.filter(d=>d.code!==u)}))};return m.jsx(Rt,{isOpen:n,onClick:t,title:e?i(e):"Applied Filters",activeColor:s,children:m.jsx("div",{className:Xo.AppliedFiltersContainer,children:l==null?void 0:l.map((u,p)=>m.jsxs("div",{className:Xo.AppliedFilterContent,style:{color:r,background:o},children:[i(u.name),m.jsx("img",{src:tl,alt:"CloseIcon",onClick:()=>c(u.code),style:{cursor:"pointer"}})]},p))})})};ni.propTypes={isOpen:a.bool,onClick:a.func,title:a.string,textColor:a.string,backgroundColor:a.string,indicators:a.arrayOf(a.shape({title:a.string.isRequired,Codename:a.string.isRequired})),activeColor:a.string};const ri=({title:e,onClick:t,isOpen:n=!0,textColor:r="#ffffff",backgroundColor:o="#605B5680",activeColor:s})=>{const{t:i}=Te.useTranslation();return Ue(l=>l),m.jsx(Rt,{isOpen:n,onClick:t,title:e?i(e):"Geographical Filters",activeColor:s,children:"A"})};ri.propTypes={isOpen:a.bool,onClick:a.func,title:a.string,textColor:a.string,backgroundColor:a.string,activeColor:a.string};const bl="_checkboxContainer_zld97_2",xl={checkboxContainer:bl},oi=({onClick:e,containerStyles:t,color:n="#605B56",indicator:r,value:o})=>{const{t:s}=Te.useTranslation(),{title:i}=r||{},{fontColor:l,inputsColor:c}=Ue(u=>u);return m.jsxs("div",{style:{...t,color:n},role:"checkbox",className:xl.checkboxContainer,onClick:e,children:[m.jsx("input",{type:"checkbox",checked:typeof o=="boolean"?o:!0,value:o,readOnly:!0,style:{border:`1.5px solid ${o?c:l}`,backgroundColor:o?c:"white"}}),m.jsx("span",{className:"checkmark",children:s(i)})]})};oi.propTypes={onClick:a.func,value:a.bool,containerStyles:a.object,color:a.string,indicator:a.shape({title:a.string,codename:a.array}),checkedColor:a.string};function ro(e,t){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ro(e,t)}function _l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ro(e,t)}function Vr(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function qr(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function Yn(e){return e!==null&&e.length===1?e[0]:e.slice()}function Zn(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function Lt(e,t){return oo(function(n,r){let o=n;return o<=r.min&&(o=r.min),o>=r.max&&(o=r.max),o}(e,t),t)}function oo(e,t){const n=(e-t.min)%t.step;let r=e-n;return 2*Math.abs(n)>=t.step&&(r+=n>0?t.step:-t.step),parseFloat(r.toFixed(5))}let so=function(e){function t(r){var o;(o=e.call(this,r)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=l=>{l.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=l=>{o.setState({pending:!0});const c=o.getMousePosition(l),u=o.getDiffPosition(c[0]),p=o.getValueFromPosition(u);o.move(p)},o.onTouchMove=l=>{if(l.touches.length>1)return;o.setState({pending:!0});const c=o.getTouchPosition(l);if(o.isScrolling===void 0){const d=c[0]-o.startPosition[0],h=c[1]-o.startPosition[1];o.isScrolling=Math.abs(h)>Math.abs(d)}if(o.isScrolling)return void o.setState({index:-1});const u=o.getDiffPosition(c[0]),p=o.getValueFromPosition(u);o.move(p)},o.onKeyDown=l=>{if(!(l.ctrlKey||l.shiftKey||l.altKey||l.metaKey))switch(o.setState({pending:!0}),l.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":l.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":l.preventDefault(),o.moveUpByStep();break;case"Home":l.preventDefault(),o.move(o.props.min);break;case"End":l.preventDefault(),o.move(o.props.max);break;case"PageDown":l.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":l.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=l=>{if(!o.props.disabled&&l.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){const c=o.getMousePosition(l);o.forceValueFromPosition(c[0],u=>{o.start(u,c[0]),Zn(o.getMouseEventMap())})}Vr(l)}},o.onSliderClick=l=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){const c=o.getMousePosition(l),u=Lt(o.calcValue(o.calcOffsetFromPosition(c[0])),o.props);o.props.onSliderClick(u)}},o.createOnKeyDown=l=>c=>{o.props.disabled||(o.start(l),Zn(o.getKeyDownEventMap()),Vr(c))},o.createOnMouseDown=l=>c=>{if(o.props.disabled||c.button===2)return;o.setState({pending:!0});const u=o.getMousePosition(c);o.start(l,u[0]),Zn(o.getMouseEventMap()),Vr(c)},o.createOnTouchStart=l=>c=>{if(o.props.disabled||c.touches.length>1)return;o.setState({pending:!0});const u=o.getTouchPosition(c);o.startPosition=u,o.isScrolling=void 0,o.start(l,u[0]),Zn(o.getTouchEventMap()),function(p){p.stopPropagation&&p.stopPropagation()}(c)},o.handleResize=()=>{const l=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(l)},o.renderThumb=(l,c)=>{const u=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+c+" "+(o.state.index===c?o.props.thumbActiveClassName:""),p={ref:h=>{o["thumb"+c]=h},key:o.props.thumbClassName+"-"+c,className:u,style:l,onMouseDown:o.createOnMouseDown(c),onTouchStart:o.createOnTouchStart(c),onFocus:o.createOnKeyDown(c),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[c],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[c]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[c]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},d={index:c,value:Yn(o.state.value),valueNow:o.state.value[c]};return o.props.ariaValuetext&&(p["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(d)),o.props.renderThumb(p,d)},o.renderTrack=(l,c,u)=>{const p={key:o.props.trackClassName+"-"+l,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+l,style:o.buildTrackStyle(c,o.state.upperBound-u)},d={index:l,value:Yn(o.state.value)};return o.props.renderTrack(p,d)};let s=qr(r.value);s.length||(s=qr(r.defaultValue)),o.pendingResizeTimeouts=[];const i=[];for(let l=0;l<s.length;l+=1)s[l]=Lt(s[l],r),i.push(l);return o.resizeObserver=null,o.resizeElementRef=b.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:s,zIndices:i},o}_l(t,e);var n=t.prototype;return n.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(r,o){const s=qr(r.value);return s.length?o.pending?null:{value:s.map(i=>Lt(i,r))}:null},n.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},n.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},n.onEnd=function(r){r&&function(o){Object.keys(o).forEach(s=>{typeof document<"u"&&document.removeEventListener(s,o[s],!1)})}(r),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},n.getValue=function(){return Yn(this.state.value)},n.getClosestIndex=function(r){let o=Number.MAX_VALUE,s=-1;const{value:i}=this.state,l=i.length;for(let c=0;c<l;c+=1){const u=this.calcOffset(i[c]),p=Math.abs(r-u);p<o&&(o=p,s=c)}return s},n.getMousePosition=function(r){return[r["page"+this.axisKey()],r["page"+this.orthogonalAxisKey()]]},n.getTouchPosition=function(r){const o=r.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},n.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},n.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},n.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},n.getValueFromPosition=function(r){const o=r/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return Lt(this.state.startValue+o,this.props)},n.getDiffPosition=function(r){let o=r-this.state.startPosition;return this.props.invert&&(o*=-1),o},n.resize=function(){const{slider:r,thumb0:o}=this;if(!r||!o)return;const s=this.sizeKey(),i=r.getBoundingClientRect(),l=r[s],c=i[this.posMaxKey()],u=i[this.posMinKey()],p=o.getBoundingClientRect()[s.replace("client","").toLowerCase()],d=l-p,h=Math.abs(c-u);this.state.upperBound===d&&this.state.sliderLength===h&&this.state.thumbSize===p||this.setState({upperBound:d,sliderLength:h,thumbSize:p})},n.calcOffset=function(r){const o=this.props.max-this.props.min;return o===0?0:(r-this.props.min)/o*this.state.upperBound},n.calcValue=function(r){return r/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},n.calcOffsetFromPosition=function(r){const{slider:o}=this,s=o.getBoundingClientRect(),i=s[this.posMaxKey()],l=s[this.posMinKey()];let c=r-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?i:l));return this.props.invert&&(c=this.state.sliderLength-c),c-=this.state.thumbSize/2,c},n.forceValueFromPosition=function(r,o){const s=this.calcOffsetFromPosition(r),i=this.getClosestIndex(s),l=Lt(this.calcValue(s),this.props),c=this.state.value.slice();c[i]=l;for(let u=0;u<c.length-1;u+=1)if(c[u+1]-c[u]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:c},()=>{o(i),this.fireChangeEvent("onChange")})},n.clearPendingResizeTimeouts=function(){do{const r=this.pendingResizeTimeouts.shift();clearTimeout(r)}while(this.pendingResizeTimeouts.length)},n.start=function(r,o){const s=this["thumb"+r];s&&s.focus();const{zIndices:i}=this.state;i.splice(i.indexOf(r),1),i.push(r),this.setState(l=>({startValue:l.value[r],startPosition:o!==void 0?o:l.startPosition,index:r,zIndices:i}))},n.moveUpByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=Lt(this.props.invert&&this.props.orientation==="horizontal"?o-r:o+r,this.props);this.move(Math.min(s,this.props.max))},n.moveDownByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=Lt(this.props.invert&&this.props.orientation==="horizontal"?o+r:o-r,this.props);this.move(Math.max(s,this.props.min))},n.move=function(r){const o=this.state.value.slice(),{index:s}=this.state,{length:i}=o,l=o[s];if(r===l)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;const{pearling:c,max:u,min:p,minDistance:d}=this.props;if(!c){if(s>0){const h=o[s-1];r<h+d&&(r=h+d)}if(s<i-1){const h=o[s+1];r>h-d&&(r=h-d)}}o[s]=r,c&&i>1&&(r>l?(this.pushSucceeding(o,d,s),function(h,v,x,f){for(let C=0;C<h;C+=1){const S=f-C*x;v[h-1-C]>S&&(v[h-1-C]=S)}}(i,o,d,u)):r<l&&(this.pushPreceding(o,d,s),function(h,v,x,f){for(let C=0;C<h;C+=1){const S=f+C*x;v[C]<S&&(v[C]=S)}}(i,o,d,p))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},n.pushSucceeding=function(r,o,s){let i,l;for(i=s,l=r[i]+o;r[i+1]!==null&&l>r[i+1];i+=1,l=r[i]+o)r[i+1]=oo(l,this.props)},n.pushPreceding=function(r,o,s){for(let i=s,l=r[i]-o;r[i-1]!==null&&l<r[i-1];i-=1,l=r[i]-o)r[i-1]=oo(l,this.props)},n.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},n.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},n.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},n.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},n.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},n.fireChangeEvent=function(r){this.props[r]&&this.props[r](Yn(this.state.value),this.state.index)},n.buildThumbStyle=function(r,o){const s={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return s[this.posMinKey()]=r+"px",s},n.buildTrackStyle=function(r,o){const s={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return s[this.posMinKey()]=r,s[this.posMaxKey()]=o,s},n.buildMarkStyle=function(r){var o;return(o={position:"absolute"})[this.posMinKey()]=r,o},n.renderThumbs=function(r){const{length:o}=r,s=[];for(let l=0;l<o;l+=1)s[l]=this.buildThumbStyle(r[l],l);const i=[];for(let l=0;l<o;l+=1)i[l]=this.renderThumb(s[l],l);return i},n.renderTracks=function(r){const o=[],s=r.length-1;o.push(this.renderTrack(0,0,r[0]));for(let i=0;i<s;i+=1)o.push(this.renderTrack(i+1,r[i],r[i+1]));return o.push(this.renderTrack(s+1,r[s],this.state.upperBound)),o},n.renderMarks=function(){let{marks:r}=this.props;const o=this.props.max-this.props.min+1;return typeof r=="boolean"?r=Array.from({length:o}).map((s,i)=>i):typeof r=="number"&&(r=Array.from({length:o}).map((s,i)=>i).filter(s=>s%r==0)),r.map(parseFloat).sort((s,i)=>s-i).map(s=>{const i=this.calcOffset(s),l={key:s,className:this.props.markClassName,style:this.buildMarkStyle(i)};return this.props.renderMark(l)})},n.render=function(){const r=[],{value:o}=this.state,s=o.length;for(let u=0;u<s;u+=1)r[u]=this.calcOffset(o[u],u);const i=this.props.withTracks?this.renderTracks(r):null,l=this.renderThumbs(r),c=this.props.marks?this.renderMarks():null;return b.createElement("div",{ref:u=>{this.slider=u,this.resizeElementRef.current=u},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},i,l,c)},t}(b.Component);so.displayName="ReactSlider",so.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>b.createElement("div",e),renderTrack:e=>b.createElement("div",e),renderMark:e=>b.createElement("span",e)};var Cl=so;const Sl="_container_15vgv_2",Tl="_unitLabel_15vgv_9",wl="_slider_15vgv_12",El="_thumb_15vgv_18",kl="_track_15vgv_27",Rl="_labels_15vgv_33",Yt={container:Sl,unitLabel:Tl,slider:wl,thumb:El,track:kl,labels:Rl},si=({min:e=0,max:t=100,step:n=1,onChange:r,width:o=300,unit:s,fontColor:i="#605B56",value:l=[e,t]})=>{const{t:c}=Te.useTranslation(),u=p=>{r==null||r({min:p[0],max:p[1]})};return m.jsxs("div",{className:Yt.container,style:{width:`${o}px`,color:`${i}`},children:[m.jsx("div",{className:Yt.unitLabel,children:m.jsx("span",{children:c(s)})}),m.jsx(Cl,{className:Yt.slider,thumbClassName:Yt.thumb,trackClassName:Yt.track,min:e,max:t,step:n,value:l,onChange:u,withTracks:!0,pearling:!0,minDistance:1}),m.jsxs("div",{className:Yt.labels,children:[m.jsx("span",{children:l[0]}),m.jsx("span",{children:l[1]})]})]})};si.propTypes={min:a.number,max:a.number,step:a.number,initialMin:a.number,initialMax:a.number,onChange:a.func,width:a.number,unit:a.string,fontColor:a.string,value:a.arrayOf(a.number)};const Ol="_tematicalFiltersInputContainer_1vm1r_2",jl="_inputTypeContainer_1vm1r_2",$l="_checkboxContainer_1vm1r_28",Pl="_absoluteSliderContainer_1vm1r_37",Gn={tematicalFiltersInputContainer:Ol,inputTypeContainer:jl,checkboxContainer:$l,absoluteSliderContainer:Pl},vo=({indicator:e,activeColor:t})=>{const[n,r]=b.useState(),{type:o,name:s,values:i,minValue:l,maxValue:c,unit:u}=e||{},p=b.useMemo(()=>o=="cat"||n=="cat",[n,o]),d=b.useMemo(()=>o=="abs"||n=="abs",[n,o]),{tematicalFiltersSelected:h,selectedIndicator:v,fontColor:x,inputsColor:f}=Ue(j=>j),C=j=>{if(j){const{min:w,max:R,valueClicked:_,allValues:F}=j||{},{code:y,type:E}=e||{},T=d?"abs":p?"cat":"both";let $=y[0];E=="both"&&($=T=="cat"?y[1]:y[0]),T=="cat"?Ue.setState(I=>{let Q=I.tematicalFiltersSelected.find(U=>U.code===$);if(Q){let U=[Q.values];if(Q.values.includes(_)){if(U=Q.values.filter(Z=>Z!==_),U.length<1)return{tematicalFiltersSelected:I.tematicalFiltersSelected.filter(Z=>Z.code!==$)}}else U=[...Q.values,_];return{tematicalFiltersSelected:I.tematicalFiltersSelected.map(Z=>Z.code===$?{...Z,values:U}:Z)}}else{console.log("entra aqui: ",F," ",_);let U=F.map((Z,q)=>q);return{tematicalFiltersSelected:[...h,{type:"cat",code:$,values:U.filter(Z=>Z!==_),name:e.name}]}}}):T=="abs"&&Ue.setState(I=>{let Q=I.tematicalFiltersSelected.find(U=>U.code===$);if(Q){let U={...Q};return U.min=w,U.max=R,{tematicalFiltersSelected:I.tematicalFiltersSelected.map(Z=>Z.code===$?U:Z)}}else return{tematicalFiltersSelected:[...h,{type:"abs",code:$,min:w,max:R}]}})}},S=b.useMemo(()=>{const j={};if((h==null?void 0:h.length)>0)for(const w of h)w.type==="cat"?j[w.code]=new Set(w.values):j[w.code]=[w.min,w.max];return j},[h]);return m.jsx("div",{className:Gn.tematicalFiltersInputContainer,children:m.jsxs(Rt,{titleFontStyles:{fontSize:16,fontWeight:400},title:s,isOpen:v==`id${s}`,onClick:()=>Ue.setState(()=>({selectedIndicator:v==`id${s}`?"":`id${s}`})),showBottomBar:!1,height:38,titleMarginChildren:14,className:"tematicalFiltersInputContainer",color:x,activeColor:t,children:[o=="both"&&m.jsxs("div",{className:Gn.inputTypeContainer,style:{color:x},children:[m.jsxs("label",{children:[m.jsx("input",{type:"radio",name:"tipo",value:"abs",onChange:()=>{r("abs")},style:{marginRight:4,backgroundColor:n=="abs"?f:"white",border:`1.5px solid ${n=="abs"?f:x}`}}),"Absoluto"]}),m.jsxs("label",{children:[m.jsx("input",{type:"radio",name:"tipo",value:"cat",onChange:()=>{r("cat")},style:{marginRight:4,backgroundColor:n=="cat"?f:"white",border:`1.5px solid ${n=="cat"?f:x}`}}),"Categórico"]})]}),p&&m.jsx("div",{className:Gn.checkboxContainer,children:i.map((j,w)=>{var R;return m.jsx(oi,{onClick:()=>C({valueClicked:w,allValues:i}),indicator:j,value:((R=S[e.code[o=="both"?1:0]])==null?void 0:R.has(w))||!S[e.code[o=="both"?1:0]]},`checkbox-${w}`)})}),d&&m.jsx("div",{className:Gn.absoluteSliderContainer,children:m.jsx(si,{onChange:C,min:l,max:c,unit:u,value:S[e.code[0]]})})]})})};vo.propTypes={indicator:a.shape({name:a.string,type:a.string,code:a.arrayOf(a.string),values:a.arrayOf(a.shape({codename:a.oneOfType(a.array,a.string),title:a.string}))}),activeColor:a.string};const ii=({subcategory:e,fontColor:t,activeColor:n})=>{const{activeSubcategory:r}=Ue(i=>i),{name:o,indicators:s}=e||{};return m.jsx(Rt,{title:o,isOpen:r==`id${o}`,onClick:()=>{Ue.setState(i=>({activeSubcategory:i.activeSubcategory===`id${o}`?"":`id${o}`}))},titleFontStyles:{fontSize:16,fontWeight:400},showBottomBar:!1,titleMarginChildren:20,height:49,color:t,activeColor:n,children:s==null?void 0:s.map((i,l)=>m.jsx(vo,{indicator:i,fontColor:t},`indicatorSub-${l}`))})};ii.propTypes={subcategory:a.shape({name:a.string,indicators:a.arrayOf(a.shape({name:a.string,value:a.string}))}),activeColor:a.string};const ai=({category:e,activeColor:t})=>{const{name:n,subcategories:r,indicators:o}=e||{},{activeCategory:s,fontColor:i}=Ue(l=>l);return e&&m.jsx(Rt,{onClick:()=>{Ue.setState(l=>({activeCategory:s===`id${n}`?"":`id${n}`}))},title:n,isOpen:s===`id${n}`,titleFontStyles:{fontSize:18,fontWeight:"bold"},showBottomBar:!1,color:i,activeColor:t,children:r?r.map((l,c)=>m.jsx(ii,{subcategory:l,fontColor:i,activeColor:t},`subcategory-${c}`)):o&&o.map((l,c)=>m.jsx(vo,{indicator:l,fontColor:i},`indicator-${c}`))})};ai.propTypes={category:a.shape({name:a.string.isRequired,subcategories:a.array,indicators:a.array}),activeColor:a.string};const li=({indicators:e,isOpen:t=!0,title:n,fontColor:r="#605B56",inputsColor:o="#605B56",activeColor:s})=>{const{tematicalFiltersSelected:i}=Ue(c=>c),{t:l}=Te.useTranslation();return b.useEffect(()=>{console.log("filtersSelected changed: ",i)},[i]),b.useEffect(()=>{r&&Ue.setState(()=>({fontColor:r}))},[r]),b.useEffect(()=>{o&&Ue.setState(()=>({inputsColor:o}))},[o]),m.jsx(Rt,{isOpen:t,title:n?l(n):"Tematical filters",color:r,activeColor:s,children:e==null?void 0:e.map((c,u)=>m.jsx(ai,{category:c,fontColor:r,activeColor:s},`category-${u}`))})};li.propTypes={isOpen:a.bool,title:a.string,indicators:a.arrayOf(a.object),fontColor:a.string,onChangeTematicalFilters:a.func,inputsColor:a.string,activeColor:a.string};const Ml="_FiltersAmbitContainer_6o4gt_2",Ll="_FiltersAmbitHeader_6o4gt_7",Al="_FiltersAmbitTitle_6o4gt_15",Nl="_FiltersAmbitDescription_6o4gt_22",Il="_FiltersAmbitDescriptionTitle_6o4gt_33",Sn={FiltersAmbitContainer:Ml,FiltersAmbitHeader:Ll,FiltersAmbitTitle:Al,FiltersAmbitDescription:Nl,FiltersAmbitDescriptionTitle:Il},ci=({ambitName:e,ambitDescription:t,defaultFilters:n,indicators:r,activeColor:o,textColor:s,backgroundColor:i,onChangeAppliedFilters:l})=>{const{t:c}=Te.useTranslation(),{tematicalFiltersSelected:u}=Ue(p=>p);return b.useEffect(()=>{n&&n.length>0&&Ue.setState(p=>({tematicalFiltersSelected:n}))},[n]),b.useEffect(()=>{console.log("filtersSelected changed: ",u),l(u)},[u]),m.jsxs("div",{className:Sn.FiltersAmbitContainer,children:[m.jsxs("div",{className:Sn.FiltersAmbitHeader,children:[m.jsx("div",{className:Sn.FiltersAmbitTitle,children:e}),m.jsxs("div",{className:Sn.FiltersAmbitDescription,children:[m.jsx("div",{className:Sn.FiltersAmbitDescriptionTitle,children:c("description")}),t]})]}),m.jsx(ni,{title:c("applied_filters"),isOpen:!0,textColor:s||"#fff",backgroundColor:i||"#605B5680",activeColor:o}),m.jsx(ri,{activeColor:o}),m.jsx(li,{indicators:r,inputsColor:o,textColor:s,title:"tematical_filters",activeColor:o})]})};ci.propTypes={indicators:a.arrayOf(a.object).isRequired,ambitName:a.string,ambitDescription:a.string,defaultFilters:a.arrayOf(a.object),activeColor:a.string,backgroundColor:a.string,textColor:a.string,onChangeAppliedFilters:a.func};const Dl="_barChartContainer_d2f1z_2",Fl={barChartContainer:Dl},ui=({data:e,width:t=700,barHeight:n=25,gap:r=23,fontColor:o="#605B56",verticalPaddign:s=10,horizontalPaddign:i=20,leftPadding:l=200,numberOfDivisions:c=7,maxValue:u=null})=>{const{t:p}=Te.useTranslation(),{xScale:d,ticks:h,height:v}=b.useMemo(()=>{if(e&&e.length>0){const x=(e==null?void 0:e.length)*(n+r)+s*2,f=Io.max(e,j=>j.value)||1,C=Io.scaleLinear().domain([0,u||f]).range([0,t-l]),S=Array.from({length:c+1},(j,w)=>u?u/c*w:f/c*w);return{xScale:C,ticks:S,height:x,width:t,verticalPaddign:s,horizontalPaddign:i}}else return{xScale:null,ticks:[],height:0}},[e,t,c,n,r,i,s,u]);return m.jsx("div",{className:Fl.barChartContainer,children:m.jsx("svg",{width:t+i*2,height:v,children:m.jsxs("g",{transform:`translate(0,${r})`,children:[m.jsx("g",{transform:`translate(${l+i}, 0)`,children:h.map((x,f)=>{const C=d(x);return m.jsxs("g",{transform:`translate(${C}, 0)`,children:[m.jsx("line",{y1:0,y2:v-r*2,stroke:"#ccc"}),m.jsx("text",{y:v-r,textAnchor:"middle",fontSize:10,fill:o,children:parseInt(x)})]},f)})}),e&&e.length>0&&(e==null?void 0:e.map((x,f)=>{const C=d(x.value),S=f*(n+r);return m.jsxs("g",{transform:`translate(${l+i}, ${S})`,children:[m.jsx("text",{x:-24,y:n/2+5,textAnchor:"end",fill:o,children:p(x.title)}),m.jsx("rect",{width:C,height:n,fill:x.color,rx:0})]},f)}))]})})})};ui.propTypes={data:a.arrayOf(a.shape({title:a.string,value:a.number,color:a.string})),width:a.number,barHeight:a.number,gap:a.number,verticalPaddign:a.number,horizontalPaddign:a.number,numberOfDivisions:a.number,fontColor:a.string};const zl="_graphicContainer_c9zrg_2",Bl="_titleContainer_c9zrg_14",Qo={graphicContainer:zl,titleContainer:Bl},fi=({data:e,graphWidth:t=700,containerStyle:n,borderColor:r="#605B56",title:o="Graphic Title",fontColor:s="#605B56",maxValue:i=null,numberOfDivisions:l=7,leftPadding:c=200})=>{const{t:u}=Te.useTranslation();return m.jsxs("div",{className:Qo.graphicContainer,style:{...n||{},border:`1.5px solid ${r}`},children:[m.jsx("div",{className:Qo.titleContainer,children:m.jsx("h2",{children:u(o)})}),m.jsx(ui,{data:e,width:t,fontColor:s,maxValue:i,numberOfDivisions:l,leftPadding:c})]})};fi.propTypes={data:a.arrayOf(a.shape({color:a.string.isRequired,value:a.number.isRequired,title:a.string.isRequired})),borderColor:a.string,title:a.string,graphWidth:a.number,containerStyle:a.object,fontColor:a.string,maxValue:a.number,numberOfDivisions:a.number,leftPadding:a.number};const Ul="_indicatorsCategory_1cu33_2",Vl="_title_1cu33_5",ql="_list_1cu33_11",Wr={indicatorsCategory:Ul,title:Vl,list:ql},Wl="_indicatorContainer_lw8gx_2",Hl="_indicatorNameContainer_lw8gx_11",Kl="_dot_lw8gx_20",Yl="_indicatorName_lw8gx_11",Zl="_switchExternalContainer_lw8gx_31",Gl="_switchType_lw8gx_40",Jl="_switchTypeOptions_lw8gx_44",Xl="_optionContainer_lw8gx_55",Ql="_customRadious_lw8gx_65",ec="_optionText_lw8gx_72",Fe={indicatorContainer:Wl,indicatorNameContainer:Hl,dot:Kl,indicatorName:Yl,switchExternalContainer:Zl,switchType:Gl,switchTypeOptions:Jl,optionContainer:Xl,customRadious:Ql,optionText:ec},bo=({indicator:e,values:t=[],activeColor:n,defaultColor:r="#92898A",activeIndicator:o,activeIndicatorType:s,onClickIndicator:i,multiple:l=!1,onChangeType:c})=>{const{t:u}=Te.useTranslation(),{name:p,type:d}=e,[h,v]=b.useState(!1);b.useEffect(()=>{o&&v(l?o.some(C=>C.name==String(p)):o.name==p)},[o]);const x=()=>m.jsx("div",{className:Fe.switchExternalContainer,children:m.jsx("div",{className:Fe.switchType,children:m.jsxs("div",{className:Fe.switchTypeOptions,children:[m.jsxs("div",{className:Fe.optionContainer,onClick:()=>c("cat"),children:[m.jsx("span",{className:`${Fe.customRadious}`,style:{backgroundColor:s==="cat"?n:"transparent",borderColor:s==="cat"?n:r}}),m.jsx("h4",{className:Fe.optionText,style:{color:s==="cat"?n:r},children:u("indicators.cat")})]}),m.jsxs("div",{className:Fe.optionContainer,onClick:()=>c("abs"),children:[m.jsx("span",{className:`${Fe.customRadious}`,style:{backgroundColor:s==="abs"?n:"transparent",borderColor:s==="abs"?n:r}}),m.jsx("h4",{className:Fe.optionText,style:{color:s==="abs"?n:r},children:u("indicators.abs")})]})]})})}),f=()=>m.jsx("div",{className:Fe.switchExternalContainer,children:m.jsx("div",{className:Fe.switchType,children:m.jsx("div",{className:Fe.switchTypeOptions,children:t.map((C,S)=>m.jsxs("div",{className:Fe.optionContainer,children:[m.jsx("span",{className:Fe.customRadious}),m.jsx("h4",{children:u(C.unit)})]},S))})})});return m.jsxs("div",{className:Fe.indicatorContainer,children:[m.jsxs("div",{className:Fe.indicatorNameContainer,onClick:()=>i({indicator:e}),children:[m.jsx("div",{style:{border:h?`1px solid ${n}`:`1px solid ${r}`},className:Fe.dot}),m.jsx("h4",{className:Fe.indicatorName,style:{color:h?n:r},children:m.jsx(Te.Trans,{i18nKey:p,components:{sup:m.jsx("sup",{})}})})]}),(o==null?void 0:o.name)===p&&d==="both"&&m.jsx("div",{children:x()}),(o==null?void 0:o.name)===p&&d==="twoUnits"&&m.jsx("div",{children:f()})]})};bo.propTypes={indicator:a.shape({name:a.string,type:a.string}),values:a.oneOfType([a.bool,a.array]),activeColor:a.string,defaultColor:a.string,activeIndicator:a.oneOfType([a.object,a.array]),multiple:a.bool,onClickIndicator:a.func};const tc="_indicatorsSubCategory_1dzsi_2",nc="_list_1dzsi_8",es={indicatorsSubCategory:tc,list:nc},di=({subcName:e,indicators:t,defaultColor:n,activeColor:r,activeSubCategory:o,onClickSubCategory:s,id:i,activeIndicator:l,onClickIndicator:c,multiple:u,activeIndicatorType:p,onChangeType:d})=>{const{t:h}=Te.useTranslation(),[v,x]=b.useState(!1);return b.useEffect(()=>{x(o==i)},[o,i]),m.jsxs(mo.motion.div,{className:es.indicatorsSubCategory,initial:{height:"43px"},animate:{height:v?"auto":"43px"},transition:{duration:.4},children:[m.jsx("button",{onClick:()=>s(i),children:m.jsxs("h3",{style:{color:v?r:n},children:[m.jsx("span",{style:{color:v?r:n},children:v?"-":"+"}),m.jsx("span",{style:{marginLeft:12,color:v?r:n},children:h(e)})]})}),t&&m.jsx("div",{className:es.list,children:t==null?void 0:t.map((f,C)=>m.jsx(bo,{indicator:f,defaultColor:n,activeColor:r,activeIndicator:l,onClickIndicator:c,multiple:u,activeIndicatorType:p,onChangeType:d},"indicator"+C))})]})};di.propTypes={subcName:a.string,indicators:a.array,activeColor:a.string,defaultColor:a.string,activeSubCategory:a.string,id:a.string,activeIndicator:a.oneOfType([a.object,a.array]),multiple:a.bool,onClickSubCategory:a.func,onClickIndicator:a.func};const pi=({cat:e,id:t,activeColor:n,defaultColor:r,onClickCategory:o,activeCategory:s,activeSubCategory:i,onClickSubCategory:l,activeIndicator:c,onClickIndicator:u,multiple:p,activeIndicatorType:d,onChangeType:h})=>{var C;const{t:v}=Te.useTranslation(),[x,f]=b.useState(!1);return b.useEffect(()=>{f(s===t)},[s,t]),m.jsxs(mo.motion.div,{className:Wr.indicatorsCategory,initial:{height:"53px"},animate:{height:x?"auto":"53px"},transition:{duration:.4},style:{backgroundColor:"white",borderBottom:x?`1px solid ${n}`:"0px",marginBottom:x?"20px":"0px"},children:[m.jsxs("h2",{className:`${Wr.title}`,onClick:()=>o(t),children:[m.jsx("span",{style:{color:x?n:r},children:x?"-":"+"}),m.jsx("span",{style:{marginLeft:12,color:x?n:r},children:v(e.name)})]}),e.subcategories?e.subcategories.map(({name:S,subcategory:j,indicators:w},R)=>m.jsx(di,{id:j,activeSubCategory:i,subcName:S,onClickSubCategory:l,activeIndicator:c,onClickIndicator:u,multiple:p,activeColor:n,defaultColor:r,indicators:w,activeIndicatorType:d,onChangeType:h},`subcKey ${R}`)):m.jsx("div",{className:Wr.list,children:(C=e.indicators)==null?void 0:C.map((S,j)=>m.jsx(bo,{indicator:S,values:S.type=="twoUnits"&&S.values,activeColor:n,defaultColor:r,activeIndicator:c,onClickIndicator:u,multiple:p,activeIndicatorType:d,onChangeType:h},`indicator${j}`))})]})};pi.propTypes={cat:a.object,id:a.string,onChange:a.func,onClickCategory:a.func,activeCategory:a.string,activeSubCategory:a.string,onClickSubCategory:a.func,onClickIndicator:a.func,activeIndicator:a.oneOfType([a.object,a.array]),multiple:a.bool,activeColor:a.string,defaultColor:a.string};const rc="_indicatorsList_fklyu_2",oc="_title_fklyu_6",ts={indicatorsList:rc,title:oc},hi=({indicators:e,activeColor:t,defaultColor:n="#92898A",onChange:r,multiple:o=!1,defaultValue:s=null,changeIndType:i,activeIndicatorType:l})=>{const{t:c}=Te.useTranslation(),[u,p]=b.useState(),[d,h]=b.useState(),[v,x]=b.useState(),f=R=>{p(u==R?null:R)},C=R=>{h(d==R?null:R)},S=({indicator:R})=>{console.log("onClickIndicator: ",R),j(R)},j=R=>{if(!o)x((v==null?void 0:v.name)==R.name?null:R);else{let _=v&&v.length>0?[...v]:[];x(_!=null&&_.some(F=>F.name==R.name)?_.filter(F=>F.name!=String(R.name)):[..._,R]),R.type=="both"&&i("cat")}};b.useEffect(()=>{console.log("activeindicator changed to: ",v),r&&typeof r=="function"&&v&&r({activeIndicator:v})},[v]),b.useLayoutEffect(()=>{if(s&&!v)if(o&&s&&Array.isArray(s)){let R=v&&v.length>0?[...v]:[];x([...R,...s]),w(s[0].name)}else j(s),w(s.name)},[]);const w=R=>{const _=e.find(F=>{if(F.subcategories){let y=F.subcategories.find(E=>E.indicators.find(T=>T.name==R));if(y)return h(y.subcategory),y}else return F.indicators.some(y=>y.name==R)});_&&p(_.category)};return m.jsxs("div",{className:ts.indicatorsList,children:[m.jsx("h2",{className:ts.title,style:{color:n},children:c("indicators.indicators")}),e.map((R,_)=>m.jsx(pi,{id:R.category,cat:R,onClickCategory:f,activeCategory:u,onClickSubCategory:C,activeSubCategory:d,onClickIndicator:S,activeIndicator:v,activeColor:t,defaultColor:n,multiple:o,onChange:r,onChangeType:i,activeIndicatorType:l},`categoryKey${_}`))]})};hi.propTypes={indicators:a.arrayOf(a.object),activeColor:a.string,defaultColor:a.string,onChange:a.func,changeIndType:a.func,multiple:a.bool,activeIndicator:a.oneOfType([a.object,a.array]),defaultValue:a.oneOfType([a.object,a.array]),activeIndicatorType:a.string};const sc="_langSelector_1of0g_2",ic="_currentLang_1of0g_7",ac="_arrow_1of0g_19",lc="_prevImg_1of0g_22",cc="_langMenu_1of0g_26",Zt={langSelector:sc,currentLang:ic,arrow:ac,prevImg:lc,langMenu:cc},mi=({langs:e,arrow:t,imgPrev:n})=>{const[r,o]=b.useState(!1),{i18n:s}=Te.useTranslation(),i=e.find(c=>c.code==s.language),l=c=>{s.changeLanguage(c),o(!1)};return m.jsxs("div",{className:Zt.langSelector,children:[m.jsxs("div",{className:Zt.currentLang,onClick:()=>{o(!r)},children:[n&&m.jsx("img",{className:Zt.prevImg,src:n}),i.titleSelected||i.title,m.jsx("img",{src:t,className:Zt.arrow})]}),r&&m.jsx("div",{className:Zt.langMenu,children:e.map(c=>m.jsx("button",{className:i.code==c.code?Zt.active:"",onClick:()=>l(c.code),children:c.title},c.code))})]})};mi.propTypes={langs:a.arrayOf(a.shape({code:a.string,title:a.string,titleSelected:a.string})),color:a.string,bckColor:a.string,hoverColor:a.string,arrow:a.object,imgPrev:a.object};const uc="_legendContainer_atg3j_3",fc="_closeButton_atg3j_18",dc="_titleContainer_atg3j_46",pc="_infoContainer_atg3j_52",hc="_titleLegendList_atg3j_63",mc="_legendListContainer_atg3j_70",gc="_gridContainer_atg3j_70",yc="_elementLegendContainer_atg3j_76",vc="_colorDot_atg3j_82",bc="_absoluteValueContainer_atg3j_88",xc="_absoluteValueColor_atg3j_91",_c="_absoluteValueText_atg3j_96",Cc="_moreInfoContainer_atg3j_108",We={legendContainer:uc,closeButton:fc,titleContainer:dc,infoContainer:pc,titleLegendList:hc,legendListContainer:mc,gridContainer:gc,elementLegendContainer:yc,colorDot:vc,absoluteValueContainer:bc,absoluteValueColor:xc,absoluteValueText:_c,moreInfoContainer:Cc},gi=({containerStyles:e,title:t,infoList:n,legendList:r,legendListTitle:o,absoluteValue:s,onClickMoreInfo:i,buttonTitle:l,onClickClose:c})=>{const{t:u}=Te.useTranslation();return m.jsxs("div",{style:e?{...e}:{},className:`${We.legendContainer}`,children:[m.jsx("button",{className:We.closeButton,onClick:c}),t&&m.jsx("div",{className:We.titleContainer,children:m.jsx("h2",{children:t})}),n&&n.length>0&&m.jsx("div",{className:We.infoContainer,children:m.jsx("ul",{children:n.map(({title:p,value:d})=>m.jsxs("li",{children:[m.jsx("h3",{className:We.title,children:`${p}:`}),m.jsxs("span",{className:We.value,children:["  ",d]})]},t))})}),m.jsx("h3",{className:We.titleLegendList,children:o?m.jsx(Te.Trans,{i18nKey:o,components:{sup:m.jsx("sup",{})}}):u("mainUse")}),m.jsx("div",{className:We.legendListContainer,children:s?m.jsxs("div",{className:We.absoluteValueContainer,children:[m.jsx("div",{className:We.absoluteValueColor,style:{background:`linear-gradient(to bottom, ${s.maxColor} 0%, ${s.minColor} 100%)`}}),m.jsxs("div",{className:We.absoluteValueText,children:[m.jsxs("span",{children:[s.maxValue," ",u(s.unit)]}),m.jsxs("span",{children:[s.minValue," ",u(s.unit)]})]})]}):r&&r.length>0&&m.jsx("div",{className:We.gridContainer,children:r.map(({title:p,color:d})=>m.jsxs("div",{className:We.elementLegendContainer,children:[m.jsx("div",{className:We.colorDot,style:{backgroundColor:d}}),m.jsxs("div",{className:We.titleLegendElement,children:[u(p)," "]})]},t))})}),i&&m.jsx("button",{className:We.moreInfoContainer,onClick:i,children:l||u("moreInformation")})]})};gi.propTypes={title:a.string,containerStyles:a.object,infoList:a.arrayOf(a.shape({title:a.string.isRequired,value:a.oneOfType([a.string,a.number])})),legendList:a.arrayOf(a.shape({title:a.string,color:a.string})),legendListTitle:a.string,absoluteValue:a.shape({maxColor:a.string,minColor:a.string,maxValue:a.number,minValue:a.number}),onClickMoreInfo:a.func,buttonTitle:a.string,onClickClose:a.func};const Sc="_logo_1ewa6_2",ns={logo:Sc},yi=({src:e,alt:t,href:n})=>{const{t:r}=Te.useTranslation(),o=m.jsx("img",{src:e,alt:r(t)});return n?m.jsx("div",{className:ns.logo,children:m.jsx("a",{href:n,children:o})}):m.jsx("div",{className:ns.logo,children:o})};yi.propTypes={src:a.string.isRequired,alt:a.string.isRequired,href:a.string,className:a.string};const Tc=X.createContext(null);function wc(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,s=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&r===s}function Qe(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Qe(e[n],t[n]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!t.hasOwnProperty(o)||!Qe(e[o],t[o]))return!1;return!0}return!1}function Ec(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function rs(e,t){if(!e.getProjection)return;const n=e.getProjection(),r=t.getProjection();Qe(n,r)||t.setProjection(n)}function os(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function ss(e,t){const n=t.viewState||t;let r=!1;if("zoom"in n){const o=e.zoom;e.zoom=n.zoom,r=r||o!==e.zoom}if("bearing"in n){const o=e.bearing;e.bearing=n.bearing,r=r||o!==e.bearing}if("pitch"in n){const o=e.pitch;e.pitch=n.pitch,r=r||o!==e.pitch}if(n.padding&&!e.isPaddingEqual(n.padding)&&(r=!0,e.padding=n.padding),"longitude"in n&&"latitude"in n){const o=e.center;e.center=new o.constructor(n.longitude,n.latitude),r=r||o!==e.center}return r}const kc=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function is(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const r of e.layers)t[r.id]=r;const n=e.layers.map(r=>{let o=null;"interactive"in r&&(o=Object.assign({},r),delete o.interactive);const s=t[r.ref];if(s){o=o||Object.assign({},r),delete o.ref;for(const i of kc)i in s&&(o[i]=s[i])}return o||r});return{...e,layers:n}}const as={version:8,sources:{},layers:[]},ls={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Hr={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},cs={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Rc=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Oc=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class ln{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=o=>{const s=this.props[cs[o.type]];s?s(o):o.type==="error"&&console.error(o.error)},this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const s=this.props[ls[o.type]];s&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),s(o),delete o.features)},this._onCameraEvent=o=>{if(!this._internalUpdate){const s=this.props[Hr[o.type]];s&&s(o)}o.type in this._deferredEvents&&(this._deferredEvents[o.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const o=this._updateSize(t),s=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||o||s&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=ln.savedMaps.pop();if(!r)return null;const o=r.map,s=o.getContainer();for(n.className=s.className;s.childNodes.length>0;)n.appendChild(s.childNodes[0]);o._container=n,r.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:i}=t;return i&&(i.bounds?o.fitBounds(i.bounds,{...i.fitBoundsOptions,duration:0}):r._updateViewState(i,!1)),o.isStyleLoaded()?o.fire("load"):o.once("styledata",()=>o.fire("load")),o._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=as}=n,o={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||jc()||null,container:t,style:is(r)},s=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),n.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,n.gl)}const i=new this._MapClass(o);s.padding&&i.setPadding(s.padding),n.cursor&&(i.getCanvas().style.cursor=n.cursor),this._createShadowTransform(i);const l=i._render;i._render=p=>{this._inRender=!0,l.call(i,p),this._inRender=!1};const c=i._renderTaskQueue.run;i._renderTaskQueue.run=p=>{c.call(i._renderTaskQueue,p),this._onBeforeRepaint()},i.on("render",()=>this._onAfterRepaint());const u=i.fire;i.fire=this._fireEvent.bind(this,u),i.on("resize",()=>{this._renderTransform.resize(i.transform.width,i.transform.height)}),i.on("styledata",()=>{this._updateStyleComponents(this.props,{}),rs(i.transform,this._renderTransform)}),i.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in ls)i.on(p,this._onPointerEvent);for(const p in Hr)i.on(p,this._onCameraEvent);for(const p in cs)i.on(p,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),ln.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=Ec(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,o=this._renderTransform,{zoom:s,pitch:i,bearing:l}=o,c=r.isMoving();c&&(o.cameraElevationReference="sea");const u=ss(o,{...os(r.transform),...t});if(c&&(o.cameraElevationReference="ground"),u&&n){const p=this._deferredEvents;p.move=!0,p.zoom||(p.zoom=s!==o.zoom),p.rotate||(p.rotate=l!==o.bearing),p.pitch||(p.pitch=i!==o.pitch)}return c||ss(r.transform,t),u}_updateSettings(t,n){const r=this._map;let o=!1;for(const s of Rc)if(s in t&&!Qe(t[s],n[s])){o=!0;const i=r[`set${s[0].toUpperCase()}${s.slice(1)}`];i==null||i.call(r,t[s])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=as,styleDiffing:o=!0}=t,s={diff:o};return"localIdeographFontFamily"in t&&(s.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(is(r),s),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let o=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Qe(t.light,n.light)&&(o=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Qe(t.fog,n.fog)&&(o=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Qe(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(o=!0,r.setTerrain(t.terrain))),o}_updateHandlers(t,n){const r=this._map;let o=!1;for(const s of Oc){const i=t[s]??!0,l=n[s]??!0;Qe(i,l)||(o=!0,i?r[s].enable(i):r[s].disable())}return o}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:o=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:o.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=t.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,l=this._queryRenderedFeatures(t.point),c=l.length>0;!c&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,c&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}_fireEvent(t,n,r){const o=this._map,s=o.transform,i=typeof n=="string"?n:n.type;return i==="move"&&this._updateViewState(this.props,!1),i in Hr&&(typeof n=="object"&&(n.viewState=os(s)),this._map.isMoving())?(o.transform=this._renderTransform,t.call(o,n,r),o.transform=s,o):(t.call(o,n,r),o)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{rs(this._renderTransform,n),t.transform=n}}}ln.savedMaps=[];function jc(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||process.env.MapboxAccessToken}catch{}try{e=e||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const $c=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Pc(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const o=t.transform;t.transform=e.transform;const s=t.project(r);return t.transform=o,s},unproject:r=>{const o=t.transform;t.transform=e.transform;const s=t.unproject(r);return t.transform=o,s},queryTerrainElevation:(r,o)=>{const s=t.transform;t.transform=e.transform;const i=t.queryTerrainElevation(r,o);return t.transform=s,i},queryRenderedFeatures:(r,o)=>{const s=t.transform;t.transform=e.transform;const i=t.queryRenderedFeatures(r,o);return t.transform=s,i}};for(const r of Mc(t))!(r in n)&&!$c.includes(r)&&(n[r]=t[r].bind(t));return n}function Mc(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Lc=typeof document<"u"?b.useLayoutEffect:b.useEffect,Ac=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Nc(e,t){for(const r of Ac)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const fn=X.createContext(null);function Ic(e,t){const n=b.useContext(Tc),[r,o]=b.useState(null),s=b.useRef(),{current:i}=b.useRef({mapLib:null,map:null});b.useEffect(()=>{const u=e.mapLib;let p=!0,d;return Promise.resolve(u||import("mapbox-gl")).then(h=>{if(!p)return;if(!h)throw new Error("Invalid mapLib");const v="Map"in h?h:h.default;if(!v.Map)throw new Error("Invalid mapLib");Nc(v,e),e.reuseMaps&&(d=ln.reuse(e,s.current)),d||(d=new ln(v.Map,e,s.current)),i.map=Pc(d),i.mapLib=v,o(d),n==null||n.onMapMount(i.map,e.id)}).catch(h=>{const{onError:v}=e;v?v({type:"error",target:null,error:h}):console.error(h)}),()=>{p=!1,d&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Lc(()=>{r&&r.setProps(e)}),b.useImperativeHandle(t,()=>i.map,[r]);const l=b.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return X.createElement("div",{id:e.id,ref:s,style:l},r&&X.createElement(fn.Provider,{value:i},X.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Dc=X.forwardRef(Ic),Fc=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function It(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const o=t[r];Number.isFinite(o)&&!Fc.test(r)?n[r]=`${o}px`:n[r]=o}}function vi(e,t){if(e===t)return null;const n=us(e),r=us(t),o=[];for(const s of r)n.has(s)||o.push(s);for(const s of n)r.has(s)||o.push(s);return o.length===0?null:o}function us(e){return new Set(e?e.trim().split(/\s+/):[])}b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(fn),o=b.useRef({props:e}),s=b.useMemo(()=>{let S=!1;X.Children.forEach(e.children,R=>{R&&(S=!0)});const j={...e,element:S?document.createElement("div"):null},w=new r.Marker(j);return w.setLngLat([e.longitude,e.latitude]),w.getElement().addEventListener("click",R=>{var _,F;(F=(_=o.current.props).onClick)==null||F.call(_,{type:"click",target:w,originalEvent:R})}),w.on("dragstart",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragStart)==null||y.call(F,_)}),w.on("drag",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDrag)==null||y.call(F,_)}),w.on("dragend",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragEnd)==null||y.call(F,_)}),w},[]);b.useEffect(()=>(s.addTo(n.getMap()),()=>{s.remove()}),[]);const{longitude:i,latitude:l,offset:c,style:u,draggable:p=!1,popup:d=null,rotation:h=0,rotationAlignment:v="auto",pitchAlignment:x="auto"}=e;b.useEffect(()=>{It(s.getElement(),u)},[u]),b.useImperativeHandle(t,()=>s,[]);const f=o.current.props;(s.getLngLat().lng!==i||s.getLngLat().lat!==l)&&s.setLngLat([i,l]),c&&!wc(s.getOffset(),c)&&s.setOffset(c),s.isDraggable()!==p&&s.setDraggable(p),s.getRotation()!==h&&s.setRotation(h),s.getRotationAlignment()!==v&&s.setRotationAlignment(v),s.getPitchAlignment()!==x&&s.setPitchAlignment(x),s.getPopup()!==d&&s.setPopup(d);const C=vi(f.className,e.className);if(C)for(const S of C)s.toggleClassName(S);return o.current.props=e,mr.createPortal(e.children,s.getElement())}));const zc=b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(fn),o=b.useMemo(()=>document.createElement("div"),[]),s=b.useRef({props:e}),i=b.useMemo(()=>{const l={...e},c=new r.Popup(l);return c.setLngLat([e.longitude,e.latitude]),c.once("open",u=>{var p,d;(d=(p=s.current.props).onOpen)==null||d.call(p,u)}),c},[]);if(b.useEffect(()=>{const l=c=>{var u,p;(p=(u=s.current.props).onClose)==null||p.call(u,c)};return i.on("close",l),i.setDOMContent(o).addTo(n.getMap()),()=>{i.off("close",l),i.isOpen()&&i.remove()}},[]),b.useEffect(()=>{It(i.getElement(),e.style)},[e.style]),b.useImperativeHandle(t,()=>i,[]),i.isOpen()){const l=s.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Qe(l.offset,e.offset)&&(i.options.anchor=e.anchor,i.setOffset(e.offset)),(l.anchor!==e.anchor||l.maxWidth!==e.maxWidth)&&i.setMaxWidth(e.maxWidth);const c=vi(l.className,e.className);if(c)for(const u of c)i.toggleClassName(u);s.current.props=e}return mr.createPortal(e.children,o)}));function Nn(e,t,n,r){const o=b.useContext(fn),s=b.useMemo(()=>e(o),[]);return b.useEffect(()=>{const i=t,l=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(s)||c.addControl(s,i==null?void 0:i.position),()=>{l&&l(o),c.hasControl(s)&&c.removeControl(s)}},[]),s}function Bc(e){const t=Nn(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return b.useEffect(()=>{It(t._container,e.style)},[e.style]),null}b.memo(Bc);function Uc(e){const t=Nn(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return b.useEffect(()=>{It(t._controlContainer,e.style)},[e.style]),null}b.memo(Uc);function Vc(e,t){const n=b.useRef({props:e}),r=Nn(({mapLib:o})=>{const s=new o.GeolocateControl(e),i=s._setupUI.bind(s);return s._setupUI=l=>{s._container.hasChildNodes()||i(l)},s.on("geolocate",l=>{var c,u;(u=(c=n.current.props).onGeolocate)==null||u.call(c,l)}),s.on("error",l=>{var c,u;(u=(c=n.current.props).onError)==null||u.call(c,l)}),s.on("outofmaxbounds",l=>{var c,u;(u=(c=n.current.props).onOutOfMaxBounds)==null||u.call(c,l)}),s.on("trackuserlocationstart",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationStart)==null||u.call(c,l)}),s.on("trackuserlocationend",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationEnd)==null||u.call(c,l)}),s},{position:e.position});return n.current.props=e,b.useImperativeHandle(t,()=>r,[]),b.useEffect(()=>{It(r._container,e.style)},[e.style]),null}b.memo(b.forwardRef(Vc));function qc(e){const t=Nn(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return b.useEffect(()=>{It(t._container,e.style)},[e.style]),null}const Wc=b.memo(qc);function Hc(e){const t=Nn(({mapLib:s})=>new s.ScaleControl(e),{position:e.position}),n=b.useRef(e),r=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),b.useEffect(()=>{It(t._container,o)},[o]),null}b.memo(Hc);function ur(e,t){if(!e)throw new Error(t)}let Kc=0;function Yc(e,t,n){if(e.style&&e.style._loaded){const r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function Zc(e,t,n){ur(t.id===n.id,"source id changed"),ur(t.type===n.type,"source type changed");let r="",o=0;for(const i in t)i!=="children"&&i!=="id"&&!Qe(n[i],t[i])&&(r=i,o++);if(!o)return;const s=t.type;s==="geojson"?e.setData(t.data):s==="image"?e.updateImage({url:t.url,coordinates:t.coordinates}):"setCoordinates"in e&&o===1&&r==="coordinates"?e.setCoordinates(t.coordinates):"setUrl"in e&&r==="url"?e.setUrl(t.url):"setTiles"in e&&r==="tiles"?e.setTiles(t.tiles):console.warn(`Unable to update <Source> prop: ${r}`)}function Gc(e){const t=b.useContext(fn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-source-${Kc++}`,[]);b.useEffect(()=>{if(t){const i=()=>setTimeout(()=>r(l=>l+1),0);return t.on("styledata",i),i(),()=>{var l;if(t.off("styledata",i),t.style&&t.style._loaded&&t.getSource(o)){const c=(l=t.getStyle())==null?void 0:l.layers;if(c)for(const u of c)u.source===o&&t.removeLayer(u.id);t.removeSource(o)}}}},[t]);let s=t&&t.style&&t.getSource(o);return s?Zc(s,e,n.current):s=Yc(t,o,e),n.current=e,s&&X.Children.map(e.children,i=>i&&b.cloneElement(i,{source:o}))||null}function Jc(e,t,n,r){if(ur(n.id===r.id,"layer id changed"),ur(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:o={},paint:s={},filter:i,minzoom:l,maxzoom:c,beforeId:u}=n;if(u!==r.beforeId&&e.moveLayer(t,u),o!==r.layout){const p=r.layout||{};for(const d in o)Qe(o[d],p[d])||e.setLayoutProperty(t,d,o[d]);for(const d in p)o.hasOwnProperty(d)||e.setLayoutProperty(t,d,void 0)}if(s!==r.paint){const p=r.paint||{};for(const d in s)Qe(s[d],p[d])||e.setPaintProperty(t,d,s[d]);for(const d in p)s.hasOwnProperty(d)||e.setPaintProperty(t,d,void 0)}Qe(i,r.filter)||e.setFilter(t,i),(l!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(t,l,c)}function Xc(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}let Qc=0;function eu(e){const t=b.useContext(fn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-layer-${Qc++}`,[]);if(b.useEffect(()=>{if(t){const i=()=>r(l=>l+1);return t.on("styledata",i),i(),()=>{t.off("styledata",i),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{Jc(t,o,e,n.current)}catch(i){console.warn(i)}else Xc(t,o,e);return n.current=e,null}const tu="_mapContainer_84pkf_2",nu={mapContainer:tu};Ea.accessToken="pk.eyJ1IjoiY2ljbGljYSIsImEiOiJja3llODhxZ2UwYzF1Mm5xcHVhMzI3anhqIn0.-r56FLAzEH57eVsB2ZeVcA";const bi=({initialView:e={latitude:39.4699,longitude:-.3763,zoom:12},maxZoom:t=17,minZoom:n=8,mapStyle:r,firstSymbolLayer:o,cssProps:s="",onClick:i="",interactiveLayers:l=[],popUp:c=!1,sources:u=[],layers:p=[]})=>{const d=b.useRef(),[h,v]=b.useState(null),x=kn.useSelector(f=>f.mapState.showTexts);return b.useEffect(()=>{if(d.current){const f=d.current.getMap();f.getStyle().layers.map(S=>{S.type=="symbol"&&S.id!="professionals"&&(x?f.setLayoutProperty(S.id,"visibility","visible"):f.setLayoutProperty(S.id,"visibility","none"))})}},[x]),m.jsx("div",{className:`${nu.mapContainer}`,style:s,children:m.jsxs(Dc,{initialViewState:e,ref:d,hash:!1,maxZoom:t,minZoom:n,mapStyle:r,onClick:i,interactiveLayerIds:l,children:[u.length&&u.map((f,C)=>m.jsx(Gc,{...f,children:p.length&&p.map((S,j)=>{if(S.sourceId==f.id)return m.jsx(eu,{...S.layer,beforeId:o},j)})},C)),m.jsx(Wc,{position:"bottom-right",visualizePitch:!0}),c&&h&&m.jsx(zc,{longitude:c.longitude,latitude:c.latitude,anchor:c.anchor,onClose:()=>v(null),children:c.content})]})})};bi.propTypes={initialView:a.shape({latitude:a.number.isRequired,longitude:a.number.isRequired,zoom:a.number.isRequired}),mapStyle:a.object,firstSymbolLayer:a.string,cssProps:a.object,style:a.object,maxZoom:a.number,minZoom:a.number,onClick:a.func,interactiveLayers:a.array,popUp:a.shape({latitude:a.number,longitude:a.number,anchor:a.string,content:a.element}),textsUrl:a.string,sources:a.arrayOf(a.shape({id:a.string,type:a.string,url:a.string,data:a.object})),layers:a.arrayOf(a.shape({sourceId:a.string,layer:a.shape({id:a.string,type:a.string,sourceLayer:a.string,minZoom:a.number,maxZoom:a.number,paint:a.object})}))};var et=Uint8Array,rn=Uint16Array,ru=Int32Array,xi=new et([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_i=new et([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ou=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ci=function(e,t){for(var n=new rn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var o=new ru(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)o[s]=s-n[r]<<5|r;return{b:n,r:o}},Si=Ci(xi,2),Ti=Si.b,su=Si.r;Ti[28]=258,su[258]=28;var iu=Ci(_i,0),au=iu.b,io=new rn(32768);for(var Ee=0;Ee<32768;++Ee){var St=(Ee&43690)>>1|(Ee&21845)<<1;St=(St&52428)>>2|(St&13107)<<2,St=(St&61680)>>4|(St&3855)<<4,io[Ee]=((St&65280)>>8|(St&255)<<8)>>1}var Rn=function(e,t,n){for(var r=e.length,o=0,s=new rn(t);o<r;++o)e[o]&&++s[e[o]-1];var i=new rn(t);for(o=1;o<t;++o)i[o]=i[o-1]+s[o-1]<<1;var l;if(n){l=new rn(1<<t);var c=15-t;for(o=0;o<r;++o)if(e[o])for(var u=o<<4|e[o],p=t-e[o],d=i[e[o]-1]++<<p,h=d|(1<<p)-1;d<=h;++d)l[io[d]>>c]=u}else for(l=new rn(r),o=0;o<r;++o)e[o]&&(l[o]=io[i[e[o]-1]++]>>15-e[o]);return l},In=new et(288);for(var Ee=0;Ee<144;++Ee)In[Ee]=8;for(var Ee=144;Ee<256;++Ee)In[Ee]=9;for(var Ee=256;Ee<280;++Ee)In[Ee]=7;for(var Ee=280;Ee<288;++Ee)In[Ee]=8;var wi=new et(32);for(var Ee=0;Ee<32;++Ee)wi[Ee]=5;var lu=Rn(In,9,1),cu=Rn(wi,5,1),Kr=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},ct=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Yr=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},uu=function(e){return(e+7)/8|0},fu=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new et(e.subarray(t,n))},du=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xe=function(e,t,n){var r=new Error(t||du[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Xe),!n)throw r;return r},xo=function(e,t,n,r){var o=e.length,s=0;if(!o||t.f&&!t.l)return n||new et(0);var i=!n,l=i||t.i!=2,c=t.i;i&&(n=new et(o*3));var u=function(be){var P=n.length;if(be>P){var xe=new et(Math.max(P*2,be));xe.set(n),n=xe}},p=t.f||0,d=t.p||0,h=t.b||0,v=t.l,x=t.d,f=t.m,C=t.n,S=o*8;do{if(!v){p=ct(e,d,1);var j=ct(e,d+1,3);if(d+=3,j)if(j==1)v=lu,x=cu,f=9,C=5;else if(j==2){var F=ct(e,d,31)+257,y=ct(e,d+10,15)+4,E=F+ct(e,d+5,31)+1;d+=14;for(var T=new et(E),$=new et(19),I=0;I<y;++I)$[ou[I]]=ct(e,d+I*3,7);d+=y*3;for(var Q=Kr($),U=(1<<Q)-1,Z=Rn($,Q,1),I=0;I<E;){var q=Z[ct(e,d,U)];d+=q&15;var w=q>>4;if(w<16)T[I++]=w;else{var ie=0,oe=0;for(w==16?(oe=3+ct(e,d,3),d+=2,ie=T[I-1]):w==17?(oe=3+ct(e,d,7),d+=3):w==18&&(oe=11+ct(e,d,127),d+=7);oe--;)T[I++]=ie}}var ke=T.subarray(0,F),$e=T.subarray(F);f=Kr(ke),C=Kr($e),v=Rn(ke,f,1),x=Rn($e,C,1)}else Xe(1);else{var w=uu(d)+4,R=e[w-4]|e[w-3]<<8,_=w+R;if(_>o){c&&Xe(0);break}l&&u(h+R),n.set(e.subarray(w,_),h),t.b=h+=R,t.p=d=_*8,t.f=p;continue}if(d>S){c&&Xe(0);break}}l&&u(h+131072);for(var O=(1<<f)-1,A=(1<<C)-1,ee=d;;ee=d){var ie=v[Yr(e,d)&O],W=ie>>4;if(d+=ie&15,d>S){c&&Xe(0);break}if(ie||Xe(2),W<256)n[h++]=W;else if(W==256){ee=d,v=null;break}else{var z=W-254;if(W>264){var I=W-257,te=xi[I];z=ct(e,d,(1<<te)-1)+Ti[I],d+=te}var Y=x[Yr(e,d)&A],K=Y>>4;Y||Xe(3),d+=Y&15;var $e=au[K];if(K>3){var te=_i[K];$e+=Yr(e,d)&(1<<te)-1,d+=te}if(d>S){c&&Xe(0);break}l&&u(h+131072);var V=h+z;if(h<$e){var G=s-$e,re=Math.min($e,V);for(G+h<0&&Xe(3);h<re;++h)n[h]=r[G+h]}for(;h<V;++h)n[h]=n[h-$e]}}t.l=v,t.p=ee,t.b=h,t.f=p,v&&(p=1,t.m=f,t.d=x,t.n=C)}while(!p);return h!=n.length&&i?fu(n,0,h):n.subarray(0,h)},pu=new et(0),hu=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&Xe(6,"invalid gzip data");var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},mu=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},gu=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Xe(6,"invalid zlib data"),(e[1]>>5&1)==1&&Xe(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function yu(e,t){return xo(e,{i:2},t,t)}function vu(e,t){var n=hu(e);return n+8>e.length&&Xe(6,"invalid gzip data"),xo(e.subarray(n,-8),{i:2},new et(mu(e)),t)}function bu(e,t){return xo(e.subarray(gu(e),-4),{i:2},t,t)}function xu(e,t){return e[0]==31&&e[1]==139&&e[2]==8?vu(e,t):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?yu(e,t):bu(e,t)}var _u=typeof TextDecoder<"u"&&new TextDecoder,Cu=0;try{_u.decode(pu,{stream:!0}),Cu=1}catch{}var Su=Object.defineProperty,On=Math.pow,Se=(e,t)=>Su(e,"name",{value:t,configurable:!0}),ze=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(u){o(u)}},i=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,i);l((n=n.apply(e,t)).next())});Se((e,t)=>{let n=!1,r="",o=L.GridLayer.extend({createTile:Se((s,i)=>{let l=document.createElement("img"),c=new AbortController,u=c.signal;return l.cancel=()=>{c.abort()},n||(e.getHeader().then(p=>{p.tileType===1?console.error("Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details."):p.tileType===2?r="image/png":p.tileType===3?r="image/jpeg":p.tileType===4?r="image/webp":p.tileType===5&&(r="image/avif")}),n=!0),e.getZxy(s.z,s.x,s.y,u).then(p=>{if(p){let d=new Blob([p.data],{type:r}),h=window.URL.createObjectURL(d);l.src=h,l.cancel=void 0,i(void 0,l)}}).catch(p=>{if(p.name!=="AbortError")throw p}),l},"createTile"),_removeTile:Se(function(s){let i=this._tiles[s];i&&(i.el.cancel&&i.el.cancel(),i.el.width=0,i.el.height=0,i.el.deleted=!0,L.DomUtil.remove(i.el),delete this._tiles[s],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(s)}))},"_removeTile")});return new o(t)},"leafletRasterLayer");var Tu=Se(e=>(t,n)=>{if(n instanceof AbortController)return e(t,n);let r=new AbortController;return e(t,r).then(o=>n(void 0,o.data,o.cacheControl||"",o.expires||""),o=>n(o)).catch(o=>n(o)),{cancel:Se(()=>r.abort(),"cancel")}},"v3compat"),Ei=class{constructor(t){this.tilev4=Se((n,r)=>ze(this,null,function*(){if(n.type==="json"){let v=n.url.substr(10),x=this.tiles.get(v);if(x||(x=new fs(v),this.tiles.set(v,x)),this.metadata)return{data:yield x.getTileJson(n.url)};let f=yield x.getHeader();return(f.minLon>=f.maxLon||f.minLat>=f.maxLat)&&console.error(`Bounds of PMTiles archive ${f.minLon},${f.minLat},${f.maxLon},${f.maxLat} are not valid.`),{data:{tiles:[`${n.url}/{z}/{x}/{y}`],minzoom:f.minZoom,maxzoom:f.maxZoom,bounds:[f.minLon,f.minLat,f.maxLon,f.maxLat]}}}let o=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),s=n.url.match(o);if(!s)throw new Error("Invalid PMTiles protocol URL");let i=s[1],l=this.tiles.get(i);l||(l=new fs(i),this.tiles.set(i,l));let c=s[2],u=s[3],p=s[4],d=yield l.getHeader(),h=yield l==null?void 0:l.getZxy(+c,+u,+p,r.signal);if(h)return{data:new Uint8Array(h.data),cacheControl:h.cacheControl,expires:h.expires};if(d.tileType===1){if(this.errorOnMissingTile)throw new Error("Tile not found.");return{data:new Uint8Array}}return{data:null}}),"tilev4"),this.tile=Tu(this.tilev4),this.tiles=new Map,this.metadata=(t==null?void 0:t.metadata)||!1,this.errorOnMissingTile=(t==null?void 0:t.errorOnMissingTile)||!1}add(t){this.tiles.set(t.source.getKey(),t)}get(t){return this.tiles.get(t)}};Se(Ei,"Protocol");var wu=Ei;function ki(e,t){return(t>>>0)*4294967296+(e>>>0)}Se(ki,"toNum");function Ri(e,t){let n=t.buf,r=n[t.pos++],o=(r&112)>>4;if(r<128||(r=n[t.pos++],o|=(r&127)<<3,r<128)||(r=n[t.pos++],o|=(r&127)<<10,r<128)||(r=n[t.pos++],o|=(r&127)<<17,r<128)||(r=n[t.pos++],o|=(r&127)<<24,r<128)||(r=n[t.pos++],o|=(r&1)<<31,r<128))return ki(e,o);throw new Error("Expected varint not more than 10 bytes")}Se(Ri,"readVarintRemainder");function tn(e){let t=e.buf,n=t[e.pos++],r=n&127;return n<128||(n=t[e.pos++],r|=(n&127)<<7,n<128)||(n=t[e.pos++],r|=(n&127)<<14,n<128)||(n=t[e.pos++],r|=(n&127)<<21,n<128)?r:(n=t[e.pos],r|=(n&15)<<28,Ri(r,e))}Se(tn,"readVarint");function _o(e,t,n,r){if(r===0){n===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let o=t[0];t[0]=t[1],t[1]=o}}Se(_o,"rotate");function Oi(e,t){let n=On(2,e),r=t,o=t,s=t,i=[0,0],l=1;for(;l<n;)r=1&s/2,o=1&(s^r),_o(l,i,r,o),i[0]+=l*r,i[1]+=l*o,s=s/4,l*=2;return[e,i[0],i[1]]}Se(Oi,"idOnLevel");var Eu=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function ji(e,t,n){if(e>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");if(t>On(2,e)-1||n>On(2,e)-1)throw new Error("tile x/y outside zoom level bounds");let r=Eu[e],o=On(2,e),s=0,i=0,l=0,c=[t,n],u=o/2;for(;u>0;)s=(c[0]&u)>0?1:0,i=(c[1]&u)>0?1:0,l+=u*u*(3*s^i),_o(u,c,s,i),u=u/2;return r+l}Se(ji,"zxyToTileId");function ku(e){let t=0;for(let n=0;n<27;n++){let r=(1<<n)*(1<<n);if(t+r>e)return Oi(n,e-t);t+=r}throw new Error("Tile zoom level exceeds max safe number limit (26)")}Se(ku,"tileIdToZxy");var Ru=(e=>(e[e.Unknown=0]="Unknown",e[e.None=1]="None",e[e.Gzip=2]="Gzip",e[e.Brotli=3]="Brotli",e[e.Zstd=4]="Zstd",e))(Ru||{});function gr(e,t){return ze(this,null,function*(){if(t===1||t===0)return e;if(t===2){if(typeof globalThis.DecompressionStream>"u")return xu(new Uint8Array(e));let n=new Response(e).body;if(!n)throw new Error("Failed to read response stream");let r=n.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(r).arrayBuffer()}throw new Error("Compression method not supported")})}Se(gr,"defaultDecompress");var Ou=(e=>(e[e.Unknown=0]="Unknown",e[e.Mvt=1]="Mvt",e[e.Png=2]="Png",e[e.Jpeg=3]="Jpeg",e[e.Webp=4]="Webp",e[e.Avif=5]="Avif",e))(Ou||{});function $i(e){return e===1?".mvt":e===2?".png":e===3?".jpg":e===4?".webp":e===5?".avif":""}Se($i,"tileTypeExt");var ju=127;function Pi(e,t){let n=0,r=e.length-1;for(;n<=r;){let o=r+n>>1,s=t-e[o].tileId;if(s>0)n=o+1;else if(s<0)r=o-1;else return e[o]}return r>=0&&(e[r].runLength===0||t-e[r].tileId<e[r].runLength)?e[r]:null}Se(Pi,"findTile");var $u=class{constructor(t){this.file=t}getKey(){return this.file.name}getBytes(t,n){return ze(this,null,function*(){return{data:yield this.file.slice(t,t+n).arrayBuffer()}})}};Se($u,"FileSource");var Mi=class{constructor(t,n=new Headers){this.url=t,this.customHeaders=n,this.mustReload=!1;let r="";"navigator"in globalThis&&(r=globalThis.navigator.userAgent||"");let o=r.indexOf("Windows")>-1,s=/Chrome|Chromium|Edg|OPR|Brave/.test(r);this.chromeWindowsNoCache=!1,o&&s&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(t){this.customHeaders=t}getBytes(t,n,r,o){return ze(this,null,function*(){let s,i;r?i=r:(s=new AbortController,i=s.signal);let l=new Headers(this.customHeaders);l.set("range",`bytes=${t}-${t+n-1}`);let c;this.mustReload?c="reload":this.chromeWindowsNoCache&&(c="no-store");let u=yield fetch(this.url,{signal:i,cache:c,headers:l});if(t===0&&u.status===416){let h=u.headers.get("Content-Range");if(!h||!h.startsWith("bytes */"))throw new Error("Missing content-length on 416 response");let v=+h.substr(8);u=yield fetch(this.url,{signal:i,cache:"reload",headers:{range:`bytes=0-${v-1}`}})}let p=u.headers.get("Etag");if(p!=null&&p.startsWith("W/")&&(p=null),u.status===416||o&&p&&p!==o)throw this.mustReload=!0,new ao(`Server returned non-matching ETag ${o} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(u.status>=300)throw new Error(`Bad response code: ${u.status}`);let d=u.headers.get("Content-Length");if(u.status===200&&(!d||+d>n))throw s&&s.abort(),new Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield u.arrayBuffer(),etag:p||void 0,cacheControl:u.headers.get("Cache-Control")||void 0,expires:u.headers.get("Expires")||void 0}})}};Se(Mi,"FetchSource");var Pu=Mi;function st(e,t){let n=e.getUint32(t+4,!0),r=e.getUint32(t+0,!0);return n*On(2,32)+r}Se(st,"getUint64");function Li(e,t){let n=new DataView(e),r=n.getUint8(7);if(r>3)throw new Error(`Archive is spec version ${r} but this library supports up to spec version 3`);return{specVersion:r,rootDirectoryOffset:st(n,8),rootDirectoryLength:st(n,16),jsonMetadataOffset:st(n,24),jsonMetadataLength:st(n,32),leafDirectoryOffset:st(n,40),leafDirectoryLength:st(n,48),tileDataOffset:st(n,56),tileDataLength:st(n,64),numAddressedTiles:st(n,72),numTileEntries:st(n,80),numTileContents:st(n,88),clustered:n.getUint8(96)===1,internalCompression:n.getUint8(97),tileCompression:n.getUint8(98),tileType:n.getUint8(99),minZoom:n.getUint8(100),maxZoom:n.getUint8(101),minLon:n.getInt32(102,!0)/1e7,minLat:n.getInt32(106,!0)/1e7,maxLon:n.getInt32(110,!0)/1e7,maxLat:n.getInt32(114,!0)/1e7,centerZoom:n.getUint8(118),centerLon:n.getInt32(119,!0)/1e7,centerLat:n.getInt32(123,!0)/1e7,etag:t}}Se(Li,"bytesToHeader");function Co(e){let t={buf:new Uint8Array(e),pos:0},n=tn(t),r=[],o=0;for(let s=0;s<n;s++){let i=tn(t);r.push({tileId:o+i,offset:0,length:0,runLength:1}),o+=i}for(let s=0;s<n;s++)r[s].runLength=tn(t);for(let s=0;s<n;s++)r[s].length=tn(t);for(let s=0;s<n;s++){let i=tn(t);i===0&&s>0?r[s].offset=r[s-1].offset+r[s-1].length:r[s].offset=i-1}return r}Se(Co,"deserializeIndex");var Ai=class extends Error{};Se(Ai,"EtagMismatch");var ao=Ai;function So(e,t){return ze(this,null,function*(){let n=yield e.getBytes(0,16384);if(new DataView(n.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");let r=n.data.slice(0,ju),o=Li(r,n.etag),s=n.data.slice(o.rootDirectoryOffset,o.rootDirectoryOffset+o.rootDirectoryLength),i=`${e.getKey()}|${o.etag||""}|${o.rootDirectoryOffset}|${o.rootDirectoryLength}`,l=Co(yield t(s,o.internalCompression));return[o,[i,l.length,l]]})}Se(So,"getHeaderAndRoot");function To(e,t,n,r,o){return ze(this,null,function*(){let s=yield e.getBytes(n,r,void 0,o.etag),i=yield t(s.data,o.internalCompression),l=Co(i);if(l.length===0)throw new Error("Empty directory is invalid");return l})}Se(To,"getDirectory");var Mu=class{constructor(t=100,n=!0,r=gr){this.cache=new Map,this.maxCacheEntries=t,this.counter=1,this.decompress=r}getHeader(t){return ze(this,null,function*(){let n=t.getKey(),r=this.cache.get(n);if(r)return r.lastUsed=this.counter++,r.data;let o=yield So(t,this.decompress);return o[1]&&this.cache.set(o[1][0],{lastUsed:this.counter++,data:o[1][2]}),this.cache.set(n,{lastUsed:this.counter++,data:o[0]}),this.prune(),o[0]})}getDirectory(t,n,r,o){return ze(this,null,function*(){let s=`${t.getKey()}|${o.etag||""}|${n}|${r}`,i=this.cache.get(s);if(i)return i.lastUsed=this.counter++,i.data;let l=yield To(t,this.decompress,n,r,o);return this.cache.set(s,{lastUsed:this.counter++,data:l}),this.prune(),l})}prune(){if(this.cache.size>this.maxCacheEntries){let t=1/0,n;this.cache.forEach((r,o)=>{r.lastUsed<t&&(t=r.lastUsed,n=o)}),n&&this.cache.delete(n)}}invalidate(t){return ze(this,null,function*(){this.cache.delete(t.getKey())})}};Se(Mu,"ResolvedValueCache");var Ni=class{constructor(t=100,n=!0,r=gr){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=t,this.counter=1,this.decompress=r}getHeader(t){return ze(this,null,function*(){let n=t.getKey(),r=this.cache.get(n);if(r)return r.lastUsed=this.counter++,yield r.data;let o=new Promise((s,i)=>{So(t,this.decompress).then(l=>{l[1]&&this.cache.set(l[1][0],{lastUsed:this.counter++,data:Promise.resolve(l[1][2])}),s(l[0]),this.prune()}).catch(l=>{i(l)})});return this.cache.set(n,{lastUsed:this.counter++,data:o}),o})}getDirectory(t,n,r,o){return ze(this,null,function*(){let s=`${t.getKey()}|${o.etag||""}|${n}|${r}`,i=this.cache.get(s);if(i)return i.lastUsed=this.counter++,yield i.data;let l=new Promise((c,u)=>{To(t,this.decompress,n,r,o).then(p=>{c(p),this.prune()}).catch(p=>{u(p)})});return this.cache.set(s,{lastUsed:this.counter++,data:l}),l})}prune(){if(this.cache.size>=this.maxCacheEntries){let t=1/0,n;this.cache.forEach((r,o)=>{r.lastUsed<t&&(t=r.lastUsed,n=o)}),n&&this.cache.delete(n)}}invalidate(t){return ze(this,null,function*(){let n=t.getKey();if(this.invalidations.get(n))return yield this.invalidations.get(n);this.cache.delete(t.getKey());let r=new Promise((o,s)=>{this.getHeader(t).then(i=>{o(),this.invalidations.delete(n)}).catch(i=>{s(i)})});this.invalidations.set(n,r)})}};Se(Ni,"SharedPromiseCache");var Lu=Ni,Ii=class{constructor(t,n,r){typeof t=="string"?this.source=new Pu(t):this.source=t,r?this.decompress=r:this.decompress=gr,n?this.cache=n:this.cache=new Lu}getHeader(){return ze(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(t,n,r,o){return ze(this,null,function*(){let s=ji(t,n,r),i=yield this.cache.getHeader(this.source);if(t<i.minZoom||t>i.maxZoom)return;let l=i.rootDirectoryOffset,c=i.rootDirectoryLength;for(let u=0;u<=3;u++){let p=yield this.cache.getDirectory(this.source,l,c,i),d=Pi(p,s);if(d){if(d.runLength>0){let h=yield this.source.getBytes(i.tileDataOffset+d.offset,d.length,o,i.etag);return{data:yield this.decompress(h.data,i.tileCompression),cacheControl:h.cacheControl,expires:h.expires}}l=i.leafDirectoryOffset+d.offset,c=d.length}else return}throw new Error("Maximum directory depth exceeded")})}getZxy(t,n,r,o){return ze(this,null,function*(){try{return yield this.getZxyAttempt(t,n,r,o)}catch(s){if(s instanceof ao)return this.cache.invalidate(this.source),yield this.getZxyAttempt(t,n,r,o);throw s}})}getMetadataAttempt(){return ze(this,null,function*(){let t=yield this.cache.getHeader(this.source),n=yield this.source.getBytes(t.jsonMetadataOffset,t.jsonMetadataLength,void 0,t.etag),r=yield this.decompress(n.data,t.internalCompression),o=new TextDecoder("utf-8");return JSON.parse(o.decode(r))})}getMetadata(){return ze(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(t){if(t instanceof ao)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw t}})}getTileJson(t){return ze(this,null,function*(){let n=yield this.getHeader(),r=yield this.getMetadata(),o=$i(n.tileType);return{tilejson:"3.0.0",scheme:"xyz",tiles:[`${t}/{z}/{x}/{y}${o}`],vector_layers:r.vector_layers,attribution:r.attribution,description:r.description,name:r.name,version:r.version,bounds:[n.minLon,n.minLat,n.maxLon,n.maxLat],center:[n.centerLon,n.centerLat,n.centerZoom],minzoom:n.minZoom,maxzoom:n.maxZoom}})}};Se(Ii,"PMTiles");var fs=Ii;const Au=X.createContext(null);function Nu(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,s=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&r===s}function Ze(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ze(e[n],t[n]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!t.hasOwnProperty(o)||!Ze(e[o],t[o]))return!1;return!0}return!1}function ds(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function ps(e,t){const n=t.viewState||t,r={};if("longitude"in n&&"latitude"in n&&(n.longitude!==e.center.lng||n.latitude!==e.center.lat)){const o=e.center.constructor;r.center=new o(n.longitude,n.latitude)}return"zoom"in n&&n.zoom!==e.zoom&&(r.zoom=n.zoom),"bearing"in n&&n.bearing!==e.bearing&&(r.bearing=n.bearing),"pitch"in n&&n.pitch!==e.pitch&&(r.pitch=n.pitch),n.padding&&e.padding&&!Ze(n.padding,e.padding)&&(r.padding=n.padding),r}const Iu=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function hs(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const r of e.layers)t[r.id]=r;const n=e.layers.map(r=>{let o=null;"interactive"in r&&(o=Object.assign({},r),delete o.interactive);const s=t[r.ref];if(s){o=o||Object.assign({},r),delete o.ref;for(const i of Iu)i in s&&(o[i]=s[i])}return o||r});return{...e,layers:n}}const ms={version:8,sources:{},layers:[]},gs={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},ys={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},vs={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Du=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Fu=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class cn{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const s=this.props[vs[o.type]];s?s(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||ds(this._map.transform);const s=this.props[ys[o.type]];s&&s(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=ds(o),ps(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const s=this.props[gs[o.type]];s&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),s(o),delete o.features)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n),o=this._updateSize(t),s=this._updateViewState(t);this._updateStyle(t,n),this._updateStyleComponents(t),this._updateHandlers(t,n),(r||o||s&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=cn.savedMaps.pop();if(!r)return null;const o=r.map,s=o.getContainer();for(n.className=s.className;s.childNodes.length>0;)n.appendChild(s.childNodes[0]);o._container=n;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(n)),r.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:l}=t;return l&&(l.bounds?o.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):r._updateViewState(l)),o.isStyleLoaded()?o.fire("load"):o.once("style.load",()=>o.fire("load")),o._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=ms}=n,o={...n,...n.initialViewState,container:t,style:hs(r)},s=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),n.gl){const l=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=l,n.gl)}const i=new this._MapClass(o);s.padding&&i.setPadding(s.padding),n.cursor&&(i.getCanvas().style.cursor=n.cursor),i.transformCameraUpdate=this._onCameraUpdate,i.on("style.load",()=>{var l;this._styleComponents={light:i.getLight(),sky:i.getSky(),projection:(l=i.getProjection)==null?void 0:l.call(i),terrain:i.getTerrain()},this._updateStyleComponents(this.props)}),i.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const l in gs)i.on(l,this._onPointerEvent);for(const l in ys)i.on(l,this._onCameraEvent);for(const l in vs)i.on(l,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),cn.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t){const n=this._map,r=n.transform;if(!n.isMoving()){const s=ps(r,t);if(Object.keys(s).length>0)return this._internalUpdate=!0,n.jumpTo(s),this._internalUpdate=!1,!0}return!1}_updateSettings(t,n){const r=this._map;let o=!1;for(const s of Du)if(s in t&&!Ze(t[s],n[s])){o=!0;const i=r[`set${s[0].toUpperCase()}${s.slice(1)}`];i==null||i.call(r,t[s])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=ms,styleDiffing:o=!0}=t,s={diff:o};"localIdeographFontFamily"in t&&(s.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(hs(r),s)}}_updateStyleComponents({light:t,projection:n,sky:r,terrain:o}){var l,c;const s=this._map,i=this._styleComponents;s.style._loaded&&(t&&!Ze(t,i.light)&&(i.light=t,s.setLight(t)),n&&!Ze(n,i.projection)&&n!==((l=i.projection)==null?void 0:l.type)&&(i.projection=typeof n=="string"?{type:n}:n,(c=s.setProjection)==null||c.call(s,i.projection)),r&&!Ze(r,i.sky)&&(i.sky=r,s.setSky(r)),o!==void 0&&!Ze(o,i.terrain)&&(!o||s.getSource(o.source))&&(i.terrain=o,s.setTerrain(o)))}_updateHandlers(t,n){const r=this._map;for(const o of Fu){const s=t[o]??!0,i=n[o]??!0;Ze(s,i)||(s?r[o].enable(s):r[o].disable())}}_queryRenderedFeatures(t){const n=this._map,{interactiveLayerIds:r=[]}=this.props;try{return n.queryRenderedFeatures(t,{layers:r.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=t.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,l=this._queryRenderedFeatures(t.point),c=l.length>0;!c&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,c&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}}cn.savedMaps=[];const zu=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Bu(e){if(!e)return null;const t=e.map,n={getMap:()=>t};for(const r of Uu(t))!(r in n)&&!zu.includes(r)&&(n[r]=t[r].bind(t));return n}function Uu(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Vu=typeof document<"u"?b.useLayoutEffect:b.useEffect;function qu(e,t){const{RTLTextPlugin:n,maxParallelImageRequests:r,workerCount:o,workerUrl:s}=t;if(n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:l=!0}=typeof n=="string"?{pluginUrl:n}:n;e.setRTLTextPlugin(i,c=>{c&&console.error(c)},l)}r!==void 0&&e.setMaxParallelImageRequests(r),o!==void 0&&e.setWorkerCount(o),s!==void 0&&e.setWorkerUrl(s)}const dn=X.createContext(null);function Wu(e,t){const n=b.useContext(Au),[r,o]=b.useState(null),s=b.useRef(),{current:i}=b.useRef({mapLib:null,map:null});b.useEffect(()=>{const u=e.mapLib;let p=!0,d;return Promise.resolve(u||import("maplibre-gl")).then(h=>{if(!p)return;if(!h)throw new Error("Invalid mapLib");const v="Map"in h?h:h.default;if(!v.Map)throw new Error("Invalid mapLib");qu(v,e),e.reuseMaps&&(d=cn.reuse(e,s.current)),d||(d=new cn(v.Map,e,s.current)),i.map=Bu(d),i.mapLib=v,o(d),n==null||n.onMapMount(i.map,e.id)}).catch(h=>{const{onError:v}=e;v?v({type:"error",target:null,originalEvent:null,error:h}):console.error(h)}),()=>{p=!1,d&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Vu(()=>{r&&r.setProps(e)}),b.useImperativeHandle(t,()=>i.map,[r]);const l=b.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return X.createElement("div",{id:e.id,ref:s,style:l},r&&X.createElement(dn.Provider,{value:i},X.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Hu=X.forwardRef(Wu),Ku=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function bt(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const o=t[r];Number.isFinite(o)&&!Ku.test(r)?n[r]=`${o}px`:n[r]=o}}function Di(e,t){if(e===t)return null;const n=bs(e),r=bs(t),o=[];for(const s of r)n.has(s)||o.push(s);for(const s of n)r.has(s)||o.push(s);return o.length===0?null:o}function bs(e){return new Set(e?e.trim().split(/\s+/):[])}b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(dn),o=b.useRef({props:e}),s=b.useMemo(()=>{let S=!1;X.Children.forEach(e.children,R=>{R&&(S=!0)});const j={...e,element:S?document.createElement("div"):void 0},w=new r.Marker(j);return w.setLngLat([e.longitude,e.latitude]),w.getElement().addEventListener("click",R=>{var _,F;(F=(_=o.current.props).onClick)==null||F.call(_,{type:"click",target:w,originalEvent:R})}),w.on("dragstart",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragStart)==null||y.call(F,_)}),w.on("drag",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDrag)==null||y.call(F,_)}),w.on("dragend",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragEnd)==null||y.call(F,_)}),w},[]);b.useEffect(()=>(s.addTo(n.getMap()),()=>{s.remove()}),[]);const{longitude:i,latitude:l,offset:c,style:u,draggable:p=!1,popup:d=null,rotation:h=0,rotationAlignment:v="auto",pitchAlignment:x="auto"}=e;b.useEffect(()=>{bt(s.getElement(),u)},[u]),b.useImperativeHandle(t,()=>s,[]);const f=o.current.props;(s.getLngLat().lng!==i||s.getLngLat().lat!==l)&&s.setLngLat([i,l]),c&&!Nu(s.getOffset(),c)&&s.setOffset(c),s.isDraggable()!==p&&s.setDraggable(p),s.getRotation()!==h&&s.setRotation(h),s.getRotationAlignment()!==v&&s.setRotationAlignment(v),s.getPitchAlignment()!==x&&s.setPitchAlignment(x),s.getPopup()!==d&&s.setPopup(d);const C=Di(f.className,e.className);if(C)for(const S of C)s.toggleClassName(S);return o.current.props=e,mr.createPortal(e.children,s.getElement())}));const Yu=b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(dn),o=b.useMemo(()=>document.createElement("div"),[]),s=b.useRef({props:e}),i=b.useMemo(()=>{const l={...e},c=new r.Popup(l);return c.setLngLat([e.longitude,e.latitude]),c.once("open",u=>{var p,d;(d=(p=s.current.props).onOpen)==null||d.call(p,u)}),c},[]);if(b.useEffect(()=>{const l=c=>{var u,p;(p=(u=s.current.props).onClose)==null||p.call(u,c)};return i.on("close",l),i.setDOMContent(o).addTo(n.getMap()),()=>{i.off("close",l),i.isOpen()&&i.remove()}},[]),b.useEffect(()=>{bt(i.getElement(),e.style)},[e.style]),b.useImperativeHandle(t,()=>i,[]),i.isOpen()){const l=s.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Ze(l.offset,e.offset)&&i.setOffset(e.offset),(l.anchor!==e.anchor||l.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth));const c=Di(l.className,e.className);if(c)for(const u of c)i.toggleClassName(u);s.current.props=e}return mr.createPortal(e.children,o)}));function Dt(e,t,n,r){const o=b.useContext(dn),s=b.useMemo(()=>e(o),[]);return b.useEffect(()=>{const i=t,l=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(s)||c.addControl(s,i==null?void 0:i.position),()=>{l&&l(o),c.hasControl(s)&&c.removeControl(s)}},[]),s}function Zu(e){const t=Dt(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}b.memo(Zu);function Gu(e){const t=Dt(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return b.useEffect(()=>{bt(t._controlContainer,e.style)},[e.style]),null}b.memo(Gu);function Ju(e,t){const n=b.useRef({props:e}),r=Dt(({mapLib:o})=>{const s=new o.GeolocateControl(e),i=s._setupUI;return s._setupUI=()=>{s._container.hasChildNodes()||i()},s.on("geolocate",l=>{var c,u;(u=(c=n.current.props).onGeolocate)==null||u.call(c,l)}),s.on("error",l=>{var c,u;(u=(c=n.current.props).onError)==null||u.call(c,l)}),s.on("outofmaxbounds",l=>{var c,u;(u=(c=n.current.props).onOutOfMaxBounds)==null||u.call(c,l)}),s.on("trackuserlocationstart",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationStart)==null||u.call(c,l)}),s.on("trackuserlocationend",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationEnd)==null||u.call(c,l)}),s},{position:e.position});return n.current.props=e,b.useImperativeHandle(t,()=>r,[]),b.useEffect(()=>{bt(r._container,e.style)},[e.style]),null}b.memo(b.forwardRef(Ju));function Xu(e){const t=Dt(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}const Qu=b.memo(Xu);function ef(e){const t=Dt(({mapLib:s})=>new s.ScaleControl(e),{position:e.position}),n=b.useRef(e),r=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),b.useEffect(()=>{bt(t._container,o)},[o]),null}b.memo(ef);function tf(e){const t=Dt(({mapLib:n})=>new n.TerrainControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}b.memo(tf);function nf(e){const t=Dt(({mapLib:n})=>new n.LogoControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}b.memo(nf);function fr(e,t){if(!e)throw new Error(t)}let rf=0;function of(e,t,n){if(e.style&&e.style._loaded){const r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function sf(e,t,n){var i,l,c;fr(t.id===n.id,"source id changed"),fr(t.type===n.type,"source type changed");let r="",o=0;for(const u in t)u!=="children"&&u!=="id"&&!Ze(n[u],t[u])&&(r=u,o++);if(!o)return;const s=t.type;if(s==="geojson")e.setData(t.data);else if(s==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else switch(r){case"coordinates":(i=e.setCoordinates)==null||i.call(e,t.coordinates);break;case"url":(l=e.setUrl)==null||l.call(e,t.url);break;case"tiles":(c=e.setTiles)==null||c.call(e,t.tiles);break;default:console.warn(`Unable to update <Source> prop: ${r}`)}}function af(e){const t=b.useContext(dn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-source-${rf++}`,[]);b.useEffect(()=>{if(t){const i=()=>setTimeout(()=>r(l=>l+1),0);return t.on("styledata",i),i(),()=>{var l;if(t.off("styledata",i),t.style&&t.style._loaded&&t.getSource(o)){const c=(l=t.getStyle())==null?void 0:l.layers;if(c)for(const u of c)u.source===o&&t.removeLayer(u.id);t.removeSource(o)}}}},[t]);let s=t&&t.style&&t.getSource(o);return s?sf(s,e,n.current):s=of(t,o,e),n.current=e,s&&X.Children.map(e.children,i=>i&&b.cloneElement(i,{source:o}))||null}function lf(e,t,n,r){if(fr(n.id===r.id,"layer id changed"),fr(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:o={},paint:s={},filter:i,minzoom:l,maxzoom:c,beforeId:u}=n;if(u!==r.beforeId&&e.moveLayer(t,u),o!==r.layout){const p=r.layout||{};for(const d in o)Ze(o[d],p[d])||e.setLayoutProperty(t,d,o[d]);for(const d in p)o.hasOwnProperty(d)||e.setLayoutProperty(t,d,void 0)}if(s!==r.paint){const p=r.paint||{};for(const d in s)Ze(s[d],p[d])||e.setPaintProperty(t,d,s[d]);for(const d in p)s.hasOwnProperty(d)||e.setPaintProperty(t,d,void 0)}Ze(i,r.filter)||e.setFilter(t,i),(l!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(t,l,c)}function cf(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}let uf=0;function ff(e){const t=b.useContext(dn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-layer-${uf++}`,[]);if(b.useEffect(()=>{if(t){const i=()=>r(l=>l+1);return t.on("styledata",i),i(),()=>{t.off("styledata",i),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{lf(t,o,e,n.current)}catch(i){console.warn(i)}else cf(t,o,e);return n.current=e,null}const df="_mapContainer_ivruh_3",pf={mapContainer:df},hf="_FeaturePopUp_1gd6w_2",mf="_title_1gd6w_2",xs={FeaturePopUp:hf,title:mf},gf=({props:e})=>{const{t}=Te.useTranslation();return m.jsx("div",{className:xs.FeaturePopUp,children:e.map(n=>m.jsxs("p",{children:[m.jsxs("span",{className:xs.title,children:[m.jsx(Te.Trans,{i18nKey:n.name,components:{sup:m.jsx("sup",{})}}),": "]}),n.value.toLocaleString("de",{maximumFractionDigits:2})," ",t(n.unit)]}))})},Fi=({initialView:e={latitude:39.4699,longitude:-.3763,zoom:12},maxZoom:t=17,minZoom:n=8,mapStyle:r,firstSymbolLayer:o,cssProps:s={},onClick:i="",interactiveLayers:l=[],sources:c=[],layers:u=[],filters:p,popUpParams:d,onClosePopUp:h,showTexts:v})=>{console.log(p);const x=b.useRef();return b.useEffect(()=>{if(x.current){const f=x.current.getMap();f.getStyle().layers.map(S=>{S.type=="symbol"&&S.id!="professionals"&&(v?f.setLayoutProperty(S.id,"visibility","visible"):f.setLayoutProperty(S.id,"visibility","none"))})}},[v]),b.useEffect(()=>{let f=new wu;return Ao.addProtocol("pmtiles",f.tile),()=>{Ao.removeProtocol("pmtiles")}},[]),m.jsx("div",{className:`${pf.mapContainer}`,style:s&&s,children:m.jsxs(Hu,{initialViewState:e,ref:x,hash:!1,maxZoom:t,minZoom:n,mapStyle:r,onClick:i,interactiveLayerIds:l,children:[c.length&&c.map((f,C)=>m.jsx(af,{...f,children:u.length&&u.map((S,j)=>{if(S.sourceId==f.id)return m.jsx(ff,{...S.layer,beforeId:o,filter:p&&p},j)})},C)),m.jsx(Qu,{position:"bottom-right",visualizePitch:!0}),d&&m.jsx(Yu,{longitude:d.lng,latitude:d.lat,onClose:h,children:m.jsx(gf,{props:d.props})})]})})};Fi.propTypes={initialView:a.shape({latitude:a.number.isRequired,longitude:a.number.isRequired,zoom:a.number.isRequired}),mapStyle:a.string,firstSymbolLayer:a.string,cssProps:a.object,style:a.object,maxZoom:a.number,minZoom:a.number,onClick:a.func,interactiveLayers:a.array,popUp:a.bool,sources:a.arrayOf(a.shape({id:a.string,type:a.string,url:a.string,data:a.object})),layers:a.arrayOf(a.shape({sourceId:a.string,layer:a.shape({id:a.string,type:a.string,sourceLayer:a.string,minZoom:a.number,maxZoom:a.number,paint:a.object})})),showTexts:a.bool,filters:a.array,popUpParams:a.object,onClosePopUp:a.func};const yf="_sectionBar_2vnc3_2",vf="_leftContent_2vnc3_13",bf="_textContainer_2vnc3_19",xf="_title_2vnc3_26",_f="_subtitle_2vnc3_32",Cf="_rightContent_2vnc3_37",At={sectionBar:yf,leftContent:vf,textContainer:bf,title:xf,subtitle:_f,rightContent:Cf},zi=({leftIcon:e,title:t,subtitle:n,rightContent:r,mainColor:o})=>{const{t:s}=Te.useTranslation();return m.jsxs("div",{className:At.sectionBar,children:[m.jsxs("div",{className:At.leftContent,children:[e&&m.jsx("img",{src:e,alt:"Icono",className:At.icon}),m.jsxs("div",{className:At.textContainer,children:[m.jsx("div",{className:At.title,style:o?{color:o}:{},children:s(t)}),n&&m.jsx("div",{className:At.subtitle,children:n})]})]}),m.jsx("div",{className:At.rightContent,children:r})]})};zi.propTypes={leftIcon:a.node.isRequired,title:a.string.isRequired,subtitle:a.string,rightContent:a.node.isRequired,mainColor:a.string};const Sf=Ys.createSlice({name:"mapSlice",initialState:{showTexts:!0,sliderSelectedYear:2025,activeIndicatorKey:0,activeIndicatorType:"cat",activeIndicatorUnit:null},reducers:{setShowTexts:(e,t)=>{e.showTexts=t.payload},setYear:(e,t)=>{e.sliderSelectedYear=t.payload},setActiveIndicatorKey:(e,t)=>{e.activeIndicatorKey=t.payload},setActiveIndicatorType:(e,t)=>{e.activeIndicatorType=t.payload},setActiveIndicatorUnit:(e,t)=>{e.activeIndicatorUnit=t.payload}}}),{setShowTexts:Cm,setYear:Zr,setActiveIndicatorKey:Sm,setActiveIndicatorType:Tm,setActiveIndicatorUnit:wm}=Sf.actions,Tf="data:image/svg+xml,%3csvg%20width='42'%20height='42'%20viewBox='0%200%2042%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='21'%20cy='21'%20r='20.25'%20fill='%23FDFDFD'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3cpath%20d='M15.2722%2012.6627C15.2722%2011.8929%2016.1055%2011.4118%2016.7722%2011.7967L31.5641%2020.3368C32.2308%2020.7217%2032.2308%2021.684%2031.5641%2022.0689L16.7722%2030.609C16.1055%2030.9939%2015.2722%2030.5128%2015.2722%2029.743L15.2722%2012.6627Z'%20fill='%23605B56'/%3e%3c/svg%3e",wf="data:image/svg+xml,%3csvg%20width='42'%20height='42'%20viewBox='0%200%2042%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='21'%20cy='21'%20r='20.25'%20fill='%23FDFDFD'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3crect%20x='15'%20y='12'%20width='4'%20height='19'%20rx='1'%20fill='%23605B56'/%3e%3crect%20x='23'%20y='12'%20width='4'%20height='19'%20rx='1'%20fill='%23605B56'/%3e%3c/svg%3e";function xt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(null,arguments)}function Bi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Bi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Et(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bi(e))&&(r&&(r+=" "),r+=t);return r}function _s(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function Ef(e,t,n=void 0){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((s,i)=>{if(i){const l=t(i);l!==""&&s.push(l),n&&n[i]&&s.push(n[i])}return s},[]).join(" ")}),r}var je={},Gr={exports:{}},Cs;function Ui(){return Cs||(Cs=1,function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Gr)),Gr.exports}function Pn(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}const kf=Object.freeze(Object.defineProperty({__proto__:null,default:Pn},Symbol.toStringTag,{value:"Module"})),Rf=kt(kf);function nn(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Of=Object.freeze(Object.defineProperty({__proto__:null,default:nn},Symbol.toStringTag,{value:"Module"})),jf=kt(Of);var Ss;function $f(){if(Ss)return je;Ss=1;var e=Ui();Object.defineProperty(je,"__esModule",{value:!0}),je.alpha=x,je.blend=F,je.colorChannel=void 0,je.darken=C,je.decomposeColor=i,je.emphasize=R,je.getContrastRatio=v,je.getLuminance=h,je.hexToRgb=o,je.hslToRgb=d,je.lighten=j,je.private_safeAlpha=f,je.private_safeColorChannel=void 0,je.private_safeDarken=S,je.private_safeEmphasize=_,je.private_safeLighten=w,je.recomposeColor=u,je.rgbToHex=p;var t=e(Rf),n=e(jf);function r(y,E=0,T=1){return process.env.NODE_ENV!=="production"&&(y<E||y>T)&&console.error(`MUI: The value provided ${y} is out of range [${E}, ${T}].`),(0,n.default)(y,E,T)}function o(y){y=y.slice(1);const E=new RegExp(`.{1,${y.length>=6?2:1}}`,"g");let T=y.match(E);return T&&T[0].length===1&&(T=T.map($=>$+$)),T?`rgb${T.length===4?"a":""}(${T.map(($,I)=>I<3?parseInt($,16):Math.round(parseInt($,16)/255*1e3)/1e3).join(", ")})`:""}function s(y){const E=y.toString(16);return E.length===1?`0${E}`:E}function i(y){if(y.type)return y;if(y.charAt(0)==="#")return i(o(y));const E=y.indexOf("("),T=y.substring(0,E);if(["rgb","rgba","hsl","hsla","color"].indexOf(T)===-1)throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${y}\` color.
51
+ ${d&&Mt.active}`,children:x}),o&&m.jsx(yo,{text:h,position:s})]},c)})})};ti.propTypes={buttons:a.arrayOf(a.shape({icon:a.node.isRequired,activeIcon:a.node,isActive:a.bool,name:a.string,onClick:a.func})).isRequired,orientation:a.oneOf(["horizontal","vertical"]),showName:a.bool,namePosition:a.oneOf(["left","right"]),useTooltip:a.bool,tooltipPosition:a.oneOf(["top","bottom","left","right"])};const pl="_indicatorsCategory_1cu33_2",hl="_title_1cu33_5",ml="_list_1cu33_11",Ur={indicatorsCategory:pl,title:hl,list:ml},Rt=({isOpen:e,onClick:t,children:n,color:r,activeColor:o="#F8A925",title:s="Title",height:i=53,titleFontStyles:l,showBottomBar:c=!0,titleMarginChildren:u=25})=>{const{t:p}=Te.useTranslation();return m.jsxs(mo.motion.div,{className:Ur.indicatorsCategory,initial:{height:`${i}px`},animate:{height:e?"auto":`${i}px`},transition:{duration:.4},style:{backgroundColor:"white",borderBottom:e&&c?`1px solid ${o}`:"0px",marginBottom:e?"20px":"0px"},children:[m.jsxs("h2",{style:{...l,marginBottom:u||"auto"},className:`${Ur.title}`,onClick:t,children:[m.jsx("span",{style:{color:e?o:r},children:e?"-":"+"}),m.jsx("span",{style:{marginLeft:12,color:e?o:r},children:p(s)})]}),m.jsx("div",{className:Ur.content,children:n})]})};Rt.propTypes={isOpen:a.bool,onClick:a.func,children:a.node,color:a.string,activeColor:a.string,title:a.string,height:a.number,showBottomBar:a.bool,titleFontStyles:a.object};const gl=()=>m.jsx("div",{children:"EditAmbit"}),yl="_AppliedFiltersContainer_s8ooe_2",vl="_AppliedFilterContent_s8ooe_10",Xo={AppliedFiltersContainer:yl,AppliedFilterContent:vl},Ue=Ta.create(e=>({activeCategory:"",activeSubCategory:"",selectedIndicator:"",tematicalFiltersSelected:[],fontColor:"#605B56",inputsColor:"#605B56"})),ni=({title:e,onClick:t,isOpen:n=!0,textColor:r="#ffffff",backgroundColor:o="#605B5680",activeColor:s})=>{const{t:i}=Te.useTranslation(),{tematicalFiltersSelected:l}=Ue(u=>u),c=u=>{Ue.setState(p=>({tematicalFiltersSelected:p.tematicalFiltersSelected.filter(d=>d.code!==u)}))};return m.jsx(Rt,{isOpen:n,onClick:t,title:e?i(e):"Applied Filters",activeColor:s,children:m.jsx("div",{className:Xo.AppliedFiltersContainer,children:l==null?void 0:l.map((u,p)=>m.jsxs("div",{className:Xo.AppliedFilterContent,style:{color:r,background:o},children:[i(u.name),m.jsx("img",{src:tl,alt:"CloseIcon",onClick:()=>c(u.code),style:{cursor:"pointer"}})]},p))})})};ni.propTypes={isOpen:a.bool,onClick:a.func,title:a.string,textColor:a.string,backgroundColor:a.string,indicators:a.arrayOf(a.shape({title:a.string.isRequired,Codename:a.string.isRequired})),activeColor:a.string};const ri=({title:e,onClick:t,isOpen:n=!0,textColor:r="#ffffff",backgroundColor:o="#605B5680",activeColor:s})=>{const{t:i}=Te.useTranslation();return Ue(l=>l),m.jsx(Rt,{isOpen:n,onClick:t,title:e?i(e):"Geographical Filters",activeColor:s,children:"A"})};ri.propTypes={isOpen:a.bool,onClick:a.func,title:a.string,textColor:a.string,backgroundColor:a.string,activeColor:a.string};const bl="_checkboxContainer_zld97_2",xl={checkboxContainer:bl},oi=({onClick:e,containerStyles:t,color:n="#605B56",indicator:r,value:o})=>{const{t:s}=Te.useTranslation(),{title:i}=r||{},{fontColor:l,inputsColor:c}=Ue(u=>u);return m.jsxs("div",{style:{...t,color:n},role:"checkbox",className:xl.checkboxContainer,onClick:e,children:[m.jsx("input",{type:"checkbox",checked:typeof o=="boolean"?o:!0,value:o,readOnly:!0,style:{border:`1.5px solid ${o?c:l}`,backgroundColor:o?c:"white"}}),m.jsx("span",{className:"checkmark",children:s(i)})]})};oi.propTypes={onClick:a.func,value:a.bool,containerStyles:a.object,color:a.string,indicator:a.shape({title:a.string,codename:a.array}),checkedColor:a.string};function ro(e,t){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ro(e,t)}function _l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ro(e,t)}function Vr(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function qr(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function Yn(e){return e!==null&&e.length===1?e[0]:e.slice()}function Zn(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function Lt(e,t){return oo(function(n,r){let o=n;return o<=r.min&&(o=r.min),o>=r.max&&(o=r.max),o}(e,t),t)}function oo(e,t){const n=(e-t.min)%t.step;let r=e-n;return 2*Math.abs(n)>=t.step&&(r+=n>0?t.step:-t.step),parseFloat(r.toFixed(5))}let so=function(e){function t(r){var o;(o=e.call(this,r)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=l=>{l.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=l=>{o.setState({pending:!0});const c=o.getMousePosition(l),u=o.getDiffPosition(c[0]),p=o.getValueFromPosition(u);o.move(p)},o.onTouchMove=l=>{if(l.touches.length>1)return;o.setState({pending:!0});const c=o.getTouchPosition(l);if(o.isScrolling===void 0){const d=c[0]-o.startPosition[0],h=c[1]-o.startPosition[1];o.isScrolling=Math.abs(h)>Math.abs(d)}if(o.isScrolling)return void o.setState({index:-1});const u=o.getDiffPosition(c[0]),p=o.getValueFromPosition(u);o.move(p)},o.onKeyDown=l=>{if(!(l.ctrlKey||l.shiftKey||l.altKey||l.metaKey))switch(o.setState({pending:!0}),l.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":l.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":l.preventDefault(),o.moveUpByStep();break;case"Home":l.preventDefault(),o.move(o.props.min);break;case"End":l.preventDefault(),o.move(o.props.max);break;case"PageDown":l.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":l.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=l=>{if(!o.props.disabled&&l.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){const c=o.getMousePosition(l);o.forceValueFromPosition(c[0],u=>{o.start(u,c[0]),Zn(o.getMouseEventMap())})}Vr(l)}},o.onSliderClick=l=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){const c=o.getMousePosition(l),u=Lt(o.calcValue(o.calcOffsetFromPosition(c[0])),o.props);o.props.onSliderClick(u)}},o.createOnKeyDown=l=>c=>{o.props.disabled||(o.start(l),Zn(o.getKeyDownEventMap()),Vr(c))},o.createOnMouseDown=l=>c=>{if(o.props.disabled||c.button===2)return;o.setState({pending:!0});const u=o.getMousePosition(c);o.start(l,u[0]),Zn(o.getMouseEventMap()),Vr(c)},o.createOnTouchStart=l=>c=>{if(o.props.disabled||c.touches.length>1)return;o.setState({pending:!0});const u=o.getTouchPosition(c);o.startPosition=u,o.isScrolling=void 0,o.start(l,u[0]),Zn(o.getTouchEventMap()),function(p){p.stopPropagation&&p.stopPropagation()}(c)},o.handleResize=()=>{const l=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(l)},o.renderThumb=(l,c)=>{const u=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+c+" "+(o.state.index===c?o.props.thumbActiveClassName:""),p={ref:h=>{o["thumb"+c]=h},key:o.props.thumbClassName+"-"+c,className:u,style:l,onMouseDown:o.createOnMouseDown(c),onTouchStart:o.createOnTouchStart(c),onFocus:o.createOnKeyDown(c),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[c],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[c]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[c]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},d={index:c,value:Yn(o.state.value),valueNow:o.state.value[c]};return o.props.ariaValuetext&&(p["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(d)),o.props.renderThumb(p,d)},o.renderTrack=(l,c,u)=>{const p={key:o.props.trackClassName+"-"+l,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+l,style:o.buildTrackStyle(c,o.state.upperBound-u)},d={index:l,value:Yn(o.state.value)};return o.props.renderTrack(p,d)};let s=qr(r.value);s.length||(s=qr(r.defaultValue)),o.pendingResizeTimeouts=[];const i=[];for(let l=0;l<s.length;l+=1)s[l]=Lt(s[l],r),i.push(l);return o.resizeObserver=null,o.resizeElementRef=b.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:s,zIndices:i},o}_l(t,e);var n=t.prototype;return n.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(r,o){const s=qr(r.value);return s.length?o.pending?null:{value:s.map(i=>Lt(i,r))}:null},n.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},n.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},n.onEnd=function(r){r&&function(o){Object.keys(o).forEach(s=>{typeof document<"u"&&document.removeEventListener(s,o[s],!1)})}(r),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},n.getValue=function(){return Yn(this.state.value)},n.getClosestIndex=function(r){let o=Number.MAX_VALUE,s=-1;const{value:i}=this.state,l=i.length;for(let c=0;c<l;c+=1){const u=this.calcOffset(i[c]),p=Math.abs(r-u);p<o&&(o=p,s=c)}return s},n.getMousePosition=function(r){return[r["page"+this.axisKey()],r["page"+this.orthogonalAxisKey()]]},n.getTouchPosition=function(r){const o=r.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},n.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},n.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},n.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},n.getValueFromPosition=function(r){const o=r/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return Lt(this.state.startValue+o,this.props)},n.getDiffPosition=function(r){let o=r-this.state.startPosition;return this.props.invert&&(o*=-1),o},n.resize=function(){const{slider:r,thumb0:o}=this;if(!r||!o)return;const s=this.sizeKey(),i=r.getBoundingClientRect(),l=r[s],c=i[this.posMaxKey()],u=i[this.posMinKey()],p=o.getBoundingClientRect()[s.replace("client","").toLowerCase()],d=l-p,h=Math.abs(c-u);this.state.upperBound===d&&this.state.sliderLength===h&&this.state.thumbSize===p||this.setState({upperBound:d,sliderLength:h,thumbSize:p})},n.calcOffset=function(r){const o=this.props.max-this.props.min;return o===0?0:(r-this.props.min)/o*this.state.upperBound},n.calcValue=function(r){return r/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},n.calcOffsetFromPosition=function(r){const{slider:o}=this,s=o.getBoundingClientRect(),i=s[this.posMaxKey()],l=s[this.posMinKey()];let c=r-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?i:l));return this.props.invert&&(c=this.state.sliderLength-c),c-=this.state.thumbSize/2,c},n.forceValueFromPosition=function(r,o){const s=this.calcOffsetFromPosition(r),i=this.getClosestIndex(s),l=Lt(this.calcValue(s),this.props),c=this.state.value.slice();c[i]=l;for(let u=0;u<c.length-1;u+=1)if(c[u+1]-c[u]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:c},()=>{o(i),this.fireChangeEvent("onChange")})},n.clearPendingResizeTimeouts=function(){do{const r=this.pendingResizeTimeouts.shift();clearTimeout(r)}while(this.pendingResizeTimeouts.length)},n.start=function(r,o){const s=this["thumb"+r];s&&s.focus();const{zIndices:i}=this.state;i.splice(i.indexOf(r),1),i.push(r),this.setState(l=>({startValue:l.value[r],startPosition:o!==void 0?o:l.startPosition,index:r,zIndices:i}))},n.moveUpByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=Lt(this.props.invert&&this.props.orientation==="horizontal"?o-r:o+r,this.props);this.move(Math.min(s,this.props.max))},n.moveDownByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=Lt(this.props.invert&&this.props.orientation==="horizontal"?o+r:o-r,this.props);this.move(Math.max(s,this.props.min))},n.move=function(r){const o=this.state.value.slice(),{index:s}=this.state,{length:i}=o,l=o[s];if(r===l)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;const{pearling:c,max:u,min:p,minDistance:d}=this.props;if(!c){if(s>0){const h=o[s-1];r<h+d&&(r=h+d)}if(s<i-1){const h=o[s+1];r>h-d&&(r=h-d)}}o[s]=r,c&&i>1&&(r>l?(this.pushSucceeding(o,d,s),function(h,v,x,f){for(let C=0;C<h;C+=1){const S=f-C*x;v[h-1-C]>S&&(v[h-1-C]=S)}}(i,o,d,u)):r<l&&(this.pushPreceding(o,d,s),function(h,v,x,f){for(let C=0;C<h;C+=1){const S=f+C*x;v[C]<S&&(v[C]=S)}}(i,o,d,p))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},n.pushSucceeding=function(r,o,s){let i,l;for(i=s,l=r[i]+o;r[i+1]!==null&&l>r[i+1];i+=1,l=r[i]+o)r[i+1]=oo(l,this.props)},n.pushPreceding=function(r,o,s){for(let i=s,l=r[i]-o;r[i-1]!==null&&l<r[i-1];i-=1,l=r[i]-o)r[i-1]=oo(l,this.props)},n.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},n.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},n.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},n.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},n.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},n.fireChangeEvent=function(r){this.props[r]&&this.props[r](Yn(this.state.value),this.state.index)},n.buildThumbStyle=function(r,o){const s={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return s[this.posMinKey()]=r+"px",s},n.buildTrackStyle=function(r,o){const s={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return s[this.posMinKey()]=r,s[this.posMaxKey()]=o,s},n.buildMarkStyle=function(r){var o;return(o={position:"absolute"})[this.posMinKey()]=r,o},n.renderThumbs=function(r){const{length:o}=r,s=[];for(let l=0;l<o;l+=1)s[l]=this.buildThumbStyle(r[l],l);const i=[];for(let l=0;l<o;l+=1)i[l]=this.renderThumb(s[l],l);return i},n.renderTracks=function(r){const o=[],s=r.length-1;o.push(this.renderTrack(0,0,r[0]));for(let i=0;i<s;i+=1)o.push(this.renderTrack(i+1,r[i],r[i+1]));return o.push(this.renderTrack(s+1,r[s],this.state.upperBound)),o},n.renderMarks=function(){let{marks:r}=this.props;const o=this.props.max-this.props.min+1;return typeof r=="boolean"?r=Array.from({length:o}).map((s,i)=>i):typeof r=="number"&&(r=Array.from({length:o}).map((s,i)=>i).filter(s=>s%r==0)),r.map(parseFloat).sort((s,i)=>s-i).map(s=>{const i=this.calcOffset(s),l={key:s,className:this.props.markClassName,style:this.buildMarkStyle(i)};return this.props.renderMark(l)})},n.render=function(){const r=[],{value:o}=this.state,s=o.length;for(let u=0;u<s;u+=1)r[u]=this.calcOffset(o[u],u);const i=this.props.withTracks?this.renderTracks(r):null,l=this.renderThumbs(r),c=this.props.marks?this.renderMarks():null;return b.createElement("div",{ref:u=>{this.slider=u,this.resizeElementRef.current=u},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},i,l,c)},t}(b.Component);so.displayName="ReactSlider",so.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>b.createElement("div",e),renderTrack:e=>b.createElement("div",e),renderMark:e=>b.createElement("span",e)};var Cl=so;const Sl="_container_15vgv_2",Tl="_unitLabel_15vgv_9",wl="_slider_15vgv_12",El="_thumb_15vgv_18",kl="_track_15vgv_27",Rl="_labels_15vgv_33",Yt={container:Sl,unitLabel:Tl,slider:wl,thumb:El,track:kl,labels:Rl},si=({min:e=0,max:t=100,step:n=1,onChange:r,width:o=300,unit:s,fontColor:i="#605B56",value:l=[e,t]})=>{const{t:c}=Te.useTranslation(),u=p=>{r==null||r({min:p[0],max:p[1]})};return m.jsxs("div",{className:Yt.container,style:{width:`${o}px`,color:`${i}`},children:[m.jsx("div",{className:Yt.unitLabel,children:m.jsx("span",{children:c(s)})}),m.jsx(Cl,{className:Yt.slider,thumbClassName:Yt.thumb,trackClassName:Yt.track,min:e,max:t,step:n,value:l,onChange:u,withTracks:!0,pearling:!0,minDistance:1}),m.jsxs("div",{className:Yt.labels,children:[m.jsx("span",{children:l[0]}),m.jsx("span",{children:l[1]})]})]})};si.propTypes={min:a.number,max:a.number,step:a.number,initialMin:a.number,initialMax:a.number,onChange:a.func,width:a.number,unit:a.string,fontColor:a.string,value:a.arrayOf(a.number)};const Ol="_tematicalFiltersInputContainer_1vm1r_2",jl="_inputTypeContainer_1vm1r_2",$l="_checkboxContainer_1vm1r_28",Pl="_absoluteSliderContainer_1vm1r_37",Gn={tematicalFiltersInputContainer:Ol,inputTypeContainer:jl,checkboxContainer:$l,absoluteSliderContainer:Pl},vo=({indicator:e,activeColor:t})=>{const[n,r]=b.useState(),{type:o,name:s,values:i,minValue:l,maxValue:c,unit:u}=e||{},p=b.useMemo(()=>o=="cat"||n=="cat",[n,o]),d=b.useMemo(()=>o=="abs"||n=="abs",[n,o]),{tematicalFiltersSelected:h,selectedIndicator:v,fontColor:x,inputsColor:f}=Ue(j=>j),C=j=>{if(j){const{min:w,max:R,valueClicked:_,allValues:F}=j||{},{code:y,type:E}=e||{},T=d?"abs":p?"cat":"both";let $=y[0];E=="both"&&($=T=="cat"?y[1]:y[0]),T=="cat"?Ue.setState(I=>{let Q=I.tematicalFiltersSelected.find(U=>U.code===$);if(Q){let U=[Q.values];if(Q.values.includes(_)){if(U=Q.values.filter(Z=>Z!==_),U.length<1)return{tematicalFiltersSelected:I.tematicalFiltersSelected.filter(Z=>Z.code!==$)}}else U=[...Q.values,_];return{tematicalFiltersSelected:I.tematicalFiltersSelected.map(Z=>Z.code===$?{...Z,values:U}:Z)}}else{console.log("entra aqui: ",F," ",_);let U=F.map((Z,q)=>q);return{tematicalFiltersSelected:[...h,{type:"cat",code:$,values:U.filter(Z=>Z!==_),name:e.name}]}}}):T=="abs"&&Ue.setState(I=>{let Q=I.tematicalFiltersSelected.find(U=>U.code===$);if(Q){let U={...Q};return U.min=w,U.max=R,{tematicalFiltersSelected:I.tematicalFiltersSelected.map(Z=>Z.code===$?U:Z)}}else return{tematicalFiltersSelected:[...h,{type:"abs",code:$,min:w,max:R}]}})}},S=b.useMemo(()=>{const j={};if((h==null?void 0:h.length)>0)for(const w of h)w.type==="cat"?j[w.code]=new Set(w.values):j[w.code]=[w.min,w.max];return j},[h]);return m.jsx("div",{className:Gn.tematicalFiltersInputContainer,children:m.jsxs(Rt,{titleFontStyles:{fontSize:16,fontWeight:400},title:s,isOpen:v==`id${s}`,onClick:()=>Ue.setState(()=>({selectedIndicator:v==`id${s}`?"":`id${s}`})),showBottomBar:!1,height:38,titleMarginChildren:14,className:"tematicalFiltersInputContainer",color:x,activeColor:t,children:[o=="both"&&m.jsxs("div",{className:Gn.inputTypeContainer,style:{color:x},children:[m.jsxs("label",{children:[m.jsx("input",{type:"radio",name:"tipo",value:"abs",onChange:()=>{r("abs")},style:{marginRight:4,backgroundColor:n=="abs"?f:"white",border:`1.5px solid ${n=="abs"?f:x}`}}),"Absoluto"]}),m.jsxs("label",{children:[m.jsx("input",{type:"radio",name:"tipo",value:"cat",onChange:()=>{r("cat")},style:{marginRight:4,backgroundColor:n=="cat"?f:"white",border:`1.5px solid ${n=="cat"?f:x}`}}),"Categórico"]})]}),p&&m.jsx("div",{className:Gn.checkboxContainer,children:i.map((j,w)=>{var R;return m.jsx(oi,{onClick:()=>C({valueClicked:w,allValues:i}),indicator:j,value:((R=S[e.code[o=="both"?1:0]])==null?void 0:R.has(w))||!S[e.code[o=="both"?1:0]]},`checkbox-${w}`)})}),d&&m.jsx("div",{className:Gn.absoluteSliderContainer,children:m.jsx(si,{onChange:C,min:l,max:c,unit:u,value:S[e.code[0]]})})]})})};vo.propTypes={indicator:a.shape({name:a.string,type:a.string,code:a.arrayOf(a.string),values:a.arrayOf(a.shape({codename:a.oneOfType(a.array,a.string),title:a.string}))}),activeColor:a.string};const ii=({subcategory:e,fontColor:t,activeColor:n})=>{const{activeSubcategory:r}=Ue(i=>i),{name:o,indicators:s}=e||{};return m.jsx(Rt,{title:o,isOpen:r==`id${o}`,onClick:()=>{Ue.setState(i=>({activeSubcategory:i.activeSubcategory===`id${o}`?"":`id${o}`}))},titleFontStyles:{fontSize:16,fontWeight:400},showBottomBar:!1,titleMarginChildren:20,height:49,color:t,activeColor:n,children:s==null?void 0:s.map((i,l)=>m.jsx(vo,{indicator:i,fontColor:t},`indicatorSub-${l}`))})};ii.propTypes={subcategory:a.shape({name:a.string,indicators:a.arrayOf(a.shape({name:a.string,value:a.string}))}),activeColor:a.string};const ai=({category:e,activeColor:t})=>{const{name:n,subcategories:r,indicators:o}=e||{},{activeCategory:s,fontColor:i}=Ue(l=>l);return e&&m.jsx(Rt,{onClick:()=>{Ue.setState(l=>({activeCategory:s===`id${n}`?"":`id${n}`}))},title:n,isOpen:s===`id${n}`,titleFontStyles:{fontSize:18,fontWeight:"bold"},showBottomBar:!1,color:i,activeColor:t,children:r?r.map((l,c)=>m.jsx(ii,{subcategory:l,fontColor:i,activeColor:t},`subcategory-${c}`)):o&&o.map((l,c)=>m.jsx(vo,{indicator:l,fontColor:i,activeColor:t},`indicator-${c}`))})};ai.propTypes={category:a.shape({name:a.string.isRequired,subcategories:a.array,indicators:a.array}),activeColor:a.string};const li=({indicators:e,isOpen:t=!0,title:n,fontColor:r="#605B56",inputsColor:o="#605B56",activeColor:s})=>{const{tematicalFiltersSelected:i}=Ue(c=>c),{t:l}=Te.useTranslation();return b.useEffect(()=>{console.log("filtersSelected changed: ",i)},[i]),b.useEffect(()=>{r&&Ue.setState(()=>({fontColor:r}))},[r]),b.useEffect(()=>{o&&Ue.setState(()=>({inputsColor:o}))},[o]),m.jsx(Rt,{isOpen:t,title:n?l(n):"Tematical filters",color:r,activeColor:s,children:e==null?void 0:e.map((c,u)=>m.jsx(ai,{category:c,fontColor:r,activeColor:s},`category-${u}`))})};li.propTypes={isOpen:a.bool,title:a.string,indicators:a.arrayOf(a.object),fontColor:a.string,onChangeTematicalFilters:a.func,inputsColor:a.string,activeColor:a.string};const Ml="_FiltersAmbitContainer_6o4gt_2",Ll="_FiltersAmbitHeader_6o4gt_7",Al="_FiltersAmbitTitle_6o4gt_15",Nl="_FiltersAmbitDescription_6o4gt_22",Il="_FiltersAmbitDescriptionTitle_6o4gt_33",Sn={FiltersAmbitContainer:Ml,FiltersAmbitHeader:Ll,FiltersAmbitTitle:Al,FiltersAmbitDescription:Nl,FiltersAmbitDescriptionTitle:Il},ci=({ambitName:e,ambitDescription:t,defaultFilters:n,indicators:r,activeColor:o,textColor:s,backgroundColor:i,onChangeAppliedFilters:l})=>{const{t:c}=Te.useTranslation(),{tematicalFiltersSelected:u}=Ue(p=>p);return b.useEffect(()=>{n&&n.length>0&&Ue.setState(p=>({tematicalFiltersSelected:n}))},[n]),b.useEffect(()=>{console.log("filtersSelected changed: ",u),l(u)},[u]),m.jsxs("div",{className:Sn.FiltersAmbitContainer,children:[m.jsxs("div",{className:Sn.FiltersAmbitHeader,children:[m.jsx("div",{className:Sn.FiltersAmbitTitle,children:e}),m.jsxs("div",{className:Sn.FiltersAmbitDescription,children:[m.jsx("div",{className:Sn.FiltersAmbitDescriptionTitle,children:c("description")}),t]})]}),m.jsx(ni,{title:c("applied_filters"),isOpen:!0,textColor:s||"#fff",backgroundColor:i||"#605B5680",activeColor:o}),m.jsx(ri,{activeColor:o}),m.jsx(li,{indicators:r,inputsColor:o,textColor:s,title:"tematical_filters",activeColor:o})]})};ci.propTypes={indicators:a.arrayOf(a.object).isRequired,ambitName:a.string,ambitDescription:a.string,defaultFilters:a.arrayOf(a.object),activeColor:a.string,backgroundColor:a.string,textColor:a.string,onChangeAppliedFilters:a.func};const Dl="_barChartContainer_d2f1z_2",Fl={barChartContainer:Dl},ui=({data:e,width:t=700,barHeight:n=25,gap:r=23,fontColor:o="#605B56",verticalPaddign:s=10,horizontalPaddign:i=20,leftPadding:l=200,numberOfDivisions:c=7,maxValue:u=null})=>{const{t:p}=Te.useTranslation(),{xScale:d,ticks:h,height:v}=b.useMemo(()=>{if(e&&e.length>0){const x=(e==null?void 0:e.length)*(n+r)+s*2,f=Io.max(e,j=>j.value)||1,C=Io.scaleLinear().domain([0,u||f]).range([0,t-l]),S=Array.from({length:c+1},(j,w)=>u?u/c*w:f/c*w);return{xScale:C,ticks:S,height:x,width:t,verticalPaddign:s,horizontalPaddign:i}}else return{xScale:null,ticks:[],height:0}},[e,t,c,n,r,i,s,u]);return m.jsx("div",{className:Fl.barChartContainer,children:m.jsx("svg",{width:t+i*2,height:v,children:m.jsxs("g",{transform:`translate(0,${r})`,children:[m.jsx("g",{transform:`translate(${l+i}, 0)`,children:h.map((x,f)=>{const C=d(x);return m.jsxs("g",{transform:`translate(${C}, 0)`,children:[m.jsx("line",{y1:0,y2:v-r*2,stroke:"#ccc"}),m.jsx("text",{y:v-r,textAnchor:"middle",fontSize:10,fill:o,children:parseInt(x)})]},f)})}),e&&e.length>0&&(e==null?void 0:e.map((x,f)=>{const C=d(x.value),S=f*(n+r);return m.jsxs("g",{transform:`translate(${l+i}, ${S})`,children:[m.jsx("text",{x:-24,y:n/2+5,textAnchor:"end",fill:o,children:p(x.title)}),m.jsx("rect",{width:C,height:n,fill:x.color,rx:0})]},f)}))]})})})};ui.propTypes={data:a.arrayOf(a.shape({title:a.string,value:a.number,color:a.string})),width:a.number,barHeight:a.number,gap:a.number,verticalPaddign:a.number,horizontalPaddign:a.number,numberOfDivisions:a.number,fontColor:a.string};const zl="_graphicContainer_c9zrg_2",Bl="_titleContainer_c9zrg_14",Qo={graphicContainer:zl,titleContainer:Bl},fi=({data:e,graphWidth:t=700,containerStyle:n,borderColor:r="#605B56",title:o="Graphic Title",fontColor:s="#605B56",maxValue:i=null,numberOfDivisions:l=7,leftPadding:c=200})=>{const{t:u}=Te.useTranslation();return m.jsxs("div",{className:Qo.graphicContainer,style:{...n||{},border:`1.5px solid ${r}`},children:[m.jsx("div",{className:Qo.titleContainer,children:m.jsx("h2",{children:u(o)})}),m.jsx(ui,{data:e,width:t,fontColor:s,maxValue:i,numberOfDivisions:l,leftPadding:c})]})};fi.propTypes={data:a.arrayOf(a.shape({color:a.string.isRequired,value:a.number.isRequired,title:a.string.isRequired})),borderColor:a.string,title:a.string,graphWidth:a.number,containerStyle:a.object,fontColor:a.string,maxValue:a.number,numberOfDivisions:a.number,leftPadding:a.number};const Ul="_indicatorsCategory_1cu33_2",Vl="_title_1cu33_5",ql="_list_1cu33_11",Wr={indicatorsCategory:Ul,title:Vl,list:ql},Wl="_indicatorContainer_lw8gx_2",Hl="_indicatorNameContainer_lw8gx_11",Kl="_dot_lw8gx_20",Yl="_indicatorName_lw8gx_11",Zl="_switchExternalContainer_lw8gx_31",Gl="_switchType_lw8gx_40",Jl="_switchTypeOptions_lw8gx_44",Xl="_optionContainer_lw8gx_55",Ql="_customRadious_lw8gx_65",ec="_optionText_lw8gx_72",Fe={indicatorContainer:Wl,indicatorNameContainer:Hl,dot:Kl,indicatorName:Yl,switchExternalContainer:Zl,switchType:Gl,switchTypeOptions:Jl,optionContainer:Xl,customRadious:Ql,optionText:ec},bo=({indicator:e,values:t=[],activeColor:n,defaultColor:r="#92898A",activeIndicator:o,activeIndicatorType:s,onClickIndicator:i,multiple:l=!1,onChangeType:c})=>{const{t:u}=Te.useTranslation(),{name:p,type:d}=e,[h,v]=b.useState(!1);b.useEffect(()=>{o&&v(l?o.some(C=>C.name==String(p)):o.name==p)},[o]);const x=()=>m.jsx("div",{className:Fe.switchExternalContainer,children:m.jsx("div",{className:Fe.switchType,children:m.jsxs("div",{className:Fe.switchTypeOptions,children:[m.jsxs("div",{className:Fe.optionContainer,onClick:()=>c("cat"),children:[m.jsx("span",{className:`${Fe.customRadious}`,style:{backgroundColor:s==="cat"?n:"transparent",borderColor:s==="cat"?n:r}}),m.jsx("h4",{className:Fe.optionText,style:{color:s==="cat"?n:r},children:u("indicators.cat")})]}),m.jsxs("div",{className:Fe.optionContainer,onClick:()=>c("abs"),children:[m.jsx("span",{className:`${Fe.customRadious}`,style:{backgroundColor:s==="abs"?n:"transparent",borderColor:s==="abs"?n:r}}),m.jsx("h4",{className:Fe.optionText,style:{color:s==="abs"?n:r},children:u("indicators.abs")})]})]})})}),f=()=>m.jsx("div",{className:Fe.switchExternalContainer,children:m.jsx("div",{className:Fe.switchType,children:m.jsx("div",{className:Fe.switchTypeOptions,children:t.map((C,S)=>m.jsxs("div",{className:Fe.optionContainer,children:[m.jsx("span",{className:Fe.customRadious}),m.jsx("h4",{children:u(C.unit)})]},S))})})});return m.jsxs("div",{className:Fe.indicatorContainer,children:[m.jsxs("div",{className:Fe.indicatorNameContainer,onClick:()=>i({indicator:e}),children:[m.jsx("div",{style:{border:h?`1px solid ${n}`:`1px solid ${r}`},className:Fe.dot}),m.jsx("h4",{className:Fe.indicatorName,style:{color:h?n:r},children:m.jsx(Te.Trans,{i18nKey:p,components:{sup:m.jsx("sup",{})}})})]}),(o==null?void 0:o.name)===p&&d==="both"&&m.jsx("div",{children:x()}),(o==null?void 0:o.name)===p&&d==="twoUnits"&&m.jsx("div",{children:f()})]})};bo.propTypes={indicator:a.shape({name:a.string,type:a.string}),values:a.oneOfType([a.bool,a.array]),activeColor:a.string,defaultColor:a.string,activeIndicator:a.oneOfType([a.object,a.array]),multiple:a.bool,onClickIndicator:a.func};const tc="_indicatorsSubCategory_1dzsi_2",nc="_list_1dzsi_8",es={indicatorsSubCategory:tc,list:nc},di=({subcName:e,indicators:t,defaultColor:n,activeColor:r,activeSubCategory:o,onClickSubCategory:s,id:i,activeIndicator:l,onClickIndicator:c,multiple:u,activeIndicatorType:p,onChangeType:d})=>{const{t:h}=Te.useTranslation(),[v,x]=b.useState(!1);return b.useEffect(()=>{x(o==i)},[o,i]),m.jsxs(mo.motion.div,{className:es.indicatorsSubCategory,initial:{height:"43px"},animate:{height:v?"auto":"43px"},transition:{duration:.4},children:[m.jsx("button",{onClick:()=>s(i),children:m.jsxs("h3",{style:{color:v?r:n},children:[m.jsx("span",{style:{color:v?r:n},children:v?"-":"+"}),m.jsx("span",{style:{marginLeft:12,color:v?r:n},children:h(e)})]})}),t&&m.jsx("div",{className:es.list,children:t==null?void 0:t.map((f,C)=>m.jsx(bo,{indicator:f,defaultColor:n,activeColor:r,activeIndicator:l,onClickIndicator:c,multiple:u,activeIndicatorType:p,onChangeType:d},"indicator"+C))})]})};di.propTypes={subcName:a.string,indicators:a.array,activeColor:a.string,defaultColor:a.string,activeSubCategory:a.string,id:a.string,activeIndicator:a.oneOfType([a.object,a.array]),multiple:a.bool,onClickSubCategory:a.func,onClickIndicator:a.func};const pi=({cat:e,id:t,activeColor:n,defaultColor:r,onClickCategory:o,activeCategory:s,activeSubCategory:i,onClickSubCategory:l,activeIndicator:c,onClickIndicator:u,multiple:p,activeIndicatorType:d,onChangeType:h})=>{var C;const{t:v}=Te.useTranslation(),[x,f]=b.useState(!1);return b.useEffect(()=>{f(s===t)},[s,t]),m.jsxs(mo.motion.div,{className:Wr.indicatorsCategory,initial:{height:"53px"},animate:{height:x?"auto":"53px"},transition:{duration:.4},style:{backgroundColor:"white",borderBottom:x?`1px solid ${n}`:"0px",marginBottom:x?"20px":"0px"},children:[m.jsxs("h2",{className:`${Wr.title}`,onClick:()=>o(t),children:[m.jsx("span",{style:{color:x?n:r},children:x?"-":"+"}),m.jsx("span",{style:{marginLeft:12,color:x?n:r},children:v(e.name)})]}),e.subcategories?e.subcategories.map(({name:S,subcategory:j,indicators:w},R)=>m.jsx(di,{id:j,activeSubCategory:i,subcName:S,onClickSubCategory:l,activeIndicator:c,onClickIndicator:u,multiple:p,activeColor:n,defaultColor:r,indicators:w,activeIndicatorType:d,onChangeType:h},`subcKey ${R}`)):m.jsx("div",{className:Wr.list,children:(C=e.indicators)==null?void 0:C.map((S,j)=>m.jsx(bo,{indicator:S,values:S.type=="twoUnits"&&S.values,activeColor:n,defaultColor:r,activeIndicator:c,onClickIndicator:u,multiple:p,activeIndicatorType:d,onChangeType:h},`indicator${j}`))})]})};pi.propTypes={cat:a.object,id:a.string,onChange:a.func,onClickCategory:a.func,activeCategory:a.string,activeSubCategory:a.string,onClickSubCategory:a.func,onClickIndicator:a.func,activeIndicator:a.oneOfType([a.object,a.array]),multiple:a.bool,activeColor:a.string,defaultColor:a.string};const rc="_indicatorsList_fklyu_2",oc="_title_fklyu_6",ts={indicatorsList:rc,title:oc},hi=({indicators:e,activeColor:t,defaultColor:n="#92898A",onChange:r,multiple:o=!1,defaultValue:s=null,changeIndType:i,activeIndicatorType:l})=>{const{t:c}=Te.useTranslation(),[u,p]=b.useState(),[d,h]=b.useState(),[v,x]=b.useState(),f=R=>{p(u==R?null:R)},C=R=>{h(d==R?null:R)},S=({indicator:R})=>{console.log("onClickIndicator: ",R),j(R)},j=R=>{if(!o)x((v==null?void 0:v.name)==R.name?null:R);else{let _=v&&v.length>0?[...v]:[];x(_!=null&&_.some(F=>F.name==R.name)?_.filter(F=>F.name!=String(R.name)):[..._,R]),R.type=="both"&&i("cat")}};b.useEffect(()=>{console.log("activeindicator changed to: ",v),r&&typeof r=="function"&&v&&r({activeIndicator:v})},[v]),b.useLayoutEffect(()=>{if(s&&!v)if(o&&s&&Array.isArray(s)){let R=v&&v.length>0?[...v]:[];x([...R,...s]),w(s[0].name)}else j(s),w(s.name)},[]);const w=R=>{const _=e.find(F=>{if(F.subcategories){let y=F.subcategories.find(E=>E.indicators.find(T=>T.name==R));if(y)return h(y.subcategory),y}else return F.indicators.some(y=>y.name==R)});_&&p(_.category)};return m.jsxs("div",{className:ts.indicatorsList,children:[m.jsx("h2",{className:ts.title,style:{color:n},children:c("indicators.indicators")}),e.map((R,_)=>m.jsx(pi,{id:R.category,cat:R,onClickCategory:f,activeCategory:u,onClickSubCategory:C,activeSubCategory:d,onClickIndicator:S,activeIndicator:v,activeColor:t,defaultColor:n,multiple:o,onChange:r,onChangeType:i,activeIndicatorType:l},`categoryKey${_}`))]})};hi.propTypes={indicators:a.arrayOf(a.object),activeColor:a.string,defaultColor:a.string,onChange:a.func,changeIndType:a.func,multiple:a.bool,activeIndicator:a.oneOfType([a.object,a.array]),defaultValue:a.oneOfType([a.object,a.array]),activeIndicatorType:a.string};const sc="_langSelector_1of0g_2",ic="_currentLang_1of0g_7",ac="_arrow_1of0g_19",lc="_prevImg_1of0g_22",cc="_langMenu_1of0g_26",Zt={langSelector:sc,currentLang:ic,arrow:ac,prevImg:lc,langMenu:cc},mi=({langs:e,arrow:t,imgPrev:n})=>{const[r,o]=b.useState(!1),{i18n:s}=Te.useTranslation(),i=e.find(c=>c.code==s.language),l=c=>{s.changeLanguage(c),o(!1)};return m.jsxs("div",{className:Zt.langSelector,children:[m.jsxs("div",{className:Zt.currentLang,onClick:()=>{o(!r)},children:[n&&m.jsx("img",{className:Zt.prevImg,src:n}),i.titleSelected||i.title,m.jsx("img",{src:t,className:Zt.arrow})]}),r&&m.jsx("div",{className:Zt.langMenu,children:e.map(c=>m.jsx("button",{className:i.code==c.code?Zt.active:"",onClick:()=>l(c.code),children:c.title},c.code))})]})};mi.propTypes={langs:a.arrayOf(a.shape({code:a.string,title:a.string,titleSelected:a.string})),color:a.string,bckColor:a.string,hoverColor:a.string,arrow:a.object,imgPrev:a.object};const uc="_legendContainer_atg3j_3",fc="_closeButton_atg3j_18",dc="_titleContainer_atg3j_46",pc="_infoContainer_atg3j_52",hc="_titleLegendList_atg3j_63",mc="_legendListContainer_atg3j_70",gc="_gridContainer_atg3j_70",yc="_elementLegendContainer_atg3j_76",vc="_colorDot_atg3j_82",bc="_absoluteValueContainer_atg3j_88",xc="_absoluteValueColor_atg3j_91",_c="_absoluteValueText_atg3j_96",Cc="_moreInfoContainer_atg3j_108",We={legendContainer:uc,closeButton:fc,titleContainer:dc,infoContainer:pc,titleLegendList:hc,legendListContainer:mc,gridContainer:gc,elementLegendContainer:yc,colorDot:vc,absoluteValueContainer:bc,absoluteValueColor:xc,absoluteValueText:_c,moreInfoContainer:Cc},gi=({containerStyles:e,title:t,infoList:n,legendList:r,legendListTitle:o,absoluteValue:s,onClickMoreInfo:i,buttonTitle:l,onClickClose:c})=>{const{t:u}=Te.useTranslation();return m.jsxs("div",{style:e?{...e}:{},className:`${We.legendContainer}`,children:[m.jsx("button",{className:We.closeButton,onClick:c}),t&&m.jsx("div",{className:We.titleContainer,children:m.jsx("h2",{children:t})}),n&&n.length>0&&m.jsx("div",{className:We.infoContainer,children:m.jsx("ul",{children:n.map(({title:p,value:d})=>m.jsxs("li",{children:[m.jsx("h3",{className:We.title,children:`${p}:`}),m.jsxs("span",{className:We.value,children:["  ",d]})]},t))})}),m.jsx("h3",{className:We.titleLegendList,children:o?m.jsx(Te.Trans,{i18nKey:o,components:{sup:m.jsx("sup",{})}}):u("mainUse")}),m.jsx("div",{className:We.legendListContainer,children:s?m.jsxs("div",{className:We.absoluteValueContainer,children:[m.jsx("div",{className:We.absoluteValueColor,style:{background:`linear-gradient(to bottom, ${s.maxColor} 0%, ${s.minColor} 100%)`}}),m.jsxs("div",{className:We.absoluteValueText,children:[m.jsxs("span",{children:[s.maxValue," ",u(s.unit)]}),m.jsxs("span",{children:[s.minValue," ",u(s.unit)]})]})]}):r&&r.length>0&&m.jsx("div",{className:We.gridContainer,children:r.map(({title:p,color:d})=>m.jsxs("div",{className:We.elementLegendContainer,children:[m.jsx("div",{className:We.colorDot,style:{backgroundColor:d}}),m.jsxs("div",{className:We.titleLegendElement,children:[u(p)," "]})]},t))})}),i&&m.jsx("button",{className:We.moreInfoContainer,onClick:i,children:l||u("moreInformation")})]})};gi.propTypes={title:a.string,containerStyles:a.object,infoList:a.arrayOf(a.shape({title:a.string.isRequired,value:a.oneOfType([a.string,a.number])})),legendList:a.arrayOf(a.shape({title:a.string,color:a.string})),legendListTitle:a.string,absoluteValue:a.shape({maxColor:a.string,minColor:a.string,maxValue:a.number,minValue:a.number}),onClickMoreInfo:a.func,buttonTitle:a.string,onClickClose:a.func};const Sc="_logo_1ewa6_2",ns={logo:Sc},yi=({src:e,alt:t,href:n})=>{const{t:r}=Te.useTranslation(),o=m.jsx("img",{src:e,alt:r(t)});return n?m.jsx("div",{className:ns.logo,children:m.jsx("a",{href:n,children:o})}):m.jsx("div",{className:ns.logo,children:o})};yi.propTypes={src:a.string.isRequired,alt:a.string.isRequired,href:a.string,className:a.string};const Tc=X.createContext(null);function wc(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,s=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&r===s}function Qe(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Qe(e[n],t[n]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!t.hasOwnProperty(o)||!Qe(e[o],t[o]))return!1;return!0}return!1}function Ec(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function rs(e,t){if(!e.getProjection)return;const n=e.getProjection(),r=t.getProjection();Qe(n,r)||t.setProjection(n)}function os(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function ss(e,t){const n=t.viewState||t;let r=!1;if("zoom"in n){const o=e.zoom;e.zoom=n.zoom,r=r||o!==e.zoom}if("bearing"in n){const o=e.bearing;e.bearing=n.bearing,r=r||o!==e.bearing}if("pitch"in n){const o=e.pitch;e.pitch=n.pitch,r=r||o!==e.pitch}if(n.padding&&!e.isPaddingEqual(n.padding)&&(r=!0,e.padding=n.padding),"longitude"in n&&"latitude"in n){const o=e.center;e.center=new o.constructor(n.longitude,n.latitude),r=r||o!==e.center}return r}const kc=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function is(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const r of e.layers)t[r.id]=r;const n=e.layers.map(r=>{let o=null;"interactive"in r&&(o=Object.assign({},r),delete o.interactive);const s=t[r.ref];if(s){o=o||Object.assign({},r),delete o.ref;for(const i of kc)i in s&&(o[i]=s[i])}return o||r});return{...e,layers:n}}const as={version:8,sources:{},layers:[]},ls={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Hr={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},cs={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Rc=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Oc=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class ln{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=o=>{const s=this.props[cs[o.type]];s?s(o):o.type==="error"&&console.error(o.error)},this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const s=this.props[ls[o.type]];s&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),s(o),delete o.features)},this._onCameraEvent=o=>{if(!this._internalUpdate){const s=this.props[Hr[o.type]];s&&s(o)}o.type in this._deferredEvents&&(this._deferredEvents[o.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const o=this._updateSize(t),s=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||o||s&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=ln.savedMaps.pop();if(!r)return null;const o=r.map,s=o.getContainer();for(n.className=s.className;s.childNodes.length>0;)n.appendChild(s.childNodes[0]);o._container=n,r.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:i}=t;return i&&(i.bounds?o.fitBounds(i.bounds,{...i.fitBoundsOptions,duration:0}):r._updateViewState(i,!1)),o.isStyleLoaded()?o.fire("load"):o.once("styledata",()=>o.fire("load")),o._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=as}=n,o={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||jc()||null,container:t,style:is(r)},s=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),n.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,n.gl)}const i=new this._MapClass(o);s.padding&&i.setPadding(s.padding),n.cursor&&(i.getCanvas().style.cursor=n.cursor),this._createShadowTransform(i);const l=i._render;i._render=p=>{this._inRender=!0,l.call(i,p),this._inRender=!1};const c=i._renderTaskQueue.run;i._renderTaskQueue.run=p=>{c.call(i._renderTaskQueue,p),this._onBeforeRepaint()},i.on("render",()=>this._onAfterRepaint());const u=i.fire;i.fire=this._fireEvent.bind(this,u),i.on("resize",()=>{this._renderTransform.resize(i.transform.width,i.transform.height)}),i.on("styledata",()=>{this._updateStyleComponents(this.props,{}),rs(i.transform,this._renderTransform)}),i.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in ls)i.on(p,this._onPointerEvent);for(const p in Hr)i.on(p,this._onCameraEvent);for(const p in cs)i.on(p,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),ln.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=Ec(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,o=this._renderTransform,{zoom:s,pitch:i,bearing:l}=o,c=r.isMoving();c&&(o.cameraElevationReference="sea");const u=ss(o,{...os(r.transform),...t});if(c&&(o.cameraElevationReference="ground"),u&&n){const p=this._deferredEvents;p.move=!0,p.zoom||(p.zoom=s!==o.zoom),p.rotate||(p.rotate=l!==o.bearing),p.pitch||(p.pitch=i!==o.pitch)}return c||ss(r.transform,t),u}_updateSettings(t,n){const r=this._map;let o=!1;for(const s of Rc)if(s in t&&!Qe(t[s],n[s])){o=!0;const i=r[`set${s[0].toUpperCase()}${s.slice(1)}`];i==null||i.call(r,t[s])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=as,styleDiffing:o=!0}=t,s={diff:o};return"localIdeographFontFamily"in t&&(s.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(is(r),s),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let o=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Qe(t.light,n.light)&&(o=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Qe(t.fog,n.fog)&&(o=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Qe(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(o=!0,r.setTerrain(t.terrain))),o}_updateHandlers(t,n){const r=this._map;let o=!1;for(const s of Oc){const i=t[s]??!0,l=n[s]??!0;Qe(i,l)||(o=!0,i?r[s].enable(i):r[s].disable())}return o}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:o=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:o.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=t.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,l=this._queryRenderedFeatures(t.point),c=l.length>0;!c&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,c&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}_fireEvent(t,n,r){const o=this._map,s=o.transform,i=typeof n=="string"?n:n.type;return i==="move"&&this._updateViewState(this.props,!1),i in Hr&&(typeof n=="object"&&(n.viewState=os(s)),this._map.isMoving())?(o.transform=this._renderTransform,t.call(o,n,r),o.transform=s,o):(t.call(o,n,r),o)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{rs(this._renderTransform,n),t.transform=n}}}ln.savedMaps=[];function jc(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||process.env.MapboxAccessToken}catch{}try{e=e||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const $c=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Pc(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const o=t.transform;t.transform=e.transform;const s=t.project(r);return t.transform=o,s},unproject:r=>{const o=t.transform;t.transform=e.transform;const s=t.unproject(r);return t.transform=o,s},queryTerrainElevation:(r,o)=>{const s=t.transform;t.transform=e.transform;const i=t.queryTerrainElevation(r,o);return t.transform=s,i},queryRenderedFeatures:(r,o)=>{const s=t.transform;t.transform=e.transform;const i=t.queryRenderedFeatures(r,o);return t.transform=s,i}};for(const r of Mc(t))!(r in n)&&!$c.includes(r)&&(n[r]=t[r].bind(t));return n}function Mc(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Lc=typeof document<"u"?b.useLayoutEffect:b.useEffect,Ac=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Nc(e,t){for(const r of Ac)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const fn=X.createContext(null);function Ic(e,t){const n=b.useContext(Tc),[r,o]=b.useState(null),s=b.useRef(),{current:i}=b.useRef({mapLib:null,map:null});b.useEffect(()=>{const u=e.mapLib;let p=!0,d;return Promise.resolve(u||import("mapbox-gl")).then(h=>{if(!p)return;if(!h)throw new Error("Invalid mapLib");const v="Map"in h?h:h.default;if(!v.Map)throw new Error("Invalid mapLib");Nc(v,e),e.reuseMaps&&(d=ln.reuse(e,s.current)),d||(d=new ln(v.Map,e,s.current)),i.map=Pc(d),i.mapLib=v,o(d),n==null||n.onMapMount(i.map,e.id)}).catch(h=>{const{onError:v}=e;v?v({type:"error",target:null,error:h}):console.error(h)}),()=>{p=!1,d&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Lc(()=>{r&&r.setProps(e)}),b.useImperativeHandle(t,()=>i.map,[r]);const l=b.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return X.createElement("div",{id:e.id,ref:s,style:l},r&&X.createElement(fn.Provider,{value:i},X.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Dc=X.forwardRef(Ic),Fc=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function It(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const o=t[r];Number.isFinite(o)&&!Fc.test(r)?n[r]=`${o}px`:n[r]=o}}function vi(e,t){if(e===t)return null;const n=us(e),r=us(t),o=[];for(const s of r)n.has(s)||o.push(s);for(const s of n)r.has(s)||o.push(s);return o.length===0?null:o}function us(e){return new Set(e?e.trim().split(/\s+/):[])}b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(fn),o=b.useRef({props:e}),s=b.useMemo(()=>{let S=!1;X.Children.forEach(e.children,R=>{R&&(S=!0)});const j={...e,element:S?document.createElement("div"):null},w=new r.Marker(j);return w.setLngLat([e.longitude,e.latitude]),w.getElement().addEventListener("click",R=>{var _,F;(F=(_=o.current.props).onClick)==null||F.call(_,{type:"click",target:w,originalEvent:R})}),w.on("dragstart",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragStart)==null||y.call(F,_)}),w.on("drag",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDrag)==null||y.call(F,_)}),w.on("dragend",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragEnd)==null||y.call(F,_)}),w},[]);b.useEffect(()=>(s.addTo(n.getMap()),()=>{s.remove()}),[]);const{longitude:i,latitude:l,offset:c,style:u,draggable:p=!1,popup:d=null,rotation:h=0,rotationAlignment:v="auto",pitchAlignment:x="auto"}=e;b.useEffect(()=>{It(s.getElement(),u)},[u]),b.useImperativeHandle(t,()=>s,[]);const f=o.current.props;(s.getLngLat().lng!==i||s.getLngLat().lat!==l)&&s.setLngLat([i,l]),c&&!wc(s.getOffset(),c)&&s.setOffset(c),s.isDraggable()!==p&&s.setDraggable(p),s.getRotation()!==h&&s.setRotation(h),s.getRotationAlignment()!==v&&s.setRotationAlignment(v),s.getPitchAlignment()!==x&&s.setPitchAlignment(x),s.getPopup()!==d&&s.setPopup(d);const C=vi(f.className,e.className);if(C)for(const S of C)s.toggleClassName(S);return o.current.props=e,mr.createPortal(e.children,s.getElement())}));const zc=b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(fn),o=b.useMemo(()=>document.createElement("div"),[]),s=b.useRef({props:e}),i=b.useMemo(()=>{const l={...e},c=new r.Popup(l);return c.setLngLat([e.longitude,e.latitude]),c.once("open",u=>{var p,d;(d=(p=s.current.props).onOpen)==null||d.call(p,u)}),c},[]);if(b.useEffect(()=>{const l=c=>{var u,p;(p=(u=s.current.props).onClose)==null||p.call(u,c)};return i.on("close",l),i.setDOMContent(o).addTo(n.getMap()),()=>{i.off("close",l),i.isOpen()&&i.remove()}},[]),b.useEffect(()=>{It(i.getElement(),e.style)},[e.style]),b.useImperativeHandle(t,()=>i,[]),i.isOpen()){const l=s.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Qe(l.offset,e.offset)&&(i.options.anchor=e.anchor,i.setOffset(e.offset)),(l.anchor!==e.anchor||l.maxWidth!==e.maxWidth)&&i.setMaxWidth(e.maxWidth);const c=vi(l.className,e.className);if(c)for(const u of c)i.toggleClassName(u);s.current.props=e}return mr.createPortal(e.children,o)}));function Nn(e,t,n,r){const o=b.useContext(fn),s=b.useMemo(()=>e(o),[]);return b.useEffect(()=>{const i=t,l=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(s)||c.addControl(s,i==null?void 0:i.position),()=>{l&&l(o),c.hasControl(s)&&c.removeControl(s)}},[]),s}function Bc(e){const t=Nn(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return b.useEffect(()=>{It(t._container,e.style)},[e.style]),null}b.memo(Bc);function Uc(e){const t=Nn(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return b.useEffect(()=>{It(t._controlContainer,e.style)},[e.style]),null}b.memo(Uc);function Vc(e,t){const n=b.useRef({props:e}),r=Nn(({mapLib:o})=>{const s=new o.GeolocateControl(e),i=s._setupUI.bind(s);return s._setupUI=l=>{s._container.hasChildNodes()||i(l)},s.on("geolocate",l=>{var c,u;(u=(c=n.current.props).onGeolocate)==null||u.call(c,l)}),s.on("error",l=>{var c,u;(u=(c=n.current.props).onError)==null||u.call(c,l)}),s.on("outofmaxbounds",l=>{var c,u;(u=(c=n.current.props).onOutOfMaxBounds)==null||u.call(c,l)}),s.on("trackuserlocationstart",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationStart)==null||u.call(c,l)}),s.on("trackuserlocationend",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationEnd)==null||u.call(c,l)}),s},{position:e.position});return n.current.props=e,b.useImperativeHandle(t,()=>r,[]),b.useEffect(()=>{It(r._container,e.style)},[e.style]),null}b.memo(b.forwardRef(Vc));function qc(e){const t=Nn(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return b.useEffect(()=>{It(t._container,e.style)},[e.style]),null}const Wc=b.memo(qc);function Hc(e){const t=Nn(({mapLib:s})=>new s.ScaleControl(e),{position:e.position}),n=b.useRef(e),r=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),b.useEffect(()=>{It(t._container,o)},[o]),null}b.memo(Hc);function ur(e,t){if(!e)throw new Error(t)}let Kc=0;function Yc(e,t,n){if(e.style&&e.style._loaded){const r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function Zc(e,t,n){ur(t.id===n.id,"source id changed"),ur(t.type===n.type,"source type changed");let r="",o=0;for(const i in t)i!=="children"&&i!=="id"&&!Qe(n[i],t[i])&&(r=i,o++);if(!o)return;const s=t.type;s==="geojson"?e.setData(t.data):s==="image"?e.updateImage({url:t.url,coordinates:t.coordinates}):"setCoordinates"in e&&o===1&&r==="coordinates"?e.setCoordinates(t.coordinates):"setUrl"in e&&r==="url"?e.setUrl(t.url):"setTiles"in e&&r==="tiles"?e.setTiles(t.tiles):console.warn(`Unable to update <Source> prop: ${r}`)}function Gc(e){const t=b.useContext(fn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-source-${Kc++}`,[]);b.useEffect(()=>{if(t){const i=()=>setTimeout(()=>r(l=>l+1),0);return t.on("styledata",i),i(),()=>{var l;if(t.off("styledata",i),t.style&&t.style._loaded&&t.getSource(o)){const c=(l=t.getStyle())==null?void 0:l.layers;if(c)for(const u of c)u.source===o&&t.removeLayer(u.id);t.removeSource(o)}}}},[t]);let s=t&&t.style&&t.getSource(o);return s?Zc(s,e,n.current):s=Yc(t,o,e),n.current=e,s&&X.Children.map(e.children,i=>i&&b.cloneElement(i,{source:o}))||null}function Jc(e,t,n,r){if(ur(n.id===r.id,"layer id changed"),ur(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:o={},paint:s={},filter:i,minzoom:l,maxzoom:c,beforeId:u}=n;if(u!==r.beforeId&&e.moveLayer(t,u),o!==r.layout){const p=r.layout||{};for(const d in o)Qe(o[d],p[d])||e.setLayoutProperty(t,d,o[d]);for(const d in p)o.hasOwnProperty(d)||e.setLayoutProperty(t,d,void 0)}if(s!==r.paint){const p=r.paint||{};for(const d in s)Qe(s[d],p[d])||e.setPaintProperty(t,d,s[d]);for(const d in p)s.hasOwnProperty(d)||e.setPaintProperty(t,d,void 0)}Qe(i,r.filter)||e.setFilter(t,i),(l!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(t,l,c)}function Xc(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}let Qc=0;function eu(e){const t=b.useContext(fn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-layer-${Qc++}`,[]);if(b.useEffect(()=>{if(t){const i=()=>r(l=>l+1);return t.on("styledata",i),i(),()=>{t.off("styledata",i),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{Jc(t,o,e,n.current)}catch(i){console.warn(i)}else Xc(t,o,e);return n.current=e,null}const tu="_mapContainer_84pkf_2",nu={mapContainer:tu};Ea.accessToken="pk.eyJ1IjoiY2ljbGljYSIsImEiOiJja3llODhxZ2UwYzF1Mm5xcHVhMzI3anhqIn0.-r56FLAzEH57eVsB2ZeVcA";const bi=({initialView:e={latitude:39.4699,longitude:-.3763,zoom:12},maxZoom:t=17,minZoom:n=8,mapStyle:r,firstSymbolLayer:o,cssProps:s="",onClick:i="",interactiveLayers:l=[],popUp:c=!1,sources:u=[],layers:p=[]})=>{const d=b.useRef(),[h,v]=b.useState(null),x=kn.useSelector(f=>f.mapState.showTexts);return b.useEffect(()=>{if(d.current){const f=d.current.getMap();f.getStyle().layers.map(S=>{S.type=="symbol"&&S.id!="professionals"&&(x?f.setLayoutProperty(S.id,"visibility","visible"):f.setLayoutProperty(S.id,"visibility","none"))})}},[x]),m.jsx("div",{className:`${nu.mapContainer}`,style:s,children:m.jsxs(Dc,{initialViewState:e,ref:d,hash:!1,maxZoom:t,minZoom:n,mapStyle:r,onClick:i,interactiveLayerIds:l,children:[u.length&&u.map((f,C)=>m.jsx(Gc,{...f,children:p.length&&p.map((S,j)=>{if(S.sourceId==f.id)return m.jsx(eu,{...S.layer,beforeId:o},j)})},C)),m.jsx(Wc,{position:"bottom-right",visualizePitch:!0}),c&&h&&m.jsx(zc,{longitude:c.longitude,latitude:c.latitude,anchor:c.anchor,onClose:()=>v(null),children:c.content})]})})};bi.propTypes={initialView:a.shape({latitude:a.number.isRequired,longitude:a.number.isRequired,zoom:a.number.isRequired}),mapStyle:a.object,firstSymbolLayer:a.string,cssProps:a.object,style:a.object,maxZoom:a.number,minZoom:a.number,onClick:a.func,interactiveLayers:a.array,popUp:a.shape({latitude:a.number,longitude:a.number,anchor:a.string,content:a.element}),textsUrl:a.string,sources:a.arrayOf(a.shape({id:a.string,type:a.string,url:a.string,data:a.object})),layers:a.arrayOf(a.shape({sourceId:a.string,layer:a.shape({id:a.string,type:a.string,sourceLayer:a.string,minZoom:a.number,maxZoom:a.number,paint:a.object})}))};var et=Uint8Array,rn=Uint16Array,ru=Int32Array,xi=new et([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_i=new et([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ou=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ci=function(e,t){for(var n=new rn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var o=new ru(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)o[s]=s-n[r]<<5|r;return{b:n,r:o}},Si=Ci(xi,2),Ti=Si.b,su=Si.r;Ti[28]=258,su[258]=28;var iu=Ci(_i,0),au=iu.b,io=new rn(32768);for(var Ee=0;Ee<32768;++Ee){var St=(Ee&43690)>>1|(Ee&21845)<<1;St=(St&52428)>>2|(St&13107)<<2,St=(St&61680)>>4|(St&3855)<<4,io[Ee]=((St&65280)>>8|(St&255)<<8)>>1}var Rn=function(e,t,n){for(var r=e.length,o=0,s=new rn(t);o<r;++o)e[o]&&++s[e[o]-1];var i=new rn(t);for(o=1;o<t;++o)i[o]=i[o-1]+s[o-1]<<1;var l;if(n){l=new rn(1<<t);var c=15-t;for(o=0;o<r;++o)if(e[o])for(var u=o<<4|e[o],p=t-e[o],d=i[e[o]-1]++<<p,h=d|(1<<p)-1;d<=h;++d)l[io[d]>>c]=u}else for(l=new rn(r),o=0;o<r;++o)e[o]&&(l[o]=io[i[e[o]-1]++]>>15-e[o]);return l},In=new et(288);for(var Ee=0;Ee<144;++Ee)In[Ee]=8;for(var Ee=144;Ee<256;++Ee)In[Ee]=9;for(var Ee=256;Ee<280;++Ee)In[Ee]=7;for(var Ee=280;Ee<288;++Ee)In[Ee]=8;var wi=new et(32);for(var Ee=0;Ee<32;++Ee)wi[Ee]=5;var lu=Rn(In,9,1),cu=Rn(wi,5,1),Kr=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},ct=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Yr=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},uu=function(e){return(e+7)/8|0},fu=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new et(e.subarray(t,n))},du=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xe=function(e,t,n){var r=new Error(t||du[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Xe),!n)throw r;return r},xo=function(e,t,n,r){var o=e.length,s=0;if(!o||t.f&&!t.l)return n||new et(0);var i=!n,l=i||t.i!=2,c=t.i;i&&(n=new et(o*3));var u=function(be){var P=n.length;if(be>P){var xe=new et(Math.max(P*2,be));xe.set(n),n=xe}},p=t.f||0,d=t.p||0,h=t.b||0,v=t.l,x=t.d,f=t.m,C=t.n,S=o*8;do{if(!v){p=ct(e,d,1);var j=ct(e,d+1,3);if(d+=3,j)if(j==1)v=lu,x=cu,f=9,C=5;else if(j==2){var F=ct(e,d,31)+257,y=ct(e,d+10,15)+4,E=F+ct(e,d+5,31)+1;d+=14;for(var T=new et(E),$=new et(19),I=0;I<y;++I)$[ou[I]]=ct(e,d+I*3,7);d+=y*3;for(var Q=Kr($),U=(1<<Q)-1,Z=Rn($,Q,1),I=0;I<E;){var q=Z[ct(e,d,U)];d+=q&15;var w=q>>4;if(w<16)T[I++]=w;else{var ie=0,oe=0;for(w==16?(oe=3+ct(e,d,3),d+=2,ie=T[I-1]):w==17?(oe=3+ct(e,d,7),d+=3):w==18&&(oe=11+ct(e,d,127),d+=7);oe--;)T[I++]=ie}}var ke=T.subarray(0,F),$e=T.subarray(F);f=Kr(ke),C=Kr($e),v=Rn(ke,f,1),x=Rn($e,C,1)}else Xe(1);else{var w=uu(d)+4,R=e[w-4]|e[w-3]<<8,_=w+R;if(_>o){c&&Xe(0);break}l&&u(h+R),n.set(e.subarray(w,_),h),t.b=h+=R,t.p=d=_*8,t.f=p;continue}if(d>S){c&&Xe(0);break}}l&&u(h+131072);for(var O=(1<<f)-1,A=(1<<C)-1,ee=d;;ee=d){var ie=v[Yr(e,d)&O],W=ie>>4;if(d+=ie&15,d>S){c&&Xe(0);break}if(ie||Xe(2),W<256)n[h++]=W;else if(W==256){ee=d,v=null;break}else{var z=W-254;if(W>264){var I=W-257,te=xi[I];z=ct(e,d,(1<<te)-1)+Ti[I],d+=te}var Y=x[Yr(e,d)&A],K=Y>>4;Y||Xe(3),d+=Y&15;var $e=au[K];if(K>3){var te=_i[K];$e+=Yr(e,d)&(1<<te)-1,d+=te}if(d>S){c&&Xe(0);break}l&&u(h+131072);var V=h+z;if(h<$e){var G=s-$e,re=Math.min($e,V);for(G+h<0&&Xe(3);h<re;++h)n[h]=r[G+h]}for(;h<V;++h)n[h]=n[h-$e]}}t.l=v,t.p=ee,t.b=h,t.f=p,v&&(p=1,t.m=f,t.d=x,t.n=C)}while(!p);return h!=n.length&&i?fu(n,0,h):n.subarray(0,h)},pu=new et(0),hu=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&Xe(6,"invalid gzip data");var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},mu=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},gu=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Xe(6,"invalid zlib data"),(e[1]>>5&1)==1&&Xe(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function yu(e,t){return xo(e,{i:2},t,t)}function vu(e,t){var n=hu(e);return n+8>e.length&&Xe(6,"invalid gzip data"),xo(e.subarray(n,-8),{i:2},new et(mu(e)),t)}function bu(e,t){return xo(e.subarray(gu(e),-4),{i:2},t,t)}function xu(e,t){return e[0]==31&&e[1]==139&&e[2]==8?vu(e,t):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?yu(e,t):bu(e,t)}var _u=typeof TextDecoder<"u"&&new TextDecoder,Cu=0;try{_u.decode(pu,{stream:!0}),Cu=1}catch{}var Su=Object.defineProperty,On=Math.pow,Se=(e,t)=>Su(e,"name",{value:t,configurable:!0}),ze=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(u){o(u)}},i=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,i);l((n=n.apply(e,t)).next())});Se((e,t)=>{let n=!1,r="",o=L.GridLayer.extend({createTile:Se((s,i)=>{let l=document.createElement("img"),c=new AbortController,u=c.signal;return l.cancel=()=>{c.abort()},n||(e.getHeader().then(p=>{p.tileType===1?console.error("Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details."):p.tileType===2?r="image/png":p.tileType===3?r="image/jpeg":p.tileType===4?r="image/webp":p.tileType===5&&(r="image/avif")}),n=!0),e.getZxy(s.z,s.x,s.y,u).then(p=>{if(p){let d=new Blob([p.data],{type:r}),h=window.URL.createObjectURL(d);l.src=h,l.cancel=void 0,i(void 0,l)}}).catch(p=>{if(p.name!=="AbortError")throw p}),l},"createTile"),_removeTile:Se(function(s){let i=this._tiles[s];i&&(i.el.cancel&&i.el.cancel(),i.el.width=0,i.el.height=0,i.el.deleted=!0,L.DomUtil.remove(i.el),delete this._tiles[s],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(s)}))},"_removeTile")});return new o(t)},"leafletRasterLayer");var Tu=Se(e=>(t,n)=>{if(n instanceof AbortController)return e(t,n);let r=new AbortController;return e(t,r).then(o=>n(void 0,o.data,o.cacheControl||"",o.expires||""),o=>n(o)).catch(o=>n(o)),{cancel:Se(()=>r.abort(),"cancel")}},"v3compat"),Ei=class{constructor(t){this.tilev4=Se((n,r)=>ze(this,null,function*(){if(n.type==="json"){let v=n.url.substr(10),x=this.tiles.get(v);if(x||(x=new fs(v),this.tiles.set(v,x)),this.metadata)return{data:yield x.getTileJson(n.url)};let f=yield x.getHeader();return(f.minLon>=f.maxLon||f.minLat>=f.maxLat)&&console.error(`Bounds of PMTiles archive ${f.minLon},${f.minLat},${f.maxLon},${f.maxLat} are not valid.`),{data:{tiles:[`${n.url}/{z}/{x}/{y}`],minzoom:f.minZoom,maxzoom:f.maxZoom,bounds:[f.minLon,f.minLat,f.maxLon,f.maxLat]}}}let o=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),s=n.url.match(o);if(!s)throw new Error("Invalid PMTiles protocol URL");let i=s[1],l=this.tiles.get(i);l||(l=new fs(i),this.tiles.set(i,l));let c=s[2],u=s[3],p=s[4],d=yield l.getHeader(),h=yield l==null?void 0:l.getZxy(+c,+u,+p,r.signal);if(h)return{data:new Uint8Array(h.data),cacheControl:h.cacheControl,expires:h.expires};if(d.tileType===1){if(this.errorOnMissingTile)throw new Error("Tile not found.");return{data:new Uint8Array}}return{data:null}}),"tilev4"),this.tile=Tu(this.tilev4),this.tiles=new Map,this.metadata=(t==null?void 0:t.metadata)||!1,this.errorOnMissingTile=(t==null?void 0:t.errorOnMissingTile)||!1}add(t){this.tiles.set(t.source.getKey(),t)}get(t){return this.tiles.get(t)}};Se(Ei,"Protocol");var wu=Ei;function ki(e,t){return(t>>>0)*4294967296+(e>>>0)}Se(ki,"toNum");function Ri(e,t){let n=t.buf,r=n[t.pos++],o=(r&112)>>4;if(r<128||(r=n[t.pos++],o|=(r&127)<<3,r<128)||(r=n[t.pos++],o|=(r&127)<<10,r<128)||(r=n[t.pos++],o|=(r&127)<<17,r<128)||(r=n[t.pos++],o|=(r&127)<<24,r<128)||(r=n[t.pos++],o|=(r&1)<<31,r<128))return ki(e,o);throw new Error("Expected varint not more than 10 bytes")}Se(Ri,"readVarintRemainder");function tn(e){let t=e.buf,n=t[e.pos++],r=n&127;return n<128||(n=t[e.pos++],r|=(n&127)<<7,n<128)||(n=t[e.pos++],r|=(n&127)<<14,n<128)||(n=t[e.pos++],r|=(n&127)<<21,n<128)?r:(n=t[e.pos],r|=(n&15)<<28,Ri(r,e))}Se(tn,"readVarint");function _o(e,t,n,r){if(r===0){n===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let o=t[0];t[0]=t[1],t[1]=o}}Se(_o,"rotate");function Oi(e,t){let n=On(2,e),r=t,o=t,s=t,i=[0,0],l=1;for(;l<n;)r=1&s/2,o=1&(s^r),_o(l,i,r,o),i[0]+=l*r,i[1]+=l*o,s=s/4,l*=2;return[e,i[0],i[1]]}Se(Oi,"idOnLevel");var Eu=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function ji(e,t,n){if(e>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");if(t>On(2,e)-1||n>On(2,e)-1)throw new Error("tile x/y outside zoom level bounds");let r=Eu[e],o=On(2,e),s=0,i=0,l=0,c=[t,n],u=o/2;for(;u>0;)s=(c[0]&u)>0?1:0,i=(c[1]&u)>0?1:0,l+=u*u*(3*s^i),_o(u,c,s,i),u=u/2;return r+l}Se(ji,"zxyToTileId");function ku(e){let t=0;for(let n=0;n<27;n++){let r=(1<<n)*(1<<n);if(t+r>e)return Oi(n,e-t);t+=r}throw new Error("Tile zoom level exceeds max safe number limit (26)")}Se(ku,"tileIdToZxy");var Ru=(e=>(e[e.Unknown=0]="Unknown",e[e.None=1]="None",e[e.Gzip=2]="Gzip",e[e.Brotli=3]="Brotli",e[e.Zstd=4]="Zstd",e))(Ru||{});function gr(e,t){return ze(this,null,function*(){if(t===1||t===0)return e;if(t===2){if(typeof globalThis.DecompressionStream>"u")return xu(new Uint8Array(e));let n=new Response(e).body;if(!n)throw new Error("Failed to read response stream");let r=n.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(r).arrayBuffer()}throw new Error("Compression method not supported")})}Se(gr,"defaultDecompress");var Ou=(e=>(e[e.Unknown=0]="Unknown",e[e.Mvt=1]="Mvt",e[e.Png=2]="Png",e[e.Jpeg=3]="Jpeg",e[e.Webp=4]="Webp",e[e.Avif=5]="Avif",e))(Ou||{});function $i(e){return e===1?".mvt":e===2?".png":e===3?".jpg":e===4?".webp":e===5?".avif":""}Se($i,"tileTypeExt");var ju=127;function Pi(e,t){let n=0,r=e.length-1;for(;n<=r;){let o=r+n>>1,s=t-e[o].tileId;if(s>0)n=o+1;else if(s<0)r=o-1;else return e[o]}return r>=0&&(e[r].runLength===0||t-e[r].tileId<e[r].runLength)?e[r]:null}Se(Pi,"findTile");var $u=class{constructor(t){this.file=t}getKey(){return this.file.name}getBytes(t,n){return ze(this,null,function*(){return{data:yield this.file.slice(t,t+n).arrayBuffer()}})}};Se($u,"FileSource");var Mi=class{constructor(t,n=new Headers){this.url=t,this.customHeaders=n,this.mustReload=!1;let r="";"navigator"in globalThis&&(r=globalThis.navigator.userAgent||"");let o=r.indexOf("Windows")>-1,s=/Chrome|Chromium|Edg|OPR|Brave/.test(r);this.chromeWindowsNoCache=!1,o&&s&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(t){this.customHeaders=t}getBytes(t,n,r,o){return ze(this,null,function*(){let s,i;r?i=r:(s=new AbortController,i=s.signal);let l=new Headers(this.customHeaders);l.set("range",`bytes=${t}-${t+n-1}`);let c;this.mustReload?c="reload":this.chromeWindowsNoCache&&(c="no-store");let u=yield fetch(this.url,{signal:i,cache:c,headers:l});if(t===0&&u.status===416){let h=u.headers.get("Content-Range");if(!h||!h.startsWith("bytes */"))throw new Error("Missing content-length on 416 response");let v=+h.substr(8);u=yield fetch(this.url,{signal:i,cache:"reload",headers:{range:`bytes=0-${v-1}`}})}let p=u.headers.get("Etag");if(p!=null&&p.startsWith("W/")&&(p=null),u.status===416||o&&p&&p!==o)throw this.mustReload=!0,new ao(`Server returned non-matching ETag ${o} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(u.status>=300)throw new Error(`Bad response code: ${u.status}`);let d=u.headers.get("Content-Length");if(u.status===200&&(!d||+d>n))throw s&&s.abort(),new Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield u.arrayBuffer(),etag:p||void 0,cacheControl:u.headers.get("Cache-Control")||void 0,expires:u.headers.get("Expires")||void 0}})}};Se(Mi,"FetchSource");var Pu=Mi;function st(e,t){let n=e.getUint32(t+4,!0),r=e.getUint32(t+0,!0);return n*On(2,32)+r}Se(st,"getUint64");function Li(e,t){let n=new DataView(e),r=n.getUint8(7);if(r>3)throw new Error(`Archive is spec version ${r} but this library supports up to spec version 3`);return{specVersion:r,rootDirectoryOffset:st(n,8),rootDirectoryLength:st(n,16),jsonMetadataOffset:st(n,24),jsonMetadataLength:st(n,32),leafDirectoryOffset:st(n,40),leafDirectoryLength:st(n,48),tileDataOffset:st(n,56),tileDataLength:st(n,64),numAddressedTiles:st(n,72),numTileEntries:st(n,80),numTileContents:st(n,88),clustered:n.getUint8(96)===1,internalCompression:n.getUint8(97),tileCompression:n.getUint8(98),tileType:n.getUint8(99),minZoom:n.getUint8(100),maxZoom:n.getUint8(101),minLon:n.getInt32(102,!0)/1e7,minLat:n.getInt32(106,!0)/1e7,maxLon:n.getInt32(110,!0)/1e7,maxLat:n.getInt32(114,!0)/1e7,centerZoom:n.getUint8(118),centerLon:n.getInt32(119,!0)/1e7,centerLat:n.getInt32(123,!0)/1e7,etag:t}}Se(Li,"bytesToHeader");function Co(e){let t={buf:new Uint8Array(e),pos:0},n=tn(t),r=[],o=0;for(let s=0;s<n;s++){let i=tn(t);r.push({tileId:o+i,offset:0,length:0,runLength:1}),o+=i}for(let s=0;s<n;s++)r[s].runLength=tn(t);for(let s=0;s<n;s++)r[s].length=tn(t);for(let s=0;s<n;s++){let i=tn(t);i===0&&s>0?r[s].offset=r[s-1].offset+r[s-1].length:r[s].offset=i-1}return r}Se(Co,"deserializeIndex");var Ai=class extends Error{};Se(Ai,"EtagMismatch");var ao=Ai;function So(e,t){return ze(this,null,function*(){let n=yield e.getBytes(0,16384);if(new DataView(n.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");let r=n.data.slice(0,ju),o=Li(r,n.etag),s=n.data.slice(o.rootDirectoryOffset,o.rootDirectoryOffset+o.rootDirectoryLength),i=`${e.getKey()}|${o.etag||""}|${o.rootDirectoryOffset}|${o.rootDirectoryLength}`,l=Co(yield t(s,o.internalCompression));return[o,[i,l.length,l]]})}Se(So,"getHeaderAndRoot");function To(e,t,n,r,o){return ze(this,null,function*(){let s=yield e.getBytes(n,r,void 0,o.etag),i=yield t(s.data,o.internalCompression),l=Co(i);if(l.length===0)throw new Error("Empty directory is invalid");return l})}Se(To,"getDirectory");var Mu=class{constructor(t=100,n=!0,r=gr){this.cache=new Map,this.maxCacheEntries=t,this.counter=1,this.decompress=r}getHeader(t){return ze(this,null,function*(){let n=t.getKey(),r=this.cache.get(n);if(r)return r.lastUsed=this.counter++,r.data;let o=yield So(t,this.decompress);return o[1]&&this.cache.set(o[1][0],{lastUsed:this.counter++,data:o[1][2]}),this.cache.set(n,{lastUsed:this.counter++,data:o[0]}),this.prune(),o[0]})}getDirectory(t,n,r,o){return ze(this,null,function*(){let s=`${t.getKey()}|${o.etag||""}|${n}|${r}`,i=this.cache.get(s);if(i)return i.lastUsed=this.counter++,i.data;let l=yield To(t,this.decompress,n,r,o);return this.cache.set(s,{lastUsed:this.counter++,data:l}),this.prune(),l})}prune(){if(this.cache.size>this.maxCacheEntries){let t=1/0,n;this.cache.forEach((r,o)=>{r.lastUsed<t&&(t=r.lastUsed,n=o)}),n&&this.cache.delete(n)}}invalidate(t){return ze(this,null,function*(){this.cache.delete(t.getKey())})}};Se(Mu,"ResolvedValueCache");var Ni=class{constructor(t=100,n=!0,r=gr){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=t,this.counter=1,this.decompress=r}getHeader(t){return ze(this,null,function*(){let n=t.getKey(),r=this.cache.get(n);if(r)return r.lastUsed=this.counter++,yield r.data;let o=new Promise((s,i)=>{So(t,this.decompress).then(l=>{l[1]&&this.cache.set(l[1][0],{lastUsed:this.counter++,data:Promise.resolve(l[1][2])}),s(l[0]),this.prune()}).catch(l=>{i(l)})});return this.cache.set(n,{lastUsed:this.counter++,data:o}),o})}getDirectory(t,n,r,o){return ze(this,null,function*(){let s=`${t.getKey()}|${o.etag||""}|${n}|${r}`,i=this.cache.get(s);if(i)return i.lastUsed=this.counter++,yield i.data;let l=new Promise((c,u)=>{To(t,this.decompress,n,r,o).then(p=>{c(p),this.prune()}).catch(p=>{u(p)})});return this.cache.set(s,{lastUsed:this.counter++,data:l}),l})}prune(){if(this.cache.size>=this.maxCacheEntries){let t=1/0,n;this.cache.forEach((r,o)=>{r.lastUsed<t&&(t=r.lastUsed,n=o)}),n&&this.cache.delete(n)}}invalidate(t){return ze(this,null,function*(){let n=t.getKey();if(this.invalidations.get(n))return yield this.invalidations.get(n);this.cache.delete(t.getKey());let r=new Promise((o,s)=>{this.getHeader(t).then(i=>{o(),this.invalidations.delete(n)}).catch(i=>{s(i)})});this.invalidations.set(n,r)})}};Se(Ni,"SharedPromiseCache");var Lu=Ni,Ii=class{constructor(t,n,r){typeof t=="string"?this.source=new Pu(t):this.source=t,r?this.decompress=r:this.decompress=gr,n?this.cache=n:this.cache=new Lu}getHeader(){return ze(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(t,n,r,o){return ze(this,null,function*(){let s=ji(t,n,r),i=yield this.cache.getHeader(this.source);if(t<i.minZoom||t>i.maxZoom)return;let l=i.rootDirectoryOffset,c=i.rootDirectoryLength;for(let u=0;u<=3;u++){let p=yield this.cache.getDirectory(this.source,l,c,i),d=Pi(p,s);if(d){if(d.runLength>0){let h=yield this.source.getBytes(i.tileDataOffset+d.offset,d.length,o,i.etag);return{data:yield this.decompress(h.data,i.tileCompression),cacheControl:h.cacheControl,expires:h.expires}}l=i.leafDirectoryOffset+d.offset,c=d.length}else return}throw new Error("Maximum directory depth exceeded")})}getZxy(t,n,r,o){return ze(this,null,function*(){try{return yield this.getZxyAttempt(t,n,r,o)}catch(s){if(s instanceof ao)return this.cache.invalidate(this.source),yield this.getZxyAttempt(t,n,r,o);throw s}})}getMetadataAttempt(){return ze(this,null,function*(){let t=yield this.cache.getHeader(this.source),n=yield this.source.getBytes(t.jsonMetadataOffset,t.jsonMetadataLength,void 0,t.etag),r=yield this.decompress(n.data,t.internalCompression),o=new TextDecoder("utf-8");return JSON.parse(o.decode(r))})}getMetadata(){return ze(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(t){if(t instanceof ao)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw t}})}getTileJson(t){return ze(this,null,function*(){let n=yield this.getHeader(),r=yield this.getMetadata(),o=$i(n.tileType);return{tilejson:"3.0.0",scheme:"xyz",tiles:[`${t}/{z}/{x}/{y}${o}`],vector_layers:r.vector_layers,attribution:r.attribution,description:r.description,name:r.name,version:r.version,bounds:[n.minLon,n.minLat,n.maxLon,n.maxLat],center:[n.centerLon,n.centerLat,n.centerZoom],minzoom:n.minZoom,maxzoom:n.maxZoom}})}};Se(Ii,"PMTiles");var fs=Ii;const Au=X.createContext(null);function Nu(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,s=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&r===s}function Ze(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ze(e[n],t[n]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!t.hasOwnProperty(o)||!Ze(e[o],t[o]))return!1;return!0}return!1}function ds(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function ps(e,t){const n=t.viewState||t,r={};if("longitude"in n&&"latitude"in n&&(n.longitude!==e.center.lng||n.latitude!==e.center.lat)){const o=e.center.constructor;r.center=new o(n.longitude,n.latitude)}return"zoom"in n&&n.zoom!==e.zoom&&(r.zoom=n.zoom),"bearing"in n&&n.bearing!==e.bearing&&(r.bearing=n.bearing),"pitch"in n&&n.pitch!==e.pitch&&(r.pitch=n.pitch),n.padding&&e.padding&&!Ze(n.padding,e.padding)&&(r.padding=n.padding),r}const Iu=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function hs(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const r of e.layers)t[r.id]=r;const n=e.layers.map(r=>{let o=null;"interactive"in r&&(o=Object.assign({},r),delete o.interactive);const s=t[r.ref];if(s){o=o||Object.assign({},r),delete o.ref;for(const i of Iu)i in s&&(o[i]=s[i])}return o||r});return{...e,layers:n}}const ms={version:8,sources:{},layers:[]},gs={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},ys={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},vs={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Du=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Fu=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class cn{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const s=this.props[vs[o.type]];s?s(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||ds(this._map.transform);const s=this.props[ys[o.type]];s&&s(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=ds(o),ps(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const s=this.props[gs[o.type]];s&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),s(o),delete o.features)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n),o=this._updateSize(t),s=this._updateViewState(t);this._updateStyle(t,n),this._updateStyleComponents(t),this._updateHandlers(t,n),(r||o||s&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=cn.savedMaps.pop();if(!r)return null;const o=r.map,s=o.getContainer();for(n.className=s.className;s.childNodes.length>0;)n.appendChild(s.childNodes[0]);o._container=n;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(n)),r.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:l}=t;return l&&(l.bounds?o.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):r._updateViewState(l)),o.isStyleLoaded()?o.fire("load"):o.once("style.load",()=>o.fire("load")),o._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=ms}=n,o={...n,...n.initialViewState,container:t,style:hs(r)},s=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),n.gl){const l=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=l,n.gl)}const i=new this._MapClass(o);s.padding&&i.setPadding(s.padding),n.cursor&&(i.getCanvas().style.cursor=n.cursor),i.transformCameraUpdate=this._onCameraUpdate,i.on("style.load",()=>{var l;this._styleComponents={light:i.getLight(),sky:i.getSky(),projection:(l=i.getProjection)==null?void 0:l.call(i),terrain:i.getTerrain()},this._updateStyleComponents(this.props)}),i.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const l in gs)i.on(l,this._onPointerEvent);for(const l in ys)i.on(l,this._onCameraEvent);for(const l in vs)i.on(l,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),cn.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t){const n=this._map,r=n.transform;if(!n.isMoving()){const s=ps(r,t);if(Object.keys(s).length>0)return this._internalUpdate=!0,n.jumpTo(s),this._internalUpdate=!1,!0}return!1}_updateSettings(t,n){const r=this._map;let o=!1;for(const s of Du)if(s in t&&!Ze(t[s],n[s])){o=!0;const i=r[`set${s[0].toUpperCase()}${s.slice(1)}`];i==null||i.call(r,t[s])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=ms,styleDiffing:o=!0}=t,s={diff:o};"localIdeographFontFamily"in t&&(s.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(hs(r),s)}}_updateStyleComponents({light:t,projection:n,sky:r,terrain:o}){var l,c;const s=this._map,i=this._styleComponents;s.style._loaded&&(t&&!Ze(t,i.light)&&(i.light=t,s.setLight(t)),n&&!Ze(n,i.projection)&&n!==((l=i.projection)==null?void 0:l.type)&&(i.projection=typeof n=="string"?{type:n}:n,(c=s.setProjection)==null||c.call(s,i.projection)),r&&!Ze(r,i.sky)&&(i.sky=r,s.setSky(r)),o!==void 0&&!Ze(o,i.terrain)&&(!o||s.getSource(o.source))&&(i.terrain=o,s.setTerrain(o)))}_updateHandlers(t,n){const r=this._map;for(const o of Fu){const s=t[o]??!0,i=n[o]??!0;Ze(s,i)||(s?r[o].enable(s):r[o].disable())}}_queryRenderedFeatures(t){const n=this._map,{interactiveLayerIds:r=[]}=this.props;try{return n.queryRenderedFeatures(t,{layers:r.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=t.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,l=this._queryRenderedFeatures(t.point),c=l.length>0;!c&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,c&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}}cn.savedMaps=[];const zu=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Bu(e){if(!e)return null;const t=e.map,n={getMap:()=>t};for(const r of Uu(t))!(r in n)&&!zu.includes(r)&&(n[r]=t[r].bind(t));return n}function Uu(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Vu=typeof document<"u"?b.useLayoutEffect:b.useEffect;function qu(e,t){const{RTLTextPlugin:n,maxParallelImageRequests:r,workerCount:o,workerUrl:s}=t;if(n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:l=!0}=typeof n=="string"?{pluginUrl:n}:n;e.setRTLTextPlugin(i,c=>{c&&console.error(c)},l)}r!==void 0&&e.setMaxParallelImageRequests(r),o!==void 0&&e.setWorkerCount(o),s!==void 0&&e.setWorkerUrl(s)}const dn=X.createContext(null);function Wu(e,t){const n=b.useContext(Au),[r,o]=b.useState(null),s=b.useRef(),{current:i}=b.useRef({mapLib:null,map:null});b.useEffect(()=>{const u=e.mapLib;let p=!0,d;return Promise.resolve(u||import("maplibre-gl")).then(h=>{if(!p)return;if(!h)throw new Error("Invalid mapLib");const v="Map"in h?h:h.default;if(!v.Map)throw new Error("Invalid mapLib");qu(v,e),e.reuseMaps&&(d=cn.reuse(e,s.current)),d||(d=new cn(v.Map,e,s.current)),i.map=Bu(d),i.mapLib=v,o(d),n==null||n.onMapMount(i.map,e.id)}).catch(h=>{const{onError:v}=e;v?v({type:"error",target:null,originalEvent:null,error:h}):console.error(h)}),()=>{p=!1,d&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Vu(()=>{r&&r.setProps(e)}),b.useImperativeHandle(t,()=>i.map,[r]);const l=b.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return X.createElement("div",{id:e.id,ref:s,style:l},r&&X.createElement(dn.Provider,{value:i},X.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Hu=X.forwardRef(Wu),Ku=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function bt(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const o=t[r];Number.isFinite(o)&&!Ku.test(r)?n[r]=`${o}px`:n[r]=o}}function Di(e,t){if(e===t)return null;const n=bs(e),r=bs(t),o=[];for(const s of r)n.has(s)||o.push(s);for(const s of n)r.has(s)||o.push(s);return o.length===0?null:o}function bs(e){return new Set(e?e.trim().split(/\s+/):[])}b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(dn),o=b.useRef({props:e}),s=b.useMemo(()=>{let S=!1;X.Children.forEach(e.children,R=>{R&&(S=!0)});const j={...e,element:S?document.createElement("div"):void 0},w=new r.Marker(j);return w.setLngLat([e.longitude,e.latitude]),w.getElement().addEventListener("click",R=>{var _,F;(F=(_=o.current.props).onClick)==null||F.call(_,{type:"click",target:w,originalEvent:R})}),w.on("dragstart",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragStart)==null||y.call(F,_)}),w.on("drag",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDrag)==null||y.call(F,_)}),w.on("dragend",R=>{var F,y;const _=R;_.lngLat=s.getLngLat(),(y=(F=o.current.props).onDragEnd)==null||y.call(F,_)}),w},[]);b.useEffect(()=>(s.addTo(n.getMap()),()=>{s.remove()}),[]);const{longitude:i,latitude:l,offset:c,style:u,draggable:p=!1,popup:d=null,rotation:h=0,rotationAlignment:v="auto",pitchAlignment:x="auto"}=e;b.useEffect(()=>{bt(s.getElement(),u)},[u]),b.useImperativeHandle(t,()=>s,[]);const f=o.current.props;(s.getLngLat().lng!==i||s.getLngLat().lat!==l)&&s.setLngLat([i,l]),c&&!Nu(s.getOffset(),c)&&s.setOffset(c),s.isDraggable()!==p&&s.setDraggable(p),s.getRotation()!==h&&s.setRotation(h),s.getRotationAlignment()!==v&&s.setRotationAlignment(v),s.getPitchAlignment()!==x&&s.setPitchAlignment(x),s.getPopup()!==d&&s.setPopup(d);const C=Di(f.className,e.className);if(C)for(const S of C)s.toggleClassName(S);return o.current.props=e,mr.createPortal(e.children,s.getElement())}));const Yu=b.memo(b.forwardRef((e,t)=>{const{map:n,mapLib:r}=b.useContext(dn),o=b.useMemo(()=>document.createElement("div"),[]),s=b.useRef({props:e}),i=b.useMemo(()=>{const l={...e},c=new r.Popup(l);return c.setLngLat([e.longitude,e.latitude]),c.once("open",u=>{var p,d;(d=(p=s.current.props).onOpen)==null||d.call(p,u)}),c},[]);if(b.useEffect(()=>{const l=c=>{var u,p;(p=(u=s.current.props).onClose)==null||p.call(u,c)};return i.on("close",l),i.setDOMContent(o).addTo(n.getMap()),()=>{i.off("close",l),i.isOpen()&&i.remove()}},[]),b.useEffect(()=>{bt(i.getElement(),e.style)},[e.style]),b.useImperativeHandle(t,()=>i,[]),i.isOpen()){const l=s.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Ze(l.offset,e.offset)&&i.setOffset(e.offset),(l.anchor!==e.anchor||l.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth));const c=Di(l.className,e.className);if(c)for(const u of c)i.toggleClassName(u);s.current.props=e}return mr.createPortal(e.children,o)}));function Dt(e,t,n,r){const o=b.useContext(dn),s=b.useMemo(()=>e(o),[]);return b.useEffect(()=>{const i=t,l=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(s)||c.addControl(s,i==null?void 0:i.position),()=>{l&&l(o),c.hasControl(s)&&c.removeControl(s)}},[]),s}function Zu(e){const t=Dt(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}b.memo(Zu);function Gu(e){const t=Dt(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return b.useEffect(()=>{bt(t._controlContainer,e.style)},[e.style]),null}b.memo(Gu);function Ju(e,t){const n=b.useRef({props:e}),r=Dt(({mapLib:o})=>{const s=new o.GeolocateControl(e),i=s._setupUI;return s._setupUI=()=>{s._container.hasChildNodes()||i()},s.on("geolocate",l=>{var c,u;(u=(c=n.current.props).onGeolocate)==null||u.call(c,l)}),s.on("error",l=>{var c,u;(u=(c=n.current.props).onError)==null||u.call(c,l)}),s.on("outofmaxbounds",l=>{var c,u;(u=(c=n.current.props).onOutOfMaxBounds)==null||u.call(c,l)}),s.on("trackuserlocationstart",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationStart)==null||u.call(c,l)}),s.on("trackuserlocationend",l=>{var c,u;(u=(c=n.current.props).onTrackUserLocationEnd)==null||u.call(c,l)}),s},{position:e.position});return n.current.props=e,b.useImperativeHandle(t,()=>r,[]),b.useEffect(()=>{bt(r._container,e.style)},[e.style]),null}b.memo(b.forwardRef(Ju));function Xu(e){const t=Dt(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}const Qu=b.memo(Xu);function ef(e){const t=Dt(({mapLib:s})=>new s.ScaleControl(e),{position:e.position}),n=b.useRef(e),r=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),b.useEffect(()=>{bt(t._container,o)},[o]),null}b.memo(ef);function tf(e){const t=Dt(({mapLib:n})=>new n.TerrainControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}b.memo(tf);function nf(e){const t=Dt(({mapLib:n})=>new n.LogoControl(e),{position:e.position});return b.useEffect(()=>{bt(t._container,e.style)},[e.style]),null}b.memo(nf);function fr(e,t){if(!e)throw new Error(t)}let rf=0;function of(e,t,n){if(e.style&&e.style._loaded){const r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function sf(e,t,n){var i,l,c;fr(t.id===n.id,"source id changed"),fr(t.type===n.type,"source type changed");let r="",o=0;for(const u in t)u!=="children"&&u!=="id"&&!Ze(n[u],t[u])&&(r=u,o++);if(!o)return;const s=t.type;if(s==="geojson")e.setData(t.data);else if(s==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else switch(r){case"coordinates":(i=e.setCoordinates)==null||i.call(e,t.coordinates);break;case"url":(l=e.setUrl)==null||l.call(e,t.url);break;case"tiles":(c=e.setTiles)==null||c.call(e,t.tiles);break;default:console.warn(`Unable to update <Source> prop: ${r}`)}}function af(e){const t=b.useContext(dn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-source-${rf++}`,[]);b.useEffect(()=>{if(t){const i=()=>setTimeout(()=>r(l=>l+1),0);return t.on("styledata",i),i(),()=>{var l;if(t.off("styledata",i),t.style&&t.style._loaded&&t.getSource(o)){const c=(l=t.getStyle())==null?void 0:l.layers;if(c)for(const u of c)u.source===o&&t.removeLayer(u.id);t.removeSource(o)}}}},[t]);let s=t&&t.style&&t.getSource(o);return s?sf(s,e,n.current):s=of(t,o,e),n.current=e,s&&X.Children.map(e.children,i=>i&&b.cloneElement(i,{source:o}))||null}function lf(e,t,n,r){if(fr(n.id===r.id,"layer id changed"),fr(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:o={},paint:s={},filter:i,minzoom:l,maxzoom:c,beforeId:u}=n;if(u!==r.beforeId&&e.moveLayer(t,u),o!==r.layout){const p=r.layout||{};for(const d in o)Ze(o[d],p[d])||e.setLayoutProperty(t,d,o[d]);for(const d in p)o.hasOwnProperty(d)||e.setLayoutProperty(t,d,void 0)}if(s!==r.paint){const p=r.paint||{};for(const d in s)Ze(s[d],p[d])||e.setPaintProperty(t,d,s[d]);for(const d in p)s.hasOwnProperty(d)||e.setPaintProperty(t,d,void 0)}Ze(i,r.filter)||e.setFilter(t,i),(l!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(t,l,c)}function cf(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}let uf=0;function ff(e){const t=b.useContext(dn).map.getMap(),n=b.useRef(e),[,r]=b.useState(0),o=b.useMemo(()=>e.id||`jsx-layer-${uf++}`,[]);if(b.useEffect(()=>{if(t){const i=()=>r(l=>l+1);return t.on("styledata",i),i(),()=>{t.off("styledata",i),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{lf(t,o,e,n.current)}catch(i){console.warn(i)}else cf(t,o,e);return n.current=e,null}const df="_mapContainer_ivruh_3",pf={mapContainer:df},hf="_FeaturePopUp_1gd6w_2",mf="_title_1gd6w_2",xs={FeaturePopUp:hf,title:mf},gf=({props:e})=>{const{t}=Te.useTranslation();return m.jsx("div",{className:xs.FeaturePopUp,children:e.map(n=>m.jsxs("p",{children:[m.jsxs("span",{className:xs.title,children:[m.jsx(Te.Trans,{i18nKey:n.name,components:{sup:m.jsx("sup",{})}}),": "]}),n.value.toLocaleString("de",{maximumFractionDigits:2})," ",t(n.unit)]}))})},Fi=({initialView:e={latitude:39.4699,longitude:-.3763,zoom:12},maxZoom:t=17,minZoom:n=8,mapStyle:r,firstSymbolLayer:o,cssProps:s={},onClick:i="",interactiveLayers:l=[],sources:c=[],layers:u=[],filters:p,popUpParams:d,onClosePopUp:h,showTexts:v})=>{console.log(p);const x=b.useRef();return b.useEffect(()=>{if(x.current){const f=x.current.getMap();f.getStyle().layers.map(S=>{S.type=="symbol"&&S.id!="professionals"&&(v?f.setLayoutProperty(S.id,"visibility","visible"):f.setLayoutProperty(S.id,"visibility","none"))})}},[v]),b.useEffect(()=>{let f=new wu;return Ao.addProtocol("pmtiles",f.tile),()=>{Ao.removeProtocol("pmtiles")}},[]),m.jsx("div",{className:`${pf.mapContainer}`,style:s&&s,children:m.jsxs(Hu,{initialViewState:e,ref:x,hash:!1,maxZoom:t,minZoom:n,mapStyle:r,onClick:i,interactiveLayerIds:l,children:[c.length&&c.map((f,C)=>m.jsx(af,{...f,children:u.length&&u.map((S,j)=>{if(S.sourceId==f.id)return m.jsx(ff,{...S.layer,beforeId:o,filter:p&&p},j)})},C)),m.jsx(Qu,{position:"bottom-right",visualizePitch:!0}),d&&m.jsx(Yu,{longitude:d.lng,latitude:d.lat,onClose:h,children:m.jsx(gf,{props:d.props})})]})})};Fi.propTypes={initialView:a.shape({latitude:a.number.isRequired,longitude:a.number.isRequired,zoom:a.number.isRequired}),mapStyle:a.string,firstSymbolLayer:a.string,cssProps:a.object,style:a.object,maxZoom:a.number,minZoom:a.number,onClick:a.func,interactiveLayers:a.array,popUp:a.bool,sources:a.arrayOf(a.shape({id:a.string,type:a.string,url:a.string,data:a.object})),layers:a.arrayOf(a.shape({sourceId:a.string,layer:a.shape({id:a.string,type:a.string,sourceLayer:a.string,minZoom:a.number,maxZoom:a.number,paint:a.object})})),showTexts:a.bool,filters:a.array,popUpParams:a.object,onClosePopUp:a.func};const yf="_sectionBar_2vnc3_2",vf="_leftContent_2vnc3_13",bf="_textContainer_2vnc3_19",xf="_title_2vnc3_26",_f="_subtitle_2vnc3_32",Cf="_rightContent_2vnc3_37",At={sectionBar:yf,leftContent:vf,textContainer:bf,title:xf,subtitle:_f,rightContent:Cf},zi=({leftIcon:e,title:t,subtitle:n,rightContent:r,mainColor:o})=>{const{t:s}=Te.useTranslation();return m.jsxs("div",{className:At.sectionBar,children:[m.jsxs("div",{className:At.leftContent,children:[e&&m.jsx("img",{src:e,alt:"Icono",className:At.icon}),m.jsxs("div",{className:At.textContainer,children:[m.jsx("div",{className:At.title,style:o?{color:o}:{},children:s(t)}),n&&m.jsx("div",{className:At.subtitle,children:n})]})]}),m.jsx("div",{className:At.rightContent,children:r})]})};zi.propTypes={leftIcon:a.node.isRequired,title:a.string.isRequired,subtitle:a.string,rightContent:a.node.isRequired,mainColor:a.string};const Sf=Ys.createSlice({name:"mapSlice",initialState:{showTexts:!0,sliderSelectedYear:2025,activeIndicatorKey:0,activeIndicatorType:"cat",activeIndicatorUnit:null},reducers:{setShowTexts:(e,t)=>{e.showTexts=t.payload},setYear:(e,t)=>{e.sliderSelectedYear=t.payload},setActiveIndicatorKey:(e,t)=>{e.activeIndicatorKey=t.payload},setActiveIndicatorType:(e,t)=>{e.activeIndicatorType=t.payload},setActiveIndicatorUnit:(e,t)=>{e.activeIndicatorUnit=t.payload}}}),{setShowTexts:Cm,setYear:Zr,setActiveIndicatorKey:Sm,setActiveIndicatorType:Tm,setActiveIndicatorUnit:wm}=Sf.actions,Tf="data:image/svg+xml,%3csvg%20width='42'%20height='42'%20viewBox='0%200%2042%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='21'%20cy='21'%20r='20.25'%20fill='%23FDFDFD'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3cpath%20d='M15.2722%2012.6627C15.2722%2011.8929%2016.1055%2011.4118%2016.7722%2011.7967L31.5641%2020.3368C32.2308%2020.7217%2032.2308%2021.684%2031.5641%2022.0689L16.7722%2030.609C16.1055%2030.9939%2015.2722%2030.5128%2015.2722%2029.743L15.2722%2012.6627Z'%20fill='%23605B56'/%3e%3c/svg%3e",wf="data:image/svg+xml,%3csvg%20width='42'%20height='42'%20viewBox='0%200%2042%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='21'%20cy='21'%20r='20.25'%20fill='%23FDFDFD'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3crect%20x='15'%20y='12'%20width='4'%20height='19'%20rx='1'%20fill='%23605B56'/%3e%3crect%20x='23'%20y='12'%20width='4'%20height='19'%20rx='1'%20fill='%23605B56'/%3e%3c/svg%3e";function xt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(null,arguments)}function Bi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Bi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Et(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bi(e))&&(r&&(r+=" "),r+=t);return r}function _s(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function Ef(e,t,n=void 0){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((s,i)=>{if(i){const l=t(i);l!==""&&s.push(l),n&&n[i]&&s.push(n[i])}return s},[]).join(" ")}),r}var je={},Gr={exports:{}},Cs;function Ui(){return Cs||(Cs=1,function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Gr)),Gr.exports}function Pn(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}const kf=Object.freeze(Object.defineProperty({__proto__:null,default:Pn},Symbol.toStringTag,{value:"Module"})),Rf=kt(kf);function nn(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Of=Object.freeze(Object.defineProperty({__proto__:null,default:nn},Symbol.toStringTag,{value:"Module"})),jf=kt(Of);var Ss;function $f(){if(Ss)return je;Ss=1;var e=Ui();Object.defineProperty(je,"__esModule",{value:!0}),je.alpha=x,je.blend=F,je.colorChannel=void 0,je.darken=C,je.decomposeColor=i,je.emphasize=R,je.getContrastRatio=v,je.getLuminance=h,je.hexToRgb=o,je.hslToRgb=d,je.lighten=j,je.private_safeAlpha=f,je.private_safeColorChannel=void 0,je.private_safeDarken=S,je.private_safeEmphasize=_,je.private_safeLighten=w,je.recomposeColor=u,je.rgbToHex=p;var t=e(Rf),n=e(jf);function r(y,E=0,T=1){return process.env.NODE_ENV!=="production"&&(y<E||y>T)&&console.error(`MUI: The value provided ${y} is out of range [${E}, ${T}].`),(0,n.default)(y,E,T)}function o(y){y=y.slice(1);const E=new RegExp(`.{1,${y.length>=6?2:1}}`,"g");let T=y.match(E);return T&&T[0].length===1&&(T=T.map($=>$+$)),T?`rgb${T.length===4?"a":""}(${T.map(($,I)=>I<3?parseInt($,16):Math.round(parseInt($,16)/255*1e3)/1e3).join(", ")})`:""}function s(y){const E=y.toString(16);return E.length===1?`0${E}`:E}function i(y){if(y.type)return y;if(y.charAt(0)==="#")return i(o(y));const E=y.indexOf("("),T=y.substring(0,E);if(["rgb","rgba","hsl","hsla","color"].indexOf(T)===-1)throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${y}\` color.
52
52
  The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:(0,t.default)(9,y));let $=y.substring(E+1,y.length-1),I;if(T==="color"){if($=$.split(" "),I=$.shift(),$.length===4&&$[3].charAt(0)==="/"&&($[3]=$[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(I)===-1)throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${I}\` color space.
53
53
  The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:(0,t.default)(10,I))}else $=$.split(",");return $=$.map(Q=>parseFloat(Q)),{type:T,values:$,colorSpace:I}}const l=y=>{const E=i(y);return E.values.slice(0,3).map((T,$)=>E.type.indexOf("hsl")!==-1&&$!==0?`${T}%`:T).join(" ")};je.colorChannel=l;const c=(y,E)=>{try{return l(y)}catch{return E&&process.env.NODE_ENV!=="production"&&console.warn(E),y}};je.private_safeColorChannel=c;function u(y){const{type:E,colorSpace:T}=y;let{values:$}=y;return E.indexOf("rgb")!==-1?$=$.map((I,Q)=>Q<3?parseInt(I,10):I):E.indexOf("hsl")!==-1&&($[1]=`${$[1]}%`,$[2]=`${$[2]}%`),E.indexOf("color")!==-1?$=`${T} ${$.join(" ")}`:$=`${$.join(", ")}`,`${E}(${$})`}function p(y){if(y.indexOf("#")===0)return y;const{values:E}=i(y);return`#${E.map((T,$)=>s($===3?Math.round(255*T):T)).join("")}`}function d(y){y=i(y);const{values:E}=y,T=E[0],$=E[1]/100,I=E[2]/100,Q=$*Math.min(I,1-I),U=(ie,oe=(ie+T/30)%12)=>I-Q*Math.max(Math.min(oe-3,9-oe,1),-1);let Z="rgb";const q=[Math.round(U(0)*255),Math.round(U(8)*255),Math.round(U(4)*255)];return y.type==="hsla"&&(Z+="a",q.push(E[3])),u({type:Z,values:q})}function h(y){y=i(y);let E=y.type==="hsl"||y.type==="hsla"?i(d(y)).values:y.values;return E=E.map(T=>(y.type!=="color"&&(T/=255),T<=.03928?T/12.92:((T+.055)/1.055)**2.4)),Number((.2126*E[0]+.7152*E[1]+.0722*E[2]).toFixed(3))}function v(y,E){const T=h(y),$=h(E);return(Math.max(T,$)+.05)/(Math.min(T,$)+.05)}function x(y,E){return y=i(y),E=r(E),(y.type==="rgb"||y.type==="hsl")&&(y.type+="a"),y.type==="color"?y.values[3]=`/${E}`:y.values[3]=E,u(y)}function f(y,E,T){try{return x(y,E)}catch{return T&&process.env.NODE_ENV!=="production"&&console.warn(T),y}}function C(y,E){if(y=i(y),E=r(E),y.type.indexOf("hsl")!==-1)y.values[2]*=1-E;else if(y.type.indexOf("rgb")!==-1||y.type.indexOf("color")!==-1)for(let T=0;T<3;T+=1)y.values[T]*=1-E;return u(y)}function S(y,E,T){try{return C(y,E)}catch{return T&&process.env.NODE_ENV!=="production"&&console.warn(T),y}}function j(y,E){if(y=i(y),E=r(E),y.type.indexOf("hsl")!==-1)y.values[2]+=(100-y.values[2])*E;else if(y.type.indexOf("rgb")!==-1)for(let T=0;T<3;T+=1)y.values[T]+=(255-y.values[T])*E;else if(y.type.indexOf("color")!==-1)for(let T=0;T<3;T+=1)y.values[T]+=(1-y.values[T])*E;return u(y)}function w(y,E,T){try{return j(y,E)}catch{return T&&process.env.NODE_ENV!=="production"&&console.warn(T),y}}function R(y,E=.15){return h(y)>.5?C(y,E):j(y,E)}function _(y,E,T){try{return R(y,E)}catch{return T&&process.env.NODE_ENV!=="production"&&console.warn(T),y}}function F(y,E,T,$=1){const I=(q,ie)=>Math.round((q**(1/$)*(1-T)+ie**(1/$)*T)**$),Q=i(y),U=i(E),Z=[I(Q.values[0],U.values[0]),I(Q.values[1],U.values[1]),I(Q.values[2],U.values[2])];return u({type:"rgb",values:Z})}return je}var ht=$f();const Pf=X.createContext();process.env.NODE_ENV!=="production"&&(a.node,a.bool);const Mf=()=>{const e=X.useContext(Pf);return e??!1};function Lf(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function lo(...e){return X.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Lf(n,t)})},e)}function jn(e){return typeof e=="string"}function Af(e,t,n){return e===void 0||jn(e)?t:B({},t,{ownerState:B({},t.ownerState,n)})}function sr(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function Ts(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function Nf(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:s}=e;if(!t){const v=Et(n==null?void 0:n.className,s,o==null?void 0:o.className,r==null?void 0:r.className),x=B({},n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),f=B({},n,o,r);return v.length>0&&(f.className=v),Object.keys(x).length>0&&(f.style=x),{props:f,internalRef:void 0}}const i=sr(B({},o,r)),l=Ts(r),c=Ts(o),u=t(i),p=Et(u==null?void 0:u.className,n==null?void 0:n.className,s,o==null?void 0:o.className,r==null?void 0:r.className),d=B({},u==null?void 0:u.style,n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),h=B({},u,n,c,l);return p.length>0&&(h.className=p),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:u.ref}}function If(e,t,n){return typeof e=="function"?e(t,n):e}const Df=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Tt(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:s=!1}=e,i=xt(e,Df),l=s?{}:If(r,o),{props:c,internalRef:u}=Nf(B({},i,{externalSlotProps:l})),p=lo(u,l==null?void 0:l.ref,(t=e.additionalProps)==null?void 0:t.ref);return Af(n,B({},c,{ref:p}),o)}function wt(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Vi(e){if(X.isValidElement(e)||!wt(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Vi(e[n])}),t}function mt(e,t,n={clone:!0}){const r=n.clone?B({},e):e;return wt(e)&&wt(t)&&Object.keys(t).forEach(o=>{X.isValidElement(t[o])?r[o]=t[o]:wt(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&wt(e[o])?r[o]=mt(e[o],t[o],n):n.clone?r[o]=wt(t[o])?Vi(t[o]):t[o]:r[o]=t[o]}),r}const Ff=Object.freeze(Object.defineProperty({__proto__:null,default:mt,isPlainObject:wt},Symbol.toStringTag,{value:"Module"}));var Jn={exports:{}},_e={};/**
54
54
  * @license React
package/dist/index.es.js CHANGED
@@ -2355,7 +2355,8 @@ const ds = ({
2355
2355
  Eo,
2356
2356
  {
2357
2357
  indicator: l,
2358
- fontColor: s
2358
+ fontColor: s,
2359
+ activeColor: t
2359
2360
  },
2360
2361
  `indicator-${c}`
2361
2362
  ))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmf_ciclica/ciclicastorybook",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",