@tomtom-org/maps-sdk 0.40.0 → 0.41.0

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 _}from"maplibre-gl";var f="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,y=f||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 O(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==S(e)}function b(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,C=A?A.prototype:void 0,v=C?C.toString:void 0;function M(e){if("string"==typeof e)return e;if(N(e))return b(e,M)+"";if(O(e))return v?v.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__"],H=(D=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"";var F=Function.prototype.toString;function G(e){if(null!=e){try{return F.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,H&&H in t))&&(P(e)?Y:j).test(G(e));var t}function K(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=K(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 _e(e){return L(e)&&"[object Arguments]"==S(e)}var fe=Object.prototype,de=fe.hasOwnProperty,ye=fe.propertyIsEnumerable,Ae=_e(/* @__PURE__ */function(){return arguments}())?_e: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,Oe=Le&&Le.exports===Se&&f.process,be=function(){try{var e=Le&&Le.require&&Le.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch(t){}}(),Ne=be&&be.isTypedArray,Ce=Ne?Te(Ne):function(e){return L(e)&&le(e.length)&&!!me[S(e)]},ve=Object.prototype.hasOwnProperty;function Me(e,t){var r=N(e),i=!r&&Ae(e),o=!r&&!i&&Ie(e),a=!r&&!i&&!o&&Ce(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&&!ve.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 He=Object.prototype.hasOwnProperty;function Fe(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&&He.call(e,i))&&r.push(i);return r}function Ge(e){return ue(e)?Me(e,!0):Fe(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&&!O(e))||(Be.test(e)||!je.test(e)||null!=t&&e in Object(t))}var Ve=K(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 Ke(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 $e=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=Ke(t,e);return!(r<0)&&(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,!0)},Xe.prototype.get=function(e){var t=this.__data__,r=Ke(t,e);return r<0?void 0:t[r][1]},Xe.prototype.has=function(e){return Ke(this.__data__,e)>-1},Xe.prototype.set=function(e,t){var r=this.__data__,i=Ke(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var qe=K(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||O(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,_t=ht.toString,ft=pt.hasOwnProperty,dt=_t.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 Ot(e){return Lt(e,xe,Tt)}function bt(e){return Lt(e,Ge,St)}var Nt=K(y,"DataView"),Ct=K(y,"Promise"),vt=K(y,"Set"),Mt="[object Map]",wt="[object Promise]",Ut="[object Set]",Pt="[object WeakMap]",Dt="[object DataView]",xt=G(Nt),Ht=G(qe),Ft=G(Ct),Gt=G(vt),jt=G($),Bt=S;(Nt&&Bt(new Nt(new ArrayBuffer(1)))!=Dt||qe&&Bt(new qe)!=Mt||Ct&&Bt(Ct.resolve())!=wt||vt&&Bt(new vt)!=Ut||$&&Bt(new $)!=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 Ht:return Mt;case Ft: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,Kt=zt?zt.valueOf:void 0;function $t(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,Kt?Object(Kt.call(i)):{}}}var Xt=be&&be.isMap,qt=Xt?Te(Xt):function(e){return L(e)&&"[object Map]"==Bt(e)};var Zt=be&&be.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=$t(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:bt(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,_=2&r?new or:void 0;for(a.set(e,t),a.set(t,e);++h<s;){var f=e[h],d=t[h];if(i)var y=n?i(d,f,h,t,e,a):i(f,d,h,e,t,a);if(void 0!==y){if(y)continue;p=!1;break}if(_){if(!ar(t,function(e,t){if(n=t,!_.has(n)&&(f===e||o(f,e,r,i,a)))return _.push(t);var n})){p=!1;break}}else if(f!==d&&!o(f,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]",_r="[object Array]",fr="[object Object]",dr=Object.prototype.hasOwnProperty;function yr(e,t,r,i,o,a){var n=N(e),s=N(t),c=n?_r:Bt(e),l=s?_r:Bt(t),u=(c=c==pr?fr:c)==fr,h=(l=l==pr?fr:l)==fr,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||Ce(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 _=u&&dr.call(e,"__wrapped__"),f=h&&dr.call(t,"__wrapped__");if(_||f){var d=_?e.value():e,y=f?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=Ot(e),c=s.length;if(c!=Ot(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 _=!0;a.set(e,t),a.set(t,e);for(var f=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)){_=!1;break}f||(f="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||(_=!1)}return a.delete(e),a.delete(t),_}(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 Or(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 br=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)||Ce(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(br.call(e,r))return!1;return!0}function Cr(e,t){return Ar(e,t)}function vr(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=Or(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=ft.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&_t.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=b(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,bt(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=b(bt(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 Hr(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 Fr=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)?Fr.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(vr(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 Kr{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 $r=(e,t)=>e.getStyle().layers.filter(e=>t.includes(e?.source));class Xr extends Kr{constructor(e,t,r){let i=$r(e,[t.id]);r&&(i=i.filter(r)),super(e,new zr(t.id,e.getStyle().sources[t.id],t),i)}}class qr extends Kr{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(0===e.length)throw Error(`Circular dependency for before Ids ${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)=>{e.mapLibreMap.getSource(t)||(e.mapLibreMap.isStyleLoaded()||await e.mapLibreMap.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),e.mapLibreMap.once("styledata",()=>{for(const r of $r(e.mapLibreMap,[t]))e.mapLibreMap.setLayoutProperty(r.id,"visibility","none",{validate:!1})}))},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,_i=(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}},fi=(e,t,r)=>{const i=[...r.shownFeatures.features];vr(_i(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=_i(e,t.id,s);return!r||(n=t,(a=r)&&n&&a.id===n.id)||(o===i?_i(e,r.id,s,"removeFromProps"):o instanceof Jr&&fi(e,r,o)),i.show({...i.shownFeatures,features:s}),{feature:s[c],index:c}}var a,n;return r&&o instanceof Jr&&fi(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:"access_gateway",ADVENTURE_SPORTS_FACILITY:"adventure_sports_facility",ADVENTURE_SPORTS_VENUE:"adventure_sports_venue",AGRICULTURE:"agriculture_business",AIRPORT:"airport",AMUSEMENT_PARK:"amusement_park",AQUATIC_ZOO:"zoo_or_aquarium",ASHRAM:"religious_site",ATM:"atm",AUTOMOTIVE_DEALER:"automotive_dealer",BANK:"bank",BEACH:"beach",BUS_STOP:"bus_station",BUSINESS_PARK:"business_park",CAFE_PUB:"cafe",CAMPING_GROUND:"camping_ground",CAR_WASH:"car_wash",CASH_DISPENSER:"atm",CASINO:"casino",CHURCH:"religious_site",CINEMA:"cinema",CLOTHING_SHOP:"clothing_shop",CLUB_ASSOCIATION:"club_and_association",COLLEGE_UNIVERSITY:"college_or_university",COMMERCIAL_BUILDING:"commercial_building",COMMUNITY_CENTER:"community_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_medical_service",EMERGENCY_ROOM:"emergency_room",ENTERTAINMENT:"entertainment",EXCHANGE:"stock_exchange",EXHIBITION_CONVENTION_CENTER:"cultural_center",FERRY_TERMINAL:"ferry_terminal",FIRE_STATION_BRIGADE:"fire_station",FRONTIER_CROSSING:"frontier_crossing",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:"elevation_point",HOLIDAY_RENTAL:"holiday_home",HOSPITAL:"hospital",HOSPITAL_POLYCLINIC:"hospital",HOTEL_MOTEL:"hotel_or_motel",ICE_SKATING_RINK:"ice_skating_rink",IMPORTANT_TOURIST_ATTRACTION:"tourist_attraction",INDUSTRIAL_BUILDING:"industrial_building",LEISURE_CENTER:"leisure_center",LIBRARY:"library",MANUFACTURING_FACILITY:"manufacturing_facility",MARINA:"marina",MARKET:"marketplace",MEDIA_FACILITY:"media_facility",MILITARY_INSTALLATION:"military_facility",MOSQUE:"religious_site",MOTORING_ORGANIZATION_OFFICE:"motoring_organization_office",MOUNTAIN_PASS:"mountain_pass",MOUNTAIN_PEAK:"elevation_point",MOVIE_THEATER:"cinema",MUSEUM:"museum",NATIVE_RESERVATION:"native_reservation",NIGHTLIFE:"nightlife",NON_GOVERNMENTAL_ORGANIZATION:"non_governmental_organization",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:"place_of_worship",POLICE_STATION:"police_station",PORT_WAREHOUSE_FACILITY:"port_or_warehouse_facility",POST_OFFICE:"post_office",PRIMARY_RESOURCE_UTILITY:"primary_resource_or_utility",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:"rent_a_car_parking",REPAIR_FACILITY:"repair_facility",RESEARCH_FACILITY:"research_facility",RESIDENTIAL_ACCOMMODATION:"urban_ground",REST_AREA:"rest_area",RESTAURANT:"restaurant",RESTAURANT_AREA:"restaurant_area",SCENIC_PANORAMIC_VIEW:"viewpoint",SCHOOL:"school",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:"tennis_court",THEATER:"theater",TOLL_GATE:"toll_gate",TOURIST_INFORMATION_OFFICE:"tourist_information_office",TRAFFIC_CONTROL_DEPARTMENT:"traffic_control_department",TRAFFIC_SERVICE_CENTER:"traffic_service_center",TRAIL_SYSTEM:"trail_system",TRAILS:"trails",TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:"transport_authority_or_vehicle_registration",TRUCK_STOP:"truck_stop",VACATION_RENTAL:"vacation_rental",VETERINARIAN:"veterinarian",WATER_SPORT:"water_sport",WEIGH_STATION:"weigh_station",WELFARE_ORGANIZATION:"welfare_organization",WINERY:"manufacturing_facility",ZOOS_ARBORETA_BOTANICAL_GARDEN:"zoo_or_aquarium"},Oi={...Li,SECURED_ENTRANCE:"access_gateway",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:"automotive_dealer",BOAT_DEALER:"automotive_dealer",BUS_DEALER:"automotive_dealer",CAR_DEALER:"automotive_dealer",MOTORCYCLE_DEALER:"automotive_dealer",RECREATIONAL_VEHICLE_DEALER:"automotive_dealer",TRUCK_DEALER:"automotive_dealer",VAN_DEALER:"automotive_dealer",DIVERSIFIED_FINANCIALS:"bank",SAVINGS_INSTITUTION:"bank",BEACH_CLUB:"beach",BAR:"cafe",CAFE:"cafe",COCKTAIL_BAR:"cafe",COFFEE_SHOP:"cafe",INTERNET_CAFE:"cafe",PUB:"cafe",TEA_HOUSE:"cafe",WINE_BAR:"cafe",CARAVAN_SITE:"camping_ground",RECREATIONAL_CAMPING_GROUND:"camping_ground",REST_CAMP:"camping_ground",TRUCK_WASH:"car_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:"commercial_building",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:"elevation_point",AMBULANCE_UNIT:"emergency_medical_service",ROAD_RESCUE:"emergency_medical_service",AMUSEMENT_ARCADE:"entertainment",AMUSEMENT_PLACE:"entertainment",BETTING_STATION:"entertainment",FAIRGROUND:"entertainment",MUSIC_CENTER:"entertainment",CHECKPOINT:"frontier_crossing",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_building",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:"museum",CABARET_THEATER:"nightlife",COMEDY_CLUB:"nightlife",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:"repair_facility",CAR_GLASS_REPLACEMENT_SHOP:"repair_facility",CAR_REPAIR_AND_SERVICE:"repair_facility",HOME_APPLIANCE_REPAIR:"repair_facility",MOTORCYCLE_REPAIR:"repair_facility",OTHER_REPAIR_SHOPS:"repair_facility",REPAIR_SHOP:"repair_facility",TIRE_SERVICE:"repair_facility",TRUCK_REPAIR_AND_SERVICE:"repair_facility",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:"school",CHILD_CARE_FACILITY:"school",CULINARY_SCHOOL:"school",DANCE_STUDIO_SCHOOL:"school",DRIVING_SCHOOL:"school",HIGH_SCHOOL:"school",LANGUAGE_SCHOOL:"school",MIDDLE_SCHOOL:"school",PRE_SCHOOL:"school",PRIMARY_SCHOOL:"school",SENIOR_HIGH_SCHOOL:"school",SPECIAL_SCHOOL:"school",SPORT_SCHOOL:"school",TECHNICAL_SCHOOL:"school",VOCATIONAL_SCHOOL:"school",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_control_department",ADVENTURE_VEHICLE_TRAIL:"trails",HIKING_TRAIL:"trails",HORSE_RIDING_TRAIL:"trails",MOUNTAIN_BIKE_TRAIL:"trails",ROCK_CLIMBING_TRAIL:"trails",APARTMENT_RENTAL:"urban_ground",CONDOMINIUM_COMPLEX:"urban_ground",FLATS_APARTMENT_COMPLEX:"urban_ground",RESIDENTIAL_ESTATE:"urban_ground",RETIREMENT_COMMUNITY:"urban_ground",TOWNHOUSE_COMPLEX:"urban_ground",ANIMAL_SERVICES:"veterinarian",ANIMAL_SHELTER:"veterinarian",WEIGH_SCALES:"weigh_station",WILDLIFE_PARK:"zoo_or_aquarium",ZOO:"zoo_or_aquarium"},bi=e=>Oi[e],Ni="Noto-Bold",Ci="title",vi="iconID",Mi="default_place",wi={"icon-image":["get",vi],"icon-anchor":"bottom","icon-size":["interpolate",["linear"],["zoom"],8,.6,22,.8],"icon-allow-overlap":!0,"icon-padding":0},Ui={"icon-translate":[0,5],"icon-translate-anchor":"viewport"},Pi={"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,.7],"left",[1.4,-1.4],"right",[-1.4,-1.4]],"text-size":["interpolate",["linear"],["zoom"],10,14,18,16],"text-padding":5},Di={"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"},xi={type:"symbol",layout:{...wi,...Pi},paint:{...Ui,...Di}},Hi=(e,t)=>`${e}-${t}`,Fi=["in",["get","eventState"],["literal",["click","contextmenu"]]],Gi=["has","eventState"],ji="#3f9cd9",Bi={...xi,filter:["!",Gi]},Wi={...xi,filter:Gi,layout:{...xi.layout,"icon-size":["interpolate",["linear"],["zoom"],8,.8,22,1],"text-allow-overlap":!0},paint:{...xi.paint,"text-color":ji}},Vi=(e,t,r)=>{const i=t?.text,o=t?.layers?.[r];return{...e,layout:{...e.layout,...i?.size&&{"text-size":i.size},...i?.font&&{"text-font":i.font},...i?.offset&&{"text-offset":i.offset},...i?.title&&"function"!=typeof i?.title&&{"text-field":i?.title},...o?.layout},paint:{...e.paint,...i?.color&&{"text-color":i.color},...i?.haloColor&&{"text-halo-color":i.haloColor},...i?.haloWidth&&{"text-halo-width":i.haloWidth},...o?.paint},...o}},ki=e=>JSON.parse(JSON.stringify(e)?.replace(/name/g,Ci)),Yi=(e,t)=>{let r;if("base-map"===e?.theme){const e=(e=>{const t=e.getStyle().layers.filter(e=>"POI"===e.id)[0]||{},r=t.layout?.["text-size"];return{filter:["!",Fi],type:"symbol",paint:t.paint,layout:{...t.layout,"text-field":["get",Ci],"icon-image":["get",vi],...r&&{"text-size":ki(r)}}}})(t);r={main:e,selected:{...e,filter:Gi,layout:{...e.layout,"text-allow-overlap":!0},paint:{...e.paint,"text-color":ji}}}}else r={main:Bi,selected:Wi};return{main:Vi(r.main,e,"main"),selected:Vi(r.selected,e,"selected"),...e?.layers?.additional}},zi=e=>{if(Br())return Wr(kr(e))},Ki=/* @__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]),$i=e=>e.properties.poi?.name??e.properties.address.freeformAddress,Xi=(e,t,i)=>{if("pin"===t){return(e=>{if(e)return Ki.has(e)?e.toString():e.toString().substring(0,4)})(r[e])??i}{const t=bi(e);return t?`poi-${t}`:i}},qi=(e,t,r={})=>{const i=r.theme??"pin",o=Hi(Mi,t),a=r.icon?.mapping;if(a)return"imageID"===a.to?a.fn(e):Xi(a.fn(e),i,o);const n=e.properties.poi?.classifications?.[0]?.code,s=r.icon?.categoryIcons?.find(e=>e.id===n);return s?Hi(s.id,t):Xi(n,i,o)},Zi=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return t&&bi(t)},Ji=e=>Array.isArray(e)?{type:"FeatureCollection",features:e}:"Feature"===e.type?{type:"FeatureCollection",features:[e]}:e,Qi=(e,r,i={})=>{const o=Ji(e);return{...o,features:o.features.map(e=>{const o="function"==typeof i?.text?.title?i?.text?.title(e):$i(e),a=i.extraFeatureProps?Object.fromEntries(Object.entries(i.extraFeatureProps).map(([t,r])=>[t,"function"==typeof r?r(e):r])):{},n=e.id??t();return{...e,id:n,geometry:{...e.geometry,bbox:e.bbox},properties:{...e.properties,id:n,title:o,iconID:qi(e,r,i),..."base-map"===i?.theme&&{category:Zi(e)},...a}}})}},eo=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=Hi(Mi,this.instanceIndex)),this.layerSpecs=this.buildLayerSpecs(t),{places:new Jr(this.mapLibreMap,this.sourceID,[this.layerSpecs.main,this.layerSpecs.selected])}}buildLayerSpecs(e){const t=Yi(e,this.mapLibreMap);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??[])ni(0,Hi(t.id,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,zi(e.icon.default.style),this.mapLibreMap,{pixelRatio:2}))}else ni(0,this.defaultPlaceIconID,zi(),this.mapLibreMap,{pixelRatio:2})}updateData(e){this.sourcesWithLayers.places.source.runtimeSource?.setData(Qi(this.sourcesWithLayers.places.shownFeatures,this.instanceIndex,e))}async show(e){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.show(Qi(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)}};eo.lastInstanceIndex=-1;let to=eo;const ro=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(!ro(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}},io=e=>e?.length?1===e.length?e[0]:{expression:["any",...e.map(e=>e?.expression)],legacy:["any",...e.map(e=>e?.legacy)]}:null,oo=(e,t)=>{return t?["all",e[(r=t,ro(r)?"expression":"legacy")],t]:e.expression;var r},ao=(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]}},no=(e,t,r)=>ao(e,t.show,r?t.values.map(r):t.values),so={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"]},co=e=>{const t=[];return e.forEach(e=>{e in so?t.push(...so[e].map(bi)):t.push(bi(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&&!vr(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=ao("category",e.show,co(e.values));this.mapLibreMap.setFilter("POI",oo(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 uo={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"]}},ho=(e,t)=>{const r=uo[e];return r.layerIDMatches.some(e=>t.id.toLowerCase().includes(e))&&r.layerTypes.includes(t.type)},po=e=>t=>(!e||((e,t)=>{const r=t?.mode,i=t?.names;if(r&&i?.length){if("include"===r)return i.some(t=>ho(t,e));if("exclude"===r)return!i.some(t=>ho(t,e))}return!0})(t,e))&&!Si.includes(t.id);class _o extends li{static async get(e,t){return await Qr(e),new _o(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(e){const t=this.mapLibreMap.getSource(Ii);if(!t)throw jr(`init ${_o.name} with source ID ${Ii}`);return{vectorTiles:new Xr(this.mapLibreMap,t,po(e?.layerGroupsFilter))}}_applyConfig(e){return e&&!vr(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=>ho(t,e)):"exclude"===t?e=>!r.some(t=>ho(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 fo=["land","water","borders","buildings2D","buildings3D","houseNumbers","roadLines","roadLabels","roadShields","placeLabels","smallerTownLabels","cityLabels","capitalLabels","stateLabels","countryLabels"],yo="title",Ao="color",go={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"]},Eo="#0A3653",Ro={type:"fill",paint:{"fill-color":["coalesce",["get",Ao],Eo],"fill-opacity":.15,"fill-antialias":!1}},Io={type:"line",paint:{"line-color":Eo,"line-opacity":.45,"line-width":2}},mo=(e,t,r)=>{const i=r?.colorConfig,o=r?.lineConfig;return[{...Ro,id:e,paint:{...Ro.paint,...!vr(i?.fillOpacity)&&{"fill-opacity":i?.fillOpacity},...i?.fillColor&&{"fill-color":["get","color"]}}},{...Io,id:t,paint:{...Io.paint,...!vr(o?.lineColor)&&{"line-color":o?.lineColor},...!vr(o?.lineWidth)&&{"line-width":o?.lineWidth},...!vr(o?.lineOpacity)&&{"line-opacity":o?.lineOpacity}}}]},To=(e,t)=>{const r=t?.textConfig;return{type:"symbol",id:e,layout:{"text-field":["get",yo],...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"}}},So=(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&&go[r]){const e=go[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()}}})}),Lo=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}},Oo=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]=mo(this.fillLayerID,this.outlineLayerID,t),a=To(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(Lo(this.sourcesWithLayers.geometry.shownFeatures)),this.config=t}updateLayerAndData(e){const[t,r]=mo(this.fillLayerID,this.outlineLayerID,e),i=To(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(So(e,this.config)),this.sourcesWithLayers.geometryLabel.show(Lo(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)}};Oo.lastInstanceIndex=-1;let bo=Oo;class No extends li{static async get(e,t){return await Qr(e),await ai(e,Ri,"hillshade"),new No(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ri);if(!e)throw jr(`init ${No.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 Co=["standardLight","standardDark","drivingLight","drivingDark","monoLight","monoDark","satellite"],vo=["trafficIncidents","trafficFlow","hillshade"],Mo="#36A8F0",wo="#105287",Uo="#ABAFB3",Po="#3C4956",Do="#727C85",xo=["interpolate",["linear"],["zoom"],1,3,5,4,10,7,18,10],Ho=["==",["get","routeState"],"selected"],Fo=["==",["get","routeState"],"deselected"],Go="#AD0000",jo="#FB2D09",Bo="#f58240",Wo="#000000",Vo=e=>!1===e?.visible?"":e?.title??["format",["get","title"],"\n",["get","chargingPower"]," • ",["get","chargingDuration"]],ko=e=>({...xi,filter:Ho,minzoom:4,layout:{...xi.layout,"text-field":Vo(e?.text)},paint:{...xi.paint}}),Yo={filter:Ho,minzoom:16},zo={...Yo,type:"line",layout:{"line-cap":"round"}},Ko={...zo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,14,22,20],"line-color":"grey"}},$o={...zo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,12,22,17],"line-color":"white"}},Xo="instruction-arrow",qo={...Yo,type:"symbol",layout:{"icon-allow-overlap":!0,"icon-image":Xo,"icon-rotation-alignment":"map","icon-rotate":["get","lastPointBearingDegrees"],"icon-size":["interpolate",["linear"],["zoom"],16,1,22,2]}},Zo={filter:Ho,type:"line",layout:{"line-join":"round"},paint:{"line-width":xo,"line-color":"#6dc4ed"}},Jo={filter:Ho,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}},Qo={type:"line",layout:{"line-join":"round","line-cap":"round","line-sort-key":["get","index"]}},ea=["interpolate",["linear"],["zoom"],1,5,5,6,10,10,18,14],ta={...Qo,filter:Fo,paint:{"line-color":Po,"line-width":ea}},ra={...Qo,filter:Fo,paint:{"line-color":Uo,"line-width":xo}},ia={...Qo,filter:Ho,paint:{"line-color":wo,"line-width":ea}},oa={type:"symbol",layout:{"symbol-placement":"line","icon-image":"roads-arrow-white","icon-rotate":180}},aa="selected-route-summary-popup",na="deselected-route-summary-popup",sa={filter:Ho,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"}},ca={filter:Ho,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]}},la=["interpolate",["linear"],["zoom"],1,2,5,3,10,4,18,6],ua={type:"line",layout:{"line-cap":"round"},paint:{"line-width":la,"line-color":["match",["get","magnitudeOfDelay"],"minor","#FFC105","moderate",jo,"major",Go,"#C7D2D8"]}},ha={type:"line",filter:["in",["get","magnitudeOfDelay"],["literal",["unknown","indefinite"]]],layout:{"line-join":"round"},paint:{"line-width":la,"line-color":["match",["get","magnitudeOfDelay"],"unknown","rgba(190, 39, 27, 1)","rgba(137, 150, 168, 1)"],"line-dasharray":[1.5,1]}},pa=["match",["get","magnitudeOfDelay"],"minor",Bo,"moderate",jo,"major",Go,"indefinite","#666666",Wo],_a={filter:Ho,type:"symbol",minzoom:6,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-ignore-placement":!0}},fa={..._a,filter:["all",["has","jamIconID"],_a.filter],layout:{..._a.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:{..._a.paint,"text-color":pa,"text-halo-color":"#FFFFFF","text-halo-width":1}},da={..._a,filter:["all",["has","causeIconID"],_a.filter],layout:{..._a.layout,"icon-image":["get","causeIconID"],"icon-anchor":"bottom-right"},paint:{..._a.paint}},ya={filter:Ho,type:"line",layout:{"line-join":"round"},paint:{"line-width":xo,"line-color":"#000000","line-opacity":.3}},Aa={filter:Ho,type:"line",layout:{"line-join":"round"},paint:{"line-color":wo,"line-width":xo}},ga={filter:Ho,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":Mo,"line-width":["interpolate",["linear"],["zoom"],1,2,5,3,10,5,18,7],"line-dasharray":[0,1.5]}},Ea="traffic-clear",Ra="traffic-major",Ia="traffic-moderate",ma="traffic-minor",Ta=["has","formattedTraffic"],Sa=e=>{const t=void 0!==e?Hi(aa,e):aa,r=void 0!==e?Hi(na,e):na,i=void 0!==e?Hi(Ea,e):Ea,o=void 0!==e?Hi(Ra,e):Ra,a=void 0!==e?Hi(Ia,e):Ia,n=void 0!==e?Hi(ma,e):ma;return{type:"symbol",layout:{"icon-image":["case",Ho,t,r],"symbol-placement":"point","icon-rotation-alignment":"viewport","text-rotation-alignment":"viewport","symbol-sort-key":["case",Ho,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",Ho,"black",Do]},["concat","\t\t",["get","formattedDistance"]],{"text-color":Do},["case",Ta,"\n",""],{},["image",["case",Ta,["match",["get","magnitudeOfDelay"],"major",o,"moderate",a,"minor",n,i],""]],{},["case",Ta,["concat"," ",["get","formattedTraffic"]],""],{"text-font":["literal",[Ni]],"text-color":pa}]},paint:{"icon-translate":[0,-35],"text-translate":[0,-35]}}},La=Sa(),Oa="start",ba="middle",Na="finish",Ca="indexType",va="stopDisplayIndex",Ma="waypointStart",wa="waypointStop",Ua="waypointSoft",Pa="waypointFinish",Da={"text-field":["get",va],"text-font":[Ni],"text-size":["interpolate",["linear"],["zoom"],13,14,18,16],"text-offset":[0,-1.6],"icon-anchor":["case",["all",["==",["get",Ca],ba],["!",["has",va]]],"center","bottom"],"text-allow-overlap":!0},xa={type:"symbol",paint:{...Ui,"text-color":"#ffffff"},layout:{...wi,...Da,"symbol-sort-key":["case",["==",["get",vi],Ua],0,["abs",["-",["get","index"],1e3]]]}},Ha={type:"symbol",paint:{...Di,"text-color":"black","text-halo-width":1.5,"text-halo-color":"#ffffff"},layout:{...Pi,"text-anchor":"top","text-offset":[0,.4]}},Fa=(e,t)=>e&&t&&(e.startsWith("route")||e.startsWith("waypoint"))?`${t}-${e}`:e,Ga=(e,t)=>e&&t?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,r?.beforeID?{...r,beforeID:Fa(r.beforeID,t)}:r])):e,ja=(e,t)=>e&&void 0!==t?`${e}-${t}`:e,Ba=(e={},t,r)=>{const i=e.layers,o=i?.sections,a=e.theme?.mainColor;return{mainLines:{routeLineArrows:{...oa,beforeID:gi.lowestLabel,...i?.mainLines?.routeLineArrows},routeLine:{...(n={color:a},{...Qo,filter:Ho,paint:{"line-color":n?.color??Mo,"line-width":xo}}),beforeID:Fa("routeIncidentBackgroundLine",t),...i?.mainLines?.routeLine},routeOutline:{...ia,beforeID:Fa("routeLine",t),...i?.mainLines?.routeOutline},routeDeselectedLine:{...ra,beforeID:Fa("routeOutline",t),...i?.mainLines?.routeDeselectedLine},routeDeselectedOutline:{...ta,beforeID:Fa("routeDeselectedLine",t),...i?.mainLines?.routeDeselectedOutline},...Ga(i?.mainLines?.additional,t)},waypoints:{routeWaypointSymbol:{...xa,beforeID:Fa("routeSummaryBubbleSymbol",t),...i?.waypoints?.routeWaypointSymbol},routeWaypointLabel:{...Ha,beforeID:Fa("routeWaypointSymbol",t),...i?.waypoints?.routeWaypointLabel},...Ga(i?.waypoints?.additional,t)},chargingStops:{routeChargingStopSymbol:{...ko(e.chargingStops),beforeID:Fa("routeWaypointSymbol",t),...i?.chargingStops?.routeChargingStopSymbol},...Ga(i?.chargingStops?.additional,t)},sections:{incident:{routeIncidentJamSymbol:{...fa,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentJamSymbol},routeIncidentCauseSymbol:{...da,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentCauseSymbol},routeIncidentBackgroundLine:{...ua,beforeID:Fa("routeIncidentDashedLine",t),...o?.incident?.routeIncidentBackgroundLine},routeIncidentDashedLine:{...ha,beforeID:Fa("routeTunnelLine",t),...o?.incident?.routeIncidentDashedLine},...Ga(o?.incident?.additional,t)},ferry:{routeFerryLine:{...Zo,beforeID:Fa("routeLineArrows",t),...o?.ferry?.routeFerryLine},routeFerrySymbol:{...Jo,beforeID:Fa("routeIncidentJamSymbol",t),...o?.ferry?.routeFerrySymbol},...Ga(o?.ferry?.additional,t)},tollRoad:{routeTollRoadOutline:{...sa,beforeID:Fa("routeDeselectedOutline",t),...o?.tollRoad?.routeTollRoadOutline},routeTollRoadSymbol:{...ca,beforeID:Fa("routeChargingStopSymbol",t),...o?.tollRoad?.routeTollRoadSymbol},...Ga(o?.tollRoad?.additional,t)},tunnel:{routeTunnelLine:{...ya,beforeID:Fa("routeLineArrows",t),...o?.tunnel?.routeTunnelLine},...Ga(o?.tunnel?.additional,t)},vehicleRestricted:{routeVehicleRestrictedBackgroundLine:{...Aa,beforeID:Fa("routeVehicleRestrictedForegroundLine",t),...o?.vehicleRestricted?.routeVehicleRestrictedBackgroundLine},routeVehicleRestrictedForegroundLine:{...ga,beforeID:gi.lowestLabel,...o?.vehicleRestricted?.routeVehicleRestrictedForegroundLine},...Ga(o?.vehicleRestricted?.additional,t)}},instructionLines:{routeInstructionLine:{...$o,beforeID:gi.lowestLabel,...i?.instructionLines?.routeInstructionLine},routeInstructionOutline:{...Ko,beforeID:Fa("routeInstructionLine",t),...i?.instructionLines?.routeInstructionOutline},...Ga(i?.instructionLines?.additional,t)},instructionArrows:{routeInstructionArrowSymbol:{...qo,beforeID:Fa("routeInstructionLine",t),...void 0!==r&&{layout:{...qo.layout,"icon-image":ja(qo.layout?.["icon-image"],r)}},...i?.instructionArrows?.routeInstructionArrowSymbol},...Ga(i?.instructionArrows?.additional,t)},summaryBubbles:{routeSummaryBubbleSymbol:{...void 0!==r?Sa(r):La,...i?.summaryBubbles?.routeSummaryBubbleSymbol},...Ga(i?.summaryBubbles?.additional,t)}};var n},Wa=Ba();let Va;Br()&&(Va=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 ka=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)},Ya={pixelRatio:2,stretchX:[[20,45],[100,130]],stretchY:[[20,35]],content:[10,10,130,45]},za=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)},Ka=(e,t)=>{if(!Br())return;const r=kr(t);return e&&r.appendChild(e),Wr(r)},$a=(e={},t)=>Object.entries(e).map(([e,r])=>({...r,id:t?`${t}-${e}`:e})),Xa=(e={},t)=>({mainLines:$a(e.mainLines,t),waypoints:$a(e.waypoints,t),chargingStops:$a(e?.chargingStops,t),ferries:$a(e.sections?.ferry,t),incidents:$a(e.sections?.incident,t),tollRoads:$a(e.sections?.tollRoad,t),tunnels:$a(e.sections?.tunnel,t),vehicleRestricted:$a(e.sections?.vehicleRestricted,t),instructionLines:$a(e.instructionLines,t),instructionArrows:$a(e.instructionArrows,t),summaryBubbles:$a(e.summaryBubbles,t)}),qa=(e,t,r)=>{const i=a.instance.get().displayUnits,o=e?.displayUnits;return{...e,...o?{}:{displayUnits:i},layers:Ba(e,t,r)}},Za=(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"},Ja=e=>{const t=e.properties;return t.chargingParkName??t.chargingParkOperatorName},Qa=(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:Za(a,r),title:Ja(a),chargingPower:`${e.chargingConnectionInfo?.chargingPowerInkW} kW`,chargingDuration:n(e.chargingTimeInSeconds,r?.displayUnits?.time),routeState:o.properties.routeState}})}}return{type:"FeatureCollection",features:i}},en=e=>e.categories.includes("jam"),tn=e=>{const t=(e=>{if(en(e))return n(e.delayInSeconds)})(e),r=((e,t)=>en(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}}},rn=(e,t,r)=>{if(e.properties.radiusMeters)return void 0!==r?Hi(Ua,r):Ua;let i;switch(t){case"start":i=Ma;break;case"finish":i=Pa;break;default:i=wa}return void 0!==r?Hi(i,r):i},on=(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?Oa:e<t-1?ba:Na)(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:rn(c,l,i),...u&&l===ba&&{stopDisplayIndex:o}}}}).filter(e=>e)}};function an(e){return e%360*Math.PI/180}function nn(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 sn(e,t,r={}){if(!0===r.final)return function(e,t){let r=sn(t,e);return r=(r+180)%360,r}(e,t);const i=nn(e),o=nn(t),a=an(i[0]),n=an(o[0]),s=an(i[1]),c=an(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 cn=sn;const ln=(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))}),un=(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},hn=(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"}}})}},pn=(e,t)=>e.some(e=>e.magnitudeOfDelay===t),_n=(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 pn(t,"major")?"major":pn(t,"moderate")?"moderate":pn(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)}}})}),fn=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=Hi("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=Hi("routes",this.instanceIndex)),this.layersSpecs=Xa(qa(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=Hi(Ma,this.instanceIndex),s=Hi(wa,this.instanceIndex),c=Hi(Ua,this.instanceIndex),l=Hi(Pa,this.instanceIndex),u=Hi(Xo,this.instanceIndex),h=Hi(aa,this.instanceIndex),p=Hi(na,this.instanceIndex),_=Hi(Ea,this.instanceIndex),f=Hi(Ra,this.instanceIndex),d=Hi(Ia,this.instanceIndex),y=Hi(ma,this.instanceIndex);this.addImageIfNotExisting(n,(e=>{if(Br())return Ka(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,Ka(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 Ka(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,Va,a),this.addImageIfNotExisting(h,ka("white"),Ya),this.addImageIfNotExisting(p,ka("#EEEEEE"),Ya),this.addImageIfNotExisting(_,za(Wo),a),this.addImageIfNotExisting(f,za(Go),a),this.addImageIfNotExisting(d,za(jo),a),this.addImageIfNotExisting(y,za(Bo),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=qa(e,this.layerIDPrefix,this.instanceIndex);if(this.config){const e=Xa(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!Cr(this.config?.displayUnits,t.displayUnits)&&this.sourcesWithLayers.summaryBubbles.shownFeatures.features.length&&this.sourcesWithLayers.summaryBubbles.show(_n(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=hn(e,r?.selectedIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(i),this.sourcesWithLayers.vehicleRestricted.show(ln(i,"vehicleRestricted")),this.sourcesWithLayers.incidents.show(ln(i,"traffic",tn)),this.sourcesWithLayers.chargingStops.show(Qa(i,this.config)),this.sourcesWithLayers.ferries.show(ln(i,"ferry")),this.sourcesWithLayers.tunnels.show(ln(i,"tunnel")),this.sourcesWithLayers.tollRoads.show(ln(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:cn(o[0],o[1])}}})||[])}))(i)),this.sourcesWithLayers.summaryBubbles.show(_n(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=hn(this.sourcesWithLayers.mainLines.shownFeatures,e);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(t),this.sourcesWithLayers.chargingStops.show(Qa(t,this.config)),un(t,this.sourcesWithLayers.vehicleRestricted),un(t,this.sourcesWithLayers.incidents),un(t,this.sourcesWithLayers.ferries),un(t,this.sourcesWithLayers.tollRoads),un(t,this.sourcesWithLayers.tunnels),un(t,this.sourcesWithLayers.instructionLines),un(t,this.sourcesWithLayers.instructionArrows),un(t,this.sourcesWithLayers.summaryBubbles)}async showWaypoints(e){const t=Array.isArray(e)?on(e,this.config?.waypoints,this.instanceIndex):on(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}};fn.lastInstanceIndex=-1;let dn=fn;const yn="standardLight",An={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"}},gn=e=>`\${baseURL}/maps/orbis/assets/styles/\${version}/style.json?&apiVersion=1&key=\${apiKey}&map=${e}`,En={standardLight:gn("basic_street-light"),standardDark:gn("basic_street-dark"),drivingLight:gn("basic_street-light-driving"),drivingDark:gn("basic_street-dark-driving"),monoLight:gn("basic_mono-light"),monoDark:gn("basic_mono-dark"),satellite:gn("basic_street-satellite")},Rn=(e,t,r)=>{const i=e.id??yn,o=new URL(En[i].replace("${baseURL}",t).replace("${version}",e.version??"0.6.0-0").replace("${apiKey}",r));for(const a of e.include??vo)o.searchParams.append(a,An[i][a]);return o.toString()},In=e=>{const t=e.style,r=e.commonBaseURL,i=e.apiKey;return"string"==typeof t?Rn({id:t},r,i):"standard"===t?.type?Rn(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:Rn({id:yn},r,i)};class mn{constructor(t,r){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&&Cr(r,this._params.style)&&this.handleStyleData(t.keepState||!0)}),this.mapLibreMap.setStyle(In(this._params),{validate:!1})},this.getStyle=()=>this._params.style,this._params=l(r),this.styleLightDarkTheme=ci(this._params.style),this.ensureMapLibreCSSLoaded(),this.mapLibreMap=new h(((t,r)=>{return{validateStyle:!1,maxTileCacheZoomLevels:22,cancelPendingTileRequestsWhileZooming:!1,...t,style:In(r),attributionControl:{compact:!1},transformRequest:(i=r,(t,r)=>t.includes("tomtom.com")?"Image"===r?{url:t}:{url:t,headers:{...e(i)}}:{url:t})};var i})(t,this._params)),this.mapLibreMap.once("styledata",()=>{this.handleStyleData(!1)}),this._eventsProxy=new Ai(this.mapLibreMap,this._params?.events),this.loadRTLTextPlugin()}loadRTLTextPlugin(){setTimeout(()=>{["deferred","loaded"].includes(p())||_("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.15.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 $r(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 Tn=["unknown","accident","fog","dangerous_conditions","rain","ice","jam","lane_closed","road_closed","road_works","wind","flooding","broken_down_vehicle"],Sn={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},Ln=["motorway","trunk","primary","secondary","tertiary","street"],On=["connecting","major_local"],bn=["local","minor_local"],Nn=(e,t)=>e.length?1===e.length?{expression:e[0],legacy:t[0]}:{expression:["all",...e],legacy:["all",...t]}:null,Cn=(e,t,r)=>{e&&(t.push(e.expression),r.push(e.legacy))},vn=(e,t,r,i)=>{e&&Cn(no(t,e),r,i)},Mn=(e,t,r)=>{vn(e.roadCategories,"road_category",t,r),vn(e.roadSubCategories,"road_subcategory",t,r)},wn=e=>{const t=[],r=[];if(Mn(e,t,r),e.incidentCategories){const i=no("icon_category_0",e.incidentCategories,e=>Sn[e]);Cn(i,t,r)}if(e.magnitudes){const i=no("magnitude",e.magnitudes,e=>u.indexOf(e));Cn(i,t,r)}return e.delays&&Cn((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 Nn(t,r)})(e.delays),t,r),Nn(t,r)},Un=e=>{if(!e?.any?.length)return null;const t=e.any.map(wn).filter(e=>!vr(e));return io(t)},Pn=e=>{const t=[],r=[];if(Mn(e,t,r),e.showRoadClosures){const i="only"===e.showRoadClosures?"==":"!=";t.push([i,["get","road_closure"],!0]),r.push([i,"road_closure",!0])}return Nn(t,r)},Dn=(e,t,r,i)=>{for(const o of t)r.setFilter(o.id,e?oo(e,i[o.id]):i[o.id])};class xn extends li{static async get(e,t){return await Qr(e),await ai(e,Ti,"trafficFlow"),new xn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ti);if(!e)throw jr(`init ${xn.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 $r(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(Pn).filter(e=>!vr(e));return io(t)})(e);t&&Dn(t,this.getLayers(),this.mapLibreMap,this.originalFilters)}else this.config?.filters?.any?.length&&Dn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);t&&(this.config=Hr({...this.config,filters:e},vr))}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 Hn extends li{static async get(e,t){return await Qr(e),await ai(e,mi,"trafficIncidents"),new Hn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(mi);if(!e)throw jr(`init ${Hn.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}),vr(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=Un(e);if(r){const e=t?this.getNonSymbolLayers():this.getLayers();Dn(r,e,this.mapLibreMap,this.originalFilters)}}else this.config?.filters?.any?.length&&Dn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);if(t?.any?.length){const e=Un(t);e&&Dn(e,this.getSymbolLayers(),this.mapLibreMap,this.originalFilters)}}r&&(this.config=Hr({...this.config,filters:e,icons:{...this.config?.icons,filters:t}},vr))}getLayers(){return $r(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={...Hr({...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 Fn=(e,t)=>({left:e.left-t.left,top:e.top-t.top,right:e.right-t.left,bottom:e.bottom-t.top}),Gn=(e,t,r)=>e.right<=0||e.left>=t||e.bottom<=0||e.top>=r,jn=(e,t,r,i,o)=>{const a=e.left,n=r-e.right,s=e.top,c=i-e.bottom,l=0===a&&0===n,u=0===s&&0===c;!l||u?!u||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)})(e,t,r,i,o):((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)})(e,t,r,o):((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)})(e,t,i,o)},Bn=e=>"string"==typeof e?document.querySelector(e):e,Wn=e=>"mapLibreMap"in e?e.mapLibreMap:e,Vn=(e,t,r)=>{const i=Wn(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=Bn(s);if(!e)continue;const t=e.getBoundingClientRect(),c=Fn(t,i);Gn(c,o,a)||jn(c,n,o,a,r)}return n.left>=n.right||n.top>=n.bottom?null:{visibleAreaBounds:n,containerWidth:o,containerHeight:a}},kn=e=>{const{map:t,surroundingElements:r,paddingPX:i=0}=e,o=Vn(t,r,i);if(!o)return null;const{visibleAreaBounds:a}=o,n=Wn(t),s=n.unproject([a.left,a.bottom]),c=n.unproject([a.right,a.top]);return[s.lng,s.lat,c.lng,c.lat]},Yn=e=>{const{map:t,surroundingElements:r}=e,i=kn({map:t,surroundingElements:r});if(!i)return null;const[o,a,n,s]=i;return[(o+n)/2,(a+s)/2]},zn=e=>{const{map:t,toBeContainedBBox:r,surroundingElements:i,paddingPX:o=0}=e,a=Vn(t,i,o);if(!a)return null;const{visibleAreaBounds:n,containerWidth:s,containerHeight:c}=a,l=n.left/s,u=n.right/s,h=n.top/c,p=u-l,_=n.bottom/c-h,[f,d,y,A]=r,g=(y-f)/p,E=(A-d)/_,R=f-l*g,I=A+h*E;return[R,I-E,R+g,I]};export{li as AbstractMapModule,Kr as AbstractSourceWithLayers,qr as AddedSourceWithLayers,Ii as BASE_MAP_SOURCE_ID,_o as BaseMapModule,Uo as DESELECTED_FOREGROUND_COLOR,Po as DESELECTED_OUTLINE_COLOR,Fo as DESELECTED_ROUTE_FILTER,Do as DESELECTED_SECONDARY_COLOR,ui as EventsModule,Ai as EventsProxy,Na as FINISH_INDEX,Ao as GEOMETRY_COLOR_PROP,yo as GEOMETRY_TITLE_PROP,Jr as GeoJSONSourceWithLayers,bo as GeometriesModule,Ri as HILLSHADE_SOURCE_ID,No as HillshadeModule,Ca as INDEX_TYPE,Go as MAJOR_DELAY_COLOR,ba as MIDDLE_INDEX,Bo as MINOR_DELAY_LABEL_COLOR,jo as MODERATE_DELAY_COLOR,Ei as POI_SOURCE_ID,lo as POIsModule,to as PlacesModule,Mo as ROUTE_LINE_FOREGROUND_COLOR,xo as ROUTE_LINE_FOREGROUND_WIDTH,wo as ROUTE_LINE_OUTLINE_COLOR,dn as RoutingModule,Ho as SELECTED_ROUTE_FILTER,Oa as START_INDEX,va as STOP_DISPLAY_INDEX,Xr as StyleSourceWithLayers,Ti as TRAFFIC_FLOW_SOURCE_ID,mi as TRAFFIC_INCIDENTS_SOURCE_ID,mn as TomTomMap,zr as TomTomMapSource,xn as TrafficFlowModule,Hn as TrafficIncidentsModule,Wo as UNKNOWN_DELAY_COLOR,fo as baseMapLayerGroupNames,$i as buildPlaceTitle,Ba as buildRoutingLayers,zn as calculateFittingBBox,kn as calculatePaddedBBox,Yn as calculatePaddedCenter,Wa as defaultRoutingLayers,$r as filterLayersBySources,qi as getIconIDForPlace,Zi as getPOILayerCategoryForPlace,co as getStyleCategories,Tn as incidentCategories,Sn as incidentCategoriesMapping,Li as mapDisplayPoiCategoryMappings,gi as mapStyleLayerIDs,so as poiCategoryGroups,Si as poiLayerIDs,Qi as preparePlacesForDisplay,Ln as roadCategories,Co as standardStyleIDs,bn as streetRoadCategories,vo as styleModules,On as tertiaryRoadCategories,bi as toBaseMapPOICategory,Ji 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 O(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==S(e)}function b(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,C=A?A.prototype:void 0,v=C?C.toString:void 0;function M(e){if("string"==typeof e)return e;if(N(e))return b(e,M)+"";if(O(e))return v?v.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__"],H=(D=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"";var F=Function.prototype.toString;function G(e){if(null!=e){try{return F.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,H&&H in t))&&(P(e)?Y:j).test(G(e));var t}function K(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=K(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,Oe=Le&&Le.exports===Se&&_.process,be=function(){try{var e=Le&&Le.require&&Le.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch(t){}}(),Ne=be&&be.isTypedArray,Ce=Ne?Te(Ne):function(e){return L(e)&&le(e.length)&&!!me[S(e)]},ve=Object.prototype.hasOwnProperty;function Me(e,t){var r=N(e),i=!r&&Ae(e),o=!r&&!i&&Ie(e),a=!r&&!i&&!o&&Ce(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&&!ve.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 He=Object.prototype.hasOwnProperty;function Fe(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&&He.call(e,i))&&r.push(i);return r}function Ge(e){return ue(e)?Me(e,!0):Fe(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&&!O(e))||(Be.test(e)||!je.test(e)||null!=t&&e in Object(t))}var Ve=K(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 Ke(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 $e=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=Ke(t,e);return!(r<0)&&(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,!0)},Xe.prototype.get=function(e){var t=this.__data__,r=Ke(t,e);return r<0?void 0:t[r][1]},Xe.prototype.has=function(e){return Ke(this.__data__,e)>-1},Xe.prototype.set=function(e,t){var r=this.__data__,i=Ke(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var qe=K(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||O(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 Ot(e){return Lt(e,xe,Tt)}function bt(e){return Lt(e,Ge,St)}var Nt=K(y,"DataView"),Ct=K(y,"Promise"),vt=K(y,"Set"),Mt="[object Map]",wt="[object Promise]",Ut="[object Set]",Pt="[object WeakMap]",Dt="[object DataView]",xt=G(Nt),Ht=G(qe),Ft=G(Ct),Gt=G(vt),jt=G($),Bt=S;(Nt&&Bt(new Nt(new ArrayBuffer(1)))!=Dt||qe&&Bt(new qe)!=Mt||Ct&&Bt(Ct.resolve())!=wt||vt&&Bt(new vt)!=Ut||$&&Bt(new $)!=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 Ht:return Mt;case Ft: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,Kt=zt?zt.valueOf:void 0;function $t(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,Kt?Object(Kt.call(i)):{}}}var Xt=be&&be.isMap,qt=Xt?Te(Xt):function(e){return L(e)&&"[object Map]"==Bt(e)};var Zt=be&&be.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=$t(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:bt(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||Ce(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=Ot(e),c=s.length;if(c!=Ot(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 Or(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 br=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)||Ce(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(br.call(e,r))return!1;return!0}function Cr(e,t){return Ar(e,t)}function vr(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=Or(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=b(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,bt(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=b(bt(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 Hr(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 Fr=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)?Fr.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(vr(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 Kr{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 $r=(e,t)=>e.getStyle().layers.filter(e=>t.includes(e?.source));class Xr extends Kr{constructor(e,t,r){let i=$r(e,[t.id]);r&&(i=i.filter(r)),super(e,new zr(t.id,e.getStyle().sources[t.id],t),i)}}class qr extends Kr{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(0===e.length)throw Error(`Circular dependency for before Ids ${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 $r(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];vr(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:"access_gateway",ADVENTURE_SPORTS_FACILITY:"adventure_sports_facility",ADVENTURE_SPORTS_VENUE:"adventure_sports_venue",AGRICULTURE:"agriculture_business",AIRPORT:"airport",AMUSEMENT_PARK:"amusement_park",AQUATIC_ZOO:"zoo_or_aquarium",ASHRAM:"religious_site",ATM:"atm",AUTOMOTIVE_DEALER:"automotive_dealer",BANK:"bank",BEACH:"beach",BUS_STOP:"bus_station",BUSINESS_PARK:"business_park",CAFE_PUB:"cafe",CAMPING_GROUND:"camping_ground",CAR_WASH:"car_wash",CASH_DISPENSER:"atm",CASINO:"casino",CHURCH:"religious_site",CINEMA:"cinema",CLOTHING_SHOP:"clothing_shop",CLUB_ASSOCIATION:"club_and_association",COLLEGE_UNIVERSITY:"college_or_university",COMMERCIAL_BUILDING:"commercial_building",COMMUNITY_CENTER:"community_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_medical_service",EMERGENCY_ROOM:"emergency_room",ENTERTAINMENT:"entertainment",EXCHANGE:"stock_exchange",EXHIBITION_CONVENTION_CENTER:"cultural_center",FERRY_TERMINAL:"ferry_terminal",FIRE_STATION_BRIGADE:"fire_station",FRONTIER_CROSSING:"frontier_crossing",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:"elevation_point",HOLIDAY_RENTAL:"holiday_home",HOSPITAL:"hospital",HOSPITAL_POLYCLINIC:"hospital",HOTEL_MOTEL:"hotel_or_motel",ICE_SKATING_RINK:"ice_skating_rink",IMPORTANT_TOURIST_ATTRACTION:"tourist_attraction",INDUSTRIAL_BUILDING:"industrial_building",LEISURE_CENTER:"leisure_center",LIBRARY:"library",MANUFACTURING_FACILITY:"manufacturing_facility",MARINA:"marina",MARKET:"marketplace",MEDIA_FACILITY:"media_facility",MILITARY_INSTALLATION:"military_facility",MOSQUE:"religious_site",MOTORING_ORGANIZATION_OFFICE:"motoring_organization_office",MOUNTAIN_PASS:"mountain_pass",MOUNTAIN_PEAK:"elevation_point",MOVIE_THEATER:"cinema",MUSEUM:"museum",NATIVE_RESERVATION:"native_reservation",NIGHTLIFE:"nightlife",NON_GOVERNMENTAL_ORGANIZATION:"non_governmental_organization",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:"place_of_worship",POLICE_STATION:"police_station",PORT_WAREHOUSE_FACILITY:"port_or_warehouse_facility",POST_OFFICE:"post_office",PRIMARY_RESOURCE_UTILITY:"primary_resource_or_utility",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:"rent_a_car_parking",REPAIR_FACILITY:"repair_facility",RESEARCH_FACILITY:"research_facility",RESIDENTIAL_ACCOMMODATION:"urban_ground",REST_AREA:"rest_area",RESTAURANT:"restaurant",RESTAURANT_AREA:"restaurant_area",SCENIC_PANORAMIC_VIEW:"viewpoint",SCHOOL:"school",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:"tennis_court",THEATER:"theater",TOLL_GATE:"toll_gate",TOURIST_INFORMATION_OFFICE:"tourist_information_office",TRAFFIC_CONTROL_DEPARTMENT:"traffic_control_department",TRAFFIC_SERVICE_CENTER:"traffic_service_center",TRAIL_SYSTEM:"trail_system",TRAILS:"trails",TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:"transport_authority_or_vehicle_registration",TRUCK_STOP:"truck_stop",VACATION_RENTAL:"vacation_rental",VETERINARIAN:"veterinarian",WATER_SPORT:"water_sport",WEIGH_STATION:"weigh_station",WELFARE_ORGANIZATION:"welfare_organization",WINERY:"manufacturing_facility",ZOOS_ARBORETA_BOTANICAL_GARDEN:"zoo_or_aquarium"},Oi={...Li,SECURED_ENTRANCE:"access_gateway",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:"automotive_dealer",BOAT_DEALER:"automotive_dealer",BUS_DEALER:"automotive_dealer",CAR_DEALER:"automotive_dealer",MOTORCYCLE_DEALER:"automotive_dealer",RECREATIONAL_VEHICLE_DEALER:"automotive_dealer",TRUCK_DEALER:"automotive_dealer",VAN_DEALER:"automotive_dealer",DIVERSIFIED_FINANCIALS:"bank",SAVINGS_INSTITUTION:"bank",BEACH_CLUB:"beach",BAR:"cafe",CAFE:"cafe",COCKTAIL_BAR:"cafe",COFFEE_SHOP:"cafe",INTERNET_CAFE:"cafe",PUB:"cafe",TEA_HOUSE:"cafe",WINE_BAR:"cafe",CARAVAN_SITE:"camping_ground",RECREATIONAL_CAMPING_GROUND:"camping_ground",REST_CAMP:"camping_ground",TRUCK_WASH:"car_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:"commercial_building",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:"elevation_point",AMBULANCE_UNIT:"emergency_medical_service",ROAD_RESCUE:"emergency_medical_service",AMUSEMENT_ARCADE:"entertainment",AMUSEMENT_PLACE:"entertainment",BETTING_STATION:"entertainment",FAIRGROUND:"entertainment",MUSIC_CENTER:"entertainment",CHECKPOINT:"frontier_crossing",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_building",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:"museum",CABARET_THEATER:"nightlife",COMEDY_CLUB:"nightlife",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:"repair_facility",CAR_GLASS_REPLACEMENT_SHOP:"repair_facility",CAR_REPAIR_AND_SERVICE:"repair_facility",HOME_APPLIANCE_REPAIR:"repair_facility",MOTORCYCLE_REPAIR:"repair_facility",OTHER_REPAIR_SHOPS:"repair_facility",REPAIR_SHOP:"repair_facility",TIRE_SERVICE:"repair_facility",TRUCK_REPAIR_AND_SERVICE:"repair_facility",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:"school",CHILD_CARE_FACILITY:"school",CULINARY_SCHOOL:"school",DANCE_STUDIO_SCHOOL:"school",DRIVING_SCHOOL:"school",HIGH_SCHOOL:"school",LANGUAGE_SCHOOL:"school",MIDDLE_SCHOOL:"school",PRE_SCHOOL:"school",PRIMARY_SCHOOL:"school",SENIOR_HIGH_SCHOOL:"school",SPECIAL_SCHOOL:"school",SPORT_SCHOOL:"school",TECHNICAL_SCHOOL:"school",VOCATIONAL_SCHOOL:"school",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_control_department",ADVENTURE_VEHICLE_TRAIL:"trails",HIKING_TRAIL:"trails",HORSE_RIDING_TRAIL:"trails",MOUNTAIN_BIKE_TRAIL:"trails",ROCK_CLIMBING_TRAIL:"trails",APARTMENT_RENTAL:"urban_ground",CONDOMINIUM_COMPLEX:"urban_ground",FLATS_APARTMENT_COMPLEX:"urban_ground",RESIDENTIAL_ESTATE:"urban_ground",RETIREMENT_COMMUNITY:"urban_ground",TOWNHOUSE_COMPLEX:"urban_ground",ANIMAL_SERVICES:"veterinarian",ANIMAL_SHELTER:"veterinarian",WEIGH_SCALES:"weigh_station",WILDLIFE_PARK:"zoo_or_aquarium",ZOO:"zoo_or_aquarium"},bi=e=>Oi[e],Ni="Noto-Bold",Ci="title",vi="iconID",Mi="default_place",wi={"icon-image":["get",vi],"icon-anchor":"bottom","icon-size":["interpolate",["linear"],["zoom"],8,.6,22,.8],"icon-allow-overlap":!0,"icon-padding":0},Ui={"icon-translate":[0,5],"icon-translate-anchor":"viewport"},Pi={"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,.7],"left",[1.4,-1.4],"right",[-1.4,-1.4]],"text-size":["interpolate",["linear"],["zoom"],10,14,18,16],"text-padding":5},Di={"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"},xi={type:"symbol",layout:{...wi,...Pi},paint:{...Ui,...Di}},Hi=(e,t)=>`${e}-${t}`,Fi=["in",["get","eventState"],["literal",["click","contextmenu"]]],Gi=["has","eventState"],ji="#3f9cd9",Bi={...xi,filter:["!",Gi]},Wi={...xi,filter:Gi,layout:{...xi.layout,"icon-size":["interpolate",["linear"],["zoom"],8,.8,22,1],"text-allow-overlap":!0},paint:{...xi.paint,"text-color":ji}},Vi=(e,t,r)=>{const i=t?.text,o=t?.layers?.[r];return{...e,layout:{...e.layout,...i?.size&&{"text-size":i.size},...i?.font&&{"text-font":i.font},...i?.offset&&{"text-offset":i.offset},...i?.title&&"function"!=typeof i?.title&&{"text-field":i?.title},...o?.layout},paint:{...e.paint,...i?.color&&{"text-color":i.color},...i?.haloColor&&{"text-halo-color":i.haloColor},...i?.haloWidth&&{"text-halo-width":i.haloWidth},...o?.paint},...o}},ki=e=>JSON.parse(JSON.stringify(e)?.replace(/name/g,Ci)),Yi=(e,t)=>{let r;if("base-map"===e?.theme){const e=(e=>{const t=e.getStyle().layers.filter(e=>"POI"===e.id)[0]||{},r=t.layout?.["text-size"];return{filter:["!",Fi],type:"symbol",paint:t.paint,layout:{...t.layout,"text-field":["get",Ci],"icon-image":["get",vi],...r&&{"text-size":ki(r)}}}})(t);r={main:e,selected:{...e,filter:Gi,layout:{...e.layout,"text-allow-overlap":!0},paint:{...e.paint,"text-color":ji}}}}else r={main:Bi,selected:Wi};return{main:Vi(r.main,e,"main"),selected:Vi(r.selected,e,"selected"),...e?.layers?.additional}},zi=e=>{if(Br())return Wr(kr(e))},Ki=/* @__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]),$i=e=>e.properties.poi?.name??e.properties.address.freeformAddress,Xi=(e,t,i)=>{if("pin"===t){return(e=>{if(e)return Ki.has(e)?e.toString():e.toString().substring(0,4)})(r[e])??i}{const t=bi(e);return t?`poi-${t}`:i}},qi=(e,t,r={})=>{const i=r.theme??"pin",o=Hi(Mi,t),a=r.icon?.mapping;if(a)return"imageID"===a.to?a.fn(e):Xi(a.fn(e),i,o);const n=e.properties.poi?.classifications?.[0]?.code,s=r.icon?.categoryIcons?.find(e=>e.id===n);return s?Hi(s.id,t):Xi(n,i,o)},Zi=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return t&&bi(t)},Ji=e=>Array.isArray(e)?{type:"FeatureCollection",features:e}:"Feature"===e.type?{type:"FeatureCollection",features:[e]}:e,Qi=(e,r,i={})=>{const o=Ji(e);return{...o,features:o.features.map(e=>{const o="function"==typeof i?.text?.title?i?.text?.title(e):$i(e),a=i.extraFeatureProps?Object.fromEntries(Object.entries(i.extraFeatureProps).map(([t,r])=>[t,"function"==typeof r?r(e):r])):{},n=e.id??t();return{...e,id:n,geometry:{...e.geometry,bbox:e.bbox},properties:{...e.properties,id:n,title:o,iconID:qi(e,r,i),..."base-map"===i?.theme&&{category:Zi(e)},...a}}})}},eo=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=Hi(Mi,this.instanceIndex)),this.layerSpecs=this.buildLayerSpecs(t),{places:new Jr(this.mapLibreMap,this.sourceID,[this.layerSpecs.main,this.layerSpecs.selected])}}buildLayerSpecs(e){const t=Yi(e,this.mapLibreMap);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??[])ni(0,Hi(t.id,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,zi(e.icon.default.style),this.mapLibreMap,{pixelRatio:2}))}else ni(0,this.defaultPlaceIconID,zi(),this.mapLibreMap,{pixelRatio:2})}updateData(e){this.sourcesWithLayers.places.source.runtimeSource?.setData(Qi(this.sourcesWithLayers.places.shownFeatures,this.instanceIndex,e))}async show(e){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.show(Qi(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)}};eo.lastInstanceIndex=-1;let to=eo;const ro=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(!ro(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}},io=e=>e?.length?1===e.length?e[0]:{expression:["any",...e.map(e=>e?.expression)],legacy:["any",...e.map(e=>e?.legacy)]}:null,oo=(e,t)=>{return t?["all",e[(r=t,ro(r)?"expression":"legacy")],t]:e.expression;var r},ao=(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]}},no=(e,t,r)=>ao(e,t.show,r?t.values.map(r):t.values),so={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"]},co=e=>{const t=[];return e.forEach(e=>{e in so?t.push(...so[e].map(bi)):t.push(bi(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&&!vr(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=ao("category",e.show,co(e.values));this.mapLibreMap.setFilter("POI",oo(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 uo={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"]}},ho=(e,t)=>{const r=uo[e];return r.layerIDMatches.some(e=>t.id.toLowerCase().includes(e))&&r.layerTypes.includes(t.type)},po=e=>t=>(!e||((e,t)=>{const r=t?.mode,i=t?.names;if(r&&i?.length){if("include"===r)return i.some(t=>ho(t,e));if("exclude"===r)return!i.some(t=>ho(t,e))}return!0})(t,e))&&!Si.includes(t.id);class fo extends li{static async get(e,t){return await Qr(e),new fo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(e){const t=this.mapLibreMap.getSource(Ii);if(!t)throw jr(`init ${fo.name} with source ID ${Ii}`);return{vectorTiles:new Xr(this.mapLibreMap,t,po(e?.layerGroupsFilter))}}_applyConfig(e){return e&&!vr(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=>ho(t,e)):"exclude"===t?e=>!r.some(t=>ho(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 _o=["land","water","borders","buildings2D","buildings3D","houseNumbers","roadLines","roadLabels","roadShields","placeLabels","smallerTownLabels","cityLabels","capitalLabels","stateLabels","countryLabels"],yo="title",Ao="color",go={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"]},Eo="#0A3653",Ro={type:"fill",paint:{"fill-color":["coalesce",["get",Ao],Eo],"fill-opacity":.15,"fill-antialias":!1}},Io={type:"line",paint:{"line-color":Eo,"line-opacity":.45,"line-width":2}},mo=(e,t,r)=>{const i=r?.colorConfig,o=r?.lineConfig;return[{...Ro,id:e,paint:{...Ro.paint,...!vr(i?.fillOpacity)&&{"fill-opacity":i?.fillOpacity},...i?.fillColor&&{"fill-color":["get","color"]}}},{...Io,id:t,paint:{...Io.paint,...!vr(o?.lineColor)&&{"line-color":o?.lineColor},...!vr(o?.lineWidth)&&{"line-width":o?.lineWidth},...!vr(o?.lineOpacity)&&{"line-opacity":o?.lineOpacity}}}]},To=(e,t)=>{const r=t?.textConfig;return{type:"symbol",id:e,layout:{"text-field":["get",yo],...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"}}},So=(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&&go[r]){const e=go[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()}}})}),Lo=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}},Oo=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]=mo(this.fillLayerID,this.outlineLayerID,t),a=To(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(Lo(this.sourcesWithLayers.geometry.shownFeatures)),this.config=t}updateLayerAndData(e){const[t,r]=mo(this.fillLayerID,this.outlineLayerID,e),i=To(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(So(e,this.config)),this.sourcesWithLayers.geometryLabel.show(Lo(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)}};Oo.lastInstanceIndex=-1;let bo=Oo;class No extends li{static async get(e,t){return await Qr(e),await ai(e,Ri,"hillshade"),new No(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ri);if(!e)throw jr(`init ${No.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 Co=["standardLight","standardDark","drivingLight","drivingDark","monoLight","monoDark","satellite"],vo=["trafficIncidents","trafficFlow","hillshade"],Mo="#36A8F0",wo="#105287",Uo="#ABAFB3",Po="#3C4956",Do="#727C85",xo=["interpolate",["linear"],["zoom"],1,3,5,4,10,7,18,10],Ho=["==",["get","routeState"],"selected"],Fo=["==",["get","routeState"],"deselected"],Go="#AD0000",jo="#FB2D09",Bo="#f58240",Wo="#000000",Vo=e=>!1===e?.visible?"":e?.title??["format",["get","title"],"\n",["get","chargingPower"]," • ",["get","chargingDuration"]],ko=e=>({...xi,filter:Ho,minzoom:4,layout:{...xi.layout,"text-field":Vo(e?.text)},paint:{...xi.paint}}),Yo={filter:Ho,minzoom:16},zo={...Yo,type:"line",layout:{"line-cap":"round"}},Ko={...zo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,14,22,20],"line-color":"grey"}},$o={...zo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,12,22,17],"line-color":"white"}},Xo="instruction-arrow",qo={...Yo,type:"symbol",layout:{"icon-allow-overlap":!0,"icon-image":Xo,"icon-rotation-alignment":"map","icon-rotate":["get","lastPointBearingDegrees"],"icon-size":["interpolate",["linear"],["zoom"],16,1,22,2]}},Zo={filter:Ho,type:"line",layout:{"line-join":"round"},paint:{"line-width":xo,"line-color":"#6dc4ed"}},Jo={filter:Ho,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}},Qo={type:"line",layout:{"line-join":"round","line-cap":"round","line-sort-key":["get","index"]}},ea=["interpolate",["linear"],["zoom"],1,5,5,6,10,10,18,14],ta={...Qo,filter:Fo,paint:{"line-color":Po,"line-width":ea}},ra={...Qo,filter:Fo,paint:{"line-color":Uo,"line-width":xo}},ia={...Qo,filter:Ho,paint:{"line-color":wo,"line-width":ea}},oa={type:"symbol",layout:{"symbol-placement":"line","icon-image":"roads-arrow-white","icon-rotate":180}},aa="selected-route-summary-popup",na="deselected-route-summary-popup",sa={filter:Ho,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"}},ca={filter:Ho,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]}},la=["interpolate",["linear"],["zoom"],1,2,5,3,10,4,18,6],ua={type:"line",layout:{"line-cap":"round"},paint:{"line-width":la,"line-color":["match",["get","magnitudeOfDelay"],"minor","#FFC105","moderate",jo,"major",Go,"#C7D2D8"]}},ha={type:"line",filter:["in",["get","magnitudeOfDelay"],["literal",["unknown","indefinite"]]],layout:{"line-join":"round"},paint:{"line-width":la,"line-color":["match",["get","magnitudeOfDelay"],"unknown","rgba(190, 39, 27, 1)","rgba(137, 150, 168, 1)"],"line-dasharray":[1.5,1]}},pa=["match",["get","magnitudeOfDelay"],"minor",Bo,"moderate",jo,"major",Go,"indefinite","#666666",Wo],fa={filter:Ho,type:"symbol",minzoom:6,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-ignore-placement":!0}},_a={...fa,filter:["all",["has","jamIconID"],fa.filter],layout:{...fa.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:{...fa.paint,"text-color":pa,"text-halo-color":"#FFFFFF","text-halo-width":1}},da={...fa,filter:["all",["has","causeIconID"],fa.filter],layout:{...fa.layout,"icon-image":["get","causeIconID"],"icon-anchor":"bottom-right"},paint:{...fa.paint}},ya={filter:Ho,type:"line",layout:{"line-join":"round"},paint:{"line-width":xo,"line-color":"#000000","line-opacity":.3}},Aa={filter:Ho,type:"line",layout:{"line-join":"round"},paint:{"line-color":wo,"line-width":xo}},ga={filter:Ho,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":Mo,"line-width":["interpolate",["linear"],["zoom"],1,2,5,3,10,5,18,7],"line-dasharray":[0,1.5]}},Ea="traffic-clear",Ra="traffic-major",Ia="traffic-moderate",ma="traffic-minor",Ta=["has","formattedTraffic"],Sa=e=>{const t=void 0!==e?Hi(aa,e):aa,r=void 0!==e?Hi(na,e):na,i=void 0!==e?Hi(Ea,e):Ea,o=void 0!==e?Hi(Ra,e):Ra,a=void 0!==e?Hi(Ia,e):Ia,n=void 0!==e?Hi(ma,e):ma;return{type:"symbol",layout:{"icon-image":["case",Ho,t,r],"symbol-placement":"point","icon-rotation-alignment":"viewport","text-rotation-alignment":"viewport","symbol-sort-key":["case",Ho,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",Ho,"black",Do]},["concat","\t\t",["get","formattedDistance"]],{"text-color":Do},["case",Ta,"\n",""],{},["image",["case",Ta,["match",["get","magnitudeOfDelay"],"major",o,"moderate",a,"minor",n,i],""]],{},["case",Ta,["concat"," ",["get","formattedTraffic"]],""],{"text-font":["literal",[Ni]],"text-color":pa}]},paint:{"icon-translate":[0,-35],"text-translate":[0,-35]}}},La=Sa(),Oa="start",ba="middle",Na="finish",Ca="indexType",va="stopDisplayIndex",Ma="waypointStart",wa="waypointStop",Ua="waypointSoft",Pa="waypointFinish",Da={"text-field":["get",va],"text-font":[Ni],"text-size":["interpolate",["linear"],["zoom"],13,14,18,16],"text-offset":[0,-1.6],"icon-anchor":["case",["all",["==",["get",Ca],ba],["!",["has",va]]],"center","bottom"],"text-allow-overlap":!0},xa={type:"symbol",paint:{...Ui,"text-color":"#ffffff"},layout:{...wi,...Da,"symbol-sort-key":["case",["==",["get",vi],Ua],0,["abs",["-",["get","index"],1e3]]]}},Ha={type:"symbol",paint:{...Di,"text-color":"black","text-halo-width":1.5,"text-halo-color":"#ffffff"},layout:{...Pi,"text-anchor":"top","text-offset":[0,.4]}},Fa=(e,t)=>e&&t&&(e.startsWith("route")||e.startsWith("waypoint"))?`${t}-${e}`:e,Ga=(e,t)=>e&&t?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,r?.beforeID?{...r,beforeID:Fa(r.beforeID,t)}:r])):e,ja=(e,t)=>e&&void 0!==t?`${e}-${t}`:e,Ba=(e={},t,r)=>{const i=e.layers,o=i?.sections,a=e.theme?.mainColor;return{mainLines:{routeLineArrows:{...oa,beforeID:gi.lowestLabel,...i?.mainLines?.routeLineArrows},routeLine:{...(n={color:a},{...Qo,filter:Ho,paint:{"line-color":n?.color??Mo,"line-width":xo}}),beforeID:Fa("routeIncidentBackgroundLine",t),...i?.mainLines?.routeLine},routeOutline:{...ia,beforeID:Fa("routeLine",t),...i?.mainLines?.routeOutline},routeDeselectedLine:{...ra,beforeID:Fa("routeOutline",t),...i?.mainLines?.routeDeselectedLine},routeDeselectedOutline:{...ta,beforeID:Fa("routeDeselectedLine",t),...i?.mainLines?.routeDeselectedOutline},...Ga(i?.mainLines?.additional,t)},waypoints:{routeWaypointSymbol:{...xa,beforeID:Fa("routeSummaryBubbleSymbol",t),...i?.waypoints?.routeWaypointSymbol},routeWaypointLabel:{...Ha,beforeID:Fa("routeWaypointSymbol",t),...i?.waypoints?.routeWaypointLabel},...Ga(i?.waypoints?.additional,t)},chargingStops:{routeChargingStopSymbol:{...ko(e.chargingStops),beforeID:Fa("routeWaypointSymbol",t),...i?.chargingStops?.routeChargingStopSymbol},...Ga(i?.chargingStops?.additional,t)},sections:{incident:{routeIncidentJamSymbol:{..._a,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentJamSymbol},routeIncidentCauseSymbol:{...da,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentCauseSymbol},routeIncidentBackgroundLine:{...ua,beforeID:Fa("routeIncidentDashedLine",t),...o?.incident?.routeIncidentBackgroundLine},routeIncidentDashedLine:{...ha,beforeID:Fa("routeTunnelLine",t),...o?.incident?.routeIncidentDashedLine},...Ga(o?.incident?.additional,t)},ferry:{routeFerryLine:{...Zo,beforeID:Fa("routeLineArrows",t),...o?.ferry?.routeFerryLine},routeFerrySymbol:{...Jo,beforeID:Fa("routeIncidentJamSymbol",t),...o?.ferry?.routeFerrySymbol},...Ga(o?.ferry?.additional,t)},tollRoad:{routeTollRoadOutline:{...sa,beforeID:Fa("routeDeselectedOutline",t),...o?.tollRoad?.routeTollRoadOutline},routeTollRoadSymbol:{...ca,beforeID:Fa("routeChargingStopSymbol",t),...o?.tollRoad?.routeTollRoadSymbol},...Ga(o?.tollRoad?.additional,t)},tunnel:{routeTunnelLine:{...ya,beforeID:Fa("routeLineArrows",t),...o?.tunnel?.routeTunnelLine},...Ga(o?.tunnel?.additional,t)},vehicleRestricted:{routeVehicleRestrictedBackgroundLine:{...Aa,beforeID:Fa("routeVehicleRestrictedForegroundLine",t),...o?.vehicleRestricted?.routeVehicleRestrictedBackgroundLine},routeVehicleRestrictedForegroundLine:{...ga,beforeID:gi.lowestLabel,...o?.vehicleRestricted?.routeVehicleRestrictedForegroundLine},...Ga(o?.vehicleRestricted?.additional,t)}},instructionLines:{routeInstructionLine:{...$o,beforeID:gi.lowestLabel,...i?.instructionLines?.routeInstructionLine},routeInstructionOutline:{...Ko,beforeID:Fa("routeInstructionLine",t),...i?.instructionLines?.routeInstructionOutline},...Ga(i?.instructionLines?.additional,t)},instructionArrows:{routeInstructionArrowSymbol:{...qo,beforeID:Fa("routeInstructionLine",t),...void 0!==r&&{layout:{...qo.layout,"icon-image":ja(qo.layout?.["icon-image"],r)}},...i?.instructionArrows?.routeInstructionArrowSymbol},...Ga(i?.instructionArrows?.additional,t)},summaryBubbles:{routeSummaryBubbleSymbol:{...void 0!==r?Sa(r):La,...i?.summaryBubbles?.routeSummaryBubbleSymbol},...Ga(i?.summaryBubbles?.additional,t)}};var n},Wa=Ba();let Va;Br()&&(Va=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 ka=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)},Ya={pixelRatio:2,stretchX:[[20,45],[100,130]],stretchY:[[20,35]],content:[10,10,130,45]},za=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)},Ka=(e,t)=>{if(!Br())return;const r=kr(t);return e&&r.appendChild(e),Wr(r)},$a=(e={},t)=>Object.entries(e).map(([e,r])=>({...r,id:t?`${t}-${e}`:e})),Xa=(e={},t)=>({mainLines:$a(e.mainLines,t),waypoints:$a(e.waypoints,t),chargingStops:$a(e?.chargingStops,t),ferries:$a(e.sections?.ferry,t),incidents:$a(e.sections?.incident,t),tollRoads:$a(e.sections?.tollRoad,t),tunnels:$a(e.sections?.tunnel,t),vehicleRestricted:$a(e.sections?.vehicleRestricted,t),instructionLines:$a(e.instructionLines,t),instructionArrows:$a(e.instructionArrows,t),summaryBubbles:$a(e.summaryBubbles,t)}),qa=(e,t,r)=>{const i=a.instance.get().displayUnits,o=e?.displayUnits;return{...e,...o?{}:{displayUnits:i},layers:Ba(e,t,r)}},Za=(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"},Ja=e=>{const t=e.properties;return t.chargingParkName??t.chargingParkOperatorName},Qa=(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:Za(a,r),title:Ja(a),chargingPower:`${e.chargingConnectionInfo?.chargingPowerInkW} kW`,chargingDuration:n(e.chargingTimeInSeconds,r?.displayUnits?.time),routeState:o.properties.routeState}})}}return{type:"FeatureCollection",features:i}},en=e=>e.categories.includes("jam"),tn=e=>{const t=(e=>{if(en(e))return n(e.delayInSeconds)})(e),r=((e,t)=>en(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}}},rn=(e,t,r)=>{if(e.properties.radiusMeters)return void 0!==r?Hi(Ua,r):Ua;let i;switch(t){case"start":i=Ma;break;case"finish":i=Pa;break;default:i=wa}return void 0!==r?Hi(i,r):i},on=(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?Oa:e<t-1?ba:Na)(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:rn(c,l,i),...u&&l===ba&&{stopDisplayIndex:o}}}}).filter(e=>e)}};function an(e){return e%360*Math.PI/180}function nn(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 sn(e,t,r={}){if(!0===r.final)return function(e,t){let r=sn(t,e);return r=(r+180)%360,r}(e,t);const i=nn(e),o=nn(t),a=an(i[0]),n=an(o[0]),s=an(i[1]),c=an(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 cn=sn;const ln=(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))}),un=(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},hn=(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"}}})}},pn=(e,t)=>e.some(e=>e.magnitudeOfDelay===t),fn=(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 pn(t,"major")?"major":pn(t,"moderate")?"moderate":pn(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)}}})}),_n=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=Hi("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=Hi("routes",this.instanceIndex)),this.layersSpecs=Xa(qa(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=Hi(Ma,this.instanceIndex),s=Hi(wa,this.instanceIndex),c=Hi(Ua,this.instanceIndex),l=Hi(Pa,this.instanceIndex),u=Hi(Xo,this.instanceIndex),h=Hi(aa,this.instanceIndex),p=Hi(na,this.instanceIndex),f=Hi(Ea,this.instanceIndex),_=Hi(Ra,this.instanceIndex),d=Hi(Ia,this.instanceIndex),y=Hi(ma,this.instanceIndex);this.addImageIfNotExisting(n,(e=>{if(Br())return Ka(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,Ka(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 Ka(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,Va,a),this.addImageIfNotExisting(h,ka("white"),Ya),this.addImageIfNotExisting(p,ka("#EEEEEE"),Ya),this.addImageIfNotExisting(f,za(Wo),a),this.addImageIfNotExisting(_,za(Go),a),this.addImageIfNotExisting(d,za(jo),a),this.addImageIfNotExisting(y,za(Bo),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=qa(e,this.layerIDPrefix,this.instanceIndex);if(this.config){const e=Xa(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!Cr(this.config?.displayUnits,t.displayUnits)&&this.sourcesWithLayers.summaryBubbles.shownFeatures.features.length&&this.sourcesWithLayers.summaryBubbles.show(fn(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=hn(e,r?.selectedIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(i),this.sourcesWithLayers.vehicleRestricted.show(ln(i,"vehicleRestricted")),this.sourcesWithLayers.incidents.show(ln(i,"traffic",tn)),this.sourcesWithLayers.chargingStops.show(Qa(i,this.config)),this.sourcesWithLayers.ferries.show(ln(i,"ferry")),this.sourcesWithLayers.tunnels.show(ln(i,"tunnel")),this.sourcesWithLayers.tollRoads.show(ln(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:cn(o[0],o[1])}}})||[])}))(i)),this.sourcesWithLayers.summaryBubbles.show(fn(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=hn(this.sourcesWithLayers.mainLines.shownFeatures,e);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(t),this.sourcesWithLayers.chargingStops.show(Qa(t,this.config)),un(t,this.sourcesWithLayers.vehicleRestricted),un(t,this.sourcesWithLayers.incidents),un(t,this.sourcesWithLayers.ferries),un(t,this.sourcesWithLayers.tollRoads),un(t,this.sourcesWithLayers.tunnels),un(t,this.sourcesWithLayers.instructionLines),un(t,this.sourcesWithLayers.instructionArrows),un(t,this.sourcesWithLayers.summaryBubbles)}async showWaypoints(e){const t=Array.isArray(e)?on(e,this.config?.waypoints,this.instanceIndex):on(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}};_n.lastInstanceIndex=-1;let dn=_n;const yn="standardLight",An={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"}},gn=e=>`\${baseURL}/maps/orbis/assets/styles/\${version}/style.json?&apiVersion=1&key=\${apiKey}&map=${e}`,En={standardLight:gn("basic_street-light"),standardDark:gn("basic_street-dark"),drivingLight:gn("basic_street-light-driving"),drivingDark:gn("basic_street-dark-driving"),monoLight:gn("basic_mono-light"),monoDark:gn("basic_mono-dark"),satellite:gn("basic_street-satellite")},Rn=(e,t,r)=>{const i=e.id??yn,o=new URL(En[i].replace("${baseURL}",t).replace("${version}",e.version??"0.6.0-0").replace("${apiKey}",r));for(const a of e.include??vo)o.searchParams.append(a,An[i][a]);return o.toString()},In=e=>{const t=e.style,r=e.commonBaseURL,i=e.apiKey;return"string"==typeof t?Rn({id:t},r,i):"standard"===t?.type?Rn(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:Rn({id:yn},r,i)};class mn{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&&Cr(r,this._params.style)&&this.handleStyleData(t.keepState||!0)}),this.mapLibreMap.setStyle(In(this._params),{validate:!1})},this.getStyle=()=>this._params.style,this._params=l(t),this.styleLightDarkTheme=ci(this._params.style),this.ensureMapLibreCSSLoaded(),this.mapLibreMap=new h({validateStyle:!1,maxTileCacheZoomLevels:22,cancelPendingTileRequestsWhileZooming:!1,...(r=this._params).mapLibre,style:In(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.16.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 $r(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 Tn=["unknown","accident","fog","dangerous_conditions","rain","ice","jam","lane_closed","road_closed","road_works","wind","flooding","broken_down_vehicle"],Sn={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},Ln=["motorway","trunk","primary","secondary","tertiary","street"],On=["connecting","major_local"],bn=["local","minor_local"],Nn=(e,t)=>e.length?1===e.length?{expression:e[0],legacy:t[0]}:{expression:["all",...e],legacy:["all",...t]}:null,Cn=(e,t,r)=>{e&&(t.push(e.expression),r.push(e.legacy))},vn=(e,t,r,i)=>{e&&Cn(no(t,e),r,i)},Mn=(e,t,r)=>{vn(e.roadCategories,"road_category",t,r),vn(e.roadSubCategories,"road_subcategory",t,r)},wn=e=>{const t=[],r=[];if(Mn(e,t,r),e.incidentCategories){const i=no("icon_category_0",e.incidentCategories,e=>Sn[e]);Cn(i,t,r)}if(e.magnitudes){const i=no("magnitude",e.magnitudes,e=>u.indexOf(e));Cn(i,t,r)}return e.delays&&Cn((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 Nn(t,r)})(e.delays),t,r),Nn(t,r)},Un=e=>{if(!e?.any?.length)return null;const t=e.any.map(wn).filter(e=>!vr(e));return io(t)},Pn=e=>{const t=[],r=[];if(Mn(e,t,r),e.showRoadClosures){const i="only"===e.showRoadClosures?"==":"!=";t.push([i,["get","road_closure"],!0]),r.push([i,"road_closure",!0])}return Nn(t,r)},Dn=(e,t,r,i)=>{for(const o of t)r.setFilter(o.id,e?oo(e,i[o.id]):i[o.id])};class xn extends li{static async get(e,t){return await Qr(e),await ai(e,Ti,"trafficFlow"),new xn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ti);if(!e)throw jr(`init ${xn.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 $r(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(Pn).filter(e=>!vr(e));return io(t)})(e);t&&Dn(t,this.getLayers(),this.mapLibreMap,this.originalFilters)}else this.config?.filters?.any?.length&&Dn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);t&&(this.config=Hr({...this.config,filters:e},vr))}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 Hn extends li{static async get(e,t){return await Qr(e),await ai(e,mi,"trafficIncidents"),new Hn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(mi);if(!e)throw jr(`init ${Hn.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}),vr(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=Un(e);if(r){const e=t?this.getNonSymbolLayers():this.getLayers();Dn(r,e,this.mapLibreMap,this.originalFilters)}}else this.config?.filters?.any?.length&&Dn(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);if(t?.any?.length){const e=Un(t);e&&Dn(e,this.getSymbolLayers(),this.mapLibreMap,this.originalFilters)}}r&&(this.config=Hr({...this.config,filters:e,icons:{...this.config?.icons,filters:t}},vr))}getLayers(){return $r(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={...Hr({...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 Fn=(e,t)=>({left:e.left-t.left,top:e.top-t.top,right:e.right-t.left,bottom:e.bottom-t.top}),Gn=(e,t,r)=>e.right<=0||e.left>=t||e.bottom<=0||e.top>=r,jn=(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)},Bn=(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)},Wn=(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 jn(a,t,i,o);if(s&&!n)return void Bn(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):Bn(a,t,r,o):jn(a,t,i,o)},Vn=e=>"string"==typeof e?document.querySelector(e):e,kn=e=>"mapLibreMap"in e?e.mapLibreMap:e,Yn=(e,t,r)=>{const i=kn(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=Vn(s);if(!e)continue;const t=e.getBoundingClientRect(),c=Fn(t,i);Gn(c,o,a)||Wn(c,n,o,a,r)}return n.left>=n.right||n.top>=n.bottom?null:{visibleAreaBounds:n,mapWidthPX:o,mapHeightPX:a}},zn=e=>{const{map:t,surroundingElements:r,paddingPX:i=0}=e,o=Yn(t,r,i);if(!o)return null;const{visibleAreaBounds:a}=o,n=kn(t),s=n.unproject([a.left,a.bottom]),c=n.unproject([a.right,a.top]);return[s.lng,s.lat,c.lng,c.lat]},Kn=e=>{const{map:t,surroundingElements:r}=e,i=zn({map:t,surroundingElements:r});if(!i)return null;const[o,a,n,s]=i;return[(o+n)/2,(a+s)/2]},$n=e=>{const{map:t,toBeContainedBBox:r,surroundingElements:i,paddingPX:o=0}=e,a=Yn(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,Kr as AbstractSourceWithLayers,qr as AddedSourceWithLayers,Ii as BASE_MAP_SOURCE_ID,fo as BaseMapModule,Uo as DESELECTED_FOREGROUND_COLOR,Po as DESELECTED_OUTLINE_COLOR,Fo as DESELECTED_ROUTE_FILTER,Do as DESELECTED_SECONDARY_COLOR,ui as EventsModule,Ai as EventsProxy,Na as FINISH_INDEX,Ao as GEOMETRY_COLOR_PROP,yo as GEOMETRY_TITLE_PROP,Jr as GeoJSONSourceWithLayers,bo as GeometriesModule,Ri as HILLSHADE_SOURCE_ID,No as HillshadeModule,Ca as INDEX_TYPE,Go as MAJOR_DELAY_COLOR,ba as MIDDLE_INDEX,Bo as MINOR_DELAY_LABEL_COLOR,jo as MODERATE_DELAY_COLOR,Ei as POI_SOURCE_ID,lo as POIsModule,to as PlacesModule,Mo as ROUTE_LINE_FOREGROUND_COLOR,xo as ROUTE_LINE_FOREGROUND_WIDTH,wo as ROUTE_LINE_OUTLINE_COLOR,dn as RoutingModule,Ho as SELECTED_ROUTE_FILTER,Oa as START_INDEX,va as STOP_DISPLAY_INDEX,Xr as StyleSourceWithLayers,Ti as TRAFFIC_FLOW_SOURCE_ID,mi as TRAFFIC_INCIDENTS_SOURCE_ID,mn as TomTomMap,zr as TomTomMapSource,xn as TrafficFlowModule,Hn as TrafficIncidentsModule,Wo as UNKNOWN_DELAY_COLOR,_o as baseMapLayerGroupNames,$i as buildPlaceTitle,Ba as buildRoutingLayers,$n as calculateFittingBBox,zn as calculatePaddedBBox,Kn as calculatePaddedCenter,Wa as defaultRoutingLayers,$r as filterLayersBySources,qi as getIconIDForPlace,Zi as getPOILayerCategoryForPlace,co as getStyleCategories,Tn as incidentCategories,Sn as incidentCategoriesMapping,Li as mapDisplayPoiCategoryMappings,gi as mapStyleLayerIDs,so as poiCategoryGroups,Si as poiLayerIDs,Qi as preparePlacesForDisplay,Ln as roadCategories,Co as standardStyleIDs,bn as streetRoadCategories,vo as styleModules,On as tertiaryRoadCategories,bi as toBaseMapPOICategory,Ji as toPlaces};
2
2
  //# sourceMappingURL=map.es.js.map