@tomtom-org/maps-sdk 0.41.7 → 0.42.1

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.
@@ -1,2 +1,2 @@
1
- import{generateTomTomHeaders as e,generateId as t,poiCategoriesToID as r,bboxFromCoordsArray as i,bboxCenter as o,TomTomConfig as a,formatDuration as n,getPosition as s,formatDistance as c,mergeFromGlobal as l,indexedMagnitudes as u}from"@tomtom-org/maps-sdk/core";import{Map as h,getRTLTextPluginStatus as p,setRTLTextPlugin as f}from"maplibre-gl";var _="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,y=_||d||Function("return this")(),A=y.Symbol,g=Object.prototype,E=g.hasOwnProperty,R=g.toString,I=A?A.toStringTag:void 0;var m=Object.prototype.toString;var T=A?A.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?function(e){var t=E.call(e,I),r=e[I];try{e[I]=void 0;var i=!0}catch(a){}var o=R.call(e);return i&&(t?e[I]=r:delete e[I]),o}(e):function(e){return m.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function b(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==S(e)}function O(e,t){for(var r=-1,i=null==e?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}var N=Array.isArray,v=A?A.prototype:void 0,C=v?v.toString:void 0;function M(e){if("string"==typeof e)return e;if(N(e))return O(e,M)+"";if(b(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function U(e){return e}function P(e){if(!w(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var D,x=y["__core-js_shared__"],F=(D=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"";var H=Function.prototype.toString;function G(e){if(null!=e){try{return H.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var j=/^\[object .+?Constructor\]$/,B=Function.prototype,W=Object.prototype,V=B.toString,k=W.hasOwnProperty,Y=RegExp("^"+V.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function z(e){return!(!w(e)||(t=e,F&&F in t))&&(P(e)?Y:j).test(G(e));var t}function $(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return z(r)?r:void 0}var K=$(y,"WeakMap");var X=Date.now;var q,Z,J,Q=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),ee=Q?function(e,t){return Q(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:U,te=(q=ee,Z=0,J=0,function(){var e=X(),t=16-(e-J);if(J=e,t>0){if(++Z>=800)return arguments[0]}else Z=0;return q.apply(void 0,arguments)});var re=/^(?:0|[1-9]\d*)$/;function ie(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&re.test(e))&&e>-1&&e%1==0&&e<t}function oe(e,t,r){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function ae(e,t){return e===t||e!=e&&t!=t}var ne=Object.prototype.hasOwnProperty;function se(e,t,r){var i=e[t];ne.call(e,t)&&ae(i,r)&&(void 0!==r||t in e)||oe(e,t,r)}var ce=Math.max;function le(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ue(e){return null!=e&&le(e.length)&&!P(e)}var he=Object.prototype;function pe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function fe(e){return L(e)&&"[object Arguments]"==S(e)}var _e=Object.prototype,de=_e.hasOwnProperty,ye=_e.propertyIsEnumerable,Ae=fe(/* @__PURE__ */function(){return arguments}())?fe:function(e){return L(e)&&de.call(e,"callee")&&!ye.call(e,"callee")};var ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ee=ge&&"object"==typeof module&&module&&!module.nodeType&&module,Re=Ee&&Ee.exports===ge?y.Buffer:void 0,Ie=(Re?Re.isBuffer:void 0)||function(){return!1},me={};function Te(e){return function(t){return e(t)}}me["[object Float32Array]"]=me["[object Float64Array]"]=me["[object Int8Array]"]=me["[object Int16Array]"]=me["[object Int32Array]"]=me["[object Uint8Array]"]=me["[object Uint8ClampedArray]"]=me["[object Uint16Array]"]=me["[object Uint32Array]"]=!0,me["[object Arguments]"]=me["[object Array]"]=me["[object ArrayBuffer]"]=me["[object Boolean]"]=me["[object DataView]"]=me["[object Date]"]=me["[object Error]"]=me["[object Function]"]=me["[object Map]"]=me["[object Number]"]=me["[object Object]"]=me["[object RegExp]"]=me["[object Set]"]=me["[object String]"]=me["[object WeakMap]"]=!1;var Se="object"==typeof exports&&exports&&!exports.nodeType&&exports,Le=Se&&"object"==typeof module&&module&&!module.nodeType&&module,be=Le&&Le.exports===Se&&_.process,Oe=function(){try{var e=Le&&Le.require&&Le.require("util").types;return e||be&&be.binding&&be.binding("util")}catch(t){}}(),Ne=Oe&&Oe.isTypedArray,ve=Ne?Te(Ne):function(e){return L(e)&&le(e.length)&&!!me[S(e)]},Ce=Object.prototype.hasOwnProperty;function Me(e,t){var r=N(e),i=!r&&Ae(e),o=!r&&!i&&Ie(e),a=!r&&!i&&!o&&ve(e),n=r||i||o||a,s=n?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],c=s.length;for(var l in e)!t&&!Ce.call(e,l)||n&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ie(l,c))||s.push(l);return s}function we(e,t){return function(r){return e(t(r))}}var Ue=we(Object.keys,Object),Pe=Object.prototype.hasOwnProperty;function De(e){if(!pe(e))return Ue(e);var t=[];for(var r in Object(e))Pe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function xe(e){return ue(e)?Me(e):De(e)}var Fe=Object.prototype.hasOwnProperty;function He(e){if(!w(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=pe(e),r=[];for(var i in e)("constructor"!=i||!t&&Fe.call(e,i))&&r.push(i);return r}function Ge(e){return ue(e)?Me(e,!0):He(e)}var je=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;function We(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!b(e))||(Be.test(e)||!je.test(e)||null!=t&&e in Object(t))}var Ve=$(Object,"create");var ke=Object.prototype.hasOwnProperty;var Ye=Object.prototype.hasOwnProperty;function ze(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function $e(e,t){for(var r=e.length;r--;)if(ae(e[r][0],t))return r;return-1}ze.prototype.clear=function(){this.__data__=Ve?Ve(null):{},this.size=0},ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ze.prototype.get=function(e){var t=this.__data__;if(Ve){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ke.call(t,e)?t[e]:void 0},ze.prototype.has=function(e){var t=this.__data__;return Ve?void 0!==t[e]:Ye.call(t,e)},ze.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ve&&void 0===t?"__lodash_hash_undefined__":t,this};var Ke=Array.prototype.splice;function Xe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Xe.prototype.clear=function(){this.__data__=[],this.size=0},Xe.prototype.delete=function(e){var t=this.__data__,r=$e(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ke.call(t,r,1),--this.size,!0)},Xe.prototype.get=function(e){var t=this.__data__,r=$e(t,e);return r<0?void 0:t[r][1]},Xe.prototype.has=function(e){return $e(this.__data__,e)>-1},Xe.prototype.set=function(e,t){var r=this.__data__,i=$e(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var qe=$(y,"Map");function Ze(e,t){var r,i,o=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Je(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Je.prototype.clear=function(){this.size=0,this.__data__={hash:new ze,map:new(qe||Xe),string:new ze}},Je.prototype.delete=function(e){var t=Ze(this,e).delete(e);return this.size-=t?1:0,t},Je.prototype.get=function(e){return Ze(this,e).get(e)},Je.prototype.has=function(e){return Ze(this,e).has(e)},Je.prototype.set=function(e,t){var r=Ze(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this};function Qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var i=arguments,o=t?t.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);var n=e.apply(this,i);return r.cache=a.set(o,n)||a,n};return r.cache=new(Qe.Cache||Je),r}Qe.Cache=Je;var et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/\\(\\)?/g,rt=function(e){var t=Qe(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(et,function(e,r,i,o){t.push(i?o.replace(tt,"$1"):r||e)}),t});function it(e,t){return N(e)?e:We(e,t)?[e]:rt(function(e){return null==e?"":M(e)}(e))}function ot(e){if("string"==typeof e||b(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function at(e,t){for(var r=0,i=(t=it(t,e)).length;null!=e&&r<i;)e=e[ot(t[r++])];return r&&r==i?e:void 0}function nt(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}var st=A?A.isConcatSpreadable:void 0;function ct(e){return N(e)||Ae(e)||!!(st&&e&&e[st])}function lt(e){return(null==e?0:e.length)?function(e,t,r,i,o){var a=-1,n=e.length;for(r||(r=ct),o||(o=[]);++a<n;){var s=e[a];r(s)?nt(o,s):o[o.length]=s}return o}(e):[]}var ut=we(Object.getPrototypeOf,Object),ht=Function.prototype,pt=Object.prototype,ft=ht.toString,_t=pt.hasOwnProperty,dt=ft.call(Object);function yt(e){var t=this.__data__=new Xe(e);this.size=t.size}yt.prototype.clear=function(){this.__data__=new Xe,this.size=0},yt.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},yt.prototype.get=function(e){return this.__data__.get(e)},yt.prototype.has=function(e){return this.__data__.has(e)},yt.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Xe){var i=r.__data__;if(!qe||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Je(i)}return r.set(e,t),this.size=r.size,this};var At="object"==typeof exports&&exports&&!exports.nodeType&&exports,gt=At&&"object"==typeof module&&module&&!module.nodeType&&module,Et=gt&&gt.exports===At?y.Buffer:void 0;function Rt(){return[]}Et&&Et.allocUnsafe;var It=Object.prototype.propertyIsEnumerable,mt=Object.getOwnPropertySymbols,Tt=mt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,i=null==e?0:e.length,o=0,a=[];++r<i;){var n=e[r];t(n,r,e)&&(a[o++]=n)}return a}(mt(e),function(t){return It.call(e,t)}))}:Rt,St=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)nt(t,Tt(e)),e=ut(e);return t}:Rt;function Lt(e,t,r){var i=t(e);return N(e)?i:nt(i,r(e))}function bt(e){return Lt(e,xe,Tt)}function Ot(e){return Lt(e,Ge,St)}var Nt=$(y,"DataView"),vt=$(y,"Promise"),Ct=$(y,"Set"),Mt="[object Map]",wt="[object Promise]",Ut="[object Set]",Pt="[object WeakMap]",Dt="[object DataView]",xt=G(Nt),Ft=G(qe),Ht=G(vt),Gt=G(Ct),jt=G(K),Bt=S;(Nt&&Bt(new Nt(new ArrayBuffer(1)))!=Dt||qe&&Bt(new qe)!=Mt||vt&&Bt(vt.resolve())!=wt||Ct&&Bt(new Ct)!=Ut||K&&Bt(new K)!=Pt)&&(Bt=function(e){var t=S(e),r="[object Object]"==t?e.constructor:void 0,i=r?G(r):"";if(i)switch(i){case xt:return Dt;case Ft:return Mt;case Ht:return wt;case Gt:return Ut;case jt:return Pt}return t});var Wt=Object.prototype.hasOwnProperty;var Vt=y.Uint8Array;function kt(e){var t=new e.constructor(e.byteLength);return new Vt(t).set(new Vt(e)),t}var Yt=/\w*$/;var zt=A?A.prototype:void 0,$t=zt?zt.valueOf:void 0;function Kt(e,t,r){var i,o,a,n,s,c=e.constructor;switch(t){case"[object ArrayBuffer]":return kt(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return s=kt((n=e).buffer),new n.constructor(s,n.byteOffset,n.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=kt(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return(a=new(o=e).constructor(o.source,Yt.exec(o))).lastIndex=o.lastIndex,a;case"[object Symbol]":return i=e,$t?Object($t.call(i)):{}}}var Xt=Oe&&Oe.isMap,qt=Xt?Te(Xt):function(e){return L(e)&&"[object Map]"==Bt(e)};var Zt=Oe&&Oe.isSet,Jt=Zt?Te(Zt):function(e){return L(e)&&"[object Set]"==Bt(e)},Qt="[object Arguments]",er="[object Function]",tr="[object Object]",rr={};function ir(e,t,r,i,o,a){var n;if(r&&(n=o?r(e,i,o,a):r(e)),void 0!==n)return n;if(!w(e))return e;var s=N(e);if(s)n=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Wt.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e);else{var c=Bt(e),l=c==er||"[object GeneratorFunction]"==c;if(Ie(e))return e.slice();if(c==tr||c==Qt||l&&!o)n={};else{if(!rr[c])return o?e:{};n=Kt(e,c)}}a||(a=new yt);var u=a.get(e);if(u)return u;a.set(e,n),Jt(e)?e.forEach(function(i){n.add(ir(i,t,r,i,e,a))}):qt(e)&&e.forEach(function(i,o){n.set(o,ir(i,t,r,o,e,a))});var h=s?void 0:Ot(e);return function(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););}(h||e,function(i,o){h&&(i=e[o=i]),se(n,o,ir(i,t,r,o,e,a))}),n}rr[Qt]=rr["[object Array]"]=rr["[object ArrayBuffer]"]=rr["[object DataView]"]=rr["[object Boolean]"]=rr["[object Date]"]=rr["[object Float32Array]"]=rr["[object Float64Array]"]=rr["[object Int8Array]"]=rr["[object Int16Array]"]=rr["[object Int32Array]"]=rr["[object Map]"]=rr["[object Number]"]=rr[tr]=rr["[object RegExp]"]=rr["[object Set]"]=rr["[object String]"]=rr["[object Symbol]"]=rr["[object Uint8Array]"]=rr["[object Uint8ClampedArray]"]=rr["[object Uint16Array]"]=rr["[object Uint32Array]"]=!0,rr["[object Error]"]=rr[er]=rr["[object WeakMap]"]=!1;function or(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Je;++t<r;)this.add(e[t])}function ar(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}or.prototype.add=or.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},or.prototype.has=function(e){return this.__data__.has(e)};function nr(e,t,r,i,o,a){var n=1&r,s=e.length,c=t.length;if(s!=c&&!(n&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var h=-1,p=!0,f=2&r?new or:void 0;for(a.set(e,t),a.set(t,e);++h<s;){var _=e[h],d=t[h];if(i)var y=n?i(d,_,h,t,e,a):i(_,d,h,e,t,a);if(void 0!==y){if(y)continue;p=!1;break}if(f){if(!ar(t,function(e,t){if(n=t,!f.has(n)&&(_===e||o(_,e,r,i,a)))return f.push(t);var n})){p=!1;break}}else if(_!==d&&!o(_,d,r,i,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var lr=A?A.prototype:void 0,ur=lr?lr.valueOf:void 0;var hr=Object.prototype.hasOwnProperty;var pr="[object Arguments]",fr="[object Array]",_r="[object Object]",dr=Object.prototype.hasOwnProperty;function yr(e,t,r,i,o,a){var n=N(e),s=N(t),c=n?fr:Bt(e),l=s?fr:Bt(t),u=(c=c==pr?_r:c)==_r,h=(l=l==pr?_r:l)==_r,p=c==l;if(p&&Ie(e)){if(!Ie(t))return!1;n=!0,u=!1}if(p&&!u)return a||(a=new yt),n||ve(e)?nr(e,t,r,i,o,a):function(e,t,r,i,o,a,n){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new Vt(e),new Vt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=sr;case"[object Set]":var c=1&i;if(s||(s=cr),e.size!=t.size&&!c)return!1;var l=n.get(e);if(l)return l==t;i|=2,n.set(e,t);var u=nr(s(e),s(t),i,o,a,n);return n.delete(e),u;case"[object Symbol]":if(ur)return ur.call(e)==ur.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var f=u&&dr.call(e,"__wrapped__"),_=h&&dr.call(t,"__wrapped__");if(f||_){var d=f?e.value():e,y=_?t.value():t;return a||(a=new yt),o(d,y,r,i,a)}}return!!p&&(a||(a=new yt),function(e,t,r,i,o,a){var n=1&r,s=bt(e),c=s.length;if(c!=bt(t).length&&!n)return!1;for(var l=c;l--;){var u=s[l];if(!(n?u in t:hr.call(t,u)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var f=!0;a.set(e,t),a.set(t,e);for(var _=n;++l<c;){var d=e[u=s[l]],y=t[u];if(i)var A=n?i(y,d,u,t,e,a):i(d,y,u,e,t,a);if(!(void 0===A?d===y||o(d,y,r,i,a):A)){f=!1;break}_||(_="constructor"==u)}if(f&&!_){var g=e.constructor,E=t.constructor;g==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof E&&E instanceof E||(f=!1)}return a.delete(e),a.delete(t),f}(e,t,r,i,o,a))}function Ar(e,t,r,i,o){return e===t||(null==e||null==t||!L(e)&&!L(t)?e!=e&&t!=t:yr(e,t,r,i,Ar,o))}function gr(e){return e==e&&!w(e)}function Er(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function Rr(e){var t=function(e){for(var t=xe(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,gr(o)]}return t}(e);return 1==t.length&&t[0][2]?Er(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,i){var o=r.length,a=o;if(null==e)return!a;for(e=Object(e);o--;){var n=r[o];if(n[2]?n[1]!==e[n[0]]:!(n[0]in e))return!1}for(;++o<a;){var s=(n=r[o])[0],c=e[s],l=n[1];if(n[2]){if(void 0===c&&!(s in e))return!1}else if(!Ar(l,c,3,i,new yt))return!1}return!0}(r,0,t)}}function Ir(e,t){return null!=e&&t in Object(e)}function mr(e,t){return null!=e&&function(e,t,r){for(var i=-1,o=(t=it(t,e)).length,a=!1;++i<o;){var n=ot(t[i]);if(!(a=null!=e&&r(e,n)))break;e=e[n]}return a||++i!=o?a:!!(o=null==e?0:e.length)&&le(o)&&ie(n,o)&&(N(e)||Ae(e))}(e,t,Ir)}function Tr(e,t){return We(e)&&gr(t)?Er(ot(e),t):function(r){var i=function(e,t,r){var i=null==e?void 0:at(e,t);return void 0===i?r:i}(r,e);return void 0===i&&i===t?mr(r,e):Ar(t,i,3)}}function Sr(e){return We(e)?(t=ot(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return at(t,e)}}(e);var t}function Lr(e){return"function"==typeof e?e:null==e?U:"object"==typeof e?N(e)?Tr(e[0],e[1]):Rr(e):Sr(e)}function br(e,t){return t.length<2?e:at(e,function(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++i<o;)a[i]=e[i+t];return a}(t,0,-1))}var Or=Object.prototype.hasOwnProperty;function Nr(e){if(null==e)return!0;if(ue(e)&&(N(e)||"string"==typeof e||"function"==typeof e.splice||Ie(e)||ve(e)||Ae(e)))return!e.length;var t=Bt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(pe(e))return!De(e).length;for(var r in e)if(Or.call(e,r))return!1;return!0}function vr(e,t){return Ar(e,t)}function Cr(e){return null==e}var Mr=Object.prototype.hasOwnProperty;function wr(e,t){var r=-1,i=(t=it(t,e)).length;if(!i)return!0;for(var o=null==e||"object"!=typeof e&&"function"!=typeof e;++r<i;){var a=t[r];if("string"==typeof a){if("__proto__"===a&&!Mr.call(e,"__proto__"))return!1;if("constructor"===a&&r+1<i&&"string"==typeof t[r+1]&&"prototype"===t[r+1]){if(o&&0===r)continue;return!1}}}var n=br(e,t);return null==n||delete n[ot(function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t))]}function Ur(e){return function(e){if(!L(e)||"[object Object]"!=S(e))return!1;var t=ut(e);if(null===t)return!0;var r=_t.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ft.call(r)==dt}(e)?void 0:e}var Pr=function(e){return te(function(e,t,r){return t=ce(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=ce(i.length-t,0),n=Array(a);++o<a;)n[o]=i[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=i[o];return s[t]=r(n),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,void 0,lt),e+"")}(function(e,t){var r={};if(null==e)return r;var i=!1;t=O(t,function(t){return t=it(t,e),i||(i=t.length>1),t}),function(e,t,r){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var n=t[o],s=void 0;void 0===s&&(s=e[n]),i?oe(r,n,s):se(r,n,s)}}(e,Ot(e),r),i&&(r=ir(r,7,Ur));for(var o=t.length;o--;)wr(r,t[o]);return r});function Dr(e,t,r,i){if(!w(e))return e;for(var o=-1,a=(t=it(t,e)).length,n=a-1,s=e;null!=s&&++o<a;){var c=ot(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=n){var u=s[c];void 0===(l=void 0)&&(l=w(u)?u:ie(t[o+1])?[]:{})}se(s,c,l),s=s[c]}return e}function xr(e,t){if(null==e)return{};var r=O(Ot(e),function(e){return[e]});return t=Lr(t),function(e,t,r){for(var i=-1,o=t.length,a={};++i<o;){var n=t[i],s=at(e,n);r(s,n)&&Dr(a,it(n,e),s)}return a}(e,r,function(e,r){return t(e,r[0])})}function Fr(e,t){return xr(e,function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(Lr(t)))}var Hr=Array.prototype.splice;function Gr(e,t){var r=[];if(!e||!e.length)return r;var i=-1,o=[],a=e.length;for(t=Lr(t);++i<a;){var n=e[i];t(n,i,e)&&(r.push(n),o.push(i))}return function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var o=t[r];if(r==i||o!==a){var a=o;ie(o)?Hr.call(e,o,1):wr(e,o)}}}(e,o),r}const jr=e=>new Error(`Trying to ${e} while it is not in the map style. Did you exclude it when loading the map?`),Br=()=>"undefined"!=typeof document&&"undefined"!=typeof DOMParser&&"undefined"!=typeof btoa,Wr=e=>{if(!Br())return;const t=document.createElement("img");return t.src=`data:image/svg+xml;base64,${btoa((new XMLSerializer).serializeToString(e))}`,t},Vr=e=>(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,kr=e=>{const t=Vr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path id="background" d="M63.95 137.516c6.556-12.737 19.098-21.09 30.828-29.388C110.046 97.324 120 79.603 120 59.574 120 26.671 93.138 0 60 0S0 26.671 0 59.574c0 20.029 9.954 37.75 25.22 48.55 11.734 8.302 24.274 16.652 30.83 29.388 1.706 3.316 6.194 3.316 7.9 0z"\n fill="#1988cf"/>\n <path id="outline" d="M91.298 103.272C105.052 93.544 114 77.596 114 59.574c0-29.61-24.176-53.617-54-53.617S6 29.964 6 59.574c0 18.022 8.95 33.97 22.7 43.698l2.27 1.601c10.172 7.153 21.922 15.423 29.03 27.416 7.104-11.993 18.858-20.259 29.03-27.416l2.268-1.601zm1.468 6.274c-11.13 7.845-22.632 15.957-28.816 27.966-1.706 3.316-6.194 3.316-7.9 0-6.182-12.009-17.686-20.121-28.816-27.966l-2.016-1.422C9.954 97.324 0 79.603 0 59.574 0 26.671 26.862 0 60 0s60 26.671 60 59.574c0 20.029-9.954 37.75-25.222 48.55l-2.016 1.422z"\n fill-opacity=".3"/>\n</svg>\n');return e?.fillColor&&t.querySelector("#background")?.setAttribute("fill",e.fillColor),e?.outlineColor&&t.querySelector("#outline")?.setAttribute("fill",e.outlineColor),void 0!==e?.outlineOpacity&&t.querySelector("#outline")?.setAttribute("fill-opacity",e.outlineOpacity.toString()),t};const Yr=e=>(function(e){if(Cr(e))throw new Error(`${e} must not be null/undefined. Something went wrong with its initialization.`)}(e),e);class zr{constructor(e,t,r){this.id=e,this.spec=t,this.runtimeSource=r}ensureAddedToMap(e){this.runtimeSource||(!e.getSource(this.id)&&this.spec&&e.addSource(this.id,this.spec),this.runtimeSource=e.getSource(this.id))}}class $r{constructor(e,t,r){this.map=e,this.source=t,this._layerSpecs=r,this._updateSourceAndLayerIDs()}isAnyLayerVisible(e){return this.getLayerSpecs(e).some(e=>this.isLayerVisible(e))}areAllLayersVisible(e){return this.getLayerSpecs(e).every(e=>this.isLayerVisible(e))}getLayerSpecs(e){return e?this._layerSpecs.filter(e):this._layerSpecs}_updateSourceAndLayerIDs(){this._sourceAndLayerIDs={sourceID:this.source.id,layerIDs:this._layerSpecs.map(e=>e.id)}}isLayerVisible(e){return"none"!==this.map.getLayoutProperty(e.id,"visibility")}setLayersVisible(e,t){for(const r of this.getLayerSpecs(t))this.map.setLayoutProperty(r.id,"visibility",e?"visible":"none",{validate:!1})}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}equalSourceAndLayerIDs(e){return this.sourceAndLayerIDs.sourceID===e.sourceAndLayerIDs.sourceID&&this.sourceAndLayerIDs.layerIDs.length===e.sourceAndLayerIDs.layerIDs.length&&this.sourceAndLayerIDs.layerIDs.every((t,r)=>t===e.sourceAndLayerIDs.layerIDs[r])}}const Kr=(e,t)=>e.getStyle().layers.filter(e=>t.includes(e?.source));class Xr extends $r{constructor(e,t,r){let i=Kr(e,[t.id]);r&&(i=i.filter(r)),super(e,new zr(t.id,e.getStyle().sources[t.id],t),i)}}class qr extends $r{constructor(e,t,r,i){super(e,new zr(t,r),i.map(e=>({...e,source:t})))}ensureLayersAddedToMap(){for(const e of this._layerSpecs)this.map.getLayer(e.id)||this.map.addLayer(e,e.beforeID)}ensureAddedToMapWithVisibility(e,t){this.source.ensureAddedToMap(this.map),t&&(this.ensureLayersAddedToMap(),this.setLayersVisible(e))}}const Zr={type:"FeatureCollection",features:[]};class Jr extends qr{constructor(e,t,r,i=!0){super(e,t,{type:"geojson",data:Zr,promoteId:"id"},r),this.shownFeatures=Zr,this.ensureAddedToMapWithVisibility(!1,i)}show(e){this.shownFeatures=e,Yr(this.source.runtimeSource).setData(e),this.setLayersVisible(!!e.features.length)}clear(){this.show(Zr)}findFeature(e){return"index"in e?this.shownFeatures.features[e.index]:"id"in e?this.shownFeatures.features.find(t=>t.id===e.id):void 0}putEventState(e){if("put"===(e.mode??"put"))for(const r of this.shownFeatures.features)r.properties?.eventState===e.state&&delete r.properties.eventState;const t=this.findFeature(e);t&&(t.properties={...t.properties,eventState:e.state}),!1!==e.show&&this.show(this.shownFeatures)}cleanEventState(e){const t=this.findFeature(e);t?.properties?.eventState&&(delete t?.properties?.eventState,!1!==e?.show&&this.show(this.shownFeatures))}cleanEventStates(e){let t=!1;for(const r of this.shownFeatures.features)e?.states&&!e.states.includes(r.properties?.eventState)||(delete r.properties?.eventState,t=!0);!1!==e?.show&&t&&this.show(this.shownFeatures)}}const Qr=async e=>{e.mapReady||(await e.mapLibreMap.once("styledata"),await Qr(e))},ei=e=>{for(const r of e)if(r&&Object.keys(r.properties).length)for(const e in r.properties)if("string"==typeof r.properties[e])try{r.properties[e]=JSON.parse(r.properties[e])}catch(t){}},ti=(e,t,r)=>{const i=e.id;e.maxzoom===t.maxzoom&&e.minzoom===t.minzoom||r.setLayerZoomRange(i,e.minzoom??r.getMinZoom(),e.maxzoom??r.getMaxZoom()),r.setFilter(i,e.filter,{validate:!1});for(const o of Object.keys(t.layout??[]))e.layout?.[o]||r.setLayoutProperty(i,o,void 0,{validate:!1});for(const o of Object.keys(t.paint??[]))e.paint?.[o]||r.setPaintProperty(i,o,void 0,{validate:!1});for(const[o,a]of Object.entries(e.paint??[]))r.setPaintProperty(i,o,a,{validate:!1});for(const[o,a]of Object.entries(e.layout??[]))r.setLayoutProperty(i,o,a,{validate:!1})},ri=(e,t,r)=>{e.forEach((e,i)=>ti(e,t[i],r))},ii=(e,t)=>{const r=/* @__PURE__ */new Set,i=e=>{t.getLayer(e.id)||t.addLayer({...e,layout:{...e.layout,visibility:"none"}},e.beforeID),r.add(e.id)},o={};for(e.forEach(e=>{e.beforeID?r.has(e.beforeID)||t.getLayer(e.beforeID)?(r.add(e.beforeID),i(e)):o[e.beforeID]?o[e.beforeID].push(e):o[e.beforeID]=[e]:i(e)});Object.keys(o).length>0;){const e=Object.keys(o).filter(e=>r.has(e));if(!e.length)return void console.error(`Some layers cannot be added. Check for non-existing layers, or circular beforeID dependencies for the following: ${JSON.stringify(Object.keys(o))}`);e.forEach(e=>{o[e].forEach(e=>i(e)),delete o[e]})}},oi=(e,t)=>{switch(typeof e){case"undefined":return{type:"standard",include:[t]};case"string":return{type:"standard",id:e,include:[t]};default:if("standard"===e.type)return e.include?{...e,include:[...e.include,t]}:{...e,include:[t]};throw(e=>new Error(`Trying to add style module ${e} to the custom style!`))(t)}},ai=async(e,t,r)=>{if(!e.mapLibreMap.getSource(t)){const i=e.mapLibreMap;i.isStyleLoaded()||await i.once("idle"),e.setStyle(oi(e.getStyle(),r)),await(async(e,t)=>{e.mapLibreMap.getSource(t)&&e.mapLibreMap.isSourceLoaded(t)||await e.mapLibreMap.once("sourcedata")})(e,t),await i.once("styledata");for(const e of Kr(i,[t]))i.setLayoutProperty(e.id,"visibility","none",{validate:!1});await i.once("styledata")}},ni=async(e,t,r,i,o)=>{if(!r)return void console.warn(`addOrUpdateImage called with empty image for ID ${t}`);const a=e=>{i.hasImage(t)||i.addImage(t,e,o)},n=e=>{e.complete?e.naturalWidth>0?a(e):console.warn(`Failed to load image for ID ${t}`):(e.onload=()=>a(e),e.onerror=()=>console.warn(`Failed to load image for ID ${t}`))};if("string"==typeof r)if(r.includes("<svg")){n(Wr(Vr(r)))}else a((await i.loadImage(r)).data);else n(r)},si=e=>{switch(e){case"standardDark":case"drivingDark":case"monoDark":case"satellite":return"dark";default:return"light"}},ci=e=>{if("string"==typeof e)return si(e);const t=e;return t?.id?si(t.id):"light"};class li{constructor(e,t,r){this._initializing=!0,this.moduleReady=!1,this.sourceType=e,this.tomtomMap=t,this.eventsProxy=t._eventsProxy,this.mapLibreMap=t.mapLibreMap,this.initSourcesWithLayers(r),this.applyConfig(r),this.tomtomMap.addStyleChangeHandler({onStyleAboutToChange:()=>{this.moduleReady=!1},onStyleChanged:()=>this.restoreDataAndConfig()}),this._initializing=!1}initSourcesWithLayers(e,t){this.moduleReady=!1,this.sourcesWithLayers=this._initSourcesWithLayers(e,t),this._sourceAndLayerIDs=Object.fromEntries(Object.entries(this.sourcesWithLayers).map(([e,t])=>[e,t.sourceAndLayerIDs])),t&&this.eventsProxy.updateIfRegistered(this.sourcesWithLayers),this.tomtomMap.mapReady&&(this.moduleReady=!0)}async waitUntilModuleReady(){await Qr(this.tomtomMap),this.moduleReady||await new Promise(e=>{const t=setInterval(()=>{this.tomtomMap.mapReady&&this.moduleReady&&(clearInterval(t),e())},200)})}applyConfig(e){this.config=this._applyConfig(e)}resetConfig(){this.applyConfig(void 0)}async restoreDataAndConfig(){this.moduleReady=!1,"geojson"===this.sourceType?setTimeout(()=>this.restoreDataAndConfigImpl(),400):this.restoreDataAndConfigImpl()}restoreDataAndConfigImpl(){this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config)}getConfig(){return this.config&&{...this.config}}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}}class ui{constructor(e,t,r){this.eventProxy=e,this.sourceWithLayers=t,this.config=r}on(e,t){this.eventProxy.addEventHandler(this.sourceWithLayers,t,e,this.config)}off(e){this.eventProxy.remove(this.sourceWithLayers,e)}}class hi{constructor(){this.interactiveLayerIDs=[],this.handlers={},this.findHandlers=(e,t,r)=>t&&r&&e.flatMap(e=>{const i=this.handlers[t]?.[e];return 1===i?.length?i:this.handlers[t]?.[e]?.filter(e=>e.layerIDs.includes(r))||[]})||[]}ensureInteractiveLayerIDsAdded(e){e._layerSpecs.forEach(e=>{this.interactiveLayerIDs.includes(e.id)||this.interactiveLayerIDs.push(e.id)})}addEventHandler(e,t,r,i){this.ensureInteractiveLayerIDsAdded(e);const o=e.source.id;this.handlers[o]||(this.handlers[o]={[r]:[]}),this.handlers[o][r]??=[],this.handlers[o][r]?.push({sourceWithLayers:e,layerIDs:e._layerSpecs.map(e=>e.id),fn:t,config:i})}remove(e,t){const r=this.handlers[e.source.id]?.[t];r&&(Gr(r,t=>{return r=e._layerSpecs,t.layerIDs.every((e,t)=>e===r[t].id);var r}),r.length||(delete this.handlers[e.source.id]?.[t],Nr(this.handlers[e.source.id])&&delete this.handlers[e.source.id]));for(const i of e._layerSpecs)Gr(this.interactiveLayerIDs,e=>i.id===e)}removeAll(){this.interactiveLayerIDs=[],this.handlers={}}hasSourceID(e){return!!this.handlers[e]}updateIfRegistered(e){for(const t of Object.values(e)){const e=this.handlers[t.source.id];if(e)for(const r of Object.values(e))for(const e of r)t.equalSourceAndLayerIDs(e.sourceWithLayers)&&(e.sourceWithLayers=t)}}}const pi=e=>"click"===e||"contextmenu"===e,fi=(e,t,r,i="updateInProps")=>{const{feature:o,index:a}=((e,t)=>{for(let r=0;r<e.length;r++){const i=e[r];if(i.id===t)return{feature:i,index:r}}})(r,t)||{};if(o&&(!pi(o.properties?.eventState)||pi(e))){const t={...o,properties:"updateInProps"===i?{...o?.properties,eventState:e}:Pr(o?.properties,"eventState")};return r.splice(a,1,t),a}},_i=(e,t,r)=>{const i=[...r.shownFeatures.features];Cr(fi(e,t.id,i,"removeFromProps"))||r.show({...r.shownFeatures,features:i})},di=(e,t,r,i,o)=>{if(t&&i instanceof Jr){const s=[...i.shownFeatures.features],c=fi(e,t.id,s);return!r||(n=t,(a=r)&&n&&a.id===n.id)||(o===i?fi(e,r.id,s,"removeFromProps"):o instanceof Jr&&_i(e,r,o)),i.show({...i.shownFeatures,features:s}),{feature:s[c],index:c}}var a,n;return r&&o instanceof Jr&&_i(e,r,o),{feature:t}},yi={precisionMode:"box",paddingBoxPx:5,cursorOnHover:"pointer",cursorOnMouseDown:"grabbing",cursorOnMap:"default",longHoverDelayAfterMapMoveMS:800,longHoverDelayOnStillMapMS:300};class Ai extends hi{constructor(e,t={}){super(),this.enabled=!0,this.firstDelayedHoverSinceMapMove=!0,this.map=e,this.mapCanvas=e.getCanvas(),this.config={...yi,...t},this.mapCanvas.style.cursor=this.config.cursorOnMap,this.lastCursorStyle=this.config.cursorOnMap,this.listenToEvents()}listenToEvents(){this.map.on("mousemove",e=>this.onMouseMove(e)),this.map.on("movestart",()=>this.onMouseStart()),this.map.on("mouseout",()=>this.onMouseOut()),this.map.on("mouseover",e=>this.onMouseMove(e)),this.map.on("mousedown",()=>this.onMouseDown()),this.map.on("mouseup",()=>this.onMouseUp()),this.map.on("click",e=>this.onMapClick("click",e)),this.map.on("contextmenu",e=>this.onMapClick("contextmenu",e))}enable(e){this.enabled=e,e||this.clearLongHoverTimeout()}toPaddedBounds(e){const t=this.config.paddingBoxPx;return[[e.x-t,e.y+t],[e.x+t,e.y-t]]}isEnabled(){return this.enabled&&!this.map.isMoving()}getRenderedFeatures(e){if(!this.interactiveLayerIDs.length)return[];const t={layers:this.interactiveLayerIDs,validate:!1},r=this.config.precisionMode,i="point-then-box"===r||"point"===r?this.map.queryRenderedFeatures(e,t):[];return i.length||"point"===r?i:this.map.queryRenderedFeatures(this.toPaddedBounds(e),t)}clearLongHoverTimeout(){window.clearTimeout(this.longHoverTimeoutHandlerID)}restartLongHoverTimeout(){this.clearLongHoverTimeout(),this.longHoverTimeoutHandlerID=window.setTimeout(()=>this.handleLongHoverTimeout(),this.firstDelayedHoverSinceMapMove?this.config.longHoverDelayAfterMapMoveMS:this.config.longHoverDelayOnStillMapMS)}handleLongHoverTimeout(){if(this.firstDelayedHoverSinceMapMove=!1,this.hoveringSourceWithLayers){const e=di("long-hover",this.hoveringFeature,void 0,this.hoveringSourceWithLayers,void 0);this.findHandlers(["long-hover"],this.hoveringFeature?.source,this.hoveringFeature?.layer.id).forEach(t=>t.fn(e.feature,this.hoveringLngLat,this.hoveringFeatures,this.hoveringSourceWithLayers))}}onMouseStart(){this.firstDelayedHoverSinceMapMove=!0,this.clearLongHoverTimeout()}onMouseOut(){this.clearLongHoverTimeout()}onMouseDown(){this.lastCursorStyle=this.mapCanvas.style.cursor,this.mapCanvas.style.cursor=this.config.cursorOnMouseDown}onMouseUp(){this.mapCanvas.style.cursor=this.lastCursorStyle}onMouseMove(e){if(!this.isEnabled())return;this.hoveringFeatures=this.getRenderedFeatures(e.point),ei(this.hoveringFeatures);const[t]=this.hoveringFeatures;if(t&&!this.hasSourceID(t.source))return;const{hoverChanged:r,mouseInMotionOverHoveredFeature:i}=((e,t,r,i)=>{if(t){if(!i)return{hoverChanged:!0};if(t.id&&t.id!==i.id||t.properties.id&&t.properties.id!==i.properties.id||t.source!==i.source||t.layer.id!==i.layer.id)return{hoverChanged:!0};if(r&&(e.x-r.x!=0||e.y-r.y!=0))return{mouseInMotionOverHoveredFeature:!0}}else if(i)return{hoverChanged:!0};return{}})(e.point,t,this.hoveringPoint,this.hoveringFeature);if(r||i){this.hoveringLngLat=e.lngLat,this.hoveringPoint=e.point;const i=this.hoveringFeature;this.hoveringFeature=t;const o=this.hoveringSourceWithLayers,a=this.findHandlers(["hover","long-hover","click","contextmenu"],t?.source,t?.layer.id)?.[0];if(this.hoveringSourceWithLayers=a?.sourceWithLayers,r){this.updateHoverCursor(a?.config);const r=di("hover",this.hoveringFeature,i,this.hoveringSourceWithLayers,o),n=this.findHandlers(["hover"],t?.source,t?.layer.id);for(const t of n)t.fn(r.feature,e.lngLat,this.hoveringFeatures,this.hoveringSourceWithLayers)}this.restartLongHoverTimeout()}}updateHoverCursor(e){this.hoveringFeature?this.mapCanvas.style.cursor=e?.cursorOnHover??this.config.cursorOnHover:this.mapCanvas.style.cursor=this.config.cursorOnMap}onMapClick(e,t){if(!this.isEnabled())return;const r=this.getRenderedFeatures(t.point);ei(r);const i=this.lastClickedFeature;this.lastClickedFeature=r[0];const o=this.lastClickedSourceWithLayers,a=this.findHandlers([e],this.lastClickedFeature?.source,this.lastClickedFeature?.layer.id);this.lastClickedSourceWithLayers=a?.[0]?.sourceWithLayers;const n=di(e,this.lastClickedFeature,i,this.lastClickedSourceWithLayers,o);for(const s of a)s.fn(n.feature,t.lngLat,r,this.lastClickedSourceWithLayers)}}const gi={country:"Places - Country name",lowestPlaceLabel:"Places - Village / Hamlet",poi:"POI",lowestLabel:"Borders - Treaty label",lowestRoadLine:"Tunnel - Railway outline",lowestBuilding:"Buildings - Underground"},Ei="vectorTiles",Ri="hillshade",Ii="vectorTiles",mi="vectorTilesIncidents",Ti="vectorTilesFlow",Si=["POI","POI - Micro"],Li={ACCESS_GATEWAY:"border_control",ADVENTURE_SPORTS_FACILITY:"sport_facility",ADVENTURE_SPORTS_VENUE:"sport_facility",AGRICULTURE:"agriculture_business",AIRPORT:"airport",AMUSEMENT_PARK:"amusement_park",AQUATIC_ZOO:"zoo_or_aquarium",ASHRAM:"religious_site",ATM:"atm",AUTOMOTIVE_DEALER:"vehicle_dealer",BANK:"bank",BEACH:"beach",BUS_STOP:"bus_station",BUSINESS_PARK:"business",CAFE_PUB:"cafe",CAMPING_GROUND:"camping_ground",CAR_WASH:"vehicle_wash",CASH_DISPENSER:"atm",CASINO:"casino_and_gambling",CHURCH:"religious_site",CINEMA:"cinema",CLOTHING_SHOP:"clothing_shop",CLUB_ASSOCIATION:"club_and_association",COLLEGE_UNIVERSITY:"college_or_university",COMMERCIAL_BUILDING:"business",COMMUNITY_CENTER:"cultural_center",COMPANY:"company_or_office",CONCERT_HALL:"nightlife",COURTHOUSE:"courthouse",CULTURAL_CENTER:"cultural_center",DENTIST:"dentist",DEPARTMENT_STORE:"department_store",DOCTOR:"doctor",ELECTRIC_VEHICLE_STATION:"charging_location",EMBASSY:"institution_office",EMERGENCY_MEDICAL_SERVICE:"emergency",EMERGENCY_ROOM:"emergency",ENTERTAINMENT:"entertainment",EXCHANGE:"stock_exchange",EXHIBITION_CONVENTION_CENTER:"cultural_center",FERRY_TERMINAL:"ferry_terminal",FIRE_STATION_BRIGADE:"fire_station",FRONTIER_CROSSING:"border_control",FUEL_FACILITIES:"fuel_station",GAS_STATION:"fuel_station",GEOGRAPHIC_FEATURE:"geographic_feature",GOLD_EXCHANGE:"gold_exchange",GOLF_COURSE:"golf_course",GOVERNMENT_OFFICE:"institution_office",GURUDWARA:"religious_site",HEALTH_CARE_SERVICE:"healthcare_service",HELIPAD_HELICOPTER_LANDING:"heliport_or_helipad",HILL:"peak_high",HOLIDAY_RENTAL:"holiday_home",HOSPITAL:"hospital",HOSPITAL_POLYCLINIC:"hospital",HOTEL_MOTEL:"hotel_or_motel",ICE_SKATING_RINK:"winter_sports",IMPORTANT_TOURIST_ATTRACTION:"tourist_attraction",INDUSTRIAL_BUILDING:"industrial_facility",LEISURE_CENTER:"leisure",LIBRARY:"public_library",MANUFACTURING_FACILITY:"manufacturing_facility",MARINA:"marina",MARKET:"marketplace",MEDIA_FACILITY:"media_facility",MILITARY_INSTALLATION:"military_facility",MOSQUE:"religious_site",MOTORING_ORGANIZATION_OFFICE:"traffic_office",MOUNTAIN_PASS:"mountain_pass",MOUNTAIN_PEAK:"peak",MOVIE_THEATER:"cinema",MUSEUM:"museum",NATIVE_RESERVATION:"aboriginal_land",NIGHTLIFE:"nightlife",NON_GOVERNMENTAL_ORGANIZATION:"ngo_office",OPEN_PARKING_AREA:"parking_facility",OPERA_HOUSE:"theater",PAGODA:"religious_site",PARK_RECREATION_AREA:"park_and_recreation_area",PARKING_GARAGE:"parking_facility",PETROL_STATION:"fuel_station",PHARMACY:"pharmacy",PLACE_OF_WORSHIP:"religion",POLICE_STATION:"police_station",PORT_WAREHOUSE_FACILITY:"industrial_facility",POST_OFFICE:"post_office",PRIMARY_RESOURCE_UTILITY:"industrial_facility",PRISON_CORRECTIONAL_FACILITY:"prison",PUBLIC_AMENITY:"public_amenity",PUBLIC_TRANSPORT_STOP:"public_transport_stop",RAILWAY_STATION:"railway_station",RENT_A_CAR_FACILITY:"car_rental",RENT_A_CAR_PARKING:"rental_car_parking",REPAIR_FACILITY:"vehicle_repair",RESEARCH_FACILITY:"research_facility",RESIDENTIAL_ACCOMMODATION:"business",REST_AREA:"rest_area",RESTAURANT:"restaurant",RESTAURANT_AREA:"restaurant",SCENIC_PANORAMIC_VIEW:"viewpoint",SCHOOL:"education",SHOP:"shop_or_store",SHOPPING_CENTER:"shop_or_store",SPORTS_CENTER:"sport_facility",STADIUM:"stadium",SUPERMARKETS_HYPERMARKETS:"supermarket",SWIMMING_POOL:"swimming_pool",SYNAGOG:"religious_site",TAXI_STAND:"taxi_stand",TEMPLE:"religious_site",TENNIS_COURT:"sport_facility",THEATER:"theater",TOLL_GATE:"toll_gantry",TOURIST_INFORMATION_OFFICE:"tourist_information",TRAFFIC_CONTROL_DEPARTMENT:"traffic_office",TRAFFIC_SERVICE_CENTER:"traffic_office",TRAIL_SYSTEM:"trailhead",TRAILS:"trailhead",TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:"traffic_office",TRUCK_STOP:"truck_stop",VACATION_RENTAL:"holiday_home",VETERINARIAN:"veterinary",WATER_SPORT:"outdoor",WEIGH_STATION:"weighbridge",WELFARE_ORGANIZATION:"social_service",WINERY:"manufacturing_facility",ZOOS_ARBORETA_BOTANICAL_GARDEN:"zoo_or_aquarium"},bi={...Li,SECURED_ENTRANCE:"border_control",AGRICULTURAL_BUSINESS:"agriculture_business",FARM:"agriculture_business",HORTICULTURE:"agriculture_business",PRIMARY_PRODUCER:"agriculture_business",AIRFIELD:"airport",AIRLINE_ACCESS:"airport",MILITARY_AIRPORT:"airport",PRIVATE_AIRPORT:"airport",PUBLIC_AIRPORT:"airport",ATV_DEALER:"vehicle_dealer",BOAT_DEALER:"boat_dealer",BUS_DEALER:"vehicle_dealer",CAR_DEALER:"vehicle_dealer",MOTORCYCLE_DEALER:"vehicle_dealer",RECREATIONAL_VEHICLE_DEALER:"vehicle_dealer",TRUCK_DEALER:"vehicle_dealer",VAN_DEALER:"vehicle_dealer",DIVERSIFIED_FINANCIALS:"bank",SAVINGS_INSTITUTION:"bank",BEACH_CLUB:"beach",BAR:"bar",CAFE:"cafe",COCKTAIL_BAR:"bar",COFFEE_SHOP:"coffee_shop",INTERNET_CAFE:"cafe",PUB:"pub",TEA_HOUSE:"tea_house",WINE_BAR:"bar",CARAVAN_SITE:"camping_ground",RECREATIONAL_CAMPING_GROUND:"camping_ground",REST_CAMP:"camping_ground",TRUCK_WASH:"vehicle_wash",DRIVE_IN_MOVIES:"cinema",CHILDRENS_CLOTHES:"clothing_shop",MENS_CLOTHING:"clothing_shop",SPECIALTY_CLOTHING_SHOP:"clothing_shop",WOMENS_CLOTHING:"clothing_shop",PRIVATE_CLUB:"club_and_association",JUNIOR_COLLEGE_COMMUNITY_COLLEGE:"college_or_university",BUILDING:"business",ADVERTISING_COMPANY:"company_or_office",AGRICULTURAL_TECHNOLOGY:"company_or_office",AIRLINE_COMPANY:"company_or_office",AUTOMOBILE_COMPANY:"company_or_office",BUSINESS_SERVICES:"company_or_office",BUS_CHARTER_COMPANY:"company_or_office",CABLE_TELEPHONE_COMPANY:"company_or_office",CLEANING_SERVICES:"company_or_office",COMPUTER_DATA_SERVICES:"company_or_office",CONSTRUCTION_COMPANY:"company_or_office",DELIVERY_SERVICE:"company_or_office",ELECTRONICS_COMPANY:"company_or_office",EQUIPMENT_RENTAL:"company_or_office",FUNERAL_SERVICE_MORTUARIES:"company_or_office",IMPORT_EXPORT_AND_DISTRIBUTION:"company_or_office",INSURANCE_COMPANY:"company_or_office",INVESTMENT_ADVISOR:"company_or_office",LEGAL_SERVICES:"company_or_office",MINING_COMPANY:"company_or_office",MOVING_STORAGE_COMPANY:"company_or_office",OIL_NATURAL_GAS:"company_or_office",PHARMACEUTICAL_COMPANY:"company_or_office",PUBLIC_HEALTH_TECHNOLOGY_COMPANY:"company_or_office",PUBLISHING_TECHNOLOGIES:"company_or_office",REAL_ESTATE_AGENT:"company_or_office",REAL_ESTATE_COMPANY:"company_or_office",SERVICE_COMPANY:"company_or_office",SOFTWARE_COMPANY:"company_or_office",TAX_SERVICES:"company_or_office",TELECOMMUNICATIONS:"company_or_office",TRANSPORT_COMPANY:"company_or_office",TRAVEL_AGENT:"company_or_office",WEDDING_SERVICES:"company_or_office",GENERAL_PRACTITIONER:"doctor",SPECIALIST:"doctor",RIDGE:"peak",AMBULANCE_UNIT:"emergency",ROAD_RESCUE:"emergency",AMUSEMENT_ARCADE:"entertainment",AMUSEMENT_PLACE:"entertainment",BETTING_STATION:"entertainment",FAIRGROUND:"entertainment",MUSIC_CENTER:"entertainment",CHECKPOINT:"border_control",BAY:"geographic_feature",BRIDGE:"geographic_feature",BRIDGE_TUNNEL_OPERATIONS:"geographic_feature",CAPE:"geographic_feature",COVE:"geographic_feature",DAM:"geographic_feature",DUNE:"geographic_feature",ISLAND:"geographic_feature",LAGOON:"geographic_feature",LAKESHORE:"geographic_feature",LOCALE:"geographic_feature",MARSH:"geographic_feature",OASIS:"geographic_feature",PAN:"geographic_feature",PARKWAY:"geographic_feature",PLAIN_FLAT:"geographic_feature",PLATEAU:"geographic_feature",RAPIDS:"geographic_feature",REEF:"geographic_feature",RESERVOIR:"geographic_feature",RIVER_CROSSING:"geographic_feature",RIVER_SCENIC_AREA:"geographic_feature",ROCKS:"geographic_feature",SEASHORE:"geographic_feature",TUNNEL:"geographic_feature",VALLEY:"geographic_feature",WATER_HOLE:"geographic_feature",WELL:"geographic_feature",BUNGALOW_RENTAL:"holiday_home",CABINS_LODGES:"holiday_home",CHALET_RENTAL:"holiday_home",COTTAGE_RENTAL:"holiday_home",VILLA_RENTAL:"holiday_home",BLOOD_BANK:"hospital",HOSPITAL_FOR_WOMEN_AND_CHILDREN:"hospital",HOSPITAL_OF_CHINESE_MEDICINE:"hospital",SPECIAL_HOSPITAL:"hospital",B_B_GUEST_HOUSE:"hotel_or_motel",HOSTEL:"hotel_or_motel",HOTEL:"hotel_or_motel",MOTEL:"hotel_or_motel",RESORT:"hotel_or_motel",QUARRY:"industrial_facility",AUTOMOBILE_MANUFACTURING:"manufacturing_facility",CHEMICAL_COMPANY:"manufacturing_facility",MANUFACTURING_COMPANY:"manufacturing_facility",MECHANICAL_ENGINEERING:"manufacturing_facility",MICROBREWERY:"manufacturing_facility",OEM:"manufacturing_facility",BOAT_LAUNCHING_RAMP:"marina",HARBOR:"marina",YACHT_BASIN:"marina",FARMERS_MARKET:"marketplace",FOOD_MARKET:"marketplace",INFORMAL_MARKET:"marketplace",PUBLIC_MARKET:"marketplace",PLANETARIUM:"planetarium",CABARET_THEATER:"nightlife",COMEDY_CLUB:"comedy_club",DISCO_CLUB:"nightlife",JAZZ_CLUB:"nightlife",KARAOKE_CLUB:"nightlife",FISHING_HUNTING_AREA:"park_and_recreation_area",FOREST_AREA:"park_and_recreation_area",HISTORICAL_PARK:"park_and_recreation_area",NATURAL_RECREATION_ATTRACTION:"park_and_recreation_area",PARK:"park_and_recreation_area",PICNIC_AREA:"park_and_recreation_area",PRESERVE:"park_and_recreation_area",RECREATION_AREA:"park_and_recreation_area",WILDERNESS_AREA:"park_and_recreation_area",OPEN_CAR_PARKING_AREA:"parking_facility",DRUG_STORE:"pharmacy",MARIJUANA_DISPENSARY:"pharmacy",MEDICINAL_MARIJUANA_DISPENSARY:"pharmacy",RECREATIONAL_MARIJUANA_DISPENSARY:"pharmacy",COURIER_DROP_BOX:"post_office",LOCAL_POST_OFFICE:"post_office",PUBLIC_CALL_BOX:"public_amenity",PUBLIC_TOILET:"public_amenity",BUS_LINES:"public_transport_stop",COACH_STOP:"public_transport_stop",PASSENGER_TRANSPORT_TICKET_OFFICE:"public_transport_stop",PEDESTRIAN_SUBWAY:"public_transport_stop",STREETCAR_STOP:"public_transport_stop",SUBWAY_STATION:"public_transport_stop",INTERNATIONAL_RAILROAD_STATION:"railway_station",NATIONAL_RAILROAD_STATION:"railway_station",RAILROAD_SIDING:"railway_station",STATION_ACCESS:"railway_station",URBAN_STATION:"railway_station",BODYSHOP:"vehicle_repair",CAR_GLASS_REPLACEMENT_SHOP:"vehicle_repair",CAR_REPAIR_AND_SERVICE:"vehicle_repair",HOME_APPLIANCE_REPAIR:"vehicle_repair",MOTORCYCLE_REPAIR:"vehicle_repair",OTHER_REPAIR_SHOPS:"vehicle_repair",REPAIR_SHOP:"vehicle_repair",TIRE_SERVICE:"vehicle_repair",TRUCK_REPAIR_AND_SERVICE:"vehicle_repair",AFGHAN_RESTAURANT:"restaurant",AFRICAN_RESTAURANT:"restaurant",ALGERIAN_RESTAURANT:"restaurant",AMERICAN_RESTAURANT:"restaurant",ARABIAN_RESTAURANT:"restaurant",ARGENTINIAN_RESTAURANT:"restaurant",ARMENIAN_RESTAURANT:"restaurant",ASIAN_RESTAURANT:"restaurant",AUSTRALIAN_RESTAURANT:"restaurant",AUSTRIAN_RESTAURANT:"restaurant",BANQUET_ROOMS:"restaurant",BARBECUE_RESTAURANT:"restaurant",BASQUE_RESTAURANT:"restaurant",BELGIAN_RESTAURANT:"restaurant",BISTRO:"restaurant",BOLIVIAN_RESTAURANT:"restaurant",BOSNIAN_RESTAURANT:"restaurant",BRAZILIAN_RESTAURANT:"restaurant",BRITISH_RESTAURANT:"restaurant",BUFFET_RESTAURANT:"restaurant",BULGARIAN_RESTAURANT:"restaurant",BURMESE_RESTAURANT:"restaurant",CAFETERIA:"restaurant",CALIFORNIAN_RESTAURANT:"restaurant",CAMBODIAN_RESTAURANT:"restaurant",CANADIAN_RESTAURANT:"restaurant",CARIBBEAN_RESTAURANT:"restaurant",CATERING_SERVICES:"restaurant",CHICKEN_RESTAURANT:"restaurant",CHILEAN_RESTAURANT:"restaurant",CHINESE_RESTAURANT:"restaurant",COLOMBIAN_RESTAURANT:"restaurant",CORSICAN_RESTAURANT:"restaurant",CREOLE_RESTAURANT:"restaurant",CREPERIE:"restaurant",CUBAN_RESTAURANT:"restaurant",CYPRIOT_RESTAURANT:"restaurant",CZECH_RESTAURANT:"restaurant",DANISH_RESTAURANT:"restaurant",DINNER_THEATER:"restaurant",DOMINICAN_RESTAURANT:"restaurant",DONGBEI_RESTAURANT:"restaurant",DOUGHNUT_RESTAURANT:"restaurant",DUTCH_RESTAURANT:"restaurant",EGYPTIAN_RESTAURANT:"restaurant",ENGLISH_RESTAURANT:"restaurant",EROTIC_RESTAURANT:"restaurant",ETHIOPIAN_RESTAURANT:"restaurant",EXOTIC_RESTAURANT:"restaurant",FAST_FOOD:"restaurant",FINNISH_RESTAURANT:"restaurant",FONDUE_RESTAURANT:"restaurant",FRENCH_RESTAURANT:"restaurant",FUSION_RESTAURANT:"restaurant",GERMAN_RESTAURANT:"restaurant",GREEK_RESTAURANT:"restaurant",GRILL_RESTAURANT:"restaurant",GUANGDONG_RESTAURANT:"restaurant",HAMBURGER_RESTAURANT:"restaurant",HAWAIIAN_RESTAURANT:"restaurant",HOT_POT_RESTAURANT:"restaurant",HUNAN_RESTAURANT:"restaurant",HUNGARIAN_RESTAURANT:"restaurant",ICE_CREAM_PARLOR:"restaurant",INDIAN_RESTAURANT:"restaurant",INDONESIAN_RESTAURANT:"restaurant",INTERNATIONAL_RESTAURANT:"restaurant",IRANIAN_RESTAURANT:"restaurant",IRISH_RESTAURANT:"restaurant",ISRAELI_RESTAURANT:"restaurant",ITALIAN_RESTAURANT:"restaurant",JAMAICAN_RESTAURANT:"restaurant",JAPANESE_RESTAURANT:"restaurant",JEWISH_RESTAURANT:"restaurant",KOREAN_RESTAURANT:"restaurant",KOSHER_RESTAURANT:"restaurant",LATIN_AMERICAN_RESTAURANT:"restaurant",LEBANESE_RESTAURANT:"restaurant",LUXEMBOURGIAN_RESTAURANT:"restaurant",MACROBIOTIC_RESTAURANT:"restaurant",MAGHRIB_RESTAURANT:"restaurant",MALTESE_RESTAURANT:"restaurant",MAURITIAN_RESTAURANT:"restaurant",MEDITERRANEAN_RESTAURANT:"restaurant",MEXICAN_RESTAURANT:"restaurant",MIDDLE_EASTERN_RESTAURANT:"restaurant",MONGOLIAN_RESTAURANT:"restaurant",MOROCCAN_RESTAURANT:"restaurant",MUSSELS_RESTAURANT:"restaurant",NEPALESE_RESTAURANT:"restaurant",NORWEGIAN_RESTAURANT:"restaurant",ORGANIC_FOOD_RESTAURANT:"restaurant",ORIENTAL_RESTAURANT:"restaurant",PAKISTANI_RESTAURANT:"restaurant",PERUVIAN_RESTAURANT:"restaurant",PHILIPPINE_RESTAURANT:"restaurant",PIZZERIA:"restaurant",POLISH_RESTAURANT:"restaurant",POLYNESIAN_RESTAURANT:"restaurant",PORTUGUESE_RESTAURANT:"restaurant",PROVENCAL_RESTAURANT:"restaurant",PUB_FOOD:"restaurant",ROADSIDE_RESTAURANT:"restaurant",ROMANIAN_RESTAURANT:"restaurant",RUSSIAN_RESTAURANT:"restaurant",SALAD_BAR:"restaurant",SANDWICH_RESTAURANT:"restaurant",SAVOY_RESTAURANT:"restaurant",SCANDINAVIAN_RESTAURANT:"restaurant",SCOTTISH_RESTAURANT:"restaurant",SEAFOOD:"restaurant",SHANDONG_RESTAURANT:"restaurant",SHANGHAI_RESTAURANT:"restaurant",SICHUAN_RESTAURANT:"restaurant",SICILIAN_RESTAURANT:"restaurant",SLAVIC_RESTAURANT:"restaurant",SLOVAK_RESTAURANT:"restaurant",SNACKS_RESTAURANT:"restaurant",SOUL_FOOD:"restaurant",SOUP_RESTAURANT:"restaurant",SPANISH_RESTAURANT:"restaurant",STEAK_HOUSE:"restaurant",SUDANESE_RESTAURANT:"restaurant",SURINAMESE_RESTAURANT:"restaurant",SUSHI_RESTAURANT:"restaurant",SWEDISH_RESTAURANT:"restaurant",SWISS_RESTAURANT:"restaurant",SYRIAN_RESTAURANT:"restaurant",TAIWANESE_RESTAURANT:"restaurant",TAKEOUT_FOOD:"restaurant",TAPAS_RESTAURANT:"restaurant",TEPPANYAKI_RESTAURANT:"restaurant",THAI_RESTAURANT:"restaurant",TIBETAN_RESTAURANT:"restaurant",TUNISIAN_RESTAURANT:"restaurant",TURKISH_RESTAURANT:"restaurant",URUGUAYAN_RESTAURANT:"restaurant",VEGETARIAN_RESTAURANT:"restaurant",VENEZUELAN_RESTAURANT:"restaurant",VIETNAMESE_RESTAURANT:"restaurant",WELSH_RESTAURANT:"restaurant",WESTERN_RESTAURANT:"restaurant",YOGURT_JUICE_BAR:"restaurant",ART_SCHOOL:"education",CHILD_CARE_FACILITY:"education",CULINARY_SCHOOL:"education",DANCE_STUDIO_SCHOOL:"education",DRIVING_SCHOOL:"education",HIGH_SCHOOL:"education",LANGUAGE_SCHOOL:"education",MIDDLE_SCHOOL:"education",PRE_SCHOOL:"education",PRIMARY_SCHOOL:"education",SENIOR_HIGH_SCHOOL:"education",SPECIAL_SCHOOL:"education",SPORT_SCHOOL:"education",TECHNICAL_SCHOOL:"education",VOCATIONAL_SCHOOL:"education",AGRICULTURAL_SUPPLIES:"shop_or_store",ANTIQUE_ART_SHOP:"shop_or_store",BAGS_LEATHERWEAR:"shop_or_store",BAKERY:"shop_or_store",BEAUTY_SALON:"shop_or_store",BEAUTY_SUPPLIES:"shop_or_store",BOATING_EQUIPMENT_ACCESSORIES:"shop_or_store",BOOK_SHOP:"shop_or_store",BUTCHER:"shop_or_store",CAMERAS_PHOTOGRAPHY:"shop_or_store",CARPET_FLOOR_COVERINGS:"shop_or_store",CAR_ACCESSORIES:"shop_or_store",CHRISTMAS_HOLIDAY_SHOP:"shop_or_store",COMPUTER_COMPUTER_SUPPLIES:"shop_or_store",CONSTRUCTION_MATERIAL_EQUIPMENT:"shop_or_store",CONSUMER_ELECTRONICS:"shop_or_store",CONVENIENCE_STORE:"shop_or_store",CURTAINS_TEXTILES:"shop_or_store",C_DS_DVD_VIDEOS:"shop_or_store",DELICATESSEN:"shop_or_store",DO_IT_YOURSELF_CENTERS:"shop_or_store",DRIVE_THROUGH_BOTTLE_SHOP:"shop_or_store",DRY_CLEANER:"shop_or_store",ELECTRICAL_APPLIANCES_SHOP:"shop_or_store",FACTORY_OUTLET:"shop_or_store",FISHMONGER:"shop_or_store",FLORISTS:"shop_or_store",FOOTWEAR_SHOE_REPAIRS:"shop_or_store",FURNITURE_HOME_FURNISHINGS:"shop_or_store",GARDEN_CENTERS_SERVICES:"shop_or_store",GIFTS_CARDS_NOVELTIES_SOUVENIRS:"shop_or_store",GLASSWARE_CERAMIC_SHOP:"shop_or_store",GLASS_WINDOWS_STORE:"shop_or_store",GREENGROCER:"shop_or_store",GROCERY_STORE:"shop_or_store",HAIRDRESSER:"shop_or_store",HARDWARE_STORE:"shop_or_store",HOBBY_SHOP:"shop_or_store",HOUSE_GARDEN_FURNITURE_FITTINGS:"shop_or_store",JEWELRY_CLOCKS_WATCHES:"shop_or_store",KITCHENS_BATHROOMS:"shop_or_store",LAUNDRY:"shop_or_store",LIGHTING_SHOPS:"shop_or_store",LOCAL_SPECIALITIES_SHOP:"shop_or_store",LOTTERY_SHOP:"shop_or_store",MARINE_ELECTRONIC_EQUIPMENT:"shop_or_store",MEDICAL_SUPPLIES_EQUIPMENT:"shop_or_store",MOBILE_PHONE_SHOP:"shop_or_store",MUSIC_INSTRUMENTS_STORE:"shop_or_store",NAIL_SALON:"shop_or_store",NEWSAGENTS_TOBACCONISTS:"shop_or_store",OFFICE_EQUIPMENT:"shop_or_store",OPTICIAN:"shop_or_store",OTHER_FOOD_SHOPS:"shop_or_store",PAINTING_DECORATING:"shop_or_store",PAWN_SHOP:"shop_or_store",PERSONAL_CARE_FACILITY:"shop_or_store",PERSONAL_SERVICE:"shop_or_store",PET_SUPPLIES:"shop_or_store",PHOTOCOPY_SHOP:"shop_or_store",PHOTO_LAB_DEVELOPMENT:"shop_or_store",RECYCLING_SHOP:"shop_or_store",RETAIL_OUTLET:"shop_or_store",SAUNA_SOLARIUM_MASSAGE:"shop_or_store",SECURITY_PRODUCTS:"shop_or_store",SHOPPING_SERVICE:"shop_or_store",SPECIALTY_FOODS:"shop_or_store",SPORTS_EQUIPMENT_CLOTHING:"shop_or_store",STAMP_SHOP:"shop_or_store",TAILOR_SHOP:"shop_or_store",TOYS_GAMES_SHOP:"shop_or_store",VARIETY_STORE:"shop_or_store",VIDEO_RENTAL_SHOP:"shop_or_store",WHOLESALE_CLUB:"shop_or_store",WINE_SPIRITS:"shop_or_store",ATHLETICS_TRACK:"sport_facility",BASEBALL_PARK:"sport_facility",BASKETBALL_ARENA:"sport_facility",BOWLING_CENTER:"sport_facility",CRICKET_GROUND:"sport_facility",FITNESS_CLUB_CENTER:"sport_facility",FLYING_CLUB:"sport_facility",HOCKEY_CLUB:"sport_facility",HORSE_RACING_TRACK:"sport_facility",HORSE_RIDING_CENTER:"sport_facility",ICE_HOCKEY_ARENA:"sport_facility",OTHER_WINTER_SPORT:"sport_facility",RACE_TRACK:"sport_facility",RUGBY_GROUND:"sport_facility",SKI_RESORT:"sport_facility",SNOOKER_POOL_BILLIARD:"sport_facility",THEMATIC_SPORT_CENTER:"sport_facility",FOOTBALL_STADIUM:"stadium",MOTOR_RACING_STADIUM:"stadium",MULTI_PURPOSE_STADIUM:"stadium",NETBALL_STADIUM:"stadium",SOCCER_STADIUM:"stadium",STOCK_EXCHANGE:"stock_exchange",TAXI_LIMOUSINE_SHUTTLE_SERVICE:"taxi_stand",AMPHITHEATER:"theater",ARCH:"tourist_attraction",BATTLEFIELD:"tourist_attraction",CAVE:"tourist_attraction",CEMETERY:"tourist_attraction",HISTORIC_SITE:"tourist_attraction",MAUSOLEUM_GRAVE:"tourist_attraction",MEMORIAL:"tourist_attraction",MINERAL_HOT_SPRINGS:"tourist_attraction",MONUMENT:"tourist_attraction",NATURAL_TOURIST_ATTRACTION:"tourist_attraction",OBSERVATORY:"tourist_attraction",STATUE:"tourist_attraction",TOURIST_ATTRACTION:"tourist_attraction",TOWER:"tourist_attraction",ROAD_TRAFFIC_CONTROL_CENTER:"traffic_office",ADVENTURE_VEHICLE_TRAIL:"trailhead",HIKING_TRAIL:"trailhead",HORSE_RIDING_TRAIL:"trailhead",MOUNTAIN_BIKE_TRAIL:"trailhead",ROCK_CLIMBING_TRAIL:"trailhead",APARTMENT_RENTAL:"business",CONDOMINIUM_COMPLEX:"business",FLATS_APARTMENT_COMPLEX:"business",RESIDENTIAL_ESTATE:"business",RETIREMENT_COMMUNITY:"business",TOWNHOUSE_COMPLEX:"business",ANIMAL_SERVICES:"veterinary",ANIMAL_SHELTER:"animal_shelter",WEIGH_SCALES:"weighbridge",WILDLIFE_PARK:"zoo_or_aquarium",ZOO:"zoo_or_aquarium"},Oi=e=>bi[e],Ni="Noto-Bold",vi=.8,Ci="title",Mi="iconID",wi=.7,Ui=1.4,Pi="default_place",Di={"icon-image":["get",Mi],"icon-anchor":"bottom","icon-size":["interpolate",["linear"],["zoom"],8,.6,22,vi],"icon-allow-overlap":!0,"icon-padding":0},xi={"icon-translate":[0,5],"icon-translate-anchor":"viewport"},Fi={"text-optional":!0,"text-font":[Ni],"text-field":["get",Ci],"text-justify":"auto","text-variable-anchor":["top","left","right"],"text-variable-anchor-offset":["top",[0,wi],"left",[Ui,-1.4],"right",[-1.4,-1.4]],"text-size":["interpolate",["linear"],["zoom"],10,14,18,16],"text-padding":5},Hi={"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"},Gi={type:"symbol",layout:{...Di,...Fi},paint:{...xi,...Hi}},ji=(e,t)=>`${e}-${t}`,Bi=(e,t)=>{if(!e)return;const r=(e=>{try{if("string"==typeof e){if(e.includes("<svg")){const t=Vr(e),r=t.getAttribute("viewBox");if(r){const e=r.split(/\s+/);if(4===e.length)return{width:Number.parseFloat(e[2]),height:Number.parseFloat(e[3])}}const i=t.getAttribute("width"),o=t.getAttribute("height");if(i&&o)return{width:Number.parseFloat(i),height:Number.parseFloat(o)}}return null}return e.complete&&e.naturalWidth>0?{width:e.naturalWidth,height:e.naturalHeight}:null}catch(t){return console.warn("Failed to extract image dimensions:",t),null}})(e);if(!r)return;if("base-map"===t){return{heightScale:r.height/54,widthScale:r.width/54}}return{heightScale:r.height/140,widthScale:r.width/120}},Wi=e=>Boolean(e&&"availability"in e&&e.availability),Vi=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return"ELECTRIC_VEHICLE_STATION"===t&&Wi(e.properties.chargingPark)},ki=e=>{const t=e.properties.chargingPark;if(Wi(t)){const e=t.availability.chargingPointAvailability,r=e.statusCounts.Available??0;return{availableCount:r,totalCount:e.count,ratio:r/e.count}}},Yi=(e,t)=>`${e}/${t}`,zi=e=>{const t=ki(e);return t?.ratio??0},$i=e=>["case",[">=",["get","evAvailabilityRatio"],e?.threshold??0],"green","red"],Ki=(e,t,r,i)=>{const o=void 0!==i;return{top:o?[0,i]:[0,e],left:o?[i,r]:[t,r],right:o?[-i,r]:[-t,r]}},Xi=(e,t,r,i)=>{const o=(e=>{if(!e)return vi;if("number"==typeof e)return e;if(Array.isArray(e)){const t=e.at(-1);if("number"==typeof t)return t}return vi})(e)/vi,a="base-map"===r;if(a&&void 0!==i)return{"text-offset":[i,i]};const n=Ui*o,s=Ki(wi*o,n,a?0:-n,i),c=["top",s.top,"left",s.left,"right",s.right];if(0===t.size)return{"text-variable-anchor-offset":c};const l=["case"];for(const[u,h]of t.entries()){const e=(a?1.4:wi)*h.heightScale,t=Ui*h.widthScale,r=Ki(e,t,a?0:-t,i);l.push(["==",["get",Mi],u],["literal",["top",r.top,"left",r.left,"right",r.right]])}return l.push(["literal",c]),{"text-variable-anchor-offset":l}},qi=(e,t,r,i,o)=>{const a=t?.text,n=t?.layers?.[r],s=o&&o.size>0,c={...e.layout};(s||void 0!==a?.offset)&&(delete c["text-offset"],delete c["text-variable-anchor-offset"],delete c["text-radial-offset"]);const l={...c,...n?.layout,...a?.size&&{"text-size":a.size},...a?.font&&{"text-font":a.font},"text-field":i};if(s||void 0!==a?.offset){const r=e.layout?.["icon-size"],i=o??/* @__PURE__ */new Map;Object.assign(l,Xi(r,i,t?.theme,a?.offset))}return l},Zi=(e,t,r,i)=>{const o=t?.text,a=t?.layers?.[r],{textColor:n,haloColor:s}=(e=>({textColor:"dark"===e?"#FFFFFF":"#333333",haloColor:"dark"===e?"#333333":"#FFFFFF"}))(i);return{...e.paint,...!o?.color&&{"text-color":n},...!o?.haloColor&&{"text-halo-color":s},...o?.color&&{"text-color":o.color},...o?.haloColor&&{"text-halo-color":o.haloColor},...o?.haloWidth&&{"text-halo-width":o.haloWidth},...a?.paint}},Ji=["in",["get","eventState"],["literal",["click","contextmenu"]]],Qi=e=>JSON.parse(JSON.stringify(e)?.replaceAll("name",Ci)),eo=["has","eventState"],to="#3f9cd9",ro={...Gi,filter:["!",eo]},io={...Gi,filter:eo,layout:{...Gi.layout,"icon-size":["interpolate",["linear"],["zoom"],8,.8,22,1],"text-allow-overlap":!0},paint:{...Gi.paint,"text-color":to}},oo=(e,t,r,i,o)=>{const a=t?.text,n=t?.layers?.[r],s=((e,t)=>t?["case",["has","evAvailabilityText"],["format",["get",Ci],{},"\n",{},["get","evAvailabilityText"],{"font-scale":1.1,"text-color":$i(e?.evAvailability)}],["get",Ci]]:["get",Ci])(t,!0===t?.evAvailability?.enabled),c=a?.title&&"function"!=typeof a?.title?a.title:s;return{...e,layout:qi(e,t,r,c,o),paint:Zi(e,t,r,i),...n}},ao=(e,t,r,i)=>{const o=((e,t)=>{const r=/* @__PURE__ */new Map,i=e?.icon?.categoryIcons??[];for(const o of i)if(o.image){const i=Bi(o.image,e?.theme);if(void 0!==i){const e=ji(o.id,t);if(r.set(e,i),o.availabilityLevel){const e=ji(`${o.id}-${o.availabilityLevel}`,t);r.set(e,i)}}}return r})(e,i);let a,n;if("base-map"===e?.theme){const e=(e=>{const t=e.getStyle().layers.find(e=>"POI"===e.id)||{},r=t.layout?.["text-size"];return{filter:["!",Ji],type:"symbol",paint:t.paint,layout:{...t.layout,"text-field":["get",Ci],"icon-image":["get",Mi],...r&&{"text-size":Qi(r)}}}})(t);a=e,n={...e,filter:eo,layout:{...e.layout,"text-allow-overlap":!0},paint:{...e.paint,"text-color":to}}}else a=ro,n=io;return{main:oo(a,e,"main",r,o),selected:oo(n,e,"selected",r,o),...e?.layers?.additional}},no=e=>{if(Br())return Wr(kr(e))},so=/* @__PURE__ */new Set([7339002,8099002,7369004,7321003,7376006,9362003,9362004,9160004,9376007,7315015,9376006,9376002,7315078,7315149,9376005,7372003,9352045,9352032,9361048,9902003,9378005,7383004,9910004,7320002,9362016,7320003,9362025,9942002,9942003,7380005,9663003,9361021,9379009,9379004,7315147,9376003,9160002,9160003,9352008,9361006,7389004,9910006]),co=e=>e.properties.poi?.name??e.properties.address.freeformAddress,lo=(e,t,i)=>{if("pin"===t){return(e=>{if(e)return so.has(e)?e.toString():e.toString().substring(0,4)})(r[e])??i}{const t=Oi(e);return t?`poi-${t}`:i}},uo=(e,t,r={})=>{const i=r.theme??"pin",o=ji(Pi,t),a=r.icon?.mapping;if(a)return"imageID"===a.to?a.fn(e):lo(a.fn(e),i,o);const n=e.properties.poi?.classifications?.[0]?.code,s=((e,t,r,i,o)=>{if(!i.evAvailability?.enabled||!Vi(e))return;const a=zi(e)>=(i.evAvailability.threshold??.3)?"available":"occupied",n=i.icon?.categoryIcons&&i.icon.categoryIcons.length>0,s=i.icon?.categoryIcons?.find(e=>e.id===t&&e.availabilityLevel===a);return s?ji(`${s.id}-${a}`,r):n||"pin"!==o?void 0:`7309-${a}`})(e,n,t,r,i);if(s)return s;const c=r.icon?.categoryIcons?.find(e=>e.id===n);if(c)return ji(c.id,t);return lo(n,i,o)},ho=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return t&&Oi(t)},po=e=>Array.isArray(e)?{type:"FeatureCollection",features:e}:"Feature"===e.type?{type:"FeatureCollection",features:[e]}:e,fo=(e,t,r)=>{if(!0!==t?.enabled)return e;let i=!1,o=!1;for(const a of r.features){if("ELECTRIC_VEHICLE_STATION"===a.properties.poi?.classifications?.[0]?.code&&(i=!0,Vi(a))){o=!0;break}}return i&&!o&&console.warn("PlacesModule: evAvailability is enabled but no availability data found. Did you call getPlacesWithEVAvailability()?"),{...e,evAvailabilityText:e=>Vi(e)?((e,t)=>{const r=ki(e);return r?(t?.formatText??Yi)(r.availableCount,r.totalCount):""})(e,t):"",evAvailabilityRatio:e=>Vi(e)?zi(e):0}},_o=(e,r,i={})=>{const o=po(e),a=!0===i.evAvailability?.enabled?fo(i.extraFeatureProps,i.evAvailability,o):i.extraFeatureProps;return{...o,features:o.features.map(e=>{const o="function"==typeof i?.text?.title?i?.text?.title(e):co(e),n=a?Object.fromEntries(Object.entries(a).map(([t,r])=>[t,"function"==typeof r?r(e):r])):{},s=e.id??t();return{...e,id:s,geometry:{...e.geometry,bbox:e.bbox},properties:{...e.properties,id:s,title:o,iconID:uo(e,r,i),..."base-map"===i?.theme&&{category:ho(e)},...n}}})}},yo=class e extends li{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){return r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.sourceID=`places-${this.instanceIndex}`,this.layerIDPrefix=this.sourceID,this.defaultPlaceIconID=ji(Pi,this.instanceIndex)),this.layerSpecs=this.buildLayerSpecs(t),{places:new Jr(this.mapLibreMap,this.sourceID,[this.layerSpecs.main,this.layerSpecs.selected])}}buildLayerSpecs(e){const t=ao(e,this.tomtomMap.mapLibreMap,this.tomtomMap.styleLightDarkTheme,this.instanceIndex);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,{...t,id:`${this.layerIDPrefix}-${e}`}]))}_applyConfig(e){return this.updateLayersAndData(e),e}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.places.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}applyTheme(e){this.applyConfigPart({theme:e})}applyIconConfig(e){this.applyConfigPart({icon:e})}applyTextConfig(e){this.applyConfigPart({text:e})}applyConfigPart(e){const t={...this.config,...e};this.updateLayersAndData(t),this.config=t}applyExtraFeatureProps(e){const t={...this.config,extraFeatureProps:e};this.updateData(t),this.config=t}updateLayersAndData(e){this.setupImages(e);const t=this.buildLayerSpecs(e),r=[t.main,t.selected],i=[this.layerSpecs.main,this.layerSpecs.selected];ri(r,i,this.mapLibreMap),this.layerSpecs=t,this.updateData(e)}setupImages(e){if(e?.icon){for(const t of e.icon.categoryIcons??[]){const e=t.availabilityLevel?`${t.id}-${t.availabilityLevel}`:t.id;ni(0,ji(e,this.instanceIndex),t.image,this.mapLibreMap,{pixelRatio:t.pixelRatio??2})}e.icon.default&&(e.icon.default.image&&ni(0,this.defaultPlaceIconID,e.icon.default.image.image,this.mapLibreMap,{pixelRatio:e.icon.default.image.pixelRatio??2}),e.icon.default.style&&ni(0,this.defaultPlaceIconID,no(e.icon.default.style),this.mapLibreMap,{pixelRatio:2}))}else ni(0,this.defaultPlaceIconID,no(),this.mapLibreMap,{pixelRatio:2})}updateData(e){this.sourcesWithLayers.places.source.runtimeSource?.setData(_o(this.sourcesWithLayers.places.shownFeatures,this.instanceIndex,e))}async show(e){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.show(_o(e,this.instanceIndex,this.config))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.clear()}putEventState(e){this.sourcesWithLayers.places.putEventState(e)}cleanEventState(e){this.sourcesWithLayers.places.cleanEventState(e)}cleanEventStates(e){this.sourcesWithLayers.places.cleanEventStates(e)}get events(){return new ui(this.eventsProxy,this.sourcesWithLayers.places,this.config?.events)}};yo.lastInstanceIndex=-1;let Ao=yo;const go=e=>{if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!go(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}},Eo=e=>e?.length?1===e.length?e[0]:{expression:["any",...e.map(e=>e?.expression)],legacy:["any",...e.map(e=>e?.legacy)]}:null,Ro=(e,t)=>{return t?["all",e[(r=t,go(r)?"expression":"legacy")],t]:e.expression;var r},Io=(e,t,r)=>{if(1===r.length){const i="only"===t?"==":"!=";return{expression:[i,["get",e],r[0]],legacy:[i,e,r[0]]}}const i=["in",["get",e],["literal",r]];return"only"===t?{expression:i,legacy:["in",e,...r]}:{expression:["!",i],legacy:["!in",e,...r]}},mo=(e,t,r)=>Io(e,t.show,r?t.values.map(r):t.values),To={FOOD_DRINKS_GROUP:["RESTAURANT","FAST_FOOD","CAFE_PUB","PUB","WINERY","PUB_FOOD","SOUL_FOOD","DELICATESSEN"],SHOPPING_GROUP:["SHOP","SHOPPING_CENTER","CLOTHING_SHOP","MARKET","FOOD_MARKET","SUPERMARKETS_HYPERMARKETS","DEPARTMENT_STORE","CONVENIENCE_STORE","GROCERY_STORE","HARDWARE_STORE","ELECTRICAL_APPLIANCES_SHOP"],TRANSPORTATION_GROUP:["AIRPORT","FERRY_TERMINAL","HELIPAD_HELICOPTER_LANDING","PUBLIC_TRANSPORT_STOP","RAILWAY_STATION","BUS_STOP","TAXI_STAND"],HEALTH_GROUP:["DOCTOR","EMERGENCY_MEDICAL_SERVICE","EMERGENCY_ROOM","HEALTH_CARE_SERVICE","HOSPITAL","HOSPITAL_POLYCLINIC","PHARMACY","DENTIST","WELFARE_ORGANIZATION"],PARKING_GROUP:["PARKING_GARAGE","OPEN_PARKING_AREA"],HOLIDAY_TOURISM_GROUP:["AMUSEMENT_PARK","BEACH","HOLIDAY_RENTAL","GEOGRAPHIC_FEATURE","IMPORTANT_TOURIST_ATTRACTION","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK","MUSEUM","SCENIC_PANORAMIC_VIEW","TOURIST_INFORMATION_OFFICE"],EV_CHARGING_STATIONS_GROUP:["ELECTRIC_VEHICLE_STATION"],GAS_STATIONS_GROUP:["GAS_STATION","PETROL_STATION"],ACCOMMODATION_GROUP:["CAMPING_GROUND","HOTEL_MOTEL","HOLIDAY_RENTAL"],ENTERTAINMENT_GROUP:["CINEMA","THEATER","MOVIE_THEATER","NIGHTLIFE","CONCERT_HALL","ENTERTAINMENT","CLUB_ASSOCIATION","CASINO"],SPORTS_LEISURE_GROUP:["SPORTS_CENTER","WATER_SPORT","SWIMMING_POOL","GOLF_COURSE","STADIUM","BEACH","ICE_SKATING_RINK","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK"],EDUCATION_GROUP:["SCHOOL","COLLEGE_UNIVERSITY","LIBRARY","CULTURAL_CENTER"],GOVERNMENT_GROUP:["GOVERNMENT_OFFICE","COURTHOUSE","EMBASSY","FIRE_STATION_BRIGADE","POLICE_STATION"]},So=e=>{const t=[];return e.forEach(e=>{e in To?t.push(...To[e].map(Oi)):t.push(Oi(e))}),[...new Set(t)]};class Lo extends li{static async get(e,t){return await Qr(e),new Lo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ei);if(!e)throw jr(`init ${Lo.name} with source ID ${Ei}`);const t=new Xr(this.mapLibreMap,e,e=>Si.includes(e.id)),r=t.sourceAndLayerIDs.layerIDs[0];return this.mapLibreMap.getLayer(r)&&(this.originalFilter=this.mapLibreMap.getFilter(r)),{poi:t}}_applyConfig(e){return e&&!Cr(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),this.filterCategories(e?.filters?.categories),e}isVisible(){return this.sourcesWithLayers.poi.isAnyLayerVisible()}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.poi.setLayersVisible(e)}filterCategories(e){if(e){if(this.tomtomMap.mapReady){const t=Io("category",e.show,So(e.values));this.mapLibreMap.setFilter("POI",Ro(t,this.originalFilter))}this.config={...this.config,filters:{categories:e}}}else this.categoriesFilter&&(this.config={...this.config,filters:{categories:{show:"all_except",values:[]}}},this.tomtomMap.mapReady&&this.mapLibreMap.setFilter("POI",this.originalFilter));this.categoriesFilter=e}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.poi,this.config?.events)}}const bo={land:{layerIDMatches:["lulc"],layerTypes:["fill"]},borders:{layerIDMatches:["borders"],layerTypes:["line"]},water:{layerIDMatches:["water"],layerTypes:["fill","line"]},buildings2D:{layerIDMatches:["building"],layerTypes:["fill","line"]},buildings3D:{layerIDMatches:["building"],layerTypes:["fill-extrusion"]},houseNumbers:{layerIDMatches:["house number"],layerTypes:["symbol"]},roadLines:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["fill","line"]},roadLabels:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["symbol"]},roadShields:{layerIDMatches:["shield"],layerTypes:["symbol"]},placeLabels:{layerIDMatches:["places"],layerTypes:["symbol"]},smallerTownLabels:{layerIDMatches:["town","village","neighbourhood"],layerTypes:["symbol"]},cityLabels:{layerIDMatches:["city","capital"],layerTypes:["symbol"]},capitalLabels:{layerIDMatches:["capital"],layerTypes:["symbol"]},stateLabels:{layerIDMatches:["state"],layerTypes:["symbol"]},countryLabels:{layerIDMatches:["places - country"],layerTypes:["symbol"]}},Oo=(e,t)=>{const r=bo[e];return r.layerIDMatches.some(e=>t.id.toLowerCase().includes(e))&&r.layerTypes.includes(t.type)},No=e=>t=>(!e||((e,t)=>{const r=t?.mode,i=t?.names;if(r&&i?.length){if("include"===r)return i.some(t=>Oo(t,e));if("exclude"===r)return!i.some(t=>Oo(t,e))}return!0})(t,e))&&!Si.includes(t.id);class vo extends li{static async get(e,t){return await Qr(e),new vo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(e){const t=this.mapLibreMap.getSource(Ii);if(!t)throw jr(`init ${vo.name} with source ID ${Ii}`);return{vectorTiles:new Xr(this.mapLibreMap,t,No(e?.layerGroupsFilter))}}_applyConfig(e){return e&&!Cr(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),e?.layerGroupsVisibility&&this.setVisible(e.layerGroupsVisibility.visible,{layerGroups:e.layerGroupsVisibility}),this.config||e?{...this.config,...e}:void 0}isVisible(){return this.sourcesWithLayers.vectorTiles.isAnyLayerVisible()}setVisible(e,t){t?.layerGroups?this.config={...this.config,layerGroupsVisibility:{...t.layerGroups,visible:e}}:(delete this.config?.layerGroupsVisibility,this.config={...this.config,visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.vectorTiles.setLayersVisible(e,t?.layerGroups&&(e=>{const t=e.mode,r=e.names;return"include"===t?e=>r.some(t=>Oo(t,e)):"exclude"===t?e=>!r.some(t=>Oo(t,e)):(console.error("Unrecognized layer group mode:",t),()=>!0)})(t.layerGroups))}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vectorTiles,this.config?.events)}}const Co=["land","water","borders","buildings2D","buildings3D","houseNumbers","roadLines","roadLabels","roadShields","placeLabels","smallerTownLabels","cityLabels","capitalLabels","stateLabels","countryLabels"],Mo="title",wo="color",Uo={warm:["#793F0D","#AC703D","#C38E63","#E49969","#E5AE86","#EEC5A9","#6E7649","#9D9754","#C7C397","#B4A851","#DFD27C","#E7E3B5","#846D74","#B7A6AD","#D3C9CE"],browns:["#edc4b3","#e6b8a2","#deab90","#d69f7e","#cd9777","#c38e70","#b07d62","#9d6b53","#8a5a44","#774936"],cold:["#344464","#548ca4","#549cac","#2c445c","#a4ccd4","#acbccc","#b4c4d4","#acd4cc","#5c8ca4"],fadedBlues:["#152033","#1d2d44","#2e455d","#3e5c76","#4c6884","#597491","#67809e","#6e86a5","#7b91ad","#879bb4"],blues:["#03045e","#023e8a","#0077b6","#0096c7","#00b4d8","#48cae4","#90e0ef","#ade8f4","#caf0f8"],greens:["#004b23","#006400","#007200","#008000","#38b000","#70e000","#9ef01a","#ccff33"],fadedGreenToBlue:["#d9ed92","#b5e48c","#99d98c","#76c893","#52b69a","#34a0a4","#168aad","#1a759f","#1e6091","#184e77"],blueToRed:["#033270","#1368aa","#4091c9","#9dcee2","#fedfd4","#f29479","#f26a4f","#ef3c2d","#cb1b16","#65010c"],greenToYellow:["#007f5f","#2b9348","#55a630","#80b918","#aacc00","#bfd200","#d4d700","#dddf00","#eeef20","#ffff3f"],pastel:["#fec5bb","#fcd5ce","#fae1dd","#f8edeb","#e8e8e4","#d8e2dc","#ece4db","#ffe5d9","#ffd7ba","#fec89a"],retro:["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],contrastRetro:["#001219","#005f73","#0a9396","#94d2bd","#e9d8a6","#ee9b00","#ca6702","#bb3e03","#ae2012","#9b2226"],fadedRainbow:["#ffadad","#ffd6a5","#fdffb6","#caffbf","#9bf6ff","#a0c4ff","#bdb2ff","#ffc6ff","#fffffc"],pastelRainbow:["#54478c","#2c699a","#048ba8","#0db39e","#16db93","#83e377","#b9e769","#efea5a","#f1c453","#f29e4c"]},Po="#0A3653",Do={type:"fill",paint:{"fill-color":["coalesce",["get",wo],Po],"fill-opacity":.15,"fill-antialias":!1}},xo={type:"line",paint:{"line-color":Po,"line-opacity":.45,"line-width":2}},Fo=(e,t,r)=>{const i=r?.colorConfig,o=r?.lineConfig;return[{...Do,id:e,paint:{...Do.paint,...!Cr(i?.fillOpacity)&&{"fill-opacity":i?.fillOpacity},...i?.fillColor&&{"fill-color":["get","color"]}}},{...xo,id:t,paint:{...xo.paint,...!Cr(o?.lineColor)&&{"line-color":o?.lineColor},...!Cr(o?.lineWidth)&&{"line-width":o?.lineWidth},...!Cr(o?.lineOpacity)&&{"line-opacity":o?.lineOpacity}}}]},Ho=(e,t)=>{const r=t?.textConfig;return{type:"symbol",id:e,layout:{"text-field":["get",Mo],...r?.textField&&{"text-field":r.textField},"text-padding":5,"text-size":12,"text-font":[Ni],"symbol-placement":"point"},paint:{"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"}}},Go=(e,r={})=>({...e,features:e.features.map((e,i)=>{const o=e.properties?.title??((e,t)=>t.textConfig?.textField?t.textConfig.textField:e.properties?.address?.freeformAddress)(e,r),a=e.properties?.color??((e,t)=>{const r=e?.colorConfig?.fillColor;if("string"==typeof r&&Uo[r]){const e=Uo[r];return e[t%e.length]}return r})(r,i);return{...e,properties:{...e.properties,...o&&{title:o},...a&&{color:a},id:e.properties?.id??t()}}})}),jo=e=>{const r=e.features.map(e=>{let r;if(e.properties?.placeCoordinates)r=e.properties?.placeCoordinates;else if("MultiPolygon"===e.geometry.type){const t=(e=>e.flat().reduce((e,t)=>t.length>e.length?t:e,[]))(e.geometry.coordinates),a=i(t);r=a&&o(a)||null}else r=e.geometry.coordinates.flat();const a=e.id??e.properties?.id??t();return{type:"Feature",id:a,geometry:{type:"Point",coordinates:r},properties:{...e.properties,id:a}}});return{type:"FeatureCollection",bbox:e.bbox,features:r}},Bo=class e extends li{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){if(!r){e.lastInstanceIndex++,this.sourceID=`geometry-${e.lastInstanceIndex}`,this.titleSourceID=`geometryTitle-${e.lastInstanceIndex}`;const t=`geometry-${e.lastInstanceIndex}`;this.fillLayerID=`${t}_Fill`,this.outlineLayerID=`${t}_Outline`,this.titleLayerID=`${t}_Title`}const[i,o]=Fo(this.fillLayerID,this.outlineLayerID,t),a=Ho(this.titleLayerID,t);return this.titleLayerSpecs=a,this.geometryFillLayerSpecs=i,this.geometryOutlineLayerSpecs=o,{geometry:new Jr(this.mapLibreMap,this.sourceID,[{...i},{...o}]),geometryLabel:new Jr(this.mapLibreMap,this.titleSourceID,[a])}}_applyConfig(e){return(e?.textConfig||e?.colorConfig||e?.lineConfig)&&this.updateLayerAndData(e),e?.beforeLayerConfig&&this.moveBeforeLayer(e.beforeLayerConfig),e}moveBeforeLayerID(e){for(const t of this.sourcesWithLayers.geometry.sourceAndLayerIDs.layerIDs)this.mapLibreMap.moveLayer(t,e)}moveBeforeLayer(e){this.config={...this.config,beforeLayerConfig:e},this.moveBeforeLayerID("top"===e?this.titleLayerID:gi[e])}applyTextConfig(e){const t={...this.config,textConfig:e};this.updateLayerAndData(t),this.sourcesWithLayers.geometryLabel.show(jo(this.sourcesWithLayers.geometry.shownFeatures)),this.config=t}updateLayerAndData(e){const[t,r]=Fo(this.fillLayerID,this.outlineLayerID,e),i=Ho(this.titleLayerID,e);ti(t,this.geometryFillLayerSpecs,this.mapLibreMap),ti(r,this.geometryOutlineLayerSpecs,this.mapLibreMap),ti(i,this.titleLayerSpecs,this.mapLibreMap),this.geometryFillLayerSpecs=t,this.geometryOutlineLayerSpecs=r,this.titleLayerSpecs=i}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.geometry.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}async show(e){await this.waitUntilModuleReady();const t=this.sourcesWithLayers.geometry;t.show(Go(e,this.config)),this.sourcesWithLayers.geometryLabel.show(jo(t.shownFeatures))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.geometry.clear()}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.geometry,this.config?.events)}};Bo.lastInstanceIndex=-1;let Wo=Bo;class Vo extends li{static async get(e,t){return await Qr(e),await ai(e,Ri,"hillshade"),new Vo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ri);if(!e)throw jr(`init ${Vo.name} with source ID ${Ri}`);return{hillshade:new Xr(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),e}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.hillshade.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.hillshade.isAnyLayerVisible()}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.hillshade,this.config?.events)}}const ko=["standardLight","standardDark","drivingLight","drivingDark","monoLight","monoDark","satellite"],Yo=["trafficIncidents","trafficFlow","hillshade"],zo="#36A8F0",$o="#105287",Ko="#ABAFB3",Xo="#3C4956",qo="#727C85",Zo=["interpolate",["linear"],["zoom"],1,3,5,4,10,7,18,10],Jo=["==",["get","routeState"],"selected"],Qo=["==",["get","routeState"],"deselected"],ea="#AD0000",ta="#FB2D09",ra="#f58240",ia="#000000",oa=e=>!1===e?.visible?"":e?.title??["format",["get","title"],"\n",["get","chargingPower"]," • ",["get","chargingDuration"]],aa=e=>({...Gi,filter:Jo,minzoom:4,layout:{...Gi.layout,"text-field":oa(e?.text)},paint:{...Gi.paint}}),na={filter:Jo,minzoom:16},sa={...na,type:"line",layout:{"line-cap":"round"}},ca={...sa,paint:{"line-width":["interpolate",["linear"],["zoom"],16,14,22,20],"line-color":"grey"}},la={...sa,paint:{"line-width":["interpolate",["linear"],["zoom"],16,12,22,17],"line-color":"white"}},ua="instruction-arrow",ha={...na,type:"symbol",layout:{"icon-allow-overlap":!0,"icon-image":ua,"icon-rotation-alignment":"map","icon-rotate":["get","lastPointBearingDegrees"],"icon-size":["interpolate",["linear"],["zoom"],16,1,22,2]}},pa={filter:Jo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Zo,"line-color":"#6dc4ed"}},fa={filter:Jo,type:"symbol",minzoom:6,maxzoom:16.5,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-ferry_terminal","icon-size":["interpolate",["linear"],["zoom"],6,.8,16.5,1],"icon-ignore-placement":!0}},_a={type:"line",layout:{"line-join":"round","line-cap":"round","line-sort-key":["get","index"]}},da=["interpolate",["linear"],["zoom"],1,5,5,6,10,10,18,14],ya={..._a,filter:Qo,paint:{"line-color":Xo,"line-width":da}},Aa={..._a,filter:Qo,paint:{"line-color":Ko,"line-width":Zo}},ga={..._a,filter:Jo,paint:{"line-color":$o,"line-width":da}},Ea={type:"symbol",layout:{"symbol-placement":"line","icon-image":"roads-arrow-white","icon-rotate":180}},Ra="selected-route-summary-popup",Ia="deselected-route-summary-popup",ma={filter:Jo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],1,9,5,11,10,15,18,20],"line-color":"#BEBFFA"}},Ta={filter:Jo,type:"symbol",minzoom:4,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-toll_plaza","icon-size":["interpolate",["linear"],["zoom"],4,.8,16.5,1]}},Sa=["interpolate",["linear"],["zoom"],1,2,5,3,10,4,18,6],La={type:"line",layout:{"line-cap":"round"},paint:{"line-width":Sa,"line-color":["match",["get","magnitudeOfDelay"],"minor","#FFC105","moderate",ta,"major",ea,"#C7D2D8"]}},ba={type:"line",filter:["in",["get","magnitudeOfDelay"],["literal",["unknown","indefinite"]]],layout:{"line-join":"round"},paint:{"line-width":Sa,"line-color":["match",["get","magnitudeOfDelay"],"unknown","rgba(190, 39, 27, 1)","rgba(137, 150, 168, 1)"],"line-dasharray":[1.5,1]}},Oa=["match",["get","magnitudeOfDelay"],"minor",ra,"moderate",ta,"major",ea,"indefinite","#666666",ia],Na={filter:Jo,type:"symbol",minzoom:6,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-ignore-placement":!0}},va={...Na,filter:["all",["has","jamIconID"],Na.filter],layout:{...Na.layout,"icon-image":["get","jamIconID"],"icon-anchor":"bottom-left","text-anchor":"bottom-left","text-field":["get","title"],"text-font":[Ni],"text-offset":[3.9,-1.4],"text-size":13},paint:{...Na.paint,"text-color":Oa,"text-halo-color":"#FFFFFF","text-halo-width":1}},Ca={...Na,filter:["all",["has","causeIconID"],Na.filter],layout:{...Na.layout,"icon-image":["get","causeIconID"],"icon-anchor":"bottom-right"},paint:{...Na.paint}},Ma={filter:Jo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Zo,"line-color":"#000000","line-opacity":.3}},wa={filter:Jo,type:"line",layout:{"line-join":"round"},paint:{"line-color":$o,"line-width":Zo}},Ua={filter:Jo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":zo,"line-width":["interpolate",["linear"],["zoom"],1,2,5,3,10,5,18,7],"line-dasharray":[0,1.5]}},Pa="traffic-clear",Da="traffic-major",xa="traffic-moderate",Fa="traffic-minor",Ha=["has","formattedTraffic"],Ga=e=>{const t=void 0!==e?ji(Ra,e):Ra,r=void 0!==e?ji(Ia,e):Ia,i=void 0!==e?ji(Pa,e):Pa,o=void 0!==e?ji(Da,e):Da,a=void 0!==e?ji(xa,e):xa,n=void 0!==e?ji(Fa,e):Fa;return{type:"symbol",layout:{"icon-image":["case",Jo,t,r],"symbol-placement":"point","icon-rotation-alignment":"viewport","text-rotation-alignment":"viewport","symbol-sort-key":["case",Jo,0,1],"icon-text-fit":"both","icon-text-fit-padding":[10,5,5,10],"text-font":["Noto-Medium"],"text-size":13,"icon-padding":0,"text-justify":"left","text-line-height":1.5,"text-field":["format",["get","formattedDuration"],{"text-font":["literal",[Ni]],"text-color":["case",Jo,"black",qo]},["concat","\t\t",["get","formattedDistance"]],{"text-color":qo},["case",Ha,"\n",""],{},["image",["case",Ha,["match",["get","magnitudeOfDelay"],"major",o,"moderate",a,"minor",n,i],""]],{},["case",Ha,["concat"," ",["get","formattedTraffic"]],""],{"text-font":["literal",[Ni]],"text-color":Oa}]},paint:{"icon-translate":[0,-35],"text-translate":[0,-35]}}},ja=Ga(),Ba="start",Wa="middle",Va="finish",ka="indexType",Ya="stopDisplayIndex",za="waypointStart",$a="waypointStop",Ka="waypointSoft",Xa="waypointFinish",qa={"text-field":["get",Ya],"text-font":[Ni],"text-size":["interpolate",["linear"],["zoom"],13,14,18,16],"text-offset":[0,-1.6],"icon-anchor":["case",["all",["==",["get",ka],Wa],["!",["has",Ya]]],"center","bottom"],"text-allow-overlap":!0},Za={type:"symbol",paint:{...xi,"text-color":"#ffffff"},layout:{...Di,...qa,"symbol-sort-key":["case",["==",["get",Mi],Ka],0,["abs",["-",["get","index"],1e3]]]}},Ja={type:"symbol",paint:{...Hi,"text-color":"black","text-halo-width":1.5,"text-halo-color":"#ffffff"},layout:{...Fi,"text-anchor":"top","text-offset":[0,.4]}},Qa=(e,t)=>e&&t&&(e.startsWith("route")||e.startsWith("waypoint"))?`${t}-${e}`:e,en=(e,t)=>e&&t?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,r?.beforeID?{...r,beforeID:Qa(r.beforeID,t)}:r])):e,tn=(e,t)=>e&&void 0!==t?`${e}-${t}`:e,rn=(e={},t,r)=>{const i=e.layers,o=i?.sections,a=e.theme?.mainColor;return{mainLines:{routeLineArrows:{...Ea,beforeID:gi.lowestLabel,...i?.mainLines?.routeLineArrows},routeLine:{...(n={color:a},{..._a,filter:Jo,paint:{"line-color":n?.color??zo,"line-width":Zo}}),beforeID:Qa("routeIncidentBackgroundLine",t),...i?.mainLines?.routeLine},routeOutline:{...ga,beforeID:Qa("routeLine",t),...i?.mainLines?.routeOutline},routeDeselectedLine:{...Aa,beforeID:Qa("routeOutline",t),...i?.mainLines?.routeDeselectedLine},routeDeselectedOutline:{...ya,beforeID:Qa("routeDeselectedLine",t),...i?.mainLines?.routeDeselectedOutline},...en(i?.mainLines?.additional,t)},waypoints:{routeWaypointSymbol:{...Za,beforeID:Qa("routeSummaryBubbleSymbol",t),...i?.waypoints?.routeWaypointSymbol},routeWaypointLabel:{...Ja,beforeID:Qa("routeWaypointSymbol",t),...i?.waypoints?.routeWaypointLabel},...en(i?.waypoints?.additional,t)},chargingStops:{routeChargingStopSymbol:{...aa(e.chargingStops),beforeID:Qa("routeWaypointSymbol",t),...i?.chargingStops?.routeChargingStopSymbol},...en(i?.chargingStops?.additional,t)},sections:{incident:{routeIncidentJamSymbol:{...va,beforeID:Qa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentJamSymbol},routeIncidentCauseSymbol:{...Ca,beforeID:Qa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentCauseSymbol},routeIncidentBackgroundLine:{...La,beforeID:Qa("routeIncidentDashedLine",t),...o?.incident?.routeIncidentBackgroundLine},routeIncidentDashedLine:{...ba,beforeID:Qa("routeTunnelLine",t),...o?.incident?.routeIncidentDashedLine},...en(o?.incident?.additional,t)},ferry:{routeFerryLine:{...pa,beforeID:Qa("routeLineArrows",t),...o?.ferry?.routeFerryLine},routeFerrySymbol:{...fa,beforeID:Qa("routeIncidentJamSymbol",t),...o?.ferry?.routeFerrySymbol},...en(o?.ferry?.additional,t)},tollRoad:{routeTollRoadOutline:{...ma,beforeID:Qa("routeDeselectedOutline",t),...o?.tollRoad?.routeTollRoadOutline},routeTollRoadSymbol:{...Ta,beforeID:Qa("routeChargingStopSymbol",t),...o?.tollRoad?.routeTollRoadSymbol},...en(o?.tollRoad?.additional,t)},tunnel:{routeTunnelLine:{...Ma,beforeID:Qa("routeLineArrows",t),...o?.tunnel?.routeTunnelLine},...en(o?.tunnel?.additional,t)},vehicleRestricted:{routeVehicleRestrictedBackgroundLine:{...wa,beforeID:Qa("routeVehicleRestrictedForegroundLine",t),...o?.vehicleRestricted?.routeVehicleRestrictedBackgroundLine},routeVehicleRestrictedForegroundLine:{...Ua,beforeID:gi.lowestLabel,...o?.vehicleRestricted?.routeVehicleRestrictedForegroundLine},...en(o?.vehicleRestricted?.additional,t)}},instructionLines:{routeInstructionLine:{...la,beforeID:gi.lowestLabel,...i?.instructionLines?.routeInstructionLine},routeInstructionOutline:{...ca,beforeID:Qa("routeInstructionLine",t),...i?.instructionLines?.routeInstructionOutline},...en(i?.instructionLines?.additional,t)},instructionArrows:{routeInstructionArrowSymbol:{...ha,beforeID:Qa("routeInstructionLine",t),...void 0!==r&&{layout:{...ha.layout,"icon-image":tn(ha.layout?.["icon-image"],r)}},...i?.instructionArrows?.routeInstructionArrowSymbol},...en(i?.instructionArrows?.additional,t)},summaryBubbles:{routeSummaryBubbleSymbol:{...void 0!==r?Ga(r):ja,...i?.summaryBubbles?.routeSummaryBubbleSymbol},...en(i?.summaryBubbles?.additional,t)}};var n},on=rn();let an;Br()&&(an=Wr(Vr('<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">\n <path d="M1.562 40.569L25 1.562l23.438 39.007L25 27.566 1.562 40.569z" fill="#fff"/>\n <path d="M25.369.107c.782.429.506.167.917.682l23.438 39.007c.79 1.316-.671 2.829-2.014 2.085L25 29.281l-22.71 12.6c-1.343.744-2.804-.769-2.014-2.085L23.714.789c.461-.694.9-.682 1.656-.682zM25 1.562L1.562 40.569 25 27.566l23.438 13.003L25 1.562z"\n fill="gray"/>\n</svg>\n')));const nn=e=>{if(!Br())return;const t=Vr('<svg xmlns="http://www.w3.org/2000/svg" width="160" height="65">\n <g filter="url(#A)">\n <rect id="pin" x="81.899" y="47" width="10" height="10" rx="2" transform="rotate(45 81.899 47)"/>\n <rect id="bubble" x="10" y="10" width="140" height="45" rx="12"/>\n </g>\n <defs>\n <filter id="A">\n <feDropShadow dx="0" dy="2" stdDeviation="4" flood-opacity=".3"/>\n </filter>\n </defs>\n</svg>\n');return t.querySelector("#bubble")?.setAttribute("fill",e),t.querySelector("#pin")?.setAttribute("fill",e),Wr(t)},sn={pixelRatio:2,stretchX:[[20,45],[100,130]],stretchY:[[20,35]],content:[10,10,130,45]},cn=e=>{if(!Br())return;const t=Vr('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">\n <g id="main">\n <path fill-rule="evenodd"\n d="M11.389 4H9.025a.86.86 0 0 0-.517.173l-.001-.001a.5.5 0 0 1-.464.059l-.028-.011a.5.5 0 0 1-.129-.83A1.86 1.86 0 0 1 9.025 3h2.364a2 2 0 0 1 1.789 1.106l1.02 2.04c.471.176.802.63.802 1.156v.803c0 .543 0 .815-.071 1.038a1.5 1.5 0 0 1-.914.953c-.219.08-.491.092-1.034.114l-1.481.062v-.166-.803a2.23 2.23 0 0 0-1.055-1.897l-.74-1.479 2.326.033h.955l-.703-1.406A1 1 0 0 0 11.389 4zM12 8.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"/>\n <path d="M11.833 11.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594h-1.187c-.328 0-.594-.266-.594-.594z"/>\n <path fill-rule="evenodd"\n d="M1.802 8.146C1.331 8.321 1 8.776 1 9.302v.803c0 .543 0 .815.071 1.038a1.5 1.5 0 0 0 .914.953c.219.08.491.092 1.034.114l2.731.114 2.731-.114c.543-.023.814-.034 1.034-.114a1.5 1.5 0 0 0 .914-.953c.071-.223.071-.494.071-1.038v-.803c0-.526-.331-.98-.802-1.156l-1.02-2.04A2 2 0 0 0 6.889 5H4.611a2 2 0 0 0-1.789 1.106l-1.02 2.04zM6.889 6H4.611a1 1 0 0 0-.894.553l-.703 1.406h.955 3.563.955l-.703-1.406A1 1 0 0 0 6.889 6zM2 10.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm6.5-1a1 1 0 0 0-1 1 .5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5 1 1 0 0 0-1-1z"/>\n <path d="M1.792 13.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594H2.385c-.328 0-.594-.266-.594-.594zm5.739-.198c-.109 0-.198.089-.198.198 0 .328.266.594.594.594h1.188c.328 0 .594-.266.594-.594 0-.109-.089-.198-.198-.198h-1.98z"/>\n </g>\n</svg>\n'),r=t.querySelector("#main");return r.setAttribute("transform","scale(2)"),r.setAttribute("fill",e),Wr(t)},ln=(e,t)=>{if(!Br())return;const r=kr(t);return e&&r.appendChild(e),Wr(r)},un=(e={},t)=>Object.entries(e).map(([e,r])=>({...r,id:t?`${t}-${e}`:e})),hn=(e={},t)=>({mainLines:un(e.mainLines,t),waypoints:un(e.waypoints,t),chargingStops:un(e?.chargingStops,t),ferries:un(e.sections?.ferry,t),incidents:un(e.sections?.incident,t),tollRoads:un(e.sections?.tollRoad,t),tunnels:un(e.sections?.tunnel,t),vehicleRestricted:un(e.sections?.vehicleRestricted,t),instructionLines:un(e.instructionLines,t),instructionArrows:un(e.instructionArrows,t),summaryBubbles:un(e.summaryBubbles,t)}),pn=(e,t,r)=>{const i=a.instance.get().displayUnits,o=e?.displayUnits;return{...e,...o?{}:{displayUnits:i},layers:rn(e,t,r)}},fn=(e,t)=>{const r=t?.chargingStops?.icon;if(r?.mapping){const t=r.mapping;switch(t.basedOn){case"chargingSpeed":if(e.properties.chargingConnectionInfo?.chargingSpeed)return t.value[e.properties.chargingConnectionInfo?.chargingSpeed];break;case"custom":return t.fn(e)}}return"7309"},_n=e=>{const t=e.properties;return t.chargingParkName??t.chargingParkOperatorName},dn=(e,r)=>{const i=[];if(!1!==r?.chargingStops?.visible)for(const o of e.features)for(const e of o.properties.sections.leg){const a=e.summary.chargingInformationAtEndOfLeg;if(a){const e=a.properties;i.push({...a,properties:{...a.properties,id:a.properties.chargingParkId??t(),iconID:fn(a,r),title:_n(a),chargingPower:`${e.chargingConnectionInfo?.chargingPowerInkW} kW`,chargingDuration:n(e.chargingTimeInSeconds,r?.displayUnits?.time),routeState:o.properties.routeState}})}}return{type:"FeatureCollection",features:i}},yn=e=>e.categories.includes("jam"),An=e=>{const t=(e=>{if(yn(e))return n(e.delayInSeconds)})(e),r=((e,t)=>yn(e)?`traffic-jam-${e.magnitudeOfDelay??"unknown"}-${(e=>e?.length?e.length<6?"small":e.length<8?"medium":"large":"collapsed")(t)}`:null)(e,t),i=(e=>{switch(e.categories.find(e=>"jam"!==e)){case"accident":return"traffic-incidents-accident";case"roadworks":return"traffic-incidents-roadworks";case"road-closed":return"traffic-incidents-road_closed";case"danger":case"animals-on-road":return"traffic-incidents-danger";case"broken-down-vehicle":return"traffic-incidents-broken_down_vehicle";case"lane-closed":case"narrow-lanes":return"traffic-incidents-lane_closed";case"wind":return"traffic-incidents-wind";case"fog":return"traffic-incidents-fog";case"rain":return"traffic-incidents-rain";case"frost":return"traffic-incidents-frost";case"flooding":return"traffic-incidents-flooding";default:return null}})(e);return{...e,...r&&{jamIconID:r},...i&&{causeIconID:i},...t&&{title:t}}},gn=(e,t,r)=>{if(e.properties.radiusMeters)return void 0!==r?ji(Ka,r):Ka;let i;switch(t){case"start":i=za;break;case"finish":i=Xa;break;default:i=$a}return void 0!==r?ji(i,r):i},En=(e,r,i)=>{let o=-1;return{type:"FeatureCollection",features:e.map((a,n)=>{if(!a)return o++,null;const c=(e=>{return Array.isArray(e)?{type:"Feature",geometry:{type:"Point",coordinates:e},properties:{}}:"Point"===e.type?{type:"Feature",geometry:t=e,properties:{},...t.bbox&&{bbox:t.bbox}}:e;var t})(a),l=((e,t)=>0===e?Ba:e<t-1?Wa:Va)(n,e.length),u=(e=>!e.properties.radiusMeters)(c);u&&o++;const h=(e=>{const t=e?.properties;return t?.poi?.name??t?.address?.freeformAddress??void 0})(c),p=c.id??t();return{...c,..."main-when-available"===r?.entryPoints&&{geometry:{type:"Point",coordinates:s(c,{useEntryPoint:"main-when-available"})}},id:p,properties:{...c.properties,id:p,index:n,indexType:l,...h&&{title:h},iconID:gn(c,l,i),...u&&l===Wa&&{stopDisplayIndex:o}}}}).filter(e=>e)}};function Rn(e){return e%360*Math.PI/180}function In(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function mn(e,t,r={}){if(!0===r.final)return function(e,t){let r=mn(t,e);return r=(r+180)%360,r}(e,t);const i=In(e),o=In(t),a=Rn(i[0]),n=Rn(o[0]),s=Rn(i[1]),c=Rn(o[1]),l=Math.sin(n-a)*Math.cos(c),u=Math.cos(s)*Math.sin(c)-Math.sin(s)*Math.cos(c)*Math.cos(n-a);return Math.atan2(l,u)%(2*Math.PI)*180/Math.PI}var Tn=mn;const Sn=(e,r,i)=>({type:"FeatureCollection",features:e.features.flatMap(e=>((e,r,i)=>e.properties.sections[r]?.map(r=>{const o=r.id??t();return{type:"Feature",id:o,geometry:{type:"LineString",coordinates:e.geometry.coordinates.slice(r.startPointIndex,r.endPointIndex+1)},properties:{...i?i(r,e.properties):r,routeState:e.properties.routeState,routeIndex:e.properties.index,id:o}}})||[])(e,r,i))}),Ln=(e,t)=>{return t.show((r=e,i=t.shownFeatures,{...i,features:i.features.map(e=>({...e,properties:{...e.properties,routeState:r.features[e.properties.routeIndex||0].properties.routeState}}))}));var r,i},bn=(e,r=0)=>{const i="features"in e?e:{type:"FeatureCollection",features:[e]};return{...i,features:i.features.map((e,i)=>{const o=e.id??t();return{...e,id:o,properties:{...e.properties,id:o,routeState:i===r?"selected":"deselected"}}})}},On=(e,t)=>e.some(e=>e.magnitudeOfDelay===t),Nn=(e,r)=>({type:"FeatureCollection",features:e.features.map(e=>{const i=e.properties.summary,o=e.geometry.coordinates,a=n(i.trafficDelayInSeconds,r?.time),s=(e=>{const t=e.properties.sections.traffic;if(t?.length)return On(t,"major")?"major":On(t,"moderate")?"moderate":On(t,"minor")?"minor":void 0})(e),l=e.id??t();return{type:"Feature",id:l,geometry:{type:"Point",coordinates:o[Math.round(o.length/2)]},properties:{id:l,routeIndex:e.properties.index,routeState:e.properties.routeState,formattedDistance:c(i.lengthInMeters,r?.distance),...s&&{magnitudeOfDelay:s},...a&&{formattedTraffic:a},formattedDuration:n(i.travelTimeInSeconds,r?.time)}}})}),vn=class e extends li{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}createSourcesWithLayers(e){const t=ji("routes",this.instanceIndex);return{mainLines:new Jr(this.mapLibreMap,`${t}-mainLines`,e.mainLines,!1),waypoints:new Jr(this.mapLibreMap,`${t}-waypoints`,e.waypoints,!1),incidents:new Jr(this.mapLibreMap,`${t}-incidents`,e.incidents,!1),ferries:new Jr(this.mapLibreMap,`${t}-ferries`,e.ferries,!1),chargingStops:new Jr(this.mapLibreMap,`${t}-chargingStops`,e.chargingStops,!1),tollRoads:new Jr(this.mapLibreMap,`${t}-tollRoads`,e.tollRoads,!1),tunnels:new Jr(this.mapLibreMap,`${t}-tunnels`,e.tunnels,!1),vehicleRestricted:new Jr(this.mapLibreMap,`${t}-vehicleRestricted`,e.vehicleRestricted,!1),instructionLines:new Jr(this.mapLibreMap,`${t}-instructionLines`,e.instructionLines,!1),instructionArrows:new Jr(this.mapLibreMap,`${t}-instructionArrows`,e.instructionArrows,!1),summaryBubbles:new Jr(this.mapLibreMap,`${t}-summaryBubbles`,e.summaryBubbles,!1)}}_initSourcesWithLayers(t,r){r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.layerIDPrefix=ji("routes",this.instanceIndex)),this.layersSpecs=hn(pn(t,this.layerIDPrefix,this.instanceIndex).layers,this.layerIDPrefix);const i=this.createSourcesWithLayers(this.layersSpecs);ii(Object.values(i).flatMap(e=>e._layerSpecs),this.mapLibreMap);const o={fillColor:t?.theme?.mainColor,...t?.waypoints?.icon?.style},a={pixelRatio:2},n=ji(za,this.instanceIndex),s=ji($a,this.instanceIndex),c=ji(Ka,this.instanceIndex),l=ji(Xa,this.instanceIndex),u=ji(ua,this.instanceIndex),h=ji(Ra,this.instanceIndex),p=ji(Ia,this.instanceIndex),f=ji(Pa,this.instanceIndex),_=ji(Da,this.instanceIndex),d=ji(xa,this.instanceIndex),y=ji(Fa,this.instanceIndex);this.addImageIfNotExisting(n,(e=>{if(Br())return ln(Vr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M63.734 86.383c-1.404.026-2.78-.393-3.93-1.197s-2.01-1.949-2.46-3.271l-3.15-9.339c-1.093-3.403-3.748-6.089-7.154-7.238L37.5 62.21c-2.742-.902-4.567-3.477-4.5-6.345-.058-2.874 1.761-5.457 4.5-6.388l36-11.886c2.461-.88 5.213-.27 7.062 1.567s2.466 4.571 1.578 7.015L70.17 81.918c-.938 2.719-3.54 4.526-6.436 4.469h0z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(s,ln(void 0,o),a),this.addImageIfNotExisting(c,(()=>{if(Br())return Wr(Vr('<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <circle id="circle" cx="16" cy="16" r="12" fill="white" stroke="#105287" stroke-width="4"/>\n</svg>\n'))})(),a),this.addImageIfNotExisting(l,(e=>{if(Br())return ln(Vr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M33 83.404a2.99 2.99 0 0 1-3-2.978V44.681a2.99 2.99 0 1 1 6 0v35.745a2.99 2.99 0 0 1-3 2.978zm48-38.723H39v17.872h42V44.681zm3.878 37.851a3.02 3.02 0 0 0 4.244 0c.561-.559.878-1.317.878-2.106V44.681a2.99 2.99 0 1 0-6 0v35.745c0 .789.317 1.547.878 2.106z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(u,an,a),this.addImageIfNotExisting(h,nn("white"),sn),this.addImageIfNotExisting(p,nn("#EEEEEE"),sn),this.addImageIfNotExisting(f,cn(ia),a),this.addImageIfNotExisting(_,cn(ea),a),this.addImageIfNotExisting(d,cn(ta),a),this.addImageIfNotExisting(y,cn(ra),a);for(const e of t?.chargingStops?.icon?.customIcons??[])this.addImageIfNotExisting(e.id,e.image,{pixelRatio:e.pixelRatio??2});return i}_applyConfig(e){const t=pn(e,this.layerIDPrefix,this.instanceIndex);if(this.config){const e=hn(t.layers,this.layerIDPrefix);Object.keys(e).forEach(t=>{const r=t;((e,t,r,i)=>{const o=e.reduce((e,t)=>({...e,[t.id]:t}),{}),a=t.reduce((e,t)=>({...e,[t.id]:t}),{}),n=[],s=[],c=[],l=[];Object.keys(o).forEach(e=>{a[e]?(c.push(o[e]),l.push(a[e])):n.push(e)}),Object.keys(a).forEach(e=>{o[e]||s.push(e)});const u=r._layerSpecs;s.forEach(e=>{i.removeLayer(e);for(let t=0;t<u.length;t++)if(u[t].id===e){u.splice(t,1);break}}),n.forEach(e=>{const t={...o[e],source:r.source.id};u.push(t)}),r._updateSourceAndLayerIDs(),ri(c,l,i)})(e[r],this.layersSpecs[r],this.sourcesWithLayers[r],this.mapLibreMap)});const r=Object.values(this.sourcesWithLayers);ii(r.flatMap(e=>e._layerSpecs),this.mapLibreMap),r.forEach(e=>e.setLayersVisible(!!e.shownFeatures.features.length)),this.layersSpecs=e}return!vr(this.config?.displayUnits,t.displayUnits)&&this.sourcesWithLayers.summaryBubbles.shownFeatures.features.length&&this.sourcesWithLayers.summaryBubbles.show(Nn(this.sourcesWithLayers.mainLines.shownFeatures,t.displayUnits)),t}restoreDataAndConfigImpl(){const e=Object.entries(this.sourcesWithLayers).map(e=>({[e[0]]:e[1].shownFeatures})).reduce((e,t)=>({...e,...t}),{});this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config);for(const t of Object.keys(e))this.sourcesWithLayers[t].show(e[t])}addImageIfNotExisting(e,t,r){ni(0,e,t,this.mapLibreMap,r)}async showRoutes(e,r){const i=bn(e,r?.selectedIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(i),this.sourcesWithLayers.vehicleRestricted.show(Sn(i,"vehicleRestricted")),this.sourcesWithLayers.incidents.show(Sn(i,"traffic",An)),this.sourcesWithLayers.chargingStops.show(dn(i,this.config)),this.sourcesWithLayers.ferries.show(Sn(i,"ferry")),this.sourcesWithLayers.tunnels.show(Sn(i,"tunnel")),this.sourcesWithLayers.tollRoads.show(Sn(i,"toll")),this.sourcesWithLayers.instructionLines.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length).map(i=>({type:"Feature",geometry:{type:"LineString",coordinates:i.routePath.map(e=>e.point)},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState}}))||[])}))(i)),this.sourcesWithLayers.instructionArrows.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length&&e.routePath.length>1).map(i=>{const o=[i.routePath[i.routePath.length-2]?.point,i.routePath[i.routePath.length-1]?.point];return{type:"Feature",geometry:{type:"Point",coordinates:o[1]},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState,lastPointBearingDegrees:Tn(o[0],o[1])}}})||[])}))(i)),this.sourcesWithLayers.summaryBubbles.show(Nn(i,this.config?.displayUnits))}async clearRoutes(){await this.waitUntilModuleReady();for(const e of Object.keys(this.sourcesWithLayers))"waypoints"!==e&&this.sourcesWithLayers[e].clear()}async selectRoute(e){const t=bn(this.sourcesWithLayers.mainLines.shownFeatures,e);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(t),this.sourcesWithLayers.chargingStops.show(dn(t,this.config)),Ln(t,this.sourcesWithLayers.vehicleRestricted),Ln(t,this.sourcesWithLayers.incidents),Ln(t,this.sourcesWithLayers.ferries),Ln(t,this.sourcesWithLayers.tollRoads),Ln(t,this.sourcesWithLayers.tunnels),Ln(t,this.sourcesWithLayers.instructionLines),Ln(t,this.sourcesWithLayers.instructionArrows),Ln(t,this.sourcesWithLayers.summaryBubbles)}async showWaypoints(e){const t=Array.isArray(e)?En(e,this.config?.waypoints,this.instanceIndex):En(e.features,this.config?.waypoints,this.instanceIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.show(t)}async clearWaypoints(){await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.clear()}get events(){return{mainLines:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.mainLines,this.config?.events),waypoints:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.waypoints,this.config?.events),chargingStops:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.chargingStops,this.config?.events),summaryBubbles:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.summaryBubbles,this.config?.events),incidents:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.incidents,this.config?.events),vehicleRestricted:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vehicleRestricted,this.config?.events),ferries:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.ferries,this.config?.events),tollRoads:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tollRoads,this.config?.events),tunnels:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tunnels,this.config?.events),instructionLines:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.instructionLines,this.config?.events)}}getLayerToRenderLinesUnder(){return gi.lowestLabel}};vn.lastInstanceIndex=-1;let Cn=vn;const Mn="standardLight",wn={standardLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},standardDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},drivingLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},drivingDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},monoLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_mono-light"},monoDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_mono-dark"},satellite:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_satellite"}},Un=e=>`\${baseURL}/maps/orbis/assets/styles/\${version}/style.json?&apiVersion=1&key=\${apiKey}&map=${e}`,Pn={standardLight:Un("basic_street-light"),standardDark:Un("basic_street-dark"),drivingLight:Un("basic_street-light-driving"),drivingDark:Un("basic_street-dark-driving"),monoLight:Un("basic_mono-light"),monoDark:Un("basic_mono-dark"),satellite:Un("basic_street-satellite")},Dn=(e,t,r)=>{const i=e.id??Mn,o=new URL(Pn[i].replace("${baseURL}",t).replace("${version}",e.version??"0.6.0-0").replace("${apiKey}",r));for(const a of e.include??Yo)o.searchParams.append(a,wn[i][a]);return o.toString()},xn=e=>{const t=e.style,r=e.commonBaseURL,i=e.apiKey;return"string"==typeof t?Dn({id:t},r,i):"standard"===t?.type?Dn(t,r,i):"custom"===t?.type&&t?.url?((e,t)=>{const r=new URL(e);return r.searchParams.has("key")?console.warn("The style URL is coming with an API key parameter which takes priority. If you want to use the SDK configured API key, remove the key param from the style URL"):r.searchParams.set("key",t),r.toString()})(t.url,i):"custom"===t?.type&&t?.json?t.json:Dn({id:Mn},r,i)};class Fn{constructor(t){var r,i;this.mapReady=!1,this.styleChangeHandlers=[],this.setStyle=(e,t={keepState:!0})=>{this.mapReady=!1;for(const o of this.styleChangeHandlers)try{o.onStyleAboutToChange?.()}catch(i){console.error(i)}const r=t.keepState?((e,t)=>t&&"object"==typeof t&&"standard"===t.type&&t.include&&("string"==typeof e||"standard"===e.type&&!e.include)?{type:"standard",id:"string"==typeof e?e:e.id,include:t.include}:e)(e,this._params.style):e;this._params={...this._params,style:r},this.styleLightDarkTheme=ci(r),this.mapLibreMap.once("styledata",()=>{!this.mapReady&&vr(r,this._params.style)&&this.handleStyleData(t.keepState||!0)}),this.mapLibreMap.setStyle(xn(this._params),{validate:!1})},this.getStyle=()=>this._params.style,this._params=l(t),void 0===this._params.style&&(this._params={...this._params,style:Mn}),this.styleLightDarkTheme=ci(this._params.style),this.ensureMapLibreCSSLoaded(),this.mapLibreMap=new h({validateStyle:!1,maxTileCacheZoomLevels:22,cancelPendingTileRequestsWhileZooming:!1,...(r=this._params).mapLibre,style:xn(r),attributionControl:{compact:!1},transformRequest:(i=r,(t,r)=>t.includes("tomtom.com")?"Image"===r?{url:t}:{url:t,headers:{...e(i)}}:{url:t})}),this.mapLibreMap.once("styledata",()=>{this.handleStyleData(!1)}),this._eventsProxy=new Ai(this.mapLibreMap,this._params?.events),this.loadRTLTextPlugin()}loadRTLTextPlugin(){setTimeout(()=>{["deferred","loaded"].includes(p())||f("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!0).catch(e=>console.error("Something went wrong when setting RTL plugin",e))})}ensureMapLibreCSSLoaded(){if("undefined"==typeof document)return;if(Array.from(document.querySelectorAll('link[rel="stylesheet"], style')).some(e=>e.textContent?.includes(".maplibregl-map")))return;const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.17.0/dist/maplibre-gl.css",document.head.appendChild(e)}_setLanguage(e){this._params={...this._params,language:e};const t=e?.includes("-")?e.split("-")[0]:e;this.mapLibreMap.getStyle().layers.forEach(e=>{if("symbol"===e.type&&(e=>{const t=e.layout?.["text-field"]??"";return!!t&&("{name}"===t||2===t.length&&"name"===t[1]||3===t.length&&Array.isArray(t[1])&&"string"==typeof t[1][1]&&t[1][1].includes("name_")&&Array.isArray(t[2])&&t[2].includes("name"))})(e)){const r=t?["coalesce",["get",`name_${t}`],["get","name"]]:["get","name"];this.mapLibreMap.setLayoutProperty(e.id,"text-field",r,{validate:!1})}})}setLanguage(e){this.mapReady?this._setLanguage(e):this.mapLibreMap.once("styledata",()=>this.setLanguage(e))}getBBox(){return this.mapLibreMap.getBounds().toArray().flat()}handleStyleData(e){for(const r of Kr(this.mapLibreMap,[mi,Ti,Ri]))this.mapLibreMap.setLayoutProperty(r.id,"visibility","none",{validate:!1});if((async(e,t)=>{t.setSprite(`${e.commonBaseURL}/maps/orbis/assets/sprites/2.*/sprite?key=${e.apiKey}&poi=poi_${ci(e.style)}&apiVersion=1&apiChannel=preview`,{validate:!1})})(this._params,this.mapLibreMap),this._params.language&&this._setLanguage(this._params.language),this.mapReady=!0,e)for(const r of this.styleChangeHandlers)try{r.onStyleChanged?.()}catch(t){console.error(t)}}addStyleChangeHandler(e){this.styleChangeHandlers.push(e)}}const Hn=["unknown","accident","fog","dangerous_conditions","rain","ice","jam","lane_closed","road_closed","road_works","wind","flooding","broken_down_vehicle"],Gn={unknown:0,accident:1,fog:2,dangerous_conditions:3,rain:4,ice:5,jam:6,lane_closed:7,road_closed:8,road_works:9,wind:10,flooding:11,broken_down_vehicle:14},jn=["motorway","trunk","primary","secondary","tertiary","street"],Bn=["connecting","major_local"],Wn=["local","minor_local"],Vn=(e,t)=>e.length?1===e.length?{expression:e[0],legacy:t[0]}:{expression:["all",...e],legacy:["all",...t]}:null,kn=(e,t,r)=>{e&&(t.push(e.expression),r.push(e.legacy))},Yn=(e,t,r,i)=>{e&&kn(mo(t,e),r,i)},zn=(e,t,r)=>{Yn(e.roadCategories,"road_category",t,r),Yn(e.roadSubCategories,"road_subcategory",t,r)},$n=e=>{const t=[],r=[];if(zn(e,t,r),e.incidentCategories){const i=mo("icon_category_0",e.incidentCategories,e=>Gn[e]);kn(i,t,r)}if(e.magnitudes){const i=mo("magnitude",e.magnitudes,e=>u.indexOf(e));kn(i,t,r)}return e.delays&&kn((e=>{const t=[],r=[];if(e.mustHaveDelay&&e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push([">=",["get","delay"],i]),r.push([">=","delay",i])}else if(e.mustHaveDelay)t.push([">",["get","delay"],0]),r.push([">","delay",0]);else if(e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push(["any",["!",["has","delay"]],["==",["get","delay"],0],[">=",["get","delay"],i]]),r.push(["any",["!has","delay"],["==","delay",0],[">=","delay",i]])}return Vn(t,r)})(e.delays),t,r),Vn(t,r)},Kn=e=>{if(!e?.any?.length)return null;const t=e.any.map($n).filter(e=>!Cr(e));return Eo(t)},Xn=e=>{const t=[],r=[];if(zn(e,t,r),e.showRoadClosures){const i="only"===e.showRoadClosures?"==":"!=";t.push([i,["get","road_closure"],!0]),r.push([i,"road_closure",!0])}return Vn(t,r)},qn=(e,t,r,i)=>{for(const o of t)r.setFilter(o.id,e?Ro(e,i[o.id]):i[o.id])};class Zn extends li{static async get(e,t){return await Qr(e),await ai(e,Ti,"trafficFlow"),new Zn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ti);if(!e)throw jr(`init ${Zn.name} with source ID ${Ti}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficFlow:new Xr(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),this._filter(e?.filters,!1),e}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[Ti])}filter(e){this._filter(e)}_filter(e,t=!0){if(this.tomtomMap.mapReady)if(e?.any?.length){const t=(e=>{if(!e?.any?.length)return null;const t=e.any.map(Xn).filter(e=>!Cr(e));return Eo(t)})(e);t&&qn(t,this.getLayers(),this.mapLibreMap,this.originalFilters)}else this.config?.filters?.any?.length&&qn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);t&&(this.config=Fr({...this.config,filters:e},Cr))}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficFlow.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficFlow.isAnyLayerVisible()}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficFlow,this.config?.events)}}class Jn extends li{static async get(e,t){return await Qr(e),await ai(e,mi,"trafficIncidents"),new Jn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(mi);if(!e)throw jr(`init ${Jn.name} with source ID ${mi}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficIncidents:new Xr(this.mapLibreMap,e)}}_applyConfig(e){return this._setVisible(e?.visible??!1,{updateConfig:!1}),Cr(e?.icons?.visible)||this.setIconsVisible(e.icons.visible),this._filter(e?.filters,e?.icons?.filters,!1),e}filter(e,t){this._filter(e,t)}_filter(e,t,r=!0){if(this.tomtomMap.mapReady){if(e?.any?.length){const r=Kn(e);if(r){const e=t?this.getNonSymbolLayers():this.getLayers();qn(r,e,this.mapLibreMap,this.originalFilters)}}else this.config?.filters?.any?.length&&qn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);if(t?.any?.length){const e=Kn(t);e&&qn(e,this.getSymbolLayers(),this.mapLibreMap,this.originalFilters)}}r&&(this.config=Fr({...this.config,filters:e,icons:{...this.config?.icons,filters:t}},Cr))}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[mi])}getSymbolLayers(){return this.getLayers().filter(e=>"symbol"===e.type)}getNonSymbolLayers(){return this.getLayers().filter(e=>"symbol"!=e.type)}setIconsVisible(e){this.config={...this.config,icons:{...this.config?.icons,visible:e}},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e,e=>"symbol"===e.type)}setVisible(e){this._setVisible(e)}_setVisible(e,t){(t?.updateConfig??!0)&&(delete this.config?.icons?.visible,this.config={...Fr({...this.config},Nr),visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficIncidents.isAnyLayerVisible()}anyIconLayersVisible(){return!!this.sourcesWithLayers.trafficIncidents?.isAnyLayerVisible(e=>"symbol"===e.type)}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficIncidents,this.config?.events)}}const Qn=(e,t)=>({left:e.left-t.left,top:e.top-t.top,right:e.right-t.left,bottom:e.bottom-t.top}),es=(e,t,r)=>e.right<=0||e.left>=t||e.bottom<=0||e.top>=r,ts=(e,t,r,i)=>{e.top<=r-e.bottom?t.top=Math.max(t.top,e.bottom+i):t.bottom=Math.min(t.bottom,e.top-i)},rs=(e,t,r,i)=>{e.left<=r-e.right?t.left=Math.max(t.left,e.right+i):t.right=Math.min(t.right,e.left-i)},is=(e,t,r,i,o)=>{const a=((e,t,r)=>({left:Math.max(0,e.left),top:Math.max(0,e.top),right:Math.min(t,e.right),bottom:Math.min(r,e.bottom)}))(e,r,i),n=e.left<=0&&e.right>=r,s=e.top<=0&&e.bottom>=i;if(n&&!s)return void ts(a,t,i,o);if(s&&!n)return void rs(a,t,r,o);const c=e.left<=0,l=e.right>=r,u=e.top<=0,h=e.bottom>=i;!c&&!l||u||h?!u&&!h||c||l?((e,t,r,i,o)=>{const a=e.left,n=r-e.right,s=e.top,c=i-e.bottom,l=Math.min(a,n,s,c);l===a?t.left=Math.max(t.left,e.right+o):l===n?t.right=Math.min(t.right,e.left-o):l===s?t.top=Math.max(t.top,e.bottom+o):t.bottom=Math.min(t.bottom,e.top-o)})(a,t,r,i,o):rs(a,t,r,o):ts(a,t,i,o)},os=e=>"string"==typeof e?document.querySelector(e):e,as=e=>"mapLibreMap"in e?e.mapLibreMap:e,ns=(e,t,r)=>{const i=as(e).getContainer().getBoundingClientRect(),{width:o,height:a}=i,n={left:r,top:r,right:o-r,bottom:a-r};for(const s of t){const e=os(s);if(!e)continue;const t=e.getBoundingClientRect(),c=Qn(t,i);es(c,o,a)||is(c,n,o,a,r)}return n.left>=n.right||n.top>=n.bottom?null:{visibleAreaBounds:n,mapWidthPX:o,mapHeightPX:a}},ss=e=>{const{map:t,surroundingElements:r,paddingPX:i=0}=e,o=ns(t,r,i);if(!o)return null;const{visibleAreaBounds:a}=o,n=as(t),s=n.unproject([a.left,a.bottom]),c=n.unproject([a.right,a.top]);return[s.lng,s.lat,c.lng,c.lat]},cs=e=>{const{map:t,surroundingElements:r}=e,i=ss({map:t,surroundingElements:r});if(!i)return null;const[o,a,n,s]=i;return[(o+n)/2,(a+s)/2]},ls=e=>{const{map:t,toBeContainedBBox:r,surroundingElements:i,paddingPX:o=0}=e,a=ns(t,i,o);if(!a)return null;const{visibleAreaBounds:n,mapWidthPX:s,mapHeightPX:c}=a,l=n.left/s,u=n.right/s,h=n.top/c,p=u-l,f=n.bottom/c-h,[_,d,y,A]=r,g=(y-_)/p,E=(A-d)/f,R=_-l*g,I=A+h*E;return[R,I-E,R+g,I]};export{li as AbstractMapModule,$r as AbstractSourceWithLayers,qr as AddedSourceWithLayers,Ii as BASE_MAP_SOURCE_ID,vo as BaseMapModule,Ko as DESELECTED_FOREGROUND_COLOR,Xo as DESELECTED_OUTLINE_COLOR,Qo as DESELECTED_ROUTE_FILTER,qo as DESELECTED_SECONDARY_COLOR,ui as EventsModule,Ai as EventsProxy,Va as FINISH_INDEX,wo as GEOMETRY_COLOR_PROP,Mo as GEOMETRY_TITLE_PROP,Jr as GeoJSONSourceWithLayers,Wo as GeometriesModule,Ri as HILLSHADE_SOURCE_ID,Vo as HillshadeModule,ka as INDEX_TYPE,ea as MAJOR_DELAY_COLOR,Wa as MIDDLE_INDEX,ra as MINOR_DELAY_LABEL_COLOR,ta as MODERATE_DELAY_COLOR,Ei as POI_SOURCE_ID,Lo as POIsModule,Ao as PlacesModule,zo as ROUTE_LINE_FOREGROUND_COLOR,Zo as ROUTE_LINE_FOREGROUND_WIDTH,$o as ROUTE_LINE_OUTLINE_COLOR,Cn as RoutingModule,Jo as SELECTED_ROUTE_FILTER,Ba as START_INDEX,Ya as STOP_DISPLAY_INDEX,Xr as StyleSourceWithLayers,Ti as TRAFFIC_FLOW_SOURCE_ID,mi as TRAFFIC_INCIDENTS_SOURCE_ID,Fn as TomTomMap,zr as TomTomMapSource,Zn as TrafficFlowModule,Jn as TrafficIncidentsModule,ia as UNKNOWN_DELAY_COLOR,Co as baseMapLayerGroupNames,co as buildPlaceTitle,rn as buildRoutingLayers,ls as calculateFittingBBox,ss as calculatePaddedBBox,cs as calculatePaddedCenter,on as defaultRoutingLayers,Kr as filterLayersBySources,uo as getIconIDForPlace,ho as getPOILayerCategoryForPlace,So as getStyleCategories,Hn as incidentCategories,Gn as incidentCategoriesMapping,Li as mapDisplayPoiCategoryMappings,gi as mapStyleLayerIDs,To as poiCategoryGroups,Si as poiLayerIDs,_o as preparePlacesForDisplay,jn as roadCategories,ko as standardStyleIDs,Wn as streetRoadCategories,Yo as styleModules,Bn as tertiaryRoadCategories,Oi as toBaseMapPOICategory,po as toPlaces};
1
+ import{generateTomTomHeaders as e,generateId as t,poiCategoriesToID as r,bboxFromCoordsArray as i,bboxCenter as o,TomTomConfig as a,formatDuration as n,getPosition as s,formatDistance as c,mergeFromGlobal as l,indexedMagnitudes as u}from"@tomtom-org/maps-sdk/core";import{Map as h,getRTLTextPluginStatus as p,setRTLTextPlugin as f}from"maplibre-gl";var _="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,y=_||d||Function("return this")(),A=y.Symbol,g=Object.prototype,E=g.hasOwnProperty,R=g.toString,I=A?A.toStringTag:void 0;var m=Object.prototype.toString;var T=A?A.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?function(e){var t=E.call(e,I),r=e[I];try{e[I]=void 0;var i=!0}catch(a){}var o=R.call(e);return i&&(t?e[I]=r:delete e[I]),o}(e):function(e){return m.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function b(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==S(e)}function O(e,t){for(var r=-1,i=null==e?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}var N=Array.isArray,v=A?A.prototype:void 0,C=v?v.toString:void 0;function M(e){if("string"==typeof e)return e;if(N(e))return O(e,M)+"";if(b(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function U(e){return e}function P(e){if(!w(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var D,x=y["__core-js_shared__"],F=(D=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"";var H=Function.prototype.toString;function G(e){if(null!=e){try{return H.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var j=/^\[object .+?Constructor\]$/,B=Function.prototype,W=Object.prototype,V=B.toString,k=W.hasOwnProperty,Y=RegExp("^"+V.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function z(e){return!(!w(e)||(t=e,F&&F in t))&&(P(e)?Y:j).test(G(e));var t}function $(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return z(r)?r:void 0}var K=$(y,"WeakMap");var X=Date.now;var q,Z,J,Q=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),ee=Q?function(e,t){return Q(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:U,te=(q=ee,Z=0,J=0,function(){var e=X(),t=16-(e-J);if(J=e,t>0){if(++Z>=800)return arguments[0]}else Z=0;return q.apply(void 0,arguments)});var re=/^(?:0|[1-9]\d*)$/;function ie(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&re.test(e))&&e>-1&&e%1==0&&e<t}function oe(e,t,r){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function ae(e,t){return e===t||e!=e&&t!=t}var ne=Object.prototype.hasOwnProperty;function se(e,t,r){var i=e[t];ne.call(e,t)&&ae(i,r)&&(void 0!==r||t in e)||oe(e,t,r)}var ce=Math.max;function le(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ue(e){return null!=e&&le(e.length)&&!P(e)}var he=Object.prototype;function pe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function fe(e){return L(e)&&"[object Arguments]"==S(e)}var _e=Object.prototype,de=_e.hasOwnProperty,ye=_e.propertyIsEnumerable,Ae=fe(/* @__PURE__ */function(){return arguments}())?fe:function(e){return L(e)&&de.call(e,"callee")&&!ye.call(e,"callee")};var ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ee=ge&&"object"==typeof module&&module&&!module.nodeType&&module,Re=Ee&&Ee.exports===ge?y.Buffer:void 0,Ie=(Re?Re.isBuffer:void 0)||function(){return!1},me={};function Te(e){return function(t){return e(t)}}me["[object Float32Array]"]=me["[object Float64Array]"]=me["[object Int8Array]"]=me["[object Int16Array]"]=me["[object Int32Array]"]=me["[object Uint8Array]"]=me["[object Uint8ClampedArray]"]=me["[object Uint16Array]"]=me["[object Uint32Array]"]=!0,me["[object Arguments]"]=me["[object Array]"]=me["[object ArrayBuffer]"]=me["[object Boolean]"]=me["[object DataView]"]=me["[object Date]"]=me["[object Error]"]=me["[object Function]"]=me["[object Map]"]=me["[object Number]"]=me["[object Object]"]=me["[object RegExp]"]=me["[object Set]"]=me["[object String]"]=me["[object WeakMap]"]=!1;var Se="object"==typeof exports&&exports&&!exports.nodeType&&exports,Le=Se&&"object"==typeof module&&module&&!module.nodeType&&module,be=Le&&Le.exports===Se&&_.process,Oe=function(){try{var e=Le&&Le.require&&Le.require("util").types;return e||be&&be.binding&&be.binding("util")}catch(t){}}(),Ne=Oe&&Oe.isTypedArray,ve=Ne?Te(Ne):function(e){return L(e)&&le(e.length)&&!!me[S(e)]},Ce=Object.prototype.hasOwnProperty;function Me(e,t){var r=N(e),i=!r&&Ae(e),o=!r&&!i&&Ie(e),a=!r&&!i&&!o&&ve(e),n=r||i||o||a,s=n?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],c=s.length;for(var l in e)!t&&!Ce.call(e,l)||n&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ie(l,c))||s.push(l);return s}function we(e,t){return function(r){return e(t(r))}}var Ue=we(Object.keys,Object),Pe=Object.prototype.hasOwnProperty;function De(e){if(!pe(e))return Ue(e);var t=[];for(var r in Object(e))Pe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function xe(e){return ue(e)?Me(e):De(e)}var Fe=Object.prototype.hasOwnProperty;function He(e){if(!w(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=pe(e),r=[];for(var i in e)("constructor"!=i||!t&&Fe.call(e,i))&&r.push(i);return r}function Ge(e){return ue(e)?Me(e,!0):He(e)}var je=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;function We(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!b(e))||(Be.test(e)||!je.test(e)||null!=t&&e in Object(t))}var Ve=$(Object,"create");var ke=Object.prototype.hasOwnProperty;var Ye=Object.prototype.hasOwnProperty;function ze(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function $e(e,t){for(var r=e.length;r--;)if(ae(e[r][0],t))return r;return-1}ze.prototype.clear=function(){this.__data__=Ve?Ve(null):{},this.size=0},ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ze.prototype.get=function(e){var t=this.__data__;if(Ve){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ke.call(t,e)?t[e]:void 0},ze.prototype.has=function(e){var t=this.__data__;return Ve?void 0!==t[e]:Ye.call(t,e)},ze.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ve&&void 0===t?"__lodash_hash_undefined__":t,this};var Ke=Array.prototype.splice;function Xe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Xe.prototype.clear=function(){this.__data__=[],this.size=0},Xe.prototype.delete=function(e){var t=this.__data__,r=$e(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ke.call(t,r,1),--this.size,!0)},Xe.prototype.get=function(e){var t=this.__data__,r=$e(t,e);return r<0?void 0:t[r][1]},Xe.prototype.has=function(e){return $e(this.__data__,e)>-1},Xe.prototype.set=function(e,t){var r=this.__data__,i=$e(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var qe=$(y,"Map");function Ze(e,t){var r,i,o=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Je(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Je.prototype.clear=function(){this.size=0,this.__data__={hash:new ze,map:new(qe||Xe),string:new ze}},Je.prototype.delete=function(e){var t=Ze(this,e).delete(e);return this.size-=t?1:0,t},Je.prototype.get=function(e){return Ze(this,e).get(e)},Je.prototype.has=function(e){return Ze(this,e).has(e)},Je.prototype.set=function(e,t){var r=Ze(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this};function Qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var i=arguments,o=t?t.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);var n=e.apply(this,i);return r.cache=a.set(o,n)||a,n};return r.cache=new(Qe.Cache||Je),r}Qe.Cache=Je;var et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/\\(\\)?/g,rt=function(e){var t=Qe(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(et,function(e,r,i,o){t.push(i?o.replace(tt,"$1"):r||e)}),t});function it(e,t){return N(e)?e:We(e,t)?[e]:rt(function(e){return null==e?"":M(e)}(e))}function ot(e){if("string"==typeof e||b(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function at(e,t){for(var r=0,i=(t=it(t,e)).length;null!=e&&r<i;)e=e[ot(t[r++])];return r&&r==i?e:void 0}function nt(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}var st=A?A.isConcatSpreadable:void 0;function ct(e){return N(e)||Ae(e)||!!(st&&e&&e[st])}function lt(e){return(null==e?0:e.length)?function(e,t,r,i,o){var a=-1,n=e.length;for(r||(r=ct),o||(o=[]);++a<n;){var s=e[a];r(s)?nt(o,s):o[o.length]=s}return o}(e):[]}var ut=we(Object.getPrototypeOf,Object),ht=Function.prototype,pt=Object.prototype,ft=ht.toString,_t=pt.hasOwnProperty,dt=ft.call(Object);function yt(e){var t=this.__data__=new Xe(e);this.size=t.size}yt.prototype.clear=function(){this.__data__=new Xe,this.size=0},yt.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},yt.prototype.get=function(e){return this.__data__.get(e)},yt.prototype.has=function(e){return this.__data__.has(e)},yt.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Xe){var i=r.__data__;if(!qe||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Je(i)}return r.set(e,t),this.size=r.size,this};var At="object"==typeof exports&&exports&&!exports.nodeType&&exports,gt=At&&"object"==typeof module&&module&&!module.nodeType&&module,Et=gt&&gt.exports===At?y.Buffer:void 0;function Rt(){return[]}Et&&Et.allocUnsafe;var It=Object.prototype.propertyIsEnumerable,mt=Object.getOwnPropertySymbols,Tt=mt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,i=null==e?0:e.length,o=0,a=[];++r<i;){var n=e[r];t(n,r,e)&&(a[o++]=n)}return a}(mt(e),function(t){return It.call(e,t)}))}:Rt,St=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)nt(t,Tt(e)),e=ut(e);return t}:Rt;function Lt(e,t,r){var i=t(e);return N(e)?i:nt(i,r(e))}function bt(e){return Lt(e,xe,Tt)}function Ot(e){return Lt(e,Ge,St)}var Nt=$(y,"DataView"),vt=$(y,"Promise"),Ct=$(y,"Set"),Mt="[object Map]",wt="[object Promise]",Ut="[object Set]",Pt="[object WeakMap]",Dt="[object DataView]",xt=G(Nt),Ft=G(qe),Ht=G(vt),Gt=G(Ct),jt=G(K),Bt=S;(Nt&&Bt(new Nt(new ArrayBuffer(1)))!=Dt||qe&&Bt(new qe)!=Mt||vt&&Bt(vt.resolve())!=wt||Ct&&Bt(new Ct)!=Ut||K&&Bt(new K)!=Pt)&&(Bt=function(e){var t=S(e),r="[object Object]"==t?e.constructor:void 0,i=r?G(r):"";if(i)switch(i){case xt:return Dt;case Ft:return Mt;case Ht:return wt;case Gt:return Ut;case jt:return Pt}return t});var Wt=Object.prototype.hasOwnProperty;var Vt=y.Uint8Array;function kt(e){var t=new e.constructor(e.byteLength);return new Vt(t).set(new Vt(e)),t}var Yt=/\w*$/;var zt=A?A.prototype:void 0,$t=zt?zt.valueOf:void 0;function Kt(e,t,r){var i,o,a,n,s,c=e.constructor;switch(t){case"[object ArrayBuffer]":return kt(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return s=kt((n=e).buffer),new n.constructor(s,n.byteOffset,n.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=kt(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return(a=new(o=e).constructor(o.source,Yt.exec(o))).lastIndex=o.lastIndex,a;case"[object Symbol]":return i=e,$t?Object($t.call(i)):{}}}var Xt=Oe&&Oe.isMap,qt=Xt?Te(Xt):function(e){return L(e)&&"[object Map]"==Bt(e)};var Zt=Oe&&Oe.isSet,Jt=Zt?Te(Zt):function(e){return L(e)&&"[object Set]"==Bt(e)},Qt="[object Arguments]",er="[object Function]",tr="[object Object]",rr={};function ir(e,t,r,i,o,a){var n;if(r&&(n=o?r(e,i,o,a):r(e)),void 0!==n)return n;if(!w(e))return e;var s=N(e);if(s)n=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Wt.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e);else{var c=Bt(e),l=c==er||"[object GeneratorFunction]"==c;if(Ie(e))return e.slice();if(c==tr||c==Qt||l&&!o)n={};else{if(!rr[c])return o?e:{};n=Kt(e,c)}}a||(a=new yt);var u=a.get(e);if(u)return u;a.set(e,n),Jt(e)?e.forEach(function(i){n.add(ir(i,t,r,i,e,a))}):qt(e)&&e.forEach(function(i,o){n.set(o,ir(i,t,r,o,e,a))});var h=s?void 0:Ot(e);return function(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););}(h||e,function(i,o){h&&(i=e[o=i]),se(n,o,ir(i,t,r,o,e,a))}),n}rr[Qt]=rr["[object Array]"]=rr["[object ArrayBuffer]"]=rr["[object DataView]"]=rr["[object Boolean]"]=rr["[object Date]"]=rr["[object Float32Array]"]=rr["[object Float64Array]"]=rr["[object Int8Array]"]=rr["[object Int16Array]"]=rr["[object Int32Array]"]=rr["[object Map]"]=rr["[object Number]"]=rr[tr]=rr["[object RegExp]"]=rr["[object Set]"]=rr["[object String]"]=rr["[object Symbol]"]=rr["[object Uint8Array]"]=rr["[object Uint8ClampedArray]"]=rr["[object Uint16Array]"]=rr["[object Uint32Array]"]=!0,rr["[object Error]"]=rr[er]=rr["[object WeakMap]"]=!1;function or(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Je;++t<r;)this.add(e[t])}function ar(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}or.prototype.add=or.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},or.prototype.has=function(e){return this.__data__.has(e)};function nr(e,t,r,i,o,a){var n=1&r,s=e.length,c=t.length;if(s!=c&&!(n&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var h=-1,p=!0,f=2&r?new or:void 0;for(a.set(e,t),a.set(t,e);++h<s;){var _=e[h],d=t[h];if(i)var y=n?i(d,_,h,t,e,a):i(_,d,h,e,t,a);if(void 0!==y){if(y)continue;p=!1;break}if(f){if(!ar(t,function(e,t){if(n=t,!f.has(n)&&(_===e||o(_,e,r,i,a)))return f.push(t);var n})){p=!1;break}}else if(_!==d&&!o(_,d,r,i,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var lr=A?A.prototype:void 0,ur=lr?lr.valueOf:void 0;var hr=Object.prototype.hasOwnProperty;var pr="[object Arguments]",fr="[object Array]",_r="[object Object]",dr=Object.prototype.hasOwnProperty;function yr(e,t,r,i,o,a){var n=N(e),s=N(t),c=n?fr:Bt(e),l=s?fr:Bt(t),u=(c=c==pr?_r:c)==_r,h=(l=l==pr?_r:l)==_r,p=c==l;if(p&&Ie(e)){if(!Ie(t))return!1;n=!0,u=!1}if(p&&!u)return a||(a=new yt),n||ve(e)?nr(e,t,r,i,o,a):function(e,t,r,i,o,a,n){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new Vt(e),new Vt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=sr;case"[object Set]":var c=1&i;if(s||(s=cr),e.size!=t.size&&!c)return!1;var l=n.get(e);if(l)return l==t;i|=2,n.set(e,t);var u=nr(s(e),s(t),i,o,a,n);return n.delete(e),u;case"[object Symbol]":if(ur)return ur.call(e)==ur.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var f=u&&dr.call(e,"__wrapped__"),_=h&&dr.call(t,"__wrapped__");if(f||_){var d=f?e.value():e,y=_?t.value():t;return a||(a=new yt),o(d,y,r,i,a)}}return!!p&&(a||(a=new yt),function(e,t,r,i,o,a){var n=1&r,s=bt(e),c=s.length;if(c!=bt(t).length&&!n)return!1;for(var l=c;l--;){var u=s[l];if(!(n?u in t:hr.call(t,u)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var f=!0;a.set(e,t),a.set(t,e);for(var _=n;++l<c;){var d=e[u=s[l]],y=t[u];if(i)var A=n?i(y,d,u,t,e,a):i(d,y,u,e,t,a);if(!(void 0===A?d===y||o(d,y,r,i,a):A)){f=!1;break}_||(_="constructor"==u)}if(f&&!_){var g=e.constructor,E=t.constructor;g==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof E&&E instanceof E||(f=!1)}return a.delete(e),a.delete(t),f}(e,t,r,i,o,a))}function Ar(e,t,r,i,o){return e===t||(null==e||null==t||!L(e)&&!L(t)?e!=e&&t!=t:yr(e,t,r,i,Ar,o))}function gr(e){return e==e&&!w(e)}function Er(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function Rr(e){var t=function(e){for(var t=xe(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,gr(o)]}return t}(e);return 1==t.length&&t[0][2]?Er(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,i){var o=r.length,a=o;if(null==e)return!a;for(e=Object(e);o--;){var n=r[o];if(n[2]?n[1]!==e[n[0]]:!(n[0]in e))return!1}for(;++o<a;){var s=(n=r[o])[0],c=e[s],l=n[1];if(n[2]){if(void 0===c&&!(s in e))return!1}else if(!Ar(l,c,3,i,new yt))return!1}return!0}(r,0,t)}}function Ir(e,t){return null!=e&&t in Object(e)}function mr(e,t){return null!=e&&function(e,t,r){for(var i=-1,o=(t=it(t,e)).length,a=!1;++i<o;){var n=ot(t[i]);if(!(a=null!=e&&r(e,n)))break;e=e[n]}return a||++i!=o?a:!!(o=null==e?0:e.length)&&le(o)&&ie(n,o)&&(N(e)||Ae(e))}(e,t,Ir)}function Tr(e,t){return We(e)&&gr(t)?Er(ot(e),t):function(r){var i=function(e,t,r){var i=null==e?void 0:at(e,t);return void 0===i?r:i}(r,e);return void 0===i&&i===t?mr(r,e):Ar(t,i,3)}}function Sr(e){return We(e)?(t=ot(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return at(t,e)}}(e);var t}function Lr(e){return"function"==typeof e?e:null==e?U:"object"==typeof e?N(e)?Tr(e[0],e[1]):Rr(e):Sr(e)}function br(e,t){return t.length<2?e:at(e,function(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++i<o;)a[i]=e[i+t];return a}(t,0,-1))}var Or=Object.prototype.hasOwnProperty;function Nr(e){if(null==e)return!0;if(ue(e)&&(N(e)||"string"==typeof e||"function"==typeof e.splice||Ie(e)||ve(e)||Ae(e)))return!e.length;var t=Bt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(pe(e))return!De(e).length;for(var r in e)if(Or.call(e,r))return!1;return!0}function vr(e,t){return Ar(e,t)}function Cr(e){return null==e}var Mr=Object.prototype.hasOwnProperty;function wr(e,t){var r=-1,i=(t=it(t,e)).length;if(!i)return!0;for(var o=null==e||"object"!=typeof e&&"function"!=typeof e;++r<i;){var a=t[r];if("string"==typeof a){if("__proto__"===a&&!Mr.call(e,"__proto__"))return!1;if("constructor"===a&&r+1<i&&"string"==typeof t[r+1]&&"prototype"===t[r+1]){if(o&&0===r)continue;return!1}}}var n=br(e,t);return null==n||delete n[ot(function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t))]}function Ur(e){return function(e){if(!L(e)||"[object Object]"!=S(e))return!1;var t=ut(e);if(null===t)return!0;var r=_t.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ft.call(r)==dt}(e)?void 0:e}var Pr=function(e){return te(function(e,t,r){return t=ce(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=ce(i.length-t,0),n=Array(a);++o<a;)n[o]=i[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=i[o];return s[t]=r(n),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,void 0,lt),e+"")}(function(e,t){var r={};if(null==e)return r;var i=!1;t=O(t,function(t){return t=it(t,e),i||(i=t.length>1),t}),function(e,t,r){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var n=t[o],s=void 0;void 0===s&&(s=e[n]),i?oe(r,n,s):se(r,n,s)}}(e,Ot(e),r),i&&(r=ir(r,7,Ur));for(var o=t.length;o--;)wr(r,t[o]);return r});function Dr(e,t,r,i){if(!w(e))return e;for(var o=-1,a=(t=it(t,e)).length,n=a-1,s=e;null!=s&&++o<a;){var c=ot(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=n){var u=s[c];void 0===(l=void 0)&&(l=w(u)?u:ie(t[o+1])?[]:{})}se(s,c,l),s=s[c]}return e}function xr(e,t){if(null==e)return{};var r=O(Ot(e),function(e){return[e]});return t=Lr(t),function(e,t,r){for(var i=-1,o=t.length,a={};++i<o;){var n=t[i],s=at(e,n);r(s,n)&&Dr(a,it(n,e),s)}return a}(e,r,function(e,r){return t(e,r[0])})}function Fr(e,t){return xr(e,function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(Lr(t)))}var Hr=Array.prototype.splice;function Gr(e,t){var r=[];if(!e||!e.length)return r;var i=-1,o=[],a=e.length;for(t=Lr(t);++i<a;){var n=e[i];t(n,i,e)&&(r.push(n),o.push(i))}return function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var o=t[r];if(r==i||o!==a){var a=o;ie(o)?Hr.call(e,o,1):wr(e,o)}}}(e,o),r}const jr=e=>new Error(`Trying to ${e} while it is not in the map style. Did you exclude it when loading the map?`),Br=()=>"undefined"!=typeof document&&"undefined"!=typeof DOMParser&&"undefined"!=typeof btoa,Wr=e=>{if(!Br())return;const t=document.createElement("img");return t.src=`data:image/svg+xml;base64,${btoa((new XMLSerializer).serializeToString(e))}`,t},Vr=e=>(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,kr=e=>{const t=Vr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path id="background" d="M63.95 137.516c6.556-12.737 19.098-21.09 30.828-29.388C110.046 97.324 120 79.603 120 59.574 120 26.671 93.138 0 60 0S0 26.671 0 59.574c0 20.029 9.954 37.75 25.22 48.55 11.734 8.302 24.274 16.652 30.83 29.388 1.706 3.316 6.194 3.316 7.9 0z"\n fill="#1988cf"/>\n <path id="outline" d="M91.298 103.272C105.052 93.544 114 77.596 114 59.574c0-29.61-24.176-53.617-54-53.617S6 29.964 6 59.574c0 18.022 8.95 33.97 22.7 43.698l2.27 1.601c10.172 7.153 21.922 15.423 29.03 27.416 7.104-11.993 18.858-20.259 29.03-27.416l2.268-1.601zm1.468 6.274c-11.13 7.845-22.632 15.957-28.816 27.966-1.706 3.316-6.194 3.316-7.9 0-6.182-12.009-17.686-20.121-28.816-27.966l-2.016-1.422C9.954 97.324 0 79.603 0 59.574 0 26.671 26.862 0 60 0s60 26.671 60 59.574c0 20.029-9.954 37.75-25.222 48.55l-2.016 1.422z"\n fill-opacity=".3"/>\n</svg>\n');return e?.fillColor&&t.querySelector("#background")?.setAttribute("fill",e.fillColor),e?.outlineColor&&t.querySelector("#outline")?.setAttribute("fill",e.outlineColor),void 0!==e?.outlineOpacity&&t.querySelector("#outline")?.setAttribute("fill-opacity",e.outlineOpacity.toString()),t};const Yr=e=>(function(e){if(Cr(e))throw new Error(`${e} must not be null/undefined. Something went wrong with its initialization.`)}(e),e);class zr{constructor(e,t,r){this.id=e,this.spec=t,this.runtimeSource=r}ensureAddedToMap(e){this.runtimeSource||(!e.getSource(this.id)&&this.spec&&e.addSource(this.id,this.spec),this.runtimeSource=e.getSource(this.id))}}class $r{constructor(e,t,r){this.map=e,this.source=t,this._layerSpecs=r,this._updateSourceAndLayerIDs()}isAnyLayerVisible(e){return this.getLayerSpecs(e).some(e=>this.isLayerVisible(e))}areAllLayersVisible(e){return this.getLayerSpecs(e).every(e=>this.isLayerVisible(e))}getLayerSpecs(e){return e?this._layerSpecs.filter(e):this._layerSpecs}_updateSourceAndLayerIDs(){this._sourceAndLayerIDs={sourceID:this.source.id,layerIDs:this._layerSpecs.map(e=>e.id)}}isLayerVisible(e){return"none"!==this.map.getLayoutProperty(e.id,"visibility")}setLayersVisible(e,t){for(const r of this.getLayerSpecs(t))this.map.setLayoutProperty(r.id,"visibility",e?"visible":"none",{validate:!1})}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}equalSourceAndLayerIDs(e){return this.sourceAndLayerIDs.sourceID===e.sourceAndLayerIDs.sourceID&&this.sourceAndLayerIDs.layerIDs.length===e.sourceAndLayerIDs.layerIDs.length&&this.sourceAndLayerIDs.layerIDs.every((t,r)=>t===e.sourceAndLayerIDs.layerIDs[r])}}const Kr=(e,t)=>e.getStyle().layers.filter(e=>t.includes(e?.source));class Xr extends $r{constructor(e,t,r){let i=Kr(e,[t.id]);r&&(i=i.filter(r)),super(e,new zr(t.id,e.getStyle().sources[t.id],t),i)}}class qr extends $r{constructor(e,t,r,i){super(e,new zr(t,r),i.map(e=>({...e,source:t})))}ensureLayersAddedToMap(){for(const e of this._layerSpecs)this.map.getLayer(e.id)||this.map.addLayer(e,e.beforeID)}ensureAddedToMapWithVisibility(e,t){this.source.ensureAddedToMap(this.map),t&&(this.ensureLayersAddedToMap(),this.setLayersVisible(e))}}const Zr={type:"FeatureCollection",features:[]};class Jr extends qr{constructor(e,t,r,i=!0){super(e,t,{type:"geojson",data:Zr,promoteId:"id"},r),this.shownFeatures=Zr,this.ensureAddedToMapWithVisibility(!1,i)}show(e){this.shownFeatures=e,Yr(this.source.runtimeSource).setData(e),this.setLayersVisible(!!e.features.length)}clear(){this.show(Zr)}findFeature(e){return"index"in e?this.shownFeatures.features[e.index]:"id"in e?this.shownFeatures.features.find(t=>t.id===e.id):void 0}putEventState(e){if("put"===(e.mode??"put"))for(const r of this.shownFeatures.features)r.properties?.eventState===e.state&&delete r.properties.eventState;const t=this.findFeature(e);t&&(t.properties={...t.properties,eventState:e.state}),!1!==e.show&&this.show(this.shownFeatures)}cleanEventState(e){const t=this.findFeature(e);t?.properties?.eventState&&(delete t?.properties?.eventState,!1!==e?.show&&this.show(this.shownFeatures))}cleanEventStates(e){let t=!1;for(const r of this.shownFeatures.features)e?.states&&!e.states.includes(r.properties?.eventState)||(delete r.properties?.eventState,t=!0);!1!==e?.show&&t&&this.show(this.shownFeatures)}}const Qr=async e=>{e.mapReady||(await e.mapLibreMap.once("styledata"),await Qr(e))},ei=e=>{for(const r of e)if(r&&Object.keys(r.properties).length)for(const e in r.properties)if("string"==typeof r.properties[e])try{r.properties[e]=JSON.parse(r.properties[e])}catch(t){}},ti=(e,t,r)=>{const i=e.id;e.maxzoom===t.maxzoom&&e.minzoom===t.minzoom||r.setLayerZoomRange(i,e.minzoom??r.getMinZoom(),e.maxzoom??r.getMaxZoom()),r.setFilter(i,e.filter,{validate:!1});for(const o of Object.keys(t.layout??[]))e.layout?.[o]||r.setLayoutProperty(i,o,void 0,{validate:!1});for(const o of Object.keys(t.paint??[]))e.paint?.[o]||r.setPaintProperty(i,o,void 0,{validate:!1});for(const[o,a]of Object.entries(e.paint??[]))r.setPaintProperty(i,o,a,{validate:!1});for(const[o,a]of Object.entries(e.layout??[]))r.setLayoutProperty(i,o,a,{validate:!1})},ri=(e,t,r)=>{e.forEach((e,i)=>ti(e,t[i],r))},ii=(e,t)=>{const r=/* @__PURE__ */new Set,i=e=>{t.getLayer(e.id)||t.addLayer({...e,layout:{...e.layout,visibility:"none"}},e.beforeID),r.add(e.id)},o={};for(e.forEach(e=>{e.beforeID?r.has(e.beforeID)||t.getLayer(e.beforeID)?(r.add(e.beforeID),i(e)):o[e.beforeID]?o[e.beforeID].push(e):o[e.beforeID]=[e]:i(e)});Object.keys(o).length>0;){const e=Object.keys(o).filter(e=>r.has(e));if(!e.length)return void console.error(`Some layers cannot be added. Check for non-existing layers, or circular beforeID dependencies for the following: ${JSON.stringify(Object.keys(o))}`);e.forEach(e=>{o[e].forEach(e=>i(e)),delete o[e]})}},oi=(e,t)=>{switch(typeof e){case"undefined":return{type:"standard",include:[t]};case"string":return{type:"standard",id:e,include:[t]};default:if("standard"===e.type)return e.include?{...e,include:[...e.include,t]}:{...e,include:[t]};throw(e=>new Error(`Trying to add style module ${e} to the custom style!`))(t)}},ai=async(e,t,r)=>{if(!e.mapLibreMap.getSource(t)){const i=e.mapLibreMap;i.isStyleLoaded()||await i.once("idle"),e.setStyle(oi(e.getStyle(),r)),await(async(e,t)=>{e.mapLibreMap.getSource(t)&&e.mapLibreMap.isSourceLoaded(t)||await e.mapLibreMap.once("sourcedata")})(e,t),await i.once("styledata");for(const e of Kr(i,[t]))i.setLayoutProperty(e.id,"visibility","none",{validate:!1});await i.once("styledata")}},ni=async(e,t,r,i,o)=>{if(!r)return void console.warn(`addOrUpdateImage called with empty image for ID ${t}`);const a=e=>{i.hasImage(t)||i.addImage(t,e,o)},n=e=>{e.complete?e.naturalWidth>0?a(e):console.warn(`Failed to load image for ID ${t}`):(e.onload=()=>a(e),e.onerror=()=>console.warn(`Failed to load image for ID ${t}`))};if("string"==typeof r)if(r.includes("<svg")){n(Wr(Vr(r)))}else a((await i.loadImage(r)).data);else n(r)},si=e=>{switch(e){case"standardDark":case"drivingDark":case"monoDark":case"satellite":return"dark";default:return"light"}},ci=e=>{if("string"==typeof e)return si(e);const t=e;return t?.id?si(t.id):"light"};class li{constructor(e,t,r){this._initializing=!0,this.moduleReady=!1,this.sourceType=e,this.tomtomMap=t,this.eventsProxy=t._eventsProxy,this.mapLibreMap=t.mapLibreMap,this.initSourcesWithLayers(r),this.applyConfig(r),this.tomtomMap.addStyleChangeHandler({onStyleAboutToChange:()=>{this.moduleReady=!1},onStyleChanged:()=>this.restoreDataAndConfig()}),this._initializing=!1}initSourcesWithLayers(e,t){this.moduleReady=!1,this.sourcesWithLayers=this._initSourcesWithLayers(e,t),this._sourceAndLayerIDs=Object.fromEntries(Object.entries(this.sourcesWithLayers).map(([e,t])=>[e,t.sourceAndLayerIDs])),t&&this.eventsProxy.updateIfRegistered(this.sourcesWithLayers),this.tomtomMap.mapReady&&(this.moduleReady=!0)}async waitUntilModuleReady(){await Qr(this.tomtomMap),this.moduleReady||await new Promise(e=>{const t=setInterval(()=>{this.tomtomMap.mapReady&&this.moduleReady&&(clearInterval(t),e())},200)})}applyConfig(e){this.config=this._applyConfig(e)}resetConfig(){this.applyConfig(void 0)}async restoreDataAndConfig(){this.moduleReady=!1,"geojson"===this.sourceType?setTimeout(()=>this.restoreDataAndConfigImpl(),400):this.restoreDataAndConfigImpl()}restoreDataAndConfigImpl(){this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config)}getConfig(){return this.config&&{...this.config}}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}}class ui{constructor(e,t,r){this.eventProxy=e,this.sourceWithLayers=t,this.config=r}on(e,t){this.eventProxy.addEventHandler(this.sourceWithLayers,t,e,this.config)}off(e){this.eventProxy.remove(this.sourceWithLayers,e)}}class hi{constructor(){this.interactiveLayerIDs=[],this.handlers={},this.findHandlers=(e,t,r)=>t&&r&&e.flatMap(e=>{const i=this.handlers[t]?.[e];return 1===i?.length?i:this.handlers[t]?.[e]?.filter(e=>e.layerIDs.includes(r))||[]})||[]}ensureInteractiveLayerIDsAdded(e){e._layerSpecs.forEach(e=>{this.interactiveLayerIDs.includes(e.id)||this.interactiveLayerIDs.push(e.id)})}addEventHandler(e,t,r,i){this.ensureInteractiveLayerIDsAdded(e);const o=e.source.id;this.handlers[o]||(this.handlers[o]={[r]:[]}),this.handlers[o][r]??=[],this.handlers[o][r]?.push({sourceWithLayers:e,layerIDs:e._layerSpecs.map(e=>e.id),fn:t,config:i})}remove(e,t){const r=this.handlers[e.source.id]?.[t];r&&(Gr(r,t=>{return r=e._layerSpecs,t.layerIDs.every((e,t)=>e===r[t].id);var r}),r.length||(delete this.handlers[e.source.id]?.[t],Nr(this.handlers[e.source.id])&&delete this.handlers[e.source.id]));for(const i of e._layerSpecs)Gr(this.interactiveLayerIDs,e=>i.id===e)}removeAll(){this.interactiveLayerIDs=[],this.handlers={}}hasSourceID(e){return!!this.handlers[e]}updateIfRegistered(e){for(const t of Object.values(e)){const e=this.handlers[t.source.id];if(e)for(const r of Object.values(e))for(const e of r)t.equalSourceAndLayerIDs(e.sourceWithLayers)&&(e.sourceWithLayers=t)}}}const pi=e=>"click"===e||"contextmenu"===e,fi=(e,t,r,i="updateInProps")=>{const{feature:o,index:a}=((e,t)=>{for(let r=0;r<e.length;r++){const i=e[r];if(i.id===t)return{feature:i,index:r}}})(r,t)||{};if(o&&(!pi(o.properties?.eventState)||pi(e))){const t={...o,properties:"updateInProps"===i?{...o?.properties,eventState:e}:Pr(o?.properties,"eventState")};return r.splice(a,1,t),a}},_i=(e,t,r)=>{const i=[...r.shownFeatures.features];Cr(fi(e,t.id,i,"removeFromProps"))||r.show({...r.shownFeatures,features:i})},di=(e,t,r,i,o)=>{if(t&&i instanceof Jr){const s=[...i.shownFeatures.features],c=fi(e,t.id,s);return!r||(n=t,(a=r)&&n&&a.id===n.id)||(o===i?fi(e,r.id,s,"removeFromProps"):o instanceof Jr&&_i(e,r,o)),i.show({...i.shownFeatures,features:s}),{feature:s[c],index:c}}var a,n;return r&&o instanceof Jr&&_i(e,r,o),{feature:t}},yi={precisionMode:"box",paddingBoxPx:5,cursorOnHover:"pointer",cursorOnMouseDown:"grabbing",cursorOnMap:"default",longHoverDelayAfterMapMoveMS:800,longHoverDelayOnStillMapMS:300};class Ai extends hi{constructor(e,t={}){super(),this.enabled=!0,this.firstDelayedHoverSinceMapMove=!0,this.map=e,this.mapCanvas=e.getCanvas(),this.config={...yi,...t},this.mapCanvas.style.cursor=this.config.cursorOnMap,this.lastCursorStyle=this.config.cursorOnMap,this.listenToEvents()}listenToEvents(){this.map.on("mousemove",e=>this.onMouseMove(e)),this.map.on("movestart",()=>this.onMouseStart()),this.map.on("mouseout",()=>this.onMouseOut()),this.map.on("mouseover",e=>this.onMouseMove(e)),this.map.on("mousedown",()=>this.onMouseDown()),this.map.on("mouseup",()=>this.onMouseUp()),this.map.on("click",e=>this.onMapClick("click",e)),this.map.on("contextmenu",e=>this.onMapClick("contextmenu",e))}enable(e){this.enabled=e,e||this.clearLongHoverTimeout()}toPaddedBounds(e){const t=this.config.paddingBoxPx;return[[e.x-t,e.y+t],[e.x+t,e.y-t]]}isEnabled(){return this.enabled&&!this.map.isMoving()}getRenderedFeatures(e){if(!this.interactiveLayerIDs.length)return[];const t={layers:this.interactiveLayerIDs,validate:!1},r=this.config.precisionMode,i="point-then-box"===r||"point"===r?this.map.queryRenderedFeatures(e,t):[];return i.length||"point"===r?i:this.map.queryRenderedFeatures(this.toPaddedBounds(e),t)}clearLongHoverTimeout(){window.clearTimeout(this.longHoverTimeoutHandlerID)}restartLongHoverTimeout(){this.clearLongHoverTimeout(),this.longHoverTimeoutHandlerID=window.setTimeout(()=>this.handleLongHoverTimeout(),this.firstDelayedHoverSinceMapMove?this.config.longHoverDelayAfterMapMoveMS:this.config.longHoverDelayOnStillMapMS)}handleLongHoverTimeout(){if(this.firstDelayedHoverSinceMapMove=!1,this.hoveringSourceWithLayers){const e=di("long-hover",this.hoveringFeature,void 0,this.hoveringSourceWithLayers,void 0);this.findHandlers(["long-hover"],this.hoveringFeature?.source,this.hoveringFeature?.layer.id).forEach(t=>t.fn(e.feature,this.hoveringLngLat,this.hoveringFeatures,this.hoveringSourceWithLayers))}}onMouseStart(){this.firstDelayedHoverSinceMapMove=!0,this.clearLongHoverTimeout()}onMouseOut(){this.clearLongHoverTimeout()}onMouseDown(){this.lastCursorStyle=this.mapCanvas.style.cursor,this.mapCanvas.style.cursor=this.config.cursorOnMouseDown}onMouseUp(){this.mapCanvas.style.cursor=this.lastCursorStyle}onMouseMove(e){if(!this.isEnabled())return;this.hoveringFeatures=this.getRenderedFeatures(e.point),ei(this.hoveringFeatures);const[t]=this.hoveringFeatures;if(t&&!this.hasSourceID(t.source))return;const{hoverChanged:r,mouseInMotionOverHoveredFeature:i}=((e,t,r,i)=>{if(t){if(!i)return{hoverChanged:!0};if(t.id&&t.id!==i.id||t.properties.id&&t.properties.id!==i.properties.id||t.source!==i.source||t.layer.id!==i.layer.id)return{hoverChanged:!0};if(r&&(e.x-r.x!=0||e.y-r.y!=0))return{mouseInMotionOverHoveredFeature:!0}}else if(i)return{hoverChanged:!0};return{}})(e.point,t,this.hoveringPoint,this.hoveringFeature);if(r||i){this.hoveringLngLat=e.lngLat,this.hoveringPoint=e.point;const i=this.hoveringFeature;this.hoveringFeature=t;const o=this.hoveringSourceWithLayers,a=this.findHandlers(["hover","long-hover","click","contextmenu"],t?.source,t?.layer.id)?.[0];if(this.hoveringSourceWithLayers=a?.sourceWithLayers,r){this.updateHoverCursor(a?.config);const r=di("hover",this.hoveringFeature,i,this.hoveringSourceWithLayers,o),n=this.findHandlers(["hover"],t?.source,t?.layer.id);for(const t of n)t.fn(r.feature,e.lngLat,this.hoveringFeatures,this.hoveringSourceWithLayers)}this.restartLongHoverTimeout()}}updateHoverCursor(e){this.hoveringFeature?this.mapCanvas.style.cursor=e?.cursorOnHover??this.config.cursorOnHover:this.mapCanvas.style.cursor=this.config.cursorOnMap}onMapClick(e,t){if(!this.isEnabled())return;const r=this.getRenderedFeatures(t.point);ei(r);const i=this.lastClickedFeature;this.lastClickedFeature=r[0];const o=this.lastClickedSourceWithLayers,a=this.findHandlers([e],this.lastClickedFeature?.source,this.lastClickedFeature?.layer.id);this.lastClickedSourceWithLayers=a?.[0]?.sourceWithLayers;const n=di(e,this.lastClickedFeature,i,this.lastClickedSourceWithLayers,o);for(const s of a)s.fn(n.feature,t.lngLat,r,this.lastClickedSourceWithLayers)}}const gi={country:"Places - Country name",lowestPlaceLabel:"Places - Village / Hamlet",poi:"POI",lowestLabel:"Borders - Treaty label",lowestRoadLine:"Tunnel - Railway outline",lowestBuilding:"Buildings - Underground"},Ei="vectorTiles",Ri="hillshade",Ii="vectorTiles",mi="vectorTilesIncidents",Ti="vectorTilesFlow",Si=["POI","POI - Micro"],Li={ACCESS_GATEWAY:"border_control",ADVENTURE_SPORTS_FACILITY:"sport_facility",ADVENTURE_SPORTS_VENUE:"sport_facility",AGRICULTURE:"agriculture_business",AIRPORT:"airport",AMUSEMENT_PARK:"amusement_park",AQUATIC_ZOO:"zoo_or_aquarium",ASHRAM:"religious_site",ATM:"atm",AUTOMOTIVE_DEALER:"vehicle_dealer",BANK:"bank",BEACH:"beach",BUS_STOP:"bus_station",BUSINESS_PARK:"business",CAFE_PUB:"cafe",CAMPING_GROUND:"camping_ground",CAR_WASH:"vehicle_wash",CASH_DISPENSER:"atm",CASINO:"casino_and_gambling",CHURCH:"religious_site",CINEMA:"cinema",CLOTHING_SHOP:"clothing_shop",CLUB_ASSOCIATION:"club_and_association",COLLEGE_UNIVERSITY:"college_or_university",COMMERCIAL_BUILDING:"business",COMMUNITY_CENTER:"cultural_center",COMPANY:"company_or_office",CONCERT_HALL:"nightlife",COURTHOUSE:"courthouse",CULTURAL_CENTER:"cultural_center",DENTIST:"dentist",DEPARTMENT_STORE:"department_store",DOCTOR:"doctor",ELECTRIC_VEHICLE_STATION:"charging_location",EMBASSY:"institution_office",EMERGENCY_MEDICAL_SERVICE:"emergency",EMERGENCY_ROOM:"emergency",ENTERTAINMENT:"entertainment",EXCHANGE:"stock_exchange",EXHIBITION_CONVENTION_CENTER:"cultural_center",FERRY_TERMINAL:"ferry_terminal",FIRE_STATION_BRIGADE:"fire_station",FRONTIER_CROSSING:"border_control",FUEL_FACILITIES:"fuel_station",GAS_STATION:"fuel_station",GEOGRAPHIC_FEATURE:"geographic_feature",GOLD_EXCHANGE:"gold_exchange",GOLF_COURSE:"golf_course",GOVERNMENT_OFFICE:"institution_office",GURUDWARA:"religious_site",HEALTH_CARE_SERVICE:"healthcare_service",HELIPAD_HELICOPTER_LANDING:"heliport_or_helipad",HILL:"peak_high",HOLIDAY_RENTAL:"holiday_home",HOSPITAL:"hospital",HOSPITAL_POLYCLINIC:"hospital",HOTEL_MOTEL:"hotel_or_motel",ICE_SKATING_RINK:"winter_sports",IMPORTANT_TOURIST_ATTRACTION:"tourist_attraction",INDUSTRIAL_BUILDING:"industrial_facility",LEISURE_CENTER:"leisure",LIBRARY:"public_library",MANUFACTURING_FACILITY:"manufacturing_facility",MARINA:"marina",MARKET:"marketplace",MEDIA_FACILITY:"media_facility",MILITARY_INSTALLATION:"military_facility",MOSQUE:"religious_site",MOTORING_ORGANIZATION_OFFICE:"traffic_office",MOUNTAIN_PASS:"mountain_pass",MOUNTAIN_PEAK:"peak",MOVIE_THEATER:"cinema",MUSEUM:"museum",NATIVE_RESERVATION:"aboriginal_land",NIGHTLIFE:"nightlife",NON_GOVERNMENTAL_ORGANIZATION:"ngo_office",OPEN_PARKING_AREA:"parking_facility",OPERA_HOUSE:"theater",PAGODA:"religious_site",PARK_RECREATION_AREA:"park_and_recreation_area",PARKING_GARAGE:"parking_facility",PETROL_STATION:"fuel_station",PHARMACY:"pharmacy",PLACE_OF_WORSHIP:"religion",POLICE_STATION:"police_station",PORT_WAREHOUSE_FACILITY:"industrial_facility",POST_OFFICE:"post_office",PRIMARY_RESOURCE_UTILITY:"industrial_facility",PRISON_CORRECTIONAL_FACILITY:"prison",PUBLIC_AMENITY:"public_amenity",PUBLIC_TRANSPORT_STOP:"public_transport_stop",RAILWAY_STATION:"railway_station",RENT_A_CAR_FACILITY:"car_rental",RENT_A_CAR_PARKING:"rental_car_parking",REPAIR_FACILITY:"vehicle_repair",RESEARCH_FACILITY:"research_facility",RESIDENTIAL_ACCOMMODATION:"business",REST_AREA:"rest_area",RESTAURANT:"restaurant",RESTAURANT_AREA:"restaurant",SCENIC_PANORAMIC_VIEW:"viewpoint",SCHOOL:"education",SHOP:"shop_or_store",SHOPPING_CENTER:"shop_or_store",SPORTS_CENTER:"sport_facility",STADIUM:"stadium",SUPERMARKETS_HYPERMARKETS:"supermarket",SWIMMING_POOL:"swimming_pool",SYNAGOG:"religious_site",TAXI_STAND:"taxi_stand",TEMPLE:"religious_site",TENNIS_COURT:"sport_facility",THEATER:"theater",TOLL_GATE:"toll_gantry",TOURIST_INFORMATION_OFFICE:"tourist_information",TRAFFIC_CONTROL_DEPARTMENT:"traffic_office",TRAFFIC_SERVICE_CENTER:"traffic_office",TRAIL_SYSTEM:"trailhead",TRAILS:"trailhead",TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:"traffic_office",TRUCK_STOP:"truck_stop",VACATION_RENTAL:"holiday_home",VETERINARIAN:"veterinary",WATER_SPORT:"outdoor",WEIGH_STATION:"weighbridge",WELFARE_ORGANIZATION:"social_service",WINERY:"manufacturing_facility",ZOOS_ARBORETA_BOTANICAL_GARDEN:"zoo_or_aquarium"},bi={...Li,SECURED_ENTRANCE:"border_control",AGRICULTURAL_BUSINESS:"agriculture_business",FARM:"agriculture_business",HORTICULTURE:"agriculture_business",PRIMARY_PRODUCER:"agriculture_business",AIRFIELD:"airport",AIRLINE_ACCESS:"airport",MILITARY_AIRPORT:"airport",PRIVATE_AIRPORT:"airport",PUBLIC_AIRPORT:"airport",ATV_DEALER:"vehicle_dealer",BOAT_DEALER:"boat_dealer",BUS_DEALER:"vehicle_dealer",CAR_DEALER:"vehicle_dealer",MOTORCYCLE_DEALER:"vehicle_dealer",RECREATIONAL_VEHICLE_DEALER:"vehicle_dealer",TRUCK_DEALER:"vehicle_dealer",VAN_DEALER:"vehicle_dealer",DIVERSIFIED_FINANCIALS:"bank",SAVINGS_INSTITUTION:"bank",BEACH_CLUB:"beach",BAR:"bar",CAFE:"cafe",COCKTAIL_BAR:"bar",COFFEE_SHOP:"coffee_shop",INTERNET_CAFE:"cafe",PUB:"pub",TEA_HOUSE:"tea_house",WINE_BAR:"bar",CARAVAN_SITE:"camping_ground",RECREATIONAL_CAMPING_GROUND:"camping_ground",REST_CAMP:"camping_ground",TRUCK_WASH:"vehicle_wash",DRIVE_IN_MOVIES:"cinema",CHILDRENS_CLOTHES:"clothing_shop",MENS_CLOTHING:"clothing_shop",SPECIALTY_CLOTHING_SHOP:"clothing_shop",WOMENS_CLOTHING:"clothing_shop",PRIVATE_CLUB:"club_and_association",JUNIOR_COLLEGE_COMMUNITY_COLLEGE:"college_or_university",BUILDING:"business",ADVERTISING_COMPANY:"company_or_office",AGRICULTURAL_TECHNOLOGY:"company_or_office",AIRLINE_COMPANY:"company_or_office",AUTOMOBILE_COMPANY:"company_or_office",BUSINESS_SERVICES:"company_or_office",BUS_CHARTER_COMPANY:"company_or_office",CABLE_TELEPHONE_COMPANY:"company_or_office",CLEANING_SERVICES:"company_or_office",COMPUTER_DATA_SERVICES:"company_or_office",CONSTRUCTION_COMPANY:"company_or_office",DELIVERY_SERVICE:"company_or_office",ELECTRONICS_COMPANY:"company_or_office",EQUIPMENT_RENTAL:"company_or_office",FUNERAL_SERVICE_MORTUARIES:"company_or_office",IMPORT_EXPORT_AND_DISTRIBUTION:"company_or_office",INSURANCE_COMPANY:"company_or_office",INVESTMENT_ADVISOR:"company_or_office",LEGAL_SERVICES:"company_or_office",MINING_COMPANY:"company_or_office",MOVING_STORAGE_COMPANY:"company_or_office",OIL_NATURAL_GAS:"company_or_office",PHARMACEUTICAL_COMPANY:"company_or_office",PUBLIC_HEALTH_TECHNOLOGY_COMPANY:"company_or_office",PUBLISHING_TECHNOLOGIES:"company_or_office",REAL_ESTATE_AGENT:"company_or_office",REAL_ESTATE_COMPANY:"company_or_office",SERVICE_COMPANY:"company_or_office",SOFTWARE_COMPANY:"company_or_office",TAX_SERVICES:"company_or_office",TELECOMMUNICATIONS:"company_or_office",TRANSPORT_COMPANY:"company_or_office",TRAVEL_AGENT:"company_or_office",WEDDING_SERVICES:"company_or_office",GENERAL_PRACTITIONER:"doctor",SPECIALIST:"doctor",RIDGE:"peak",AMBULANCE_UNIT:"emergency",ROAD_RESCUE:"emergency",AMUSEMENT_ARCADE:"entertainment",AMUSEMENT_PLACE:"entertainment",BETTING_STATION:"entertainment",FAIRGROUND:"entertainment",MUSIC_CENTER:"entertainment",CHECKPOINT:"border_control",BAY:"geographic_feature",BRIDGE:"geographic_feature",BRIDGE_TUNNEL_OPERATIONS:"geographic_feature",CAPE:"geographic_feature",COVE:"geographic_feature",DAM:"geographic_feature",DUNE:"geographic_feature",ISLAND:"geographic_feature",LAGOON:"geographic_feature",LAKESHORE:"geographic_feature",LOCALE:"geographic_feature",MARSH:"geographic_feature",OASIS:"geographic_feature",PAN:"geographic_feature",PARKWAY:"geographic_feature",PLAIN_FLAT:"geographic_feature",PLATEAU:"geographic_feature",RAPIDS:"geographic_feature",REEF:"geographic_feature",RESERVOIR:"geographic_feature",RIVER_CROSSING:"geographic_feature",RIVER_SCENIC_AREA:"geographic_feature",ROCKS:"geographic_feature",SEASHORE:"geographic_feature",TUNNEL:"geographic_feature",VALLEY:"geographic_feature",WATER_HOLE:"geographic_feature",WELL:"geographic_feature",BUNGALOW_RENTAL:"holiday_home",CABINS_LODGES:"holiday_home",CHALET_RENTAL:"holiday_home",COTTAGE_RENTAL:"holiday_home",VILLA_RENTAL:"holiday_home",BLOOD_BANK:"hospital",HOSPITAL_FOR_WOMEN_AND_CHILDREN:"hospital",HOSPITAL_OF_CHINESE_MEDICINE:"hospital",SPECIAL_HOSPITAL:"hospital",B_B_GUEST_HOUSE:"hotel_or_motel",HOSTEL:"hotel_or_motel",HOTEL:"hotel_or_motel",MOTEL:"hotel_or_motel",RESORT:"hotel_or_motel",QUARRY:"industrial_facility",AUTOMOBILE_MANUFACTURING:"manufacturing_facility",CHEMICAL_COMPANY:"manufacturing_facility",MANUFACTURING_COMPANY:"manufacturing_facility",MECHANICAL_ENGINEERING:"manufacturing_facility",MICROBREWERY:"manufacturing_facility",OEM:"manufacturing_facility",BOAT_LAUNCHING_RAMP:"marina",HARBOR:"marina",YACHT_BASIN:"marina",FARMERS_MARKET:"marketplace",FOOD_MARKET:"marketplace",INFORMAL_MARKET:"marketplace",PUBLIC_MARKET:"marketplace",PLANETARIUM:"planetarium",CABARET_THEATER:"nightlife",COMEDY_CLUB:"comedy_club",DISCO_CLUB:"nightlife",JAZZ_CLUB:"nightlife",KARAOKE_CLUB:"nightlife",FISHING_HUNTING_AREA:"park_and_recreation_area",FOREST_AREA:"park_and_recreation_area",HISTORICAL_PARK:"park_and_recreation_area",NATURAL_RECREATION_ATTRACTION:"park_and_recreation_area",PARK:"park_and_recreation_area",PICNIC_AREA:"park_and_recreation_area",PRESERVE:"park_and_recreation_area",RECREATION_AREA:"park_and_recreation_area",WILDERNESS_AREA:"park_and_recreation_area",OPEN_CAR_PARKING_AREA:"parking_facility",DRUG_STORE:"pharmacy",MARIJUANA_DISPENSARY:"pharmacy",MEDICINAL_MARIJUANA_DISPENSARY:"pharmacy",RECREATIONAL_MARIJUANA_DISPENSARY:"pharmacy",COURIER_DROP_BOX:"post_office",LOCAL_POST_OFFICE:"post_office",PUBLIC_CALL_BOX:"public_amenity",PUBLIC_TOILET:"public_amenity",BUS_LINES:"public_transport_stop",COACH_STOP:"public_transport_stop",PASSENGER_TRANSPORT_TICKET_OFFICE:"public_transport_stop",PEDESTRIAN_SUBWAY:"public_transport_stop",STREETCAR_STOP:"public_transport_stop",SUBWAY_STATION:"public_transport_stop",INTERNATIONAL_RAILROAD_STATION:"railway_station",NATIONAL_RAILROAD_STATION:"railway_station",RAILROAD_SIDING:"railway_station",STATION_ACCESS:"railway_station",URBAN_STATION:"railway_station",BODYSHOP:"vehicle_repair",CAR_GLASS_REPLACEMENT_SHOP:"vehicle_repair",CAR_REPAIR_AND_SERVICE:"vehicle_repair",HOME_APPLIANCE_REPAIR:"vehicle_repair",MOTORCYCLE_REPAIR:"vehicle_repair",OTHER_REPAIR_SHOPS:"vehicle_repair",REPAIR_SHOP:"vehicle_repair",TIRE_SERVICE:"vehicle_repair",TRUCK_REPAIR_AND_SERVICE:"vehicle_repair",AFGHAN_RESTAURANT:"restaurant",AFRICAN_RESTAURANT:"restaurant",ALGERIAN_RESTAURANT:"restaurant",AMERICAN_RESTAURANT:"restaurant",ARABIAN_RESTAURANT:"restaurant",ARGENTINIAN_RESTAURANT:"restaurant",ARMENIAN_RESTAURANT:"restaurant",ASIAN_RESTAURANT:"restaurant",AUSTRALIAN_RESTAURANT:"restaurant",AUSTRIAN_RESTAURANT:"restaurant",BANQUET_ROOMS:"restaurant",BARBECUE_RESTAURANT:"restaurant",BASQUE_RESTAURANT:"restaurant",BELGIAN_RESTAURANT:"restaurant",BISTRO:"restaurant",BOLIVIAN_RESTAURANT:"restaurant",BOSNIAN_RESTAURANT:"restaurant",BRAZILIAN_RESTAURANT:"restaurant",BRITISH_RESTAURANT:"restaurant",BUFFET_RESTAURANT:"restaurant",BULGARIAN_RESTAURANT:"restaurant",BURMESE_RESTAURANT:"restaurant",CAFETERIA:"restaurant",CALIFORNIAN_RESTAURANT:"restaurant",CAMBODIAN_RESTAURANT:"restaurant",CANADIAN_RESTAURANT:"restaurant",CARIBBEAN_RESTAURANT:"restaurant",CATERING_SERVICES:"restaurant",CHICKEN_RESTAURANT:"restaurant",CHILEAN_RESTAURANT:"restaurant",CHINESE_RESTAURANT:"restaurant",COLOMBIAN_RESTAURANT:"restaurant",CORSICAN_RESTAURANT:"restaurant",CREOLE_RESTAURANT:"restaurant",CREPERIE:"restaurant",CUBAN_RESTAURANT:"restaurant",CYPRIOT_RESTAURANT:"restaurant",CZECH_RESTAURANT:"restaurant",DANISH_RESTAURANT:"restaurant",DINNER_THEATER:"restaurant",DOMINICAN_RESTAURANT:"restaurant",DONGBEI_RESTAURANT:"restaurant",DOUGHNUT_RESTAURANT:"restaurant",DUTCH_RESTAURANT:"restaurant",EGYPTIAN_RESTAURANT:"restaurant",ENGLISH_RESTAURANT:"restaurant",EROTIC_RESTAURANT:"restaurant",ETHIOPIAN_RESTAURANT:"restaurant",EXOTIC_RESTAURANT:"restaurant",FAST_FOOD:"restaurant",FINNISH_RESTAURANT:"restaurant",FONDUE_RESTAURANT:"restaurant",FRENCH_RESTAURANT:"restaurant",FUSION_RESTAURANT:"restaurant",GERMAN_RESTAURANT:"restaurant",GREEK_RESTAURANT:"restaurant",GRILL_RESTAURANT:"restaurant",GUANGDONG_RESTAURANT:"restaurant",HAMBURGER_RESTAURANT:"restaurant",HAWAIIAN_RESTAURANT:"restaurant",HOT_POT_RESTAURANT:"restaurant",HUNAN_RESTAURANT:"restaurant",HUNGARIAN_RESTAURANT:"restaurant",ICE_CREAM_PARLOR:"restaurant",INDIAN_RESTAURANT:"restaurant",INDONESIAN_RESTAURANT:"restaurant",INTERNATIONAL_RESTAURANT:"restaurant",IRANIAN_RESTAURANT:"restaurant",IRISH_RESTAURANT:"restaurant",ISRAELI_RESTAURANT:"restaurant",ITALIAN_RESTAURANT:"restaurant",JAMAICAN_RESTAURANT:"restaurant",JAPANESE_RESTAURANT:"restaurant",JEWISH_RESTAURANT:"restaurant",KOREAN_RESTAURANT:"restaurant",KOSHER_RESTAURANT:"restaurant",LATIN_AMERICAN_RESTAURANT:"restaurant",LEBANESE_RESTAURANT:"restaurant",LUXEMBOURGIAN_RESTAURANT:"restaurant",MACROBIOTIC_RESTAURANT:"restaurant",MAGHRIB_RESTAURANT:"restaurant",MALTESE_RESTAURANT:"restaurant",MAURITIAN_RESTAURANT:"restaurant",MEDITERRANEAN_RESTAURANT:"restaurant",MEXICAN_RESTAURANT:"restaurant",MIDDLE_EASTERN_RESTAURANT:"restaurant",MONGOLIAN_RESTAURANT:"restaurant",MOROCCAN_RESTAURANT:"restaurant",MUSSELS_RESTAURANT:"restaurant",NEPALESE_RESTAURANT:"restaurant",NORWEGIAN_RESTAURANT:"restaurant",ORGANIC_FOOD_RESTAURANT:"restaurant",ORIENTAL_RESTAURANT:"restaurant",PAKISTANI_RESTAURANT:"restaurant",PERUVIAN_RESTAURANT:"restaurant",PHILIPPINE_RESTAURANT:"restaurant",PIZZERIA:"restaurant",POLISH_RESTAURANT:"restaurant",POLYNESIAN_RESTAURANT:"restaurant",PORTUGUESE_RESTAURANT:"restaurant",PROVENCAL_RESTAURANT:"restaurant",PUB_FOOD:"restaurant",ROADSIDE_RESTAURANT:"restaurant",ROMANIAN_RESTAURANT:"restaurant",RUSSIAN_RESTAURANT:"restaurant",SALAD_BAR:"restaurant",SANDWICH_RESTAURANT:"restaurant",SAVOY_RESTAURANT:"restaurant",SCANDINAVIAN_RESTAURANT:"restaurant",SCOTTISH_RESTAURANT:"restaurant",SEAFOOD:"restaurant",SHANDONG_RESTAURANT:"restaurant",SHANGHAI_RESTAURANT:"restaurant",SICHUAN_RESTAURANT:"restaurant",SICILIAN_RESTAURANT:"restaurant",SLAVIC_RESTAURANT:"restaurant",SLOVAK_RESTAURANT:"restaurant",SNACKS_RESTAURANT:"restaurant",SOUL_FOOD:"restaurant",SOUP_RESTAURANT:"restaurant",SPANISH_RESTAURANT:"restaurant",STEAK_HOUSE:"restaurant",SUDANESE_RESTAURANT:"restaurant",SURINAMESE_RESTAURANT:"restaurant",SUSHI_RESTAURANT:"restaurant",SWEDISH_RESTAURANT:"restaurant",SWISS_RESTAURANT:"restaurant",SYRIAN_RESTAURANT:"restaurant",TAIWANESE_RESTAURANT:"restaurant",TAKEOUT_FOOD:"restaurant",TAPAS_RESTAURANT:"restaurant",TEPPANYAKI_RESTAURANT:"restaurant",THAI_RESTAURANT:"restaurant",TIBETAN_RESTAURANT:"restaurant",TUNISIAN_RESTAURANT:"restaurant",TURKISH_RESTAURANT:"restaurant",URUGUAYAN_RESTAURANT:"restaurant",VEGETARIAN_RESTAURANT:"restaurant",VENEZUELAN_RESTAURANT:"restaurant",VIETNAMESE_RESTAURANT:"restaurant",WELSH_RESTAURANT:"restaurant",WESTERN_RESTAURANT:"restaurant",YOGURT_JUICE_BAR:"restaurant",ART_SCHOOL:"education",CHILD_CARE_FACILITY:"education",CULINARY_SCHOOL:"education",DANCE_STUDIO_SCHOOL:"education",DRIVING_SCHOOL:"education",HIGH_SCHOOL:"education",LANGUAGE_SCHOOL:"education",MIDDLE_SCHOOL:"education",PRE_SCHOOL:"education",PRIMARY_SCHOOL:"education",SENIOR_HIGH_SCHOOL:"education",SPECIAL_SCHOOL:"education",SPORT_SCHOOL:"education",TECHNICAL_SCHOOL:"education",VOCATIONAL_SCHOOL:"education",AGRICULTURAL_SUPPLIES:"shop_or_store",ANTIQUE_ART_SHOP:"shop_or_store",BAGS_LEATHERWEAR:"shop_or_store",BAKERY:"shop_or_store",BEAUTY_SALON:"shop_or_store",BEAUTY_SUPPLIES:"shop_or_store",BOATING_EQUIPMENT_ACCESSORIES:"shop_or_store",BOOK_SHOP:"shop_or_store",BUTCHER:"shop_or_store",CAMERAS_PHOTOGRAPHY:"shop_or_store",CARPET_FLOOR_COVERINGS:"shop_or_store",CAR_ACCESSORIES:"shop_or_store",CHRISTMAS_HOLIDAY_SHOP:"shop_or_store",COMPUTER_COMPUTER_SUPPLIES:"shop_or_store",CONSTRUCTION_MATERIAL_EQUIPMENT:"shop_or_store",CONSUMER_ELECTRONICS:"shop_or_store",CONVENIENCE_STORE:"shop_or_store",CURTAINS_TEXTILES:"shop_or_store",C_DS_DVD_VIDEOS:"shop_or_store",DELICATESSEN:"shop_or_store",DO_IT_YOURSELF_CENTERS:"shop_or_store",DRIVE_THROUGH_BOTTLE_SHOP:"shop_or_store",DRY_CLEANER:"shop_or_store",ELECTRICAL_APPLIANCES_SHOP:"shop_or_store",FACTORY_OUTLET:"shop_or_store",FISHMONGER:"shop_or_store",FLORISTS:"shop_or_store",FOOTWEAR_SHOE_REPAIRS:"shop_or_store",FURNITURE_HOME_FURNISHINGS:"shop_or_store",GARDEN_CENTERS_SERVICES:"shop_or_store",GIFTS_CARDS_NOVELTIES_SOUVENIRS:"shop_or_store",GLASSWARE_CERAMIC_SHOP:"shop_or_store",GLASS_WINDOWS_STORE:"shop_or_store",GREENGROCER:"shop_or_store",GROCERY_STORE:"shop_or_store",HAIRDRESSER:"shop_or_store",HARDWARE_STORE:"shop_or_store",HOBBY_SHOP:"shop_or_store",HOUSE_GARDEN_FURNITURE_FITTINGS:"shop_or_store",JEWELRY_CLOCKS_WATCHES:"shop_or_store",KITCHENS_BATHROOMS:"shop_or_store",LAUNDRY:"shop_or_store",LIGHTING_SHOPS:"shop_or_store",LOCAL_SPECIALITIES_SHOP:"shop_or_store",LOTTERY_SHOP:"shop_or_store",MARINE_ELECTRONIC_EQUIPMENT:"shop_or_store",MEDICAL_SUPPLIES_EQUIPMENT:"shop_or_store",MOBILE_PHONE_SHOP:"shop_or_store",MUSIC_INSTRUMENTS_STORE:"shop_or_store",NAIL_SALON:"shop_or_store",NEWSAGENTS_TOBACCONISTS:"shop_or_store",OFFICE_EQUIPMENT:"shop_or_store",OPTICIAN:"shop_or_store",OTHER_FOOD_SHOPS:"shop_or_store",PAINTING_DECORATING:"shop_or_store",PAWN_SHOP:"shop_or_store",PERSONAL_CARE_FACILITY:"shop_or_store",PERSONAL_SERVICE:"shop_or_store",PET_SUPPLIES:"shop_or_store",PHOTOCOPY_SHOP:"shop_or_store",PHOTO_LAB_DEVELOPMENT:"shop_or_store",RECYCLING_SHOP:"shop_or_store",RETAIL_OUTLET:"shop_or_store",SAUNA_SOLARIUM_MASSAGE:"shop_or_store",SECURITY_PRODUCTS:"shop_or_store",SHOPPING_SERVICE:"shop_or_store",SPECIALTY_FOODS:"shop_or_store",SPORTS_EQUIPMENT_CLOTHING:"shop_or_store",STAMP_SHOP:"shop_or_store",TAILOR_SHOP:"shop_or_store",TOYS_GAMES_SHOP:"shop_or_store",VARIETY_STORE:"shop_or_store",VIDEO_RENTAL_SHOP:"shop_or_store",WHOLESALE_CLUB:"shop_or_store",WINE_SPIRITS:"shop_or_store",ATHLETICS_TRACK:"sport_facility",BASEBALL_PARK:"sport_facility",BASKETBALL_ARENA:"sport_facility",BOWLING_CENTER:"sport_facility",CRICKET_GROUND:"sport_facility",FITNESS_CLUB_CENTER:"sport_facility",FLYING_CLUB:"sport_facility",HOCKEY_CLUB:"sport_facility",HORSE_RACING_TRACK:"sport_facility",HORSE_RIDING_CENTER:"sport_facility",ICE_HOCKEY_ARENA:"sport_facility",OTHER_WINTER_SPORT:"sport_facility",RACE_TRACK:"sport_facility",RUGBY_GROUND:"sport_facility",SKI_RESORT:"sport_facility",SNOOKER_POOL_BILLIARD:"sport_facility",THEMATIC_SPORT_CENTER:"sport_facility",FOOTBALL_STADIUM:"stadium",MOTOR_RACING_STADIUM:"stadium",MULTI_PURPOSE_STADIUM:"stadium",NETBALL_STADIUM:"stadium",SOCCER_STADIUM:"stadium",STOCK_EXCHANGE:"stock_exchange",TAXI_LIMOUSINE_SHUTTLE_SERVICE:"taxi_stand",AMPHITHEATER:"theater",ARCH:"tourist_attraction",BATTLEFIELD:"tourist_attraction",CAVE:"tourist_attraction",CEMETERY:"tourist_attraction",HISTORIC_SITE:"tourist_attraction",MAUSOLEUM_GRAVE:"tourist_attraction",MEMORIAL:"tourist_attraction",MINERAL_HOT_SPRINGS:"tourist_attraction",MONUMENT:"tourist_attraction",NATURAL_TOURIST_ATTRACTION:"tourist_attraction",OBSERVATORY:"tourist_attraction",STATUE:"tourist_attraction",TOURIST_ATTRACTION:"tourist_attraction",TOWER:"tourist_attraction",ROAD_TRAFFIC_CONTROL_CENTER:"traffic_office",ADVENTURE_VEHICLE_TRAIL:"trailhead",HIKING_TRAIL:"trailhead",HORSE_RIDING_TRAIL:"trailhead",MOUNTAIN_BIKE_TRAIL:"trailhead",ROCK_CLIMBING_TRAIL:"trailhead",APARTMENT_RENTAL:"business",CONDOMINIUM_COMPLEX:"business",FLATS_APARTMENT_COMPLEX:"business",RESIDENTIAL_ESTATE:"business",RETIREMENT_COMMUNITY:"business",TOWNHOUSE_COMPLEX:"business",ANIMAL_SERVICES:"veterinary",ANIMAL_SHELTER:"animal_shelter",WEIGH_SCALES:"weighbridge",WILDLIFE_PARK:"zoo_or_aquarium",ZOO:"zoo_or_aquarium"},Oi=e=>bi[e],Ni="Noto-Bold",vi=.8,Ci="title",Mi="iconID",wi=.7,Ui=1.4,Pi="default_place",Di={"icon-image":["get",Mi],"icon-anchor":"bottom","icon-size":["interpolate",["linear"],["zoom"],8,.6,22,vi],"icon-allow-overlap":!0,"icon-padding":0},xi={"icon-translate":[0,5],"icon-translate-anchor":"viewport"},Fi={"text-optional":!0,"text-font":[Ni],"text-field":["get",Ci],"text-justify":"auto","text-variable-anchor":["top","left","right"],"text-variable-anchor-offset":["top",[0,wi],"left",[Ui,-1.4],"right",[-1.4,-1.4]],"text-size":["interpolate",["linear"],["zoom"],10,14,18,16],"text-padding":5},Hi={"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"},Gi={type:"symbol",layout:{...Di,...Fi},paint:{...xi,...Hi}},ji=(e,t)=>`${e}-${t}`,Bi=(e,t)=>{if(!e)return;const r=(e=>{try{if("string"==typeof e){if(e.includes("<svg")){const t=Vr(e),r=t.getAttribute("viewBox");if(r){const e=r.split(/\s+/);if(4===e.length)return{width:Number.parseFloat(e[2]),height:Number.parseFloat(e[3])}}const i=t.getAttribute("width"),o=t.getAttribute("height");if(i&&o)return{width:Number.parseFloat(i),height:Number.parseFloat(o)}}return null}return e.complete&&e.naturalWidth>0?{width:e.naturalWidth,height:e.naturalHeight}:null}catch(t){return console.warn("Failed to extract image dimensions:",t),null}})(e);if(!r)return;if("base-map"===t){return{heightScale:r.height/54,widthScale:r.width/54}}return{heightScale:r.height/140,widthScale:r.width/120}},Wi=e=>Boolean(e&&"availability"in e&&e.availability),Vi=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return"ELECTRIC_VEHICLE_STATION"===t&&Wi(e.properties.chargingPark)},ki=e=>{const t=e.properties.chargingPark;if(Wi(t)){const e=t.availability.chargingPointAvailability,r=e.statusCounts.Available??0;return{availableCount:r,totalCount:e.count,ratio:r/e.count}}},Yi=(e,t)=>`${e}/${t}`,zi=e=>{const t=ki(e);return t?.ratio??0},$i=e=>["case",[">=",["get","evAvailabilityRatio"],e?.threshold??0],"green","red"],Ki=(e,t,r,i)=>{const o=void 0!==i;return{top:o?[0,i]:[0,e],left:o?[i,r]:[t,r],right:o?[-i,r]:[-t,r]}},Xi=(e,t,r,i)=>{const o=(e=>{if(!e)return vi;if("number"==typeof e)return e;if(Array.isArray(e)){const t=e.at(-1);if("number"==typeof t)return t}return vi})(e)/vi,a="base-map"===r;if(a&&void 0!==i)return{"text-offset":[i,i]};const n=Ui*o,s=Ki(wi*o,n,a?0:-n,i),c=["top",s.top,"left",s.left,"right",s.right];if(0===t.size)return{"text-variable-anchor-offset":c};const l=["case"];for(const[u,h]of t.entries()){const e=(a?1.4:wi)*h.heightScale,t=Ui*h.widthScale,r=Ki(e,t,a?0:-t,i);l.push(["==",["get",Mi],u],["literal",["top",r.top,"left",r.left,"right",r.right]])}return l.push(["literal",c]),{"text-variable-anchor-offset":l}},qi=(e,t,r,i,o)=>{const a=t?.text,n=t?.layers?.[r],s=o&&o.size>0,c={...e.layout};(s||void 0!==a?.offset)&&(delete c["text-offset"],delete c["text-variable-anchor-offset"],delete c["text-radial-offset"]);const l={...c,...n?.layout,...a?.size&&{"text-size":a.size},...a?.font&&{"text-font":a.font},"text-field":i};if(s||void 0!==a?.offset){const r=e.layout?.["icon-size"],i=o??/* @__PURE__ */new Map;Object.assign(l,Xi(r,i,t?.theme,a?.offset))}return l},Zi=(e,t,r,i)=>{const o=t?.text,a=t?.layers?.[r],{textColor:n,haloColor:s}=(e=>({textColor:"dark"===e?"#FFFFFF":"#333333",haloColor:"dark"===e?"#333333":"#FFFFFF"}))(i);return{...e.paint,...!o?.color&&{"text-color":n},...!o?.haloColor&&{"text-halo-color":s},...o?.color&&{"text-color":o.color},...o?.haloColor&&{"text-halo-color":o.haloColor},...o?.haloWidth&&{"text-halo-width":o.haloWidth},...a?.paint}},Ji=["in",["get","eventState"],["literal",["click","contextmenu"]]],Qi=e=>JSON.parse(JSON.stringify(e)?.replaceAll("name",Ci)),eo=["has","eventState"],to="#3f9cd9",ro={...Gi,filter:["!",eo]},io={...Gi,filter:eo,layout:{...Gi.layout,"icon-size":["interpolate",["linear"],["zoom"],8,.8,22,1],"text-allow-overlap":!0},paint:{...Gi.paint,"text-color":to}},oo=(e,t,r,i,o)=>{const a=t?.text,n=t?.layers?.[r],s=((e,t)=>t?["case",["has","evAvailabilityText"],["format",["get",Ci],{},"\n",{},["get","evAvailabilityText"],{"font-scale":1.1,"text-color":$i(e?.evAvailability)}],["get",Ci]]:["get",Ci])(t,!0===t?.evAvailability?.enabled),c=a?.title&&"function"!=typeof a?.title?a.title:s;return{...e,layout:qi(e,t,r,c,o),paint:Zi(e,t,r,i),...n}},ao=(e,t,r,i)=>{const o=((e,t)=>{const r=/* @__PURE__ */new Map,i=e?.icon?.categoryIcons??[];for(const o of i)if(o.image){const i=Bi(o.image,e?.theme);if(void 0!==i){const e=ji(o.id,t);if(r.set(e,i),o.availabilityLevel){const e=ji(`${o.id}-${o.availabilityLevel}`,t);r.set(e,i)}}}return r})(e,i);let a,n;if("base-map"===e?.theme){const e=(e=>{const t=e.getStyle().layers.find(e=>"POI"===e.id)||{},r=t.layout?.["text-size"];return{filter:["!",Ji],type:"symbol",paint:t.paint,layout:{...t.layout,"text-field":["get",Ci],"icon-image":["get",Mi],...r&&{"text-size":Qi(r)}}}})(t);a=e,n={...e,filter:eo,layout:{...e.layout,"text-allow-overlap":!0},paint:{...e.paint,"text-color":to}}}else a=ro,n=io;return{main:oo(a,e,"main",r,o),selected:oo(n,e,"selected",r,o),...e?.layers?.additional}},no=e=>{if(Br())return Wr(kr(e))},so=/* @__PURE__ */new Set([7339002,8099002,7369004,7321003,7376006,9362003,9362004,9160004,9376007,7315015,9376006,9376002,7315078,7315149,9376005,7372003,9352045,9352032,9361048,9902003,9378005,7383004,9910004,7320002,9362016,7320003,9362025,9942002,9942003,7380005,9663003,9361021,9379009,9379004,7315147,9376003,9160002,9160003,9352008,9361006,7389004,9910006]),co=e=>e.properties.poi?.name??e.properties.address.freeformAddress,lo=(e,t,i)=>{if("pin"===t){return(e=>{if(e)return so.has(e)?e.toString():e.toString().substring(0,4)})(r[e])??i}{const t=Oi(e);return t?`poi-${t}`:i}},uo=(e,t,r={})=>{const i=r.theme??"pin",o=ji(Pi,t),a=r.icon?.mapping;if(a)return"imageID"===a.to?a.fn(e):lo(a.fn(e),i,o);const n=e.properties.poi?.classifications?.[0]?.code,s=((e,t,r,i,o)=>{if(!i.evAvailability?.enabled||!Vi(e))return;const a=zi(e)>=(i.evAvailability.threshold??.3)?"available":"occupied",n=i.icon?.categoryIcons&&i.icon.categoryIcons.length>0,s=i.icon?.categoryIcons?.find(e=>e.id===t&&e.availabilityLevel===a);return s?ji(`${s.id}-${a}`,r):n||"pin"!==o?void 0:`7309-${a}`})(e,n,t,r,i);if(s)return s;const c=r.icon?.categoryIcons?.find(e=>e.id===n);if(c)return ji(c.id,t);return lo(n,i,o)},ho=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return t&&Oi(t)},po=e=>Array.isArray(e)?{type:"FeatureCollection",features:e}:"Feature"===e.type?{type:"FeatureCollection",features:[e]}:e,fo=(e,t,r)=>{if(!0!==t?.enabled)return e;let i=!1,o=!1;for(const a of r.features){if("ELECTRIC_VEHICLE_STATION"===a.properties.poi?.classifications?.[0]?.code&&(i=!0,Vi(a))){o=!0;break}}return i&&!o&&console.warn("PlacesModule: evAvailability is enabled but no availability data found. Did you call getPlacesWithEVAvailability()?"),{...e,evAvailabilityText:e=>Vi(e)?((e,t)=>{const r=ki(e);return r?(t?.formatText??Yi)(r.availableCount,r.totalCount):""})(e,t):"",evAvailabilityRatio:e=>Vi(e)?zi(e):0}},_o=(e,r,i={})=>{const o=po(e),a=!0===i.evAvailability?.enabled?fo(i.extraFeatureProps,i.evAvailability,o):i.extraFeatureProps;return{...o,features:o.features.map(e=>{const o="function"==typeof i?.text?.title?i?.text?.title(e):co(e),n=a?Object.fromEntries(Object.entries(a).map(([t,r])=>[t,"function"==typeof r?r(e):r])):{},s=e.id??t();return{...e,id:s,geometry:{...e.geometry,bbox:e.bbox},properties:{...e.properties,id:s,title:o,iconID:uo(e,r,i),..."base-map"===i?.theme&&{category:ho(e)},...n}}})}},yo=class e extends li{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){return r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.sourceID=`places-${this.instanceIndex}`,this.layerIDPrefix=this.sourceID,this.defaultPlaceIconID=ji(Pi,this.instanceIndex)),this.layerSpecs=this.buildLayerSpecs(t),{places:new Jr(this.mapLibreMap,this.sourceID,[this.layerSpecs.main,this.layerSpecs.selected])}}buildLayerSpecs(e){const t=ao(e,this.tomtomMap.mapLibreMap,this.tomtomMap.styleLightDarkTheme,this.instanceIndex);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,{...t,id:`${this.layerIDPrefix}-${e}`}]))}_applyConfig(e){return this.updateLayersAndData(e),e}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.places.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}applyTheme(e){this.applyConfigPart({theme:e})}applyIconConfig(e){this.applyConfigPart({icon:e})}applyTextConfig(e){this.applyConfigPart({text:e})}applyConfigPart(e){const t={...this.config,...e};this.updateLayersAndData(t),this.config=t}applyExtraFeatureProps(e){const t={...this.config,extraFeatureProps:e};this.updateData(t),this.config=t}updateLayersAndData(e){this.setupImages(e);const t=this.buildLayerSpecs(e),r=[t.main,t.selected],i=[this.layerSpecs.main,this.layerSpecs.selected];ri(r,i,this.mapLibreMap),this.layerSpecs=t,this.updateData(e)}setupImages(e){if(e?.icon){for(const t of e.icon.categoryIcons??[]){const e=t.availabilityLevel?`${t.id}-${t.availabilityLevel}`:t.id;ni(0,ji(e,this.instanceIndex),t.image,this.mapLibreMap,{pixelRatio:t.pixelRatio??2})}e.icon.default&&(e.icon.default.image&&ni(0,this.defaultPlaceIconID,e.icon.default.image.image,this.mapLibreMap,{pixelRatio:e.icon.default.image.pixelRatio??2}),e.icon.default.style&&ni(0,this.defaultPlaceIconID,no(e.icon.default.style),this.mapLibreMap,{pixelRatio:2}))}else ni(0,this.defaultPlaceIconID,no(),this.mapLibreMap,{pixelRatio:2})}updateData(e){this.sourcesWithLayers.places.source.runtimeSource?.setData(_o(this.sourcesWithLayers.places.shownFeatures,this.instanceIndex,e))}async show(e){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.show(_o(e,this.instanceIndex,this.config))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.clear()}putEventState(e){this.sourcesWithLayers.places.putEventState(e)}cleanEventState(e){this.sourcesWithLayers.places.cleanEventState(e)}cleanEventStates(e){this.sourcesWithLayers.places.cleanEventStates(e)}get events(){return new ui(this.eventsProxy,this.sourcesWithLayers.places,this.config?.events)}};yo.lastInstanceIndex=-1;let Ao=yo;const go=e=>{if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!go(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}},Eo=e=>e?.length?1===e.length?e[0]:{expression:["any",...e.map(e=>e?.expression)],legacy:["any",...e.map(e=>e?.legacy)]}:null,Ro=(e,t)=>{return t?["all",e[(r=t,go(r)?"expression":"legacy")],t]:e.expression;var r},Io=(e,t,r)=>{if(1===r.length){const i="only"===t?"==":"!=";return{expression:[i,["get",e],r[0]],legacy:[i,e,r[0]]}}const i=["in",["get",e],["literal",r]];return"only"===t?{expression:i,legacy:["in",e,...r]}:{expression:["!",i],legacy:["!in",e,...r]}},mo=(e,t,r)=>Io(e,t.show,r?t.values.map(r):t.values),To={FOOD_DRINKS_GROUP:["RESTAURANT","FAST_FOOD","CAFE_PUB","PUB","WINERY","PUB_FOOD","SOUL_FOOD","DELICATESSEN"],SHOPPING_GROUP:["SHOP","SHOPPING_CENTER","CLOTHING_SHOP","MARKET","FOOD_MARKET","SUPERMARKETS_HYPERMARKETS","DEPARTMENT_STORE","CONVENIENCE_STORE","GROCERY_STORE","HARDWARE_STORE","ELECTRICAL_APPLIANCES_SHOP"],TRANSPORTATION_GROUP:["AIRPORT","FERRY_TERMINAL","HELIPAD_HELICOPTER_LANDING","PUBLIC_TRANSPORT_STOP","RAILWAY_STATION","BUS_STOP","TAXI_STAND"],HEALTH_GROUP:["DOCTOR","EMERGENCY_MEDICAL_SERVICE","EMERGENCY_ROOM","HEALTH_CARE_SERVICE","HOSPITAL","HOSPITAL_POLYCLINIC","PHARMACY","DENTIST","WELFARE_ORGANIZATION"],PARKING_GROUP:["PARKING_GARAGE","OPEN_PARKING_AREA"],HOLIDAY_TOURISM_GROUP:["AMUSEMENT_PARK","BEACH","HOLIDAY_RENTAL","GEOGRAPHIC_FEATURE","IMPORTANT_TOURIST_ATTRACTION","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK","MUSEUM","SCENIC_PANORAMIC_VIEW","TOURIST_INFORMATION_OFFICE"],EV_CHARGING_STATIONS_GROUP:["ELECTRIC_VEHICLE_STATION"],GAS_STATIONS_GROUP:["GAS_STATION","PETROL_STATION"],ACCOMMODATION_GROUP:["CAMPING_GROUND","HOTEL_MOTEL","HOLIDAY_RENTAL"],ENTERTAINMENT_GROUP:["CINEMA","THEATER","MOVIE_THEATER","NIGHTLIFE","CONCERT_HALL","ENTERTAINMENT","CLUB_ASSOCIATION","CASINO"],SPORTS_LEISURE_GROUP:["SPORTS_CENTER","WATER_SPORT","SWIMMING_POOL","GOLF_COURSE","STADIUM","BEACH","ICE_SKATING_RINK","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK"],EDUCATION_GROUP:["SCHOOL","COLLEGE_UNIVERSITY","LIBRARY","CULTURAL_CENTER"],GOVERNMENT_GROUP:["GOVERNMENT_OFFICE","COURTHOUSE","EMBASSY","FIRE_STATION_BRIGADE","POLICE_STATION"]},So=e=>{const t=[];return e.forEach(e=>{e in To?t.push(...To[e].map(Oi)):t.push(Oi(e))}),[...new Set(t)]};class Lo extends li{static async get(e,t){return await Qr(e),new Lo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ei);if(!e)throw jr(`init ${Lo.name} with source ID ${Ei}`);const t=new Xr(this.mapLibreMap,e,e=>Si.includes(e.id)),r=t.sourceAndLayerIDs.layerIDs[0];return this.mapLibreMap.getLayer(r)&&(this.originalFilter=this.mapLibreMap.getFilter(r)),{poi:t}}_applyConfig(e){return e&&!Cr(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),this.filterCategories(e?.filters?.categories),e}isVisible(){return this.sourcesWithLayers.poi.isAnyLayerVisible()}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.poi.setLayersVisible(e)}filterCategories(e){if(e){if(this.tomtomMap.mapReady){const t=Io("category",e.show,So(e.values));this.mapLibreMap.setFilter("POI",Ro(t,this.originalFilter))}this.config={...this.config,filters:{categories:e}}}else this.categoriesFilter&&(this.config={...this.config,filters:{categories:{show:"all_except",values:[]}}},this.tomtomMap.mapReady&&this.mapLibreMap.setFilter("POI",this.originalFilter));this.categoriesFilter=e}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.poi,this.config?.events)}}const bo={land:{layerIDMatches:["lulc"],layerTypes:["fill"]},borders:{layerIDMatches:["borders"],layerTypes:["line"]},water:{layerIDMatches:["water"],layerTypes:["fill","line"]},buildings2D:{layerIDMatches:["building"],layerTypes:["fill","line"]},buildings3D:{layerIDMatches:["building"],layerTypes:["fill-extrusion"]},houseNumbers:{layerIDMatches:["house number"],layerTypes:["symbol"]},roadLines:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["fill","line"]},roadLabels:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["symbol"]},roadShields:{layerIDMatches:["shield"],layerTypes:["symbol"]},placeLabels:{layerIDMatches:["places"],layerTypes:["symbol"]},smallerTownLabels:{layerIDMatches:["town","village","neighbourhood"],layerTypes:["symbol"]},cityLabels:{layerIDMatches:["city","capital"],layerTypes:["symbol"]},capitalLabels:{layerIDMatches:["capital"],layerTypes:["symbol"]},stateLabels:{layerIDMatches:["state"],layerTypes:["symbol"]},countryLabels:{layerIDMatches:["places - country"],layerTypes:["symbol"]}},Oo=(e,t)=>{const r=bo[e];return r.layerIDMatches.some(e=>t.id.toLowerCase().includes(e))&&r.layerTypes.includes(t.type)},No=e=>t=>(!e||((e,t)=>{const r=t?.mode,i=t?.names;if(r&&i?.length){if("include"===r)return i.some(t=>Oo(t,e));if("exclude"===r)return!i.some(t=>Oo(t,e))}return!0})(t,e))&&!Si.includes(t.id);class vo extends li{static async get(e,t){return await Qr(e),new vo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(e){const t=this.mapLibreMap.getSource(Ii);if(!t)throw jr(`init ${vo.name} with source ID ${Ii}`);return{vectorTiles:new Xr(this.mapLibreMap,t,No(e?.layerGroupsFilter))}}_applyConfig(e){return e&&!Cr(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),e?.layerGroupsVisibility&&this.setVisible(e.layerGroupsVisibility.visible,{layerGroups:e.layerGroupsVisibility}),this.config||e?{...this.config,...e}:void 0}isVisible(){return this.sourcesWithLayers.vectorTiles.isAnyLayerVisible()}setVisible(e,t){t?.layerGroups?this.config={...this.config,layerGroupsVisibility:{...t.layerGroups,visible:e}}:(delete this.config?.layerGroupsVisibility,this.config={...this.config,visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.vectorTiles.setLayersVisible(e,t?.layerGroups&&(e=>{const t=e.mode,r=e.names;return"include"===t?e=>r.some(t=>Oo(t,e)):"exclude"===t?e=>!r.some(t=>Oo(t,e)):(console.error("Unrecognized layer group mode:",t),()=>!0)})(t.layerGroups))}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vectorTiles,this.config?.events)}}const Co=["land","water","borders","buildings2D","buildings3D","houseNumbers","roadLines","roadLabels","roadShields","placeLabels","smallerTownLabels","cityLabels","capitalLabels","stateLabels","countryLabels"],Mo="title",wo="color",Uo={warm:["#793F0D","#AC703D","#C38E63","#E49969","#E5AE86","#EEC5A9","#6E7649","#9D9754","#C7C397","#B4A851","#DFD27C","#E7E3B5","#846D74","#B7A6AD","#D3C9CE"],browns:["#edc4b3","#e6b8a2","#deab90","#d69f7e","#cd9777","#c38e70","#b07d62","#9d6b53","#8a5a44","#774936"],cold:["#344464","#548ca4","#549cac","#2c445c","#a4ccd4","#acbccc","#b4c4d4","#acd4cc","#5c8ca4"],fadedBlues:["#152033","#1d2d44","#2e455d","#3e5c76","#4c6884","#597491","#67809e","#6e86a5","#7b91ad","#879bb4"],blues:["#03045e","#023e8a","#0077b6","#0096c7","#00b4d8","#48cae4","#90e0ef","#ade8f4","#caf0f8"],greens:["#004b23","#006400","#007200","#008000","#38b000","#70e000","#9ef01a","#ccff33"],fadedGreenToBlue:["#d9ed92","#b5e48c","#99d98c","#76c893","#52b69a","#34a0a4","#168aad","#1a759f","#1e6091","#184e77"],blueToRed:["#033270","#1368aa","#4091c9","#9dcee2","#fedfd4","#f29479","#f26a4f","#ef3c2d","#cb1b16","#65010c"],greenToYellow:["#007f5f","#2b9348","#55a630","#80b918","#aacc00","#bfd200","#d4d700","#dddf00","#eeef20","#ffff3f"],pastel:["#fec5bb","#fcd5ce","#fae1dd","#f8edeb","#e8e8e4","#d8e2dc","#ece4db","#ffe5d9","#ffd7ba","#fec89a"],retro:["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],contrastRetro:["#001219","#005f73","#0a9396","#94d2bd","#e9d8a6","#ee9b00","#ca6702","#bb3e03","#ae2012","#9b2226"],fadedRainbow:["#ffadad","#ffd6a5","#fdffb6","#caffbf","#9bf6ff","#a0c4ff","#bdb2ff","#ffc6ff","#fffffc"],pastelRainbow:["#54478c","#2c699a","#048ba8","#0db39e","#16db93","#83e377","#b9e769","#efea5a","#f1c453","#f29e4c"]},Po="#0A3653",Do={type:"fill",paint:{"fill-color":["coalesce",["get",wo],Po],"fill-opacity":.15,"fill-antialias":!1}},xo={type:"line",paint:{"line-color":Po,"line-opacity":.45,"line-width":2}},Fo=(e,t,r)=>{const i=r?.colorConfig,o=r?.lineConfig;return[{...Do,id:e,paint:{...Do.paint,...!Cr(i?.fillOpacity)&&{"fill-opacity":i?.fillOpacity},...i?.fillColor&&{"fill-color":["get","color"]}}},{...xo,id:t,paint:{...xo.paint,...!Cr(o?.lineColor)&&{"line-color":o?.lineColor},...!Cr(o?.lineWidth)&&{"line-width":o?.lineWidth},...!Cr(o?.lineOpacity)&&{"line-opacity":o?.lineOpacity}}}]},Ho=(e,t)=>{const r=t?.textConfig;return{type:"symbol",id:e,layout:{"text-field":["get",Mo],...r?.textField&&{"text-field":r.textField},"text-padding":5,"text-size":12,"text-font":[Ni],"symbol-placement":"point"},paint:{"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"}}},Go=(e,r={})=>({...e,features:e.features.map((e,i)=>{const o=e.properties?.title??((e,t)=>t.textConfig?.textField?t.textConfig.textField:e.properties?.address?.freeformAddress)(e,r),a=e.properties?.color??((e,t)=>{const r=e?.colorConfig?.fillColor;if("string"==typeof r&&Uo[r]){const e=Uo[r];return e[t%e.length]}return r})(r,i);return{...e,properties:{...e.properties,...o&&{title:o},...a&&{color:a},id:e.properties?.id??t()}}})}),jo=e=>{const r=e.features.map(e=>{let r;if(e.properties?.placeCoordinates)r=e.properties?.placeCoordinates;else if("MultiPolygon"===e.geometry.type){const t=(e=>e.flat().reduce((e,t)=>t.length>e.length?t:e,[]))(e.geometry.coordinates),a=i(t);r=a&&o(a)||null}else r=e.geometry.coordinates.flat();const a=e.id??e.properties?.id??t();return{type:"Feature",id:a,geometry:{type:"Point",coordinates:r},properties:{...e.properties,id:a}}});return{type:"FeatureCollection",bbox:e.bbox,features:r}},Bo=class e extends li{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){if(!r){e.lastInstanceIndex++,this.sourceID=`geometry-${e.lastInstanceIndex}`,this.titleSourceID=`geometryTitle-${e.lastInstanceIndex}`;const t=`geometry-${e.lastInstanceIndex}`;this.fillLayerID=`${t}_Fill`,this.outlineLayerID=`${t}_Outline`,this.titleLayerID=`${t}_Title`}const[i,o]=Fo(this.fillLayerID,this.outlineLayerID,t),a=Ho(this.titleLayerID,t);return this.titleLayerSpecs=a,this.geometryFillLayerSpecs=i,this.geometryOutlineLayerSpecs=o,{geometry:new Jr(this.mapLibreMap,this.sourceID,[{...i},{...o}]),geometryLabel:new Jr(this.mapLibreMap,this.titleSourceID,[a])}}_applyConfig(e){return(e?.textConfig||e?.colorConfig||e?.lineConfig)&&this.updateLayerAndData(e),e?.beforeLayerConfig&&this.moveBeforeLayer(e.beforeLayerConfig),e}moveBeforeLayerID(e){for(const t of this.sourcesWithLayers.geometry.sourceAndLayerIDs.layerIDs)this.mapLibreMap.moveLayer(t,e)}moveBeforeLayer(e){this.config={...this.config,beforeLayerConfig:e},this.moveBeforeLayerID("top"===e?this.titleLayerID:gi[e])}applyTextConfig(e){const t={...this.config,textConfig:e};this.updateLayerAndData(t),this.sourcesWithLayers.geometryLabel.show(jo(this.sourcesWithLayers.geometry.shownFeatures)),this.config=t}updateLayerAndData(e){const[t,r]=Fo(this.fillLayerID,this.outlineLayerID,e),i=Ho(this.titleLayerID,e);ti(t,this.geometryFillLayerSpecs,this.mapLibreMap),ti(r,this.geometryOutlineLayerSpecs,this.mapLibreMap),ti(i,this.titleLayerSpecs,this.mapLibreMap),this.geometryFillLayerSpecs=t,this.geometryOutlineLayerSpecs=r,this.titleLayerSpecs=i}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.geometry.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}async show(e){await this.waitUntilModuleReady();const t=this.sourcesWithLayers.geometry;t.show(Go(e,this.config)),this.sourcesWithLayers.geometryLabel.show(jo(t.shownFeatures))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.geometry.clear()}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.geometry,this.config?.events)}};Bo.lastInstanceIndex=-1;let Wo=Bo;class Vo extends li{static async get(e,t){return await Qr(e),await ai(e,Ri,"hillshade"),new Vo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ri);if(!e)throw jr(`init ${Vo.name} with source ID ${Ri}`);return{hillshade:new Xr(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),e}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.hillshade.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.hillshade.isAnyLayerVisible()}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.hillshade,this.config?.events)}}const ko=["standardLight","standardDark","drivingLight","drivingDark","monoLight","monoDark","satellite"],Yo=["trafficIncidents","trafficFlow","hillshade"],zo="#36A8F0",$o="#105287",Ko="#ABAFB3",Xo="#3C4956",qo="#727C85",Zo=["interpolate",["linear"],["zoom"],1,3,5,4,10,7,18,10],Jo=["==",["get","routeState"],"selected"],Qo=["==",["get","routeState"],"deselected"],ea="#AD0000",ta="#FB2D09",ra="#f58240",ia="#000000",oa=e=>!1===e?.visible?"":e?.title??["format",["get","title"],"\n",["get","chargingPower"]," • ",["get","chargingDuration"]],aa=e=>({...Gi,filter:Jo,minzoom:4,layout:{...Gi.layout,"text-field":oa(e?.text)},paint:{...Gi.paint}}),na={filter:Jo,minzoom:16},sa={...na,type:"line",layout:{"line-cap":"round"}},ca={...sa,paint:{"line-width":["interpolate",["linear"],["zoom"],16,14,22,20],"line-color":"grey"}},la={...sa,paint:{"line-width":["interpolate",["linear"],["zoom"],16,12,22,17],"line-color":"white"}},ua="instruction-arrow",ha={...na,type:"symbol",layout:{"icon-allow-overlap":!0,"icon-image":ua,"icon-rotation-alignment":"map","icon-rotate":["get","lastPointBearingDegrees"],"icon-size":["interpolate",["linear"],["zoom"],16,1,22,2]}},pa={filter:Jo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Zo,"line-color":"#6dc4ed"}},fa={filter:Jo,type:"symbol",minzoom:6,maxzoom:16.5,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-ferry_terminal","icon-size":["interpolate",["linear"],["zoom"],6,.8,16.5,1],"icon-ignore-placement":!0}},_a={type:"line",layout:{"line-join":"round","line-cap":"round","line-sort-key":["get","index"]}},da=["interpolate",["linear"],["zoom"],1,5,5,6,10,10,18,14],ya={..._a,filter:Qo,paint:{"line-color":Xo,"line-width":da}},Aa={..._a,filter:Qo,paint:{"line-color":Ko,"line-width":Zo}},ga={..._a,filter:Jo,paint:{"line-color":$o,"line-width":da}},Ea={type:"symbol",layout:{"symbol-placement":"line","icon-image":"roads-arrow-white","icon-rotate":180}},Ra="selected-route-summary-popup",Ia="deselected-route-summary-popup",ma={filter:Jo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],1,9,5,11,10,15,18,20],"line-color":"#BEBFFA"}},Ta={filter:Jo,type:"symbol",minzoom:4,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-toll_plaza","icon-size":["interpolate",["linear"],["zoom"],4,.8,16.5,1]}},Sa=["interpolate",["linear"],["zoom"],1,2,5,3,10,4,18,6],La={type:"line",layout:{"line-cap":"round"},paint:{"line-width":Sa,"line-color":["match",["get","magnitudeOfDelay"],"minor","#FFC105","moderate",ta,"major",ea,"#C7D2D8"]}},ba={type:"line",filter:["in",["get","magnitudeOfDelay"],["literal",["unknown","indefinite"]]],layout:{"line-join":"round"},paint:{"line-width":Sa,"line-color":["match",["get","magnitudeOfDelay"],"unknown","rgba(190, 39, 27, 1)","rgba(137, 150, 168, 1)"],"line-dasharray":[1.5,1]}},Oa=["match",["get","magnitudeOfDelay"],"minor",ra,"moderate",ta,"major",ea,"indefinite","#666666",ia],Na={filter:Jo,type:"symbol",minzoom:6,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-ignore-placement":!0}},va={...Na,filter:["all",["has","jamIconID"],Na.filter],layout:{...Na.layout,"icon-image":["get","jamIconID"],"icon-anchor":"bottom-left","text-anchor":"bottom-left","text-field":["get","title"],"text-font":[Ni],"text-offset":[3.9,-1.4],"text-size":13},paint:{...Na.paint,"text-color":Oa,"text-halo-color":"#FFFFFF","text-halo-width":1}},Ca={...Na,filter:["all",["has","causeIconID"],Na.filter],layout:{...Na.layout,"icon-image":["get","causeIconID"],"icon-anchor":"bottom-right"},paint:{...Na.paint}},Ma={filter:Jo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Zo,"line-color":"#000000","line-opacity":.3}},wa={filter:Jo,type:"line",layout:{"line-join":"round"},paint:{"line-color":$o,"line-width":Zo}},Ua={filter:Jo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":zo,"line-width":["interpolate",["linear"],["zoom"],1,2,5,3,10,5,18,7],"line-dasharray":[0,1.5]}},Pa="traffic-clear",Da="traffic-major",xa="traffic-moderate",Fa="traffic-minor",Ha=["has","formattedTraffic"],Ga=e=>{const t=void 0!==e?ji(Ra,e):Ra,r=void 0!==e?ji(Ia,e):Ia,i=void 0!==e?ji(Pa,e):Pa,o=void 0!==e?ji(Da,e):Da,a=void 0!==e?ji(xa,e):xa,n=void 0!==e?ji(Fa,e):Fa;return{type:"symbol",layout:{"icon-image":["case",Jo,t,r],"symbol-placement":"point","icon-rotation-alignment":"viewport","text-rotation-alignment":"viewport","symbol-sort-key":["case",Jo,0,1],"icon-text-fit":"both","icon-text-fit-padding":[10,5,5,10],"text-font":["Noto-Medium"],"text-size":13,"icon-padding":0,"text-justify":"left","text-line-height":1.5,"text-field":["format",["get","formattedDuration"],{"text-font":["literal",[Ni]],"text-color":["case",Jo,"black",qo]},["concat","\t\t",["get","formattedDistance"]],{"text-color":qo},["case",Ha,"\n",""],{},["image",["case",Ha,["match",["get","magnitudeOfDelay"],"major",o,"moderate",a,"minor",n,i],""]],{},["case",Ha,["concat"," ",["get","formattedTraffic"]],""],{"text-font":["literal",[Ni]],"text-color":Oa}]},paint:{"icon-translate":[0,-35],"text-translate":[0,-35]}}},ja=Ga(),Ba="start",Wa="middle",Va="finish",ka="indexType",Ya="stopDisplayIndex",za="waypointStart",$a="waypointStop",Ka="waypointSoft",Xa="waypointFinish",qa={"text-field":["get",Ya],"text-font":[Ni],"text-size":["interpolate",["linear"],["zoom"],13,14,18,16],"text-offset":[0,-1.6],"icon-anchor":["case",["all",["==",["get",ka],Wa],["!",["has",Ya]]],"center","bottom"],"text-allow-overlap":!0},Za={type:"symbol",paint:{...xi,"text-color":"#ffffff"},layout:{...Di,...qa,"symbol-sort-key":["case",["==",["get",Mi],Ka],0,["abs",["-",["get","index"],1e3]]]}},Ja={type:"symbol",paint:{...Hi,"text-color":"black","text-halo-width":1.5,"text-halo-color":"#ffffff"},layout:{...Fi,"text-anchor":"top","text-offset":[0,.4]}},Qa=(e,t)=>e&&t&&(e.startsWith("route")||e.startsWith("waypoint"))?`${t}-${e}`:e,en=(e,t)=>e&&t?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,r?.beforeID?{...r,beforeID:Qa(r.beforeID,t)}:r])):e,tn=(e,t)=>e&&void 0!==t?`${e}-${t}`:e,rn=(e={},t,r)=>{const i=e.layers,o=i?.sections,a=e.theme?.mainColor;return{mainLines:{routeLineArrows:{...Ea,beforeID:gi.lowestLabel,...i?.mainLines?.routeLineArrows},routeLine:{...(n={color:a},{..._a,filter:Jo,paint:{"line-color":n?.color??zo,"line-width":Zo}}),beforeID:Qa("routeIncidentBackgroundLine",t),...i?.mainLines?.routeLine},routeOutline:{...ga,beforeID:Qa("routeLine",t),...i?.mainLines?.routeOutline},routeDeselectedLine:{...Aa,beforeID:Qa("routeOutline",t),...i?.mainLines?.routeDeselectedLine},routeDeselectedOutline:{...ya,beforeID:Qa("routeDeselectedLine",t),...i?.mainLines?.routeDeselectedOutline},...en(i?.mainLines?.additional,t)},waypoints:{routeWaypointSymbol:{...Za,beforeID:Qa("routeSummaryBubbleSymbol",t),...i?.waypoints?.routeWaypointSymbol},routeWaypointLabel:{...Ja,beforeID:Qa("routeWaypointSymbol",t),...i?.waypoints?.routeWaypointLabel},...en(i?.waypoints?.additional,t)},chargingStops:{routeChargingStopSymbol:{...aa(e.chargingStops),beforeID:Qa("routeWaypointSymbol",t),...i?.chargingStops?.routeChargingStopSymbol},...en(i?.chargingStops?.additional,t)},sections:{incident:{routeIncidentJamSymbol:{...va,beforeID:Qa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentJamSymbol},routeIncidentCauseSymbol:{...Ca,beforeID:Qa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentCauseSymbol},routeIncidentBackgroundLine:{...La,beforeID:Qa("routeIncidentDashedLine",t),...o?.incident?.routeIncidentBackgroundLine},routeIncidentDashedLine:{...ba,beforeID:Qa("routeTunnelLine",t),...o?.incident?.routeIncidentDashedLine},...en(o?.incident?.additional,t)},ferry:{routeFerryLine:{...pa,beforeID:Qa("routeLineArrows",t),...o?.ferry?.routeFerryLine},routeFerrySymbol:{...fa,beforeID:Qa("routeIncidentJamSymbol",t),...o?.ferry?.routeFerrySymbol},...en(o?.ferry?.additional,t)},tollRoad:{routeTollRoadOutline:{...ma,beforeID:Qa("routeDeselectedOutline",t),...o?.tollRoad?.routeTollRoadOutline},routeTollRoadSymbol:{...Ta,beforeID:Qa("routeChargingStopSymbol",t),...o?.tollRoad?.routeTollRoadSymbol},...en(o?.tollRoad?.additional,t)},tunnel:{routeTunnelLine:{...Ma,beforeID:Qa("routeLineArrows",t),...o?.tunnel?.routeTunnelLine},...en(o?.tunnel?.additional,t)},vehicleRestricted:{routeVehicleRestrictedBackgroundLine:{...wa,beforeID:Qa("routeVehicleRestrictedForegroundLine",t),...o?.vehicleRestricted?.routeVehicleRestrictedBackgroundLine},routeVehicleRestrictedForegroundLine:{...Ua,beforeID:gi.lowestLabel,...o?.vehicleRestricted?.routeVehicleRestrictedForegroundLine},...en(o?.vehicleRestricted?.additional,t)}},instructionLines:{routeInstructionLine:{...la,beforeID:gi.lowestLabel,...i?.instructionLines?.routeInstructionLine},routeInstructionOutline:{...ca,beforeID:Qa("routeInstructionLine",t),...i?.instructionLines?.routeInstructionOutline},...en(i?.instructionLines?.additional,t)},instructionArrows:{routeInstructionArrowSymbol:{...ha,beforeID:Qa("routeInstructionLine",t),...void 0!==r&&{layout:{...ha.layout,"icon-image":tn(ha.layout?.["icon-image"],r)}},...i?.instructionArrows?.routeInstructionArrowSymbol},...en(i?.instructionArrows?.additional,t)},summaryBubbles:{routeSummaryBubbleSymbol:{...void 0!==r?Ga(r):ja,...i?.summaryBubbles?.routeSummaryBubbleSymbol},...en(i?.summaryBubbles?.additional,t)}};var n},on=rn();let an;Br()&&(an=Wr(Vr('<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">\n <path d="M1.562 40.569L25 1.562l23.438 39.007L25 27.566 1.562 40.569z" fill="#fff"/>\n <path d="M25.369.107c.782.429.506.167.917.682l23.438 39.007c.79 1.316-.671 2.829-2.014 2.085L25 29.281l-22.71 12.6c-1.343.744-2.804-.769-2.014-2.085L23.714.789c.461-.694.9-.682 1.656-.682zM25 1.562L1.562 40.569 25 27.566l23.438 13.003L25 1.562z"\n fill="gray"/>\n</svg>\n')));const nn=e=>{if(!Br())return;const t=Vr('<svg xmlns="http://www.w3.org/2000/svg" width="160" height="65">\n <g filter="url(#A)">\n <rect id="pin" x="81.899" y="47" width="10" height="10" rx="2" transform="rotate(45 81.899 47)"/>\n <rect id="bubble" x="10" y="10" width="140" height="45" rx="12"/>\n </g>\n <defs>\n <filter id="A">\n <feDropShadow dx="0" dy="2" stdDeviation="4" flood-opacity=".3"/>\n </filter>\n </defs>\n</svg>\n');return t.querySelector("#bubble")?.setAttribute("fill",e),t.querySelector("#pin")?.setAttribute("fill",e),Wr(t)},sn={pixelRatio:2,stretchX:[[20,45],[100,130]],stretchY:[[20,35]],content:[10,10,130,45]},cn=e=>{if(!Br())return;const t=Vr('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">\n <g id="main">\n <path fill-rule="evenodd"\n d="M11.389 4H9.025a.86.86 0 0 0-.517.173l-.001-.001a.5.5 0 0 1-.464.059l-.028-.011a.5.5 0 0 1-.129-.83A1.86 1.86 0 0 1 9.025 3h2.364a2 2 0 0 1 1.789 1.106l1.02 2.04c.471.176.802.63.802 1.156v.803c0 .543 0 .815-.071 1.038a1.5 1.5 0 0 1-.914.953c-.219.08-.491.092-1.034.114l-1.481.062v-.166-.803a2.23 2.23 0 0 0-1.055-1.897l-.74-1.479 2.326.033h.955l-.703-1.406A1 1 0 0 0 11.389 4zM12 8.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"/>\n <path d="M11.833 11.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594h-1.187c-.328 0-.594-.266-.594-.594z"/>\n <path fill-rule="evenodd"\n d="M1.802 8.146C1.331 8.321 1 8.776 1 9.302v.803c0 .543 0 .815.071 1.038a1.5 1.5 0 0 0 .914.953c.219.08.491.092 1.034.114l2.731.114 2.731-.114c.543-.023.814-.034 1.034-.114a1.5 1.5 0 0 0 .914-.953c.071-.223.071-.494.071-1.038v-.803c0-.526-.331-.98-.802-1.156l-1.02-2.04A2 2 0 0 0 6.889 5H4.611a2 2 0 0 0-1.789 1.106l-1.02 2.04zM6.889 6H4.611a1 1 0 0 0-.894.553l-.703 1.406h.955 3.563.955l-.703-1.406A1 1 0 0 0 6.889 6zM2 10.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm6.5-1a1 1 0 0 0-1 1 .5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5 1 1 0 0 0-1-1z"/>\n <path d="M1.792 13.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594H2.385c-.328 0-.594-.266-.594-.594zm5.739-.198c-.109 0-.198.089-.198.198 0 .328.266.594.594.594h1.188c.328 0 .594-.266.594-.594 0-.109-.089-.198-.198-.198h-1.98z"/>\n </g>\n</svg>\n'),r=t.querySelector("#main");return r.setAttribute("transform","scale(2)"),r.setAttribute("fill",e),Wr(t)},ln=(e,t)=>{if(!Br())return;const r=kr(t);return e&&r.appendChild(e),Wr(r)},un=(e={},t)=>Object.entries(e).map(([e,r])=>({...r,id:t?`${t}-${e}`:e})),hn=(e={},t)=>({mainLines:un(e.mainLines,t),waypoints:un(e.waypoints,t),chargingStops:un(e?.chargingStops,t),ferries:un(e.sections?.ferry,t),incidents:un(e.sections?.incident,t),tollRoads:un(e.sections?.tollRoad,t),tunnels:un(e.sections?.tunnel,t),vehicleRestricted:un(e.sections?.vehicleRestricted,t),instructionLines:un(e.instructionLines,t),instructionArrows:un(e.instructionArrows,t),summaryBubbles:un(e.summaryBubbles,t)}),pn=(e,t,r)=>{const i=a.instance.get().displayUnits,o=e?.displayUnits;return{...e,...o?{}:{displayUnits:i},layers:rn(e,t,r)}},fn=(e,t)=>{const r=t?.chargingStops?.icon;if(r?.mapping){const t=r.mapping;switch(t.basedOn){case"chargingSpeed":if(e.properties.chargingConnectionInfo?.chargingSpeed)return t.value[e.properties.chargingConnectionInfo?.chargingSpeed];break;case"custom":return t.fn(e)}}return"7309"},_n=e=>{const t=e.properties;return t.chargingParkName??t.chargingParkOperatorName},dn=(e,r)=>{const i=[];if(!1!==r?.chargingStops?.visible)for(const o of e.features)for(const e of o.properties.sections.leg){const a=e.summary.chargingInformationAtEndOfLeg;if(a){const e=a.properties;i.push({...a,properties:{...a.properties,id:a.properties.chargingParkId??t(),iconID:fn(a,r),title:_n(a),chargingPower:`${e.chargingConnectionInfo?.chargingPowerInkW} kW`,chargingDuration:n(e.chargingTimeInSeconds,r?.displayUnits?.time),routeState:o.properties.routeState}})}}return{type:"FeatureCollection",features:i}},yn=e=>e.categories.includes("jam"),An=e=>{const t=(e=>{if(yn(e))return n(e.delayInSeconds)})(e),r=((e,t)=>yn(e)?`traffic-jam-${e.magnitudeOfDelay??"unknown"}-${(e=>e?.length?e.length<6?"small":e.length<8?"medium":"large":"collapsed")(t)}`:null)(e,t),i=(e=>{switch(e.categories.find(e=>"jam"!==e)){case"accident":return"traffic-incidents-accident";case"roadworks":return"traffic-incidents-roadworks";case"road-closed":return"traffic-incidents-road_closed";case"danger":case"animals-on-road":return"traffic-incidents-danger";case"broken-down-vehicle":return"traffic-incidents-broken_down_vehicle";case"lane-closed":case"narrow-lanes":return"traffic-incidents-lane_closed";case"wind":return"traffic-incidents-wind";case"fog":return"traffic-incidents-fog";case"rain":return"traffic-incidents-rain";case"frost":return"traffic-incidents-frost";case"flooding":return"traffic-incidents-flooding";default:return null}})(e);return{...e,...r&&{jamIconID:r},...i&&{causeIconID:i},...t&&{title:t}}},gn=(e,t,r)=>{if(e.properties.radiusMeters)return void 0!==r?ji(Ka,r):Ka;let i;switch(t){case"start":i=za;break;case"finish":i=Xa;break;default:i=$a}return void 0!==r?ji(i,r):i},En=(e,r,i)=>{let o=-1;return{type:"FeatureCollection",features:e.map((a,n)=>{if(!a)return o++,null;const c=(e=>{return Array.isArray(e)?{type:"Feature",geometry:{type:"Point",coordinates:e},properties:{}}:"Point"===e.type?{type:"Feature",geometry:t=e,properties:{},...t.bbox&&{bbox:t.bbox}}:e;var t})(a),l=((e,t)=>0===e?Ba:e<t-1?Wa:Va)(n,e.length),u=(e=>!e.properties.radiusMeters)(c);u&&o++;const h=(e=>{const t=e?.properties;return t?.poi?.name??t?.address?.freeformAddress??void 0})(c),p=c.id??t();return{...c,..."main-when-available"===r?.entryPoints&&{geometry:{type:"Point",coordinates:s(c,{useEntryPoint:"main-when-available"})}},id:p,properties:{...c.properties,id:p,index:n,indexType:l,...h&&{title:h},iconID:gn(c,l,i),...u&&l===Wa&&{stopDisplayIndex:o}}}}).filter(e=>e)}};function Rn(e){return e%360*Math.PI/180}function In(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function mn(e,t,r={}){if(!0===r.final)return function(e,t){let r=mn(t,e);return r=(r+180)%360,r}(e,t);const i=In(e),o=In(t),a=Rn(i[0]),n=Rn(o[0]),s=Rn(i[1]),c=Rn(o[1]),l=Math.sin(n-a)*Math.cos(c),u=Math.cos(s)*Math.sin(c)-Math.sin(s)*Math.cos(c)*Math.cos(n-a);return Math.atan2(l,u)%(2*Math.PI)*180/Math.PI}var Tn=mn;const Sn=(e,r,i)=>({type:"FeatureCollection",features:e.features.flatMap(e=>((e,r,i)=>e.properties.sections[r]?.map(r=>{const o=r.id??t();return{type:"Feature",id:o,geometry:{type:"LineString",coordinates:e.geometry.coordinates.slice(r.startPointIndex,r.endPointIndex+1)},properties:{...i?i(r,e.properties):r,routeState:e.properties.routeState,routeIndex:e.properties.index,id:o}}})||[])(e,r,i))}),Ln=(e,t)=>{return t.show((r=e,i=t.shownFeatures,{...i,features:i.features.map(e=>({...e,properties:{...e.properties,routeState:r.features[e.properties.routeIndex||0].properties.routeState}}))}));var r,i},bn=(e,r=0)=>{const i="features"in e?e:{type:"FeatureCollection",features:[e]};return{...i,features:i.features.map((e,i)=>{const o=e.id??t();return{...e,id:o,properties:{...e.properties,id:o,routeState:i===r?"selected":"deselected"}}})}},On=(e,t)=>e.some(e=>e.magnitudeOfDelay===t),Nn=(e,r)=>({type:"FeatureCollection",features:e.features.map(e=>{const i=e.properties.summary,o=e.geometry.coordinates,a=n(i.trafficDelayInSeconds,r?.time),s=(e=>{const t=e.properties.sections.traffic;if(t?.length)return On(t,"major")?"major":On(t,"moderate")?"moderate":On(t,"minor")?"minor":void 0})(e),l=e.id??t();return{type:"Feature",id:l,geometry:{type:"Point",coordinates:o[Math.round(o.length/2)]},properties:{id:l,routeIndex:e.properties.index,routeState:e.properties.routeState,formattedDistance:c(i.lengthInMeters,r?.distance),...s&&{magnitudeOfDelay:s},...a&&{formattedTraffic:a},formattedDuration:n(i.travelTimeInSeconds,r?.time)}}})}),vn=class e extends li{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}createSourcesWithLayers(e){const t=ji("routes",this.instanceIndex);return{mainLines:new Jr(this.mapLibreMap,`${t}-mainLines`,e.mainLines,!1),waypoints:new Jr(this.mapLibreMap,`${t}-waypoints`,e.waypoints,!1),incidents:new Jr(this.mapLibreMap,`${t}-incidents`,e.incidents,!1),ferries:new Jr(this.mapLibreMap,`${t}-ferries`,e.ferries,!1),chargingStops:new Jr(this.mapLibreMap,`${t}-chargingStops`,e.chargingStops,!1),tollRoads:new Jr(this.mapLibreMap,`${t}-tollRoads`,e.tollRoads,!1),tunnels:new Jr(this.mapLibreMap,`${t}-tunnels`,e.tunnels,!1),vehicleRestricted:new Jr(this.mapLibreMap,`${t}-vehicleRestricted`,e.vehicleRestricted,!1),instructionLines:new Jr(this.mapLibreMap,`${t}-instructionLines`,e.instructionLines,!1),instructionArrows:new Jr(this.mapLibreMap,`${t}-instructionArrows`,e.instructionArrows,!1),summaryBubbles:new Jr(this.mapLibreMap,`${t}-summaryBubbles`,e.summaryBubbles,!1)}}_initSourcesWithLayers(t,r){r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.layerIDPrefix=ji("routes",this.instanceIndex)),this.layersSpecs=hn(pn(t,this.layerIDPrefix,this.instanceIndex).layers,this.layerIDPrefix);const i=this.createSourcesWithLayers(this.layersSpecs);ii(Object.values(i).flatMap(e=>e._layerSpecs),this.mapLibreMap);const o={fillColor:t?.theme?.mainColor,...t?.waypoints?.icon?.style},a={pixelRatio:2},n=ji(za,this.instanceIndex),s=ji($a,this.instanceIndex),c=ji(Ka,this.instanceIndex),l=ji(Xa,this.instanceIndex),u=ji(ua,this.instanceIndex),h=ji(Ra,this.instanceIndex),p=ji(Ia,this.instanceIndex),f=ji(Pa,this.instanceIndex),_=ji(Da,this.instanceIndex),d=ji(xa,this.instanceIndex),y=ji(Fa,this.instanceIndex);this.addImageIfNotExisting(n,(e=>{if(Br())return ln(Vr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M63.734 86.383c-1.404.026-2.78-.393-3.93-1.197s-2.01-1.949-2.46-3.271l-3.15-9.339c-1.093-3.403-3.748-6.089-7.154-7.238L37.5 62.21c-2.742-.902-4.567-3.477-4.5-6.345-.058-2.874 1.761-5.457 4.5-6.388l36-11.886c2.461-.88 5.213-.27 7.062 1.567s2.466 4.571 1.578 7.015L70.17 81.918c-.938 2.719-3.54 4.526-6.436 4.469h0z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(s,ln(void 0,o),a),this.addImageIfNotExisting(c,(()=>{if(Br())return Wr(Vr('<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <circle id="circle" cx="16" cy="16" r="12" fill="white" stroke="#105287" stroke-width="4"/>\n</svg>\n'))})(),a),this.addImageIfNotExisting(l,(e=>{if(Br())return ln(Vr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M33 83.404a2.99 2.99 0 0 1-3-2.978V44.681a2.99 2.99 0 1 1 6 0v35.745a2.99 2.99 0 0 1-3 2.978zm48-38.723H39v17.872h42V44.681zm3.878 37.851a3.02 3.02 0 0 0 4.244 0c.561-.559.878-1.317.878-2.106V44.681a2.99 2.99 0 1 0-6 0v35.745c0 .789.317 1.547.878 2.106z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(u,an,a),this.addImageIfNotExisting(h,nn("white"),sn),this.addImageIfNotExisting(p,nn("#EEEEEE"),sn),this.addImageIfNotExisting(f,cn(ia),a),this.addImageIfNotExisting(_,cn(ea),a),this.addImageIfNotExisting(d,cn(ta),a),this.addImageIfNotExisting(y,cn(ra),a);for(const e of t?.chargingStops?.icon?.customIcons??[])this.addImageIfNotExisting(e.id,e.image,{pixelRatio:e.pixelRatio??2});return i}_applyConfig(e){const t=pn(e,this.layerIDPrefix,this.instanceIndex);if(this.config){const e=hn(t.layers,this.layerIDPrefix);Object.keys(e).forEach(t=>{const r=t;((e,t,r,i)=>{const o=e.reduce((e,t)=>({...e,[t.id]:t}),{}),a=t.reduce((e,t)=>({...e,[t.id]:t}),{}),n=[],s=[],c=[],l=[];Object.keys(o).forEach(e=>{a[e]?(c.push(o[e]),l.push(a[e])):n.push(e)}),Object.keys(a).forEach(e=>{o[e]||s.push(e)});const u=r._layerSpecs;s.forEach(e=>{i.removeLayer(e);for(let t=0;t<u.length;t++)if(u[t].id===e){u.splice(t,1);break}}),n.forEach(e=>{const t={...o[e],source:r.source.id};u.push(t)}),r._updateSourceAndLayerIDs(),ri(c,l,i)})(e[r],this.layersSpecs[r],this.sourcesWithLayers[r],this.mapLibreMap)});const r=Object.values(this.sourcesWithLayers);ii(r.flatMap(e=>e._layerSpecs),this.mapLibreMap),r.forEach(e=>e.setLayersVisible(!!e.shownFeatures.features.length)),this.layersSpecs=e}return!vr(this.config?.displayUnits,t.displayUnits)&&this.sourcesWithLayers.summaryBubbles.shownFeatures.features.length&&this.sourcesWithLayers.summaryBubbles.show(Nn(this.sourcesWithLayers.mainLines.shownFeatures,t.displayUnits)),t}restoreDataAndConfigImpl(){const e=Object.entries(this.sourcesWithLayers).map(e=>({[e[0]]:e[1].shownFeatures})).reduce((e,t)=>({...e,...t}),{});this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config);for(const t of Object.keys(e))this.sourcesWithLayers[t].show(e[t])}addImageIfNotExisting(e,t,r){ni(0,e,t,this.mapLibreMap,r)}async showRoutes(e,r){const i=bn(e,r?.selectedIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(i),this.sourcesWithLayers.vehicleRestricted.show(Sn(i,"vehicleRestricted")),this.sourcesWithLayers.incidents.show(Sn(i,"traffic",An)),this.sourcesWithLayers.chargingStops.show(dn(i,this.config)),this.sourcesWithLayers.ferries.show(Sn(i,"ferry")),this.sourcesWithLayers.tunnels.show(Sn(i,"tunnel")),this.sourcesWithLayers.tollRoads.show(Sn(i,"toll")),this.sourcesWithLayers.instructionLines.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length).map(i=>({type:"Feature",geometry:{type:"LineString",coordinates:i.routePath.map(e=>e.point)},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState}}))||[])}))(i)),this.sourcesWithLayers.instructionArrows.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length&&e.routePath.length>1).map(i=>{const o=[i.routePath[i.routePath.length-2]?.point,i.routePath[i.routePath.length-1]?.point];return{type:"Feature",geometry:{type:"Point",coordinates:o[1]},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState,lastPointBearingDegrees:Tn(o[0],o[1])}}})||[])}))(i)),this.sourcesWithLayers.summaryBubbles.show(Nn(i,this.config?.displayUnits))}async clearRoutes(){await this.waitUntilModuleReady();for(const e of Object.keys(this.sourcesWithLayers))"waypoints"!==e&&this.sourcesWithLayers[e].clear()}async selectRoute(e){const t=bn(this.sourcesWithLayers.mainLines.shownFeatures,e);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(t),this.sourcesWithLayers.chargingStops.show(dn(t,this.config)),Ln(t,this.sourcesWithLayers.vehicleRestricted),Ln(t,this.sourcesWithLayers.incidents),Ln(t,this.sourcesWithLayers.ferries),Ln(t,this.sourcesWithLayers.tollRoads),Ln(t,this.sourcesWithLayers.tunnels),Ln(t,this.sourcesWithLayers.instructionLines),Ln(t,this.sourcesWithLayers.instructionArrows),Ln(t,this.sourcesWithLayers.summaryBubbles)}async showWaypoints(e){const t=Array.isArray(e)?En(e,this.config?.waypoints,this.instanceIndex):En(e.features,this.config?.waypoints,this.instanceIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.show(t)}async clearWaypoints(){await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.clear()}get events(){return{mainLines:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.mainLines,this.config?.events),waypoints:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.waypoints,this.config?.events),chargingStops:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.chargingStops,this.config?.events),summaryBubbles:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.summaryBubbles,this.config?.events),incidents:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.incidents,this.config?.events),vehicleRestricted:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vehicleRestricted,this.config?.events),ferries:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.ferries,this.config?.events),tollRoads:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tollRoads,this.config?.events),tunnels:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tunnels,this.config?.events),instructionLines:new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.instructionLines,this.config?.events)}}getLayerToRenderLinesUnder(){return gi.lowestLabel}};vn.lastInstanceIndex=-1;let Cn=vn;const Mn="standardLight",wn={standardLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},standardDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},drivingLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},drivingDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},monoLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_mono-light"},monoDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_mono-dark"},satellite:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_satellite"}},Un=e=>`\${baseURL}/maps/orbis/assets/styles/\${version}/style.json?&apiVersion=1&key=\${apiKey}&map=${e}`,Pn={standardLight:Un("basic_street-light"),standardDark:Un("basic_street-dark"),drivingLight:Un("basic_street-light-driving"),drivingDark:Un("basic_street-dark-driving"),monoLight:Un("basic_mono-light"),monoDark:Un("basic_mono-dark"),satellite:Un("basic_street-satellite")},Dn=(e,t,r)=>{const i=e.id??Mn,o=new URL(Pn[i].replace("${baseURL}",t).replace("${version}",e.version??"0.6.0-0").replace("${apiKey}",r));for(const a of e.include??Yo)o.searchParams.append(a,wn[i][a]);return o.toString()},xn=e=>{const t=e.style,r=e.commonBaseURL,i=e.apiKey;return"string"==typeof t?Dn({id:t},r,i):"standard"===t?.type?Dn(t,r,i):"custom"===t?.type&&t?.url?((e,t)=>{const r=new URL(e);return r.searchParams.has("key")?console.warn("The style URL is coming with an API key parameter which takes priority. If you want to use the SDK configured API key, remove the key param from the style URL"):r.searchParams.set("key",t),r.toString()})(t.url,i):"custom"===t?.type&&t?.json?t.json:Dn({id:Mn},r,i)};class Fn{constructor(t){var r,i;this.mapReady=!1,this.styleChangeHandlers=[],this.setStyle=(e,t={keepState:!0})=>{this.mapReady=!1;for(const o of this.styleChangeHandlers)try{o.onStyleAboutToChange?.()}catch(i){console.error(i)}const r=t.keepState?((e,t)=>t&&"object"==typeof t&&"standard"===t.type&&t.include&&("string"==typeof e||"standard"===e.type&&!e.include)?{type:"standard",id:"string"==typeof e?e:e.id,include:t.include}:e)(e,this._params.style):e;this._params={...this._params,style:r},this.styleLightDarkTheme=ci(r),this.mapLibreMap.once("styledata",()=>{!this.mapReady&&vr(r,this._params.style)&&this.handleStyleData(t.keepState||!0)}),this.mapLibreMap.setStyle(xn(this._params),{validate:!1})},this.getStyle=()=>this._params.style,this._params=l(t),void 0===this._params.style&&(this._params={...this._params,style:Mn}),this.styleLightDarkTheme=ci(this._params.style),this.ensureMapLibreCSSLoaded(),this.mapLibreMap=new h({validateStyle:!1,maxTileCacheZoomLevels:22,cancelPendingTileRequestsWhileZooming:!1,...(r=this._params).mapLibre,style:xn(r),attributionControl:{compact:!1},transformRequest:(i=r,(t,r)=>t.includes("tomtom.com")?"Image"===r?{url:t}:{url:t,headers:{...e(i)}}:{url:t})}),this.mapLibreMap.once("styledata",()=>{this.handleStyleData(!1)}),this._eventsProxy=new Ai(this.mapLibreMap,this._params?.events),this.loadRTLTextPlugin()}loadRTLTextPlugin(){setTimeout(()=>{["deferred","loaded"].includes(p())||f("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!0).catch(e=>console.error("Something went wrong when setting RTL plugin",e))})}ensureMapLibreCSSLoaded(){if("undefined"==typeof document)return;if(Array.from(document.querySelectorAll('link[rel="stylesheet"], style')).some(e=>e.textContent?.includes(".maplibregl-map")))return;const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.17.0/dist/maplibre-gl.css",document.head.appendChild(e)}_setLanguage(e){this._params={...this._params,language:e};const t=e?.includes("-")?e.split("-")[0]:e;this.mapLibreMap.getStyle().layers.forEach(e=>{if("symbol"===e.type&&(e=>{const t=e.layout?.["text-field"]??"";return!!t&&("{name}"===t||2===t.length&&"name"===t[1]||3===t.length&&Array.isArray(t[1])&&"string"==typeof t[1][1]&&t[1][1].includes("name_")&&Array.isArray(t[2])&&t[2].includes("name"))})(e)){const r=t?["coalesce",["get",`name_${t}`],["get","name"]]:["get","name"];this.mapLibreMap.setLayoutProperty(e.id,"text-field",r,{validate:!1})}})}setLanguage(e){this.mapReady?this._setLanguage(e):this.mapLibreMap.once("styledata",()=>this.setLanguage(e))}getBBox(){return this.mapLibreMap.getBounds().toArray().flat()}handleStyleData(e){for(const r of Kr(this.mapLibreMap,[mi,Ti,Ri]))this.mapLibreMap.setLayoutProperty(r.id,"visibility","none",{validate:!1});if((async(e,t)=>{t.setSprite(`${e.commonBaseURL}/maps/orbis/assets/sprites/2.*/sprite?key=${e.apiKey}&poi=poi_${ci(e.style)}&apiVersion=1&apiChannel=preview`,{validate:!1})})(this._params,this.mapLibreMap),this._params.language&&this._setLanguage(this._params.language),this.mapReady=!0,e)for(const r of this.styleChangeHandlers)try{r.onStyleChanged?.()}catch(t){console.error(t)}}addStyleChangeHandler(e){this.styleChangeHandlers.push(e)}}const Hn=["unknown","accident","fog","dangerous_conditions","rain","ice","jam","lane_closed","road_closed","road_works","wind","flooding","broken_down_vehicle"],Gn={unknown:0,accident:1,fog:2,dangerous_conditions:3,rain:4,ice:5,jam:6,lane_closed:7,road_closed:8,road_works:9,wind:10,flooding:11,broken_down_vehicle:14},jn=["motorway","trunk","primary","secondary","tertiary","street"],Bn=["connecting","major_local"],Wn=["local","minor_local"],Vn=(e,t)=>e.length?1===e.length?{expression:e[0],legacy:t[0]}:{expression:["all",...e],legacy:["all",...t]}:null,kn=(e,t,r)=>{e&&(t.push(e.expression),r.push(e.legacy))},Yn=(e,t,r,i)=>{e&&kn(mo(t,e),r,i)},zn=(e,t,r)=>{Yn(e.roadCategories,"road_category",t,r),Yn(e.roadSubCategories,"road_subcategory",t,r)},$n=e=>{const t=[],r=[];if(zn(e,t,r),e.incidentCategories){const i=mo("icon_category_0",e.incidentCategories,e=>Gn[e]);kn(i,t,r)}if(e.magnitudes){const i=mo("magnitude_of_delay",e.magnitudes,e=>u.indexOf(e));kn(i,t,r)}return e.delays&&kn((e=>{const t=[],r=[];if(e.mustHaveDelay&&e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push([">=",["get","delay"],i]),r.push([">=","delay",i])}else if(e.mustHaveDelay)t.push([">",["get","delay"],0]),r.push([">","delay",0]);else if(e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push(["any",["!",["has","delay"]],["==",["get","delay"],0],[">=",["get","delay"],i]]),r.push(["any",["!has","delay"],["==","delay",0],[">=","delay",i]])}return Vn(t,r)})(e.delays),t,r),Vn(t,r)},Kn=e=>{if(!e?.any?.length)return null;const t=e.any.map($n).filter(e=>!Cr(e));return Eo(t)},Xn=e=>{const t=[],r=[];if(zn(e,t,r),e.showRoadClosures){const i="only"===e.showRoadClosures?"==":"!=";t.push([i,["get","road_closure"],!0]),r.push([i,"road_closure",!0])}return Vn(t,r)},qn=(e,t,r,i)=>{for(const o of t)r.setFilter(o.id,e?Ro(e,i[o.id]):i[o.id])};class Zn extends li{static async get(e,t){return await Qr(e),await ai(e,Ti,"trafficFlow"),new Zn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ti);if(!e)throw jr(`init ${Zn.name} with source ID ${Ti}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficFlow:new Xr(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),this._filter(e?.filters,!1),e}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[Ti])}filter(e){this._filter(e)}_filter(e,t=!0){if(this.tomtomMap.mapReady)if(e?.any?.length){const t=(e=>{if(!e?.any?.length)return null;const t=e.any.map(Xn).filter(e=>!Cr(e));return Eo(t)})(e);t&&qn(t,this.getLayers(),this.mapLibreMap,this.originalFilters)}else this.config?.filters?.any?.length&&qn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);t&&(this.config=Fr({...this.config,filters:e},Cr))}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficFlow.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficFlow.isAnyLayerVisible()}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficFlow,this.config?.events)}}class Jn extends li{static async get(e,t){return await Qr(e),await ai(e,mi,"trafficIncidents"),new Jn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(mi);if(!e)throw jr(`init ${Jn.name} with source ID ${mi}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficIncidents:new Xr(this.mapLibreMap,e)}}_applyConfig(e){return this._setVisible(e?.visible??!1,{updateConfig:!1}),Cr(e?.icons?.visible)||this.setIconsVisible(e.icons.visible),this._filter(e?.filters,e?.icons?.filters,!1),e}filter(e,t){this._filter(e,t)}_filter(e,t,r=!0){if(this.tomtomMap.mapReady){if(e?.any?.length){const r=Kn(e);if(r){const e=t?this.getNonSymbolLayers():this.getLayers();qn(r,e,this.mapLibreMap,this.originalFilters)}}else this.config?.filters?.any?.length&&qn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);if(t?.any?.length){const e=Kn(t);e&&qn(e,this.getSymbolLayers(),this.mapLibreMap,this.originalFilters)}}r&&(this.config=Fr({...this.config,filters:e,icons:{...this.config?.icons,filters:t}},Cr))}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[mi])}getSymbolLayers(){return this.getLayers().filter(e=>"symbol"===e.type)}getNonSymbolLayers(){return this.getLayers().filter(e=>"symbol"!=e.type)}setIconsVisible(e){this.config={...this.config,icons:{...this.config?.icons,visible:e}},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e,e=>"symbol"===e.type)}setVisible(e){this._setVisible(e)}_setVisible(e,t){(t?.updateConfig??!0)&&(delete this.config?.icons?.visible,this.config={...Fr({...this.config},Nr),visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficIncidents.isAnyLayerVisible()}anyIconLayersVisible(){return!!this.sourcesWithLayers.trafficIncidents?.isAnyLayerVisible(e=>"symbol"===e.type)}get events(){return new ui(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficIncidents,this.config?.events)}}const Qn=(e,t)=>({left:e.left-t.left,top:e.top-t.top,right:e.right-t.left,bottom:e.bottom-t.top}),es=(e,t,r)=>e.right<=0||e.left>=t||e.bottom<=0||e.top>=r,ts=(e,t,r,i)=>{e.top<=r-e.bottom?t.top=Math.max(t.top,e.bottom+i):t.bottom=Math.min(t.bottom,e.top-i)},rs=(e,t,r,i)=>{e.left<=r-e.right?t.left=Math.max(t.left,e.right+i):t.right=Math.min(t.right,e.left-i)},is=(e,t,r,i,o)=>{const a=((e,t,r)=>({left:Math.max(0,e.left),top:Math.max(0,e.top),right:Math.min(t,e.right),bottom:Math.min(r,e.bottom)}))(e,r,i),n=e.left<=0&&e.right>=r,s=e.top<=0&&e.bottom>=i;if(n&&!s)return void ts(a,t,i,o);if(s&&!n)return void rs(a,t,r,o);const c=e.left<=0,l=e.right>=r,u=e.top<=0,h=e.bottom>=i;!c&&!l||u||h?!u&&!h||c||l?((e,t,r,i,o)=>{const a=e.left,n=r-e.right,s=e.top,c=i-e.bottom,l=Math.min(a,n,s,c);l===a?t.left=Math.max(t.left,e.right+o):l===n?t.right=Math.min(t.right,e.left-o):l===s?t.top=Math.max(t.top,e.bottom+o):t.bottom=Math.min(t.bottom,e.top-o)})(a,t,r,i,o):rs(a,t,r,o):ts(a,t,i,o)},os=e=>"string"==typeof e?document.querySelector(e):e,as=e=>"mapLibreMap"in e?e.mapLibreMap:e,ns=(e,t,r)=>{const i=as(e).getContainer().getBoundingClientRect(),{width:o,height:a}=i,n={left:r,top:r,right:o-r,bottom:a-r};for(const s of t){const e=os(s);if(!e)continue;const t=e.getBoundingClientRect(),c=Qn(t,i);es(c,o,a)||is(c,n,o,a,r)}return n.left>=n.right||n.top>=n.bottom?null:{visibleAreaBounds:n,mapWidthPX:o,mapHeightPX:a}},ss=e=>{const{map:t,surroundingElements:r,paddingPX:i=0}=e,o=ns(t,r,i);if(!o)return null;const{visibleAreaBounds:a}=o,n=as(t),s=n.unproject([a.left,a.bottom]),c=n.unproject([a.right,a.top]);return[s.lng,s.lat,c.lng,c.lat]},cs=e=>{const{map:t,surroundingElements:r}=e,i=ss({map:t,surroundingElements:r});if(!i)return null;const[o,a,n,s]=i;return[(o+n)/2,(a+s)/2]},ls=e=>{const{map:t,toBeContainedBBox:r,surroundingElements:i,paddingPX:o=0}=e,a=ns(t,i,o);if(!a)return null;const{visibleAreaBounds:n,mapWidthPX:s,mapHeightPX:c}=a,l=n.left/s,u=n.right/s,h=n.top/c,p=u-l,f=n.bottom/c-h,[_,d,y,A]=r,g=(y-_)/p,E=(A-d)/f,R=_-l*g,I=A+h*E;return[R,I-E,R+g,I]};export{li as AbstractMapModule,$r as AbstractSourceWithLayers,qr as AddedSourceWithLayers,Ii as BASE_MAP_SOURCE_ID,vo as BaseMapModule,Ko as DESELECTED_FOREGROUND_COLOR,Xo as DESELECTED_OUTLINE_COLOR,Qo as DESELECTED_ROUTE_FILTER,qo as DESELECTED_SECONDARY_COLOR,ui as EventsModule,Ai as EventsProxy,Va as FINISH_INDEX,wo as GEOMETRY_COLOR_PROP,Mo as GEOMETRY_TITLE_PROP,Jr as GeoJSONSourceWithLayers,Wo as GeometriesModule,Ri as HILLSHADE_SOURCE_ID,Vo as HillshadeModule,ka as INDEX_TYPE,ea as MAJOR_DELAY_COLOR,Wa as MIDDLE_INDEX,ra as MINOR_DELAY_LABEL_COLOR,ta as MODERATE_DELAY_COLOR,Ei as POI_SOURCE_ID,Lo as POIsModule,Ao as PlacesModule,zo as ROUTE_LINE_FOREGROUND_COLOR,Zo as ROUTE_LINE_FOREGROUND_WIDTH,$o as ROUTE_LINE_OUTLINE_COLOR,Cn as RoutingModule,Jo as SELECTED_ROUTE_FILTER,Ba as START_INDEX,Ya as STOP_DISPLAY_INDEX,Xr as StyleSourceWithLayers,Ti as TRAFFIC_FLOW_SOURCE_ID,mi as TRAFFIC_INCIDENTS_SOURCE_ID,Fn as TomTomMap,zr as TomTomMapSource,Zn as TrafficFlowModule,Jn as TrafficIncidentsModule,ia as UNKNOWN_DELAY_COLOR,Co as baseMapLayerGroupNames,co as buildPlaceTitle,rn as buildRoutingLayers,ls as calculateFittingBBox,ss as calculatePaddedBBox,cs as calculatePaddedCenter,on as defaultRoutingLayers,Kr as filterLayersBySources,uo as getIconIDForPlace,ho as getPOILayerCategoryForPlace,So as getStyleCategories,Hn as incidentCategories,Gn as incidentCategoriesMapping,Li as mapDisplayPoiCategoryMappings,gi as mapStyleLayerIDs,To as poiCategoryGroups,Si as poiLayerIDs,_o as preparePlacesForDisplay,jn as roadCategories,ko as standardStyleIDs,Wn as streetRoadCategories,Yo as styleModules,Bn as tertiaryRoadCategories,Oi as toBaseMapPOICategory,po as toPlaces};
2
2
  //# sourceMappingURL=map.es.js.map