@arenarium/maps 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(Vt,ni){typeof exports=="object"&&typeof module<"u"?ni(exports):typeof define=="function"&&define.amd?define(["exports"],ni):(Vt=typeof globalThis<"u"?globalThis:Vt||self,ni(Vt.arenarium={}))})(this,function(Vt){"use strict";var M0=Object.defineProperty;var Wg=Vt=>{throw TypeError(Vt)};var I0=(Vt,ni,ki)=>ni in Vt?M0(Vt,ni,{enumerable:!0,configurable:!0,writable:!0,value:ki}):Vt[ni]=ki;var Ts=(Vt,ni,ki)=>I0(Vt,typeof ni!="symbol"?ni+"":ni,ki),qp=(Vt,ni,ki)=>ni.has(Vt)||Wg("Cannot "+ki);var Ft=(Vt,ni,ki)=>(qp(Vt,ni,"read from private field"),ki?ki.call(Vt):ni.get(Vt)),wr=(Vt,ni,ki)=>ni.has(Vt)?Wg("Cannot add the same private member more than once"):ni instanceof WeakSet?ni.add(Vt):ni.set(Vt,ki),au=(Vt,ni,ki,su)=>(qp(Vt,ni,"write to private field"),su?su.call(Vt,ki):ni.set(Vt,ki),ki),Hg=(Vt,ni,ki)=>(qp(Vt,ni,"access private method"),ki);var Va,So,ql,Zu,Xg,um,pa,Mo,Wl,Es;var ki=Array.isArray,su=Array.prototype.indexOf,sd=Array.from,Yg=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,Wp=Object.prototype,Jg=Array.prototype,Hp=Object.getPrototypeOf,Xp=Object.isExtensible;const Qg=()=>{};function Kp(y){for(var m=0;m<y.length;m++)y[m]()}const _n=2,Yp=4,ou=8,od=16,aa=32,uo=64,lu=128,$r=256,cu=512,Lr=1024,sa=2048,Ps=4096,oa=8192,uu=16384,e_=32768,hu=65536,t_=1<<19,Jp=1<<20,ld=1<<21,du=Symbol("$state");function Qp(y){return y===this.v}function i_(y,m){return y!=y?m==m:y!==m||y!==null&&typeof y=="object"||typeof y=="function"}function ef(y){return!i_(y,this.v)}function r_(y){throw new Error("https://svelte.dev/e/effect_in_teardown")}function n_(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function a_(y){throw new Error("https://svelte.dev/e/effect_orphan")}function s_(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function o_(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function l_(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function c_(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let C0=!1;const u_=1,h_=2,d_=16,p_=1,f_=2,Fr=Symbol(),m_=[];function g_(y,m=!1){return pu(y,new Map,"",m_)}function pu(y,m,b,C,A=null){if(typeof y=="object"&&y!==null){var D=m.get(y);if(D!==void 0)return D;if(y instanceof Map)return new Map(y);if(y instanceof Set)return new Set(y);if(ki(y)){var S=Array(y.length);m.set(y,S),A!==null&&m.set(A,S);for(var o=0;o<y.length;o+=1){var le=y[o];o in y&&(S[o]=pu(le,m,b,C))}return S}if(Hp(y)===Wp){S={},m.set(y,S),A!==null&&m.set(A,S);for(var ue in y)S[ue]=pu(y[ue],m,b,C);return S}if(y instanceof Date)return structuredClone(y);if(typeof y.toJSON=="function")return pu(y.toJSON(),m,b,C,y)}if(y instanceof EventTarget)return y;try{return structuredClone(y)}catch{return y}}function __(y){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let Br=null;function tf(y){Br=y}function fu(y,m=!1,b){var C=Br={p:Br,c:null,d:!1,e:null,m:!1,s:y,x:null,l:null};pf(()=>{C.d=!0})}function mu(y){const m=Br;if(m!==null){y!==void 0&&(m.x=y);const S=m.e;if(S!==null){var b=ci,C=Xt;m.e=null;try{for(var A=0;A<S.length;A++){var D=S[A];Da(D.effect),jn(D.reaction),xu(D.fn)}}finally{Da(b),jn(C)}}Br=m.p,m.m=!0}return y||{}}function rf(){return!0}function la(y){if(typeof y!="object"||y===null||du in y)return y;const m=Hp(y);if(m!==Wp&&m!==Jg)return y;var b=new Map,C=ki(y),A=Pi(0),D=Xt,S=o=>{var le=Xt;jn(D);var ue=o();return jn(le),ue};return C&&b.set("length",Pi(y.length)),new Proxy(y,{defineProperty(o,le,ue){(!("value"in ue)||ue.configurable===!1||ue.enumerable===!1||ue.writable===!1)&&o_();var _e=b.get(le);return _e===void 0?(_e=S(()=>Pi(ue.value)),b.set(le,_e)):ai(_e,S(()=>la(ue.value))),!0},deleteProperty(o,le){var ue=b.get(le);if(ue===void 0)le in o&&(b.set(le,S(()=>Pi(Fr))),cd(A));else{if(C&&typeof le=="string"){var _e=b.get("length"),Re=Number(le);Number.isInteger(Re)&&Re<_e.v&&ai(_e,Re)}ai(ue,Fr),cd(A)}return!0},get(o,le,ue){var ie;if(le===du)return y;var _e=b.get(le),Re=le in o;if(_e===void 0&&(!Re||(ie=wl(o,le))!=null&&ie.writable)&&(_e=S(()=>Pi(la(Re?o[le]:Fr))),b.set(le,_e)),_e!==void 0){var xe=tt(_e);return xe===Fr?void 0:xe}return Reflect.get(o,le,ue)},getOwnPropertyDescriptor(o,le){var ue=Reflect.getOwnPropertyDescriptor(o,le);if(ue&&"value"in ue){var _e=b.get(le);_e&&(ue.value=tt(_e))}else if(ue===void 0){var Re=b.get(le),xe=Re==null?void 0:Re.v;if(Re!==void 0&&xe!==Fr)return{enumerable:!0,configurable:!0,value:xe,writable:!0}}return ue},has(o,le){var xe;if(le===du)return!0;var ue=b.get(le),_e=ue!==void 0&&ue.v!==Fr||Reflect.has(o,le);if(ue!==void 0||ci!==null&&(!_e||(xe=wl(o,le))!=null&&xe.writable)){ue===void 0&&(ue=S(()=>Pi(_e?la(o[le]):Fr)),b.set(le,ue));var Re=tt(ue);if(Re===Fr)return!1}return _e},set(o,le,ue,_e){var Rt;var Re=b.get(le),xe=le in o;if(C&&le==="length")for(var ie=ue;ie<Re.v;ie+=1){var De=b.get(ie+"");De!==void 0?ai(De,Fr):ie in o&&(De=S(()=>Pi(Fr)),b.set(ie+"",De))}Re===void 0?(!xe||(Rt=wl(o,le))!=null&&Rt.writable)&&(Re=S(()=>Pi(void 0)),ai(Re,S(()=>la(ue))),b.set(le,Re)):(xe=Re.v!==Fr,ai(Re,S(()=>la(ue))));var gt=Reflect.getOwnPropertyDescriptor(o,le);if(gt!=null&>.set&>.set.call(_e,ue),!xe){if(C&&typeof le=="string"){var $t=b.get("length"),_t=Number(le);Number.isInteger(_t)&&_t>=$t.v&&ai($t,_t+1)}cd(A)}return!0},ownKeys(o){tt(A);var le=Reflect.ownKeys(o).filter(Re=>{var xe=b.get(Re);return xe===void 0||xe.v!==Fr});for(var[ue,_e]of b)_e.v!==Fr&&!(ue in o)&&le.push(ue);return le},setPrototypeOf(){l_()}})}function cd(y,m=1){ai(y,y.v+m)}function ud(y){var m=_n|sa,b=Xt!==null&&(Xt.f&_n)!==0?Xt:null;return ci===null||b!==null&&(b.f&$r)!==0?m|=$r:ci.f|=Jp,{ctx:Br,deps:null,effects:null,equals:Qp,f:m,fn:y,reactions:null,rv:0,v:null,wv:0,parent:b??ci}}function gu(y){const m=ud(y);return Pf(m),m}function y_(y){const m=ud(y);return m.equals=ef,m}function nf(y){var m=y.effects;if(m!==null){y.effects=null;for(var b=0;b<m.length;b+=1)ca(m[b])}}function x_(y){for(var m=y.parent;m!==null;){if((m.f&_n)===0)return m;m=m.parent}return null}function af(y){var m,b=ci;Da(x_(y));try{nf(y),m=kf(y)}finally{Da(b)}return m}function sf(y){var m=af(y),b=(La||(y.f&$r)!==0)&&y.deps!==null?Ps:Lr;yn(y,b),y.equals(m)||(y.v=m,y.wv=Mf())}const Tl=new Map;function ho(y,m){var b={f:0,v:y,reactions:null,equals:Qp,rv:0,wv:0};return b}function Pi(y,m){const b=ho(y);return Pf(b),b}function v_(y,m=!1){const b=ho(y);return m||(b.equals=ef),b}function ai(y,m,b=!1){Xt!==null&&!On&&rf()&&(Xt.f&(_n|od))!==0&&!(Tr!=null&&Tr.includes(y))&&c_();let C=b?la(m):m;return of(y,C)}function of(y,m){if(!y.equals(m)){var b=y.v;Ml?Tl.set(y,m):Tl.set(y,b),y.v=m,(y.f&_n)!==0&&((y.f&sa)!==0&&af(y),yn(y,(y.f&$r)===0?Lr:Ps)),y.wv=Mf(),lf(y,sa),ci!==null&&(ci.f&Lr)!==0&&(ci.f&(aa|uo))===0&&(sn===null?A_([y]):sn.push(y))}return m}function lf(y,m){var b=y.reactions;if(b!==null)for(var C=b.length,A=0;A<C;A++){var D=b[A],S=D.f;(S&sa)===0&&(yn(D,m),(S&(Lr|$r))!==0&&((S&_n)!==0?lf(D,Ps):Eu(D)))}}let b_=!1;var hd,cf,uf,hf;function w_(){if(hd===void 0){hd=window,cf=/Firefox/.test(navigator.userAgent);var y=Element.prototype,m=Node.prototype,b=Text.prototype;uf=wl(m,"firstChild").get,hf=wl(m,"nextSibling").get,Xp(y)&&(y.__click=void 0,y.__className=void 0,y.__attributes=null,y.__style=void 0,y.__e=void 0),Xp(b)&&(b.__t=void 0)}}function df(y=""){return document.createTextNode(y)}function _u(y){return uf.call(y)}function yu(y){return hf.call(y)}function Pl(y,m){return _u(y)}function T_(y,m){{var b=_u(y);return b instanceof Comment&&b.data===""?yu(b):b}}function dd(y,m=1,b=!1){let C=y;for(;m--;)C=yu(C);return C}function P_(y){y.textContent=""}function S_(y){ci===null&&Xt===null&&a_(),Xt!==null&&(Xt.f&$r)!==0&&ci===null&&n_(),Ml&&r_()}function M_(y,m){var b=m.last;b===null?m.last=m.first=y:(b.next=y,y.prev=b,m.last=y)}function po(y,m,b,C=!0){var A=ci,D={ctx:Br,deps:null,nodes_start:null,nodes_end:null,f:y|sa,first:null,fn:m,last:null,next:null,parent:A,prev:null,teardown:null,transitions:null,wv:0};if(b)try{md(D),D.f|=e_}catch(le){throw ca(D),le}else m!==null&&Eu(D);var S=b&&D.deps===null&&D.first===null&&D.nodes_start===null&&D.teardown===null&&(D.f&(Jp|lu))===0;if(!S&&C&&(A!==null&&M_(D,A),Xt!==null&&(Xt.f&_n)!==0)){var o=Xt;(o.effects??(o.effects=[])).push(D)}return D}function pf(y){const m=po(ou,null,!1);return yn(m,Lr),m.teardown=y,m}function fo(y){S_();var m=ci!==null&&(ci.f&aa)!==0&&Br!==null&&!Br.m;if(m){var b=Br;(b.e??(b.e=[])).push({fn:y,effect:ci,reaction:Xt})}else{var C=xu(y);return C}}function I_(y){const m=po(uo,y,!0);return(b={})=>new Promise(C=>{b.outro?wu(m,()=>{ca(m),C(void 0)}):(ca(m),C(void 0))})}function xu(y){return po(Yp,y,!1)}function ff(y){return po(ou,y,!0)}function vu(y,m=[],b=ud){const C=m.map(b);return bu(()=>y(...C.map(tt)))}function bu(y,m=0){return po(ou|od|m,y,!0)}function mo(y,m=!0){return po(ou|aa,y,!0,m)}function mf(y){var m=y.teardown;if(m!==null){const b=Ml,C=Xt;Tf(!0),jn(null);try{m.call(null)}finally{Tf(b),jn(C)}}}function gf(y,m=!1){var b=y.first;for(y.first=y.last=null;b!==null;){var C=b.next;(b.f&uo)!==0?b.parent=null:ca(b,m),b=C}}function C_(y){for(var m=y.first;m!==null;){var b=m.next;(m.f&aa)===0&&ca(m),m=b}}function ca(y,m=!0){var b=!1;(m||(y.f&t_)!==0)&&y.nodes_start!==null&&(k_(y.nodes_start,y.nodes_end),b=!0),gf(y,m&&!b),ku(y,0),yn(y,uu);var C=y.transitions;if(C!==null)for(const D of C)D.stop();mf(y);var A=y.parent;A!==null&&A.first!==null&&_f(y),y.next=y.prev=y.teardown=y.ctx=y.deps=y.fn=y.nodes_start=y.nodes_end=null}function k_(y,m){for(;y!==null;){var b=y===m?null:yu(y);y.remove(),y=b}}function _f(y){var m=y.parent,b=y.prev,C=y.next;b!==null&&(b.next=C),C!==null&&(C.prev=b),m!==null&&(m.first===y&&(m.first=C),m.last===y&&(m.last=b))}function wu(y,m){var b=[];pd(y,b,!0),yf(b,()=>{ca(y),m&&m()})}function yf(y,m){var b=y.length;if(b>0){var C=()=>--b||m();for(var A of y)A.out(C)}else m()}function pd(y,m,b){if((y.f&oa)===0){if(y.f^=oa,y.transitions!==null)for(const S of y.transitions)(S.is_global||b)&&m.push(S);for(var C=y.first;C!==null;){var A=C.next,D=(C.f&hu)!==0||(C.f&aa)!==0;pd(C,m,D?b:!1),C=A}}}function Tu(y){xf(y,!0)}function xf(y,m){if((y.f&oa)!==0){y.f^=oa,(y.f&Lr)===0&&(y.f^=Lr),Cl(y)&&(yn(y,sa),Eu(y));for(var b=y.first;b!==null;){var C=b.next,A=(b.f&hu)!==0||(b.f&aa)!==0;xf(b,A?m:!1),b=C}if(y.transitions!==null)for(const D of y.transitions)(D.is_global||m)&&D.in()}}let Sl=[],fd=[];function vf(){var y=Sl;Sl=[],Kp(y)}function E_(){var y=fd;fd=[],Kp(y)}function bf(y){Sl.length===0&&queueMicrotask(vf),Sl.push(y)}function wf(){Sl.length>0&&vf(),fd.length>0&&E_()}let Pu=!1,Su=!1,Mu=null,Ss=!1,Ml=!1;function Tf(y){Ml=y}let Il=[],k0=[],Xt=null,On=!1;function jn(y){Xt=y}let ci=null;function Da(y){ci=y}let Tr=null;function Pf(y){Xt!==null&&Xt.f&ld&&(Tr===null?Tr=[y]:Tr.push(y))}let Pr=null,Gr=0,sn=null;function A_(y){sn=y}let Sf=1,Iu=0,La=!1;function Mf(){return++Sf}function Cl(y){var Re;var m=y.f;if((m&sa)!==0)return!0;if((m&Ps)!==0){var b=y.deps,C=(m&$r)!==0;if(b!==null){var A,D,S=(m&cu)!==0,o=C&&ci!==null&&!La,le=b.length;if(S||o){var ue=y,_e=ue.parent;for(A=0;A<le;A++)D=b[A],(S||!((Re=D==null?void 0:D.reactions)!=null&&Re.includes(ue)))&&(D.reactions??(D.reactions=[])).push(ue);S&&(ue.f^=cu),o&&_e!==null&&(_e.f&$r)===0&&(ue.f^=$r)}for(A=0;A<le;A++)if(D=b[A],Cl(D)&&sf(D),D.wv>y.wv)return!0}(!C||ci!==null&&!La)&&yn(y,Lr)}return!1}function z_(y,m){for(var b=m;b!==null;){if((b.f&lu)!==0)try{b.fn(y);return}catch{b.f^=lu}b=b.parent}throw Pu=!1,y}function If(y){return(y.f&uu)===0&&(y.parent===null||(y.parent.f&lu)===0)}function Cu(y,m,b,C){if(Pu){if(b===null&&(Pu=!1),If(m))throw y;return}if(b!==null&&(Pu=!0),z_(y,m),If(m))throw y}function Cf(y,m,b=!0){var C=y.reactions;if(C!==null)for(var A=0;A<C.length;A++){var D=C[A];Tr!=null&&Tr.includes(y)||((D.f&_n)!==0?Cf(D,m,!1):m===D&&(b?yn(D,sa):(D.f&Lr)!==0&&yn(D,Ps),Eu(D)))}}function kf(y){var ie;var m=Pr,b=Gr,C=sn,A=Xt,D=La,S=Tr,o=Br,le=On,ue=y.f;Pr=null,Gr=0,sn=null,La=(ue&$r)!==0&&(On||!Ss||Xt===null),Xt=(ue&(aa|uo))===0?y:null,Tr=null,tf(y.ctx),On=!1,Iu++,y.f|=ld;try{var _e=(0,y.fn)(),Re=y.deps;if(Pr!==null){var xe;if(ku(y,Gr),Re!==null&&Gr>0)for(Re.length=Gr+Pr.length,xe=0;xe<Pr.length;xe++)Re[Gr+xe]=Pr[xe];else y.deps=Re=Pr;if(!La)for(xe=Gr;xe<Re.length;xe++)((ie=Re[xe]).reactions??(ie.reactions=[])).push(y)}else Re!==null&&Gr<Re.length&&(ku(y,Gr),Re.length=Gr);if(rf()&&sn!==null&&!On&&Re!==null&&(y.f&(_n|Ps|sa))===0)for(xe=0;xe<sn.length;xe++)Cf(sn[xe],y);return A!==null&&A!==y&&(Iu++,sn!==null&&(C===null?C=sn:C.push(...sn))),_e}finally{Pr=m,Gr=b,sn=C,Xt=A,La=D,Tr=S,tf(o),On=le,y.f^=ld}}function R_(y,m){let b=m.reactions;if(b!==null){var C=su.call(b,y);if(C!==-1){var A=b.length-1;A===0?b=m.reactions=null:(b[C]=b[A],b.pop())}}b===null&&(m.f&_n)!==0&&(Pr===null||!Pr.includes(m))&&(yn(m,Ps),(m.f&($r|cu))===0&&(m.f^=cu),nf(m),ku(m,0))}function ku(y,m){var b=y.deps;if(b!==null)for(var C=m;C<b.length;C++)R_(y,b[C])}function md(y){var m=y.f;if((m&uu)===0){yn(y,Lr);var b=ci,C=Br,A=Ss;ci=y,Ss=!0;try{(m&od)!==0?C_(y):gf(y),mf(y);var D=kf(y);y.teardown=typeof D=="function"?D:null,y.wv=Sf;var S=y.deps,o}catch(le){Cu(le,y,b,C||y.ctx)}finally{Ss=A,ci=b}}}function D_(){try{s_()}catch(y){if(Mu!==null)Cu(y,Mu,null);else throw y}}function Ef(){var y=Ss;try{var m=0;for(Ss=!0;Il.length>0;){m++>1e3&&D_();var b=Il,C=b.length;Il=[];for(var A=0;A<C;A++){var D=F_(b[A]);L_(D)}Tl.clear()}}finally{Su=!1,Ss=y,Mu=null}}function L_(y){var m=y.length;if(m!==0)for(var b=0;b<m;b++){var C=y[b];if((C.f&(uu|oa))===0)try{Cl(C)&&(md(C),C.deps===null&&C.first===null&&C.nodes_start===null&&(C.teardown===null?_f(C):C.fn=null))}catch(A){Cu(A,C,null,C.ctx)}}}function Eu(y){Su||(Su=!0,queueMicrotask(Ef));for(var m=Mu=y;m.parent!==null;){m=m.parent;var b=m.f;if((b&(uo|aa))!==0){if((b&Lr)===0)return;m.f^=Lr}}Il.push(m)}function F_(y){for(var m=[],b=y;b!==null;){var C=b.f,A=(C&(aa|uo))!==0,D=A&&(C&Lr)!==0;if(!D&&(C&oa)===0){if((C&Yp)!==0)m.push(b);else if(A)b.f^=Lr;else{var S=Xt;try{Xt=b,Cl(b)&&md(b)}catch(ue){Cu(ue,b,null,b.ctx)}finally{Xt=S}}var o=b.first;if(o!==null){b=o;continue}}var le=b.parent;for(b=b.next;b===null&&le!==null;)b=le.next,le=le.parent}return m}function B_(y){var m;for(wf();Il.length>0;)Su=!0,Ef(),wf();return m}async function O_(){await Promise.resolve(),B_()}function tt(y){var m=y.f,b=(m&_n)!==0;if(Xt!==null&&!On){if(!(Tr!=null&&Tr.includes(y))){var C=Xt.deps;y.rv<Iu&&(y.rv=Iu,Pr===null&&C!==null&&C[Gr]===y?Gr++:Pr===null?Pr=[y]:(!La||!Pr.includes(y))&&Pr.push(y))}}else if(b&&y.deps===null&&y.effects===null){var A=y,D=A.parent;D!==null&&(D.f&$r)===0&&(A.f^=$r)}return b&&(A=y,Cl(A)&&sf(A)),Ml&&Tl.has(y)?Tl.get(y):y.v}function gd(y){var m=On;try{return On=!0,y()}finally{On=m}}const j_=-7169;function yn(y,m){y.f=y.f&j_|m}const N_=["touchstart","touchmove"];function Z_(y){return N_.includes(y)}function V_(y){var m=Xt,b=ci;jn(null),Da(null);try{return y()}finally{jn(m),Da(b)}}const Af=new Set,_d=new Set;function U_(y,m,b,C={}){function A(D){if(C.capture||kl.call(m,D),!D.cancelBubble)return V_(()=>b==null?void 0:b.call(this,D))}return y.startsWith("pointer")||y.startsWith("touch")||y==="wheel"?bf(()=>{m.addEventListener(y,A,C)}):m.addEventListener(y,A,C),A}function $_(y,m,b,C,A){var D={capture:C,passive:A},S=U_(y,m,b,D);(m===document.body||m===window||m===document)&&pf(()=>{m.removeEventListener(y,S,D)})}function G_(y){for(var m=0;m<y.length;m++)Af.add(y[m]);for(var b of _d)b(y)}function kl(y){var Rt;var m=this,b=m.ownerDocument,C=y.type,A=((Rt=y.composedPath)==null?void 0:Rt.call(y))||[],D=A[0]||y.target,S=0,o=y.__root;if(o){var le=A.indexOf(o);if(le!==-1&&(m===document||m===window)){y.__root=m;return}var ue=A.indexOf(m);if(ue===-1)return;le<=ue&&(S=le)}if(D=A[S]||y.target,D!==m){Yg(y,"currentTarget",{configurable:!0,get(){return D||b}});var _e=Xt,Re=ci;jn(null),Da(null);try{for(var xe,ie=[];D!==null;){var De=D.assignedSlot||D.parentNode||D.host||null;try{var gt=D["__"+C];if(gt!=null&&(!D.disabled||y.target===D))if(ki(gt)){var[$t,..._t]=gt;$t.apply(D,[y,..._t])}else gt.call(D,y)}catch(Mi){xe?ie.push(Mi):xe=Mi}if(y.cancelBubble||De===m||De===null)break;D=De}if(xe){for(let Mi of ie)queueMicrotask(()=>{throw Mi});throw xe}}finally{y.__root=m,delete y.currentTarget,jn(_e),Da(Re)}}}function q_(y){var m=document.createElement("template");return m.innerHTML=y,m.content}function zf(y,m){var b=ci;b.nodes_start===null&&(b.nodes_start=y,b.nodes_end=m)}function go(y,m){var b=(m&p_)!==0,C=(m&f_)!==0,A,D=!y.startsWith("<!>");return()=>{A===void 0&&(A=q_(D?y:"<!>"+y),b||(A=_u(A)));var S=C||cf?document.importNode(A,!0):A.cloneNode(!0);if(b){var o=_u(S),le=S.lastChild;zf(o,le)}else zf(S,S);return S}}function _o(y,m){y!==null&&y.before(m)}function W_(y,m){return H_(y,m)}const yo=new Map;function H_(y,{target:m,anchor:b,props:C={},events:A,context:D,intro:S=!0}){w_();var o=new Set,le=Re=>{for(var xe=0;xe<Re.length;xe++){var ie=Re[xe];if(!o.has(ie)){o.add(ie);var De=Z_(ie);m.addEventListener(ie,kl,{passive:De});var gt=yo.get(ie);gt===void 0?(document.addEventListener(ie,kl,{passive:De}),yo.set(ie,1)):yo.set(ie,gt+1)}}};le(sd(Af)),_d.add(le);var ue=void 0,_e=I_(()=>{var Re=b??m.appendChild(df());return mo(()=>{if(D){fu({});var xe=Br;xe.c=D}A&&(C.$$events=A),ue=y(Re,C)||{},D&&mu()}),()=>{var De;for(var xe of o){m.removeEventListener(xe,kl);var ie=yo.get(xe);--ie===0?(document.removeEventListener(xe,kl),yo.delete(xe)):yo.set(xe,ie)}_d.delete(le),Re!==b&&((De=Re.parentNode)==null||De.removeChild(Re))}});return yd.set(ue,_e),ue}let yd=new WeakMap;function X_(y,m){const b=yd.get(y);return b?(yd.delete(y),b(m)):Promise.resolve()}function K_(y,m,[b,C]=[0,0]){var A=y,D=null,S=null,o=Fr,le=b>0?hu:0,ue=!1;const _e=(xe,ie=!0)=>{ue=!0,Re(ie,xe)},Re=(xe,ie)=>{o!==(o=xe)&&(o?(D?Tu(D):ie&&(D=mo(()=>ie(A))),S&&wu(S,()=>{S=null})):(S?Tu(S):ie&&(S=mo(()=>ie(A,[b+1,C]))),D&&wu(D,()=>{D=null})))};bu(()=>{ue=!1,m(_e),ue||Re(null,null)},le)}function Y_(y,m,b,C){for(var A=[],D=m.length,S=0;S<D;S++)pd(m[S].e,A,!0);var o=D>0&&A.length===0&&b!==null;if(o){var le=b.parentNode;P_(le),le.append(b),C.clear(),Fa(y,m[0].prev,m[D-1].next)}yf(A,()=>{for(var ue=0;ue<D;ue++){var _e=m[ue];o||(C.delete(_e.k),Fa(y,_e.prev,_e.next)),ca(_e.e,!o)}})}function J_(y,m,b,C,A,D=null){var S=y,o={flags:m,items:new Map,first:null};{var le=y;S=le.appendChild(df())}var ue=null,_e=!1,Re=y_(()=>{var xe=b();return ki(xe)?xe:xe==null?[]:sd(xe)});bu(()=>{var xe=tt(Re),ie=xe.length;_e&&ie===0||(_e=ie===0,Q_(xe,o,S,A,m,C,b),D!==null&&(ie===0?ue?Tu(ue):ue=mo(()=>D(S)):ue!==null&&wu(ue,()=>{ue=null})),tt(Re))})}function Q_(y,m,b,C,A,D,S){var o=y.length,le=m.items,ue=m.first,_e=ue,Re,xe=null,ie=[],De=[],gt,$t,_t,Rt;for(Rt=0;Rt<o;Rt+=1){if(gt=y[Rt],$t=D(gt,Rt),_t=le.get($t),_t===void 0){var Mi=_e?_e.e.nodes_start:b;xe=ty(Mi,m,xe,xe===null?m.first:xe.next,gt,$t,Rt,C,A,S),le.set($t,xe),ie=[],De=[],_e=xe.next;continue}if(ey(_t,gt,Rt),(_t.e.f&oa)!==0&&Tu(_t.e),_t!==_e){if(Re!==void 0&&Re.has(_t)){if(ie.length<De.length){var Jt=De[0],pi;xe=Jt.prev;var Bt=ie[0],vt=ie[ie.length-1];for(pi=0;pi<ie.length;pi+=1)Rf(ie[pi],Jt,b);for(pi=0;pi<De.length;pi+=1)Re.delete(De[pi]);Fa(m,Bt.prev,vt.next),Fa(m,xe,Bt),Fa(m,vt,Jt),_e=Jt,xe=vt,Rt-=1,ie=[],De=[]}else Re.delete(_t),Rf(_t,_e,b),Fa(m,_t.prev,_t.next),Fa(m,_t,xe===null?m.first:xe.next),Fa(m,xe,_t),xe=_t;continue}for(ie=[],De=[];_e!==null&&_e.k!==$t;)(_e.e.f&oa)===0&&(Re??(Re=new Set)).add(_e),De.push(_e),_e=_e.next;if(_e===null)continue;_t=_e}ie.push(_t),xe=_t,_e=_t.next}if(_e!==null||Re!==void 0){for(var Ot=Re===void 0?[]:sd(Re);_e!==null;)(_e.e.f&oa)===0&&Ot.push(_e),_e=_e.next;var rr=Ot.length;if(rr>0){var on=o===0?b:null;Y_(m,Ot,on,le)}}ci.first=m.first&&m.first.e,ci.last=xe&&xe.e}function ey(y,m,b,C){of(y.v,m),y.i=b}function ty(y,m,b,C,A,D,S,o,le,ue){var _e=(le&u_)!==0,Re=(le&d_)===0,xe=_e?Re?v_(A):ho(A):A,ie=(le&h_)===0?S:ho(S),De={i:ie,v:xe,k:D,a:null,e:null,prev:b,next:C};try{return De.e=mo(()=>o(y,xe,ie,ue),b_),De.e.prev=b&&b.e,De.e.next=C&&C.e,b===null?m.first=De:(b.next=De,b.e.next=De.e),C!==null&&(C.prev=De,C.e.prev=De.e),De}finally{}}function Rf(y,m,b){for(var C=y.next?y.next.e.nodes_start:b,A=m?m.e.nodes_start:b,D=y.e.nodes_start;D!==C;){var S=yu(D);A.before(D),D=S}}function Fa(y,m,b){m===null?y.first=b:(m.next=b,m.e.next=b&&b.e),b!==null&&(b.prev=m,b.e.prev=m&&m.e)}function iy(y,m,...b){var C=y,A=Qg,D;bu(()=>{A!==(A=m())&&(D&&(ca(D),D=null),D=mo(()=>A(C,...b)))},hu)}const Df=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function ry(y,m,b){var C=y==null?"":""+y;if(b){for(var A in b)if(b[A])C=C?C+" "+A:A;else if(C.length)for(var D=A.length,S=0;(S=C.indexOf(A,S))>=0;){var o=S+D;(S===0||Df.includes(C[S-1]))&&(o===C.length||Df.includes(C[o]))?C=(S===0?"":C.substring(0,S))+C.substring(o+1):S=o}}return C===""?null:C}function Lf(y,m=!1){var b=m?" !important;":";",C="";for(var A in y){var D=y[A];D!=null&&D!==""&&(C+=" "+A+": "+D+b)}return C}function xd(y){return y[0]!=="-"||y[1]!=="-"?y.toLowerCase():y}function ny(y,m){if(m){var b="",C,A;if(Array.isArray(m)?(C=m[0],A=m[1]):C=m,y){y=String(y).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var D=!1,S=0,o=!1,le=[];C&&le.push(...Object.keys(C).map(xd)),A&&le.push(...Object.keys(A).map(xd));var ue=0,_e=-1;const gt=y.length;for(var Re=0;Re<gt;Re++){var xe=y[Re];if(o?xe==="/"&&y[Re-1]==="*"&&(o=!1):D?D===xe&&(D=!1):xe==="/"&&y[Re+1]==="*"?o=!0:xe==='"'||xe==="'"?D=xe:xe==="("?S++:xe===")"&&S--,!o&&D===!1&&S===0){if(xe===":"&&_e===-1)_e=Re;else if(xe===";"||Re===gt-1){if(_e!==-1){var ie=xd(y.substring(ue,_e).trim());if(!le.includes(ie)){xe!==";"&&Re++;var De=y.substring(ue,Re).trim();b+=" "+De+";"}}ue=Re+1,_e=-1}}}}return C&&(b+=Lf(C)),A&&(b+=Lf(A,!0)),b=b.trim(),b===""?null:b}return y==null?null:String(y)}function Ff(y,m,b,C,A,D){var S=y.__className;if(S!==b||S===void 0){var o=ry(b,C,D);o==null?y.removeAttribute("class"):y.className=o,y.__className=b}else if(D&&A!==D)for(var le in D){var ue=!!D[le];(A==null||ue!==!!A[le])&&y.classList.toggle(le,ue)}return D}function vd(y,m={},b,C){for(var A in b){var D=b[A];m[A]!==D&&(b[A]==null?y.style.removeProperty(A):y.style.setProperty(A,D,C))}}function Au(y,m,b,C){var A=y.__style;if(A!==m){var D=ny(m,C);D==null?y.removeAttribute("style"):y.style.cssText=D,y.__style=m}else C&&(Array.isArray(C)?(vd(y,b==null?void 0:b[0],C[0]),vd(y,b==null?void 0:b[1],C[1],"important")):vd(y,b,C));return C}const ay=()=>performance.now(),Nn={tick:y=>requestAnimationFrame(y),now:()=>ay(),tasks:new Set};function Bf(){const y=Nn.now();Nn.tasks.forEach(m=>{m.c(y)||(Nn.tasks.delete(m),m.f())}),Nn.tasks.size!==0&&Nn.tick(Bf)}function sy(y){let m;return Nn.tasks.size===0&&Nn.tick(Bf),{promise:new Promise(b=>{Nn.tasks.add(m={c:y,f:b})}),abort(){Nn.tasks.delete(m)}}}const Vu=class Vu{constructor(m){wr(this,Zu);wr(this,Va,new WeakMap);wr(this,So);wr(this,ql);au(this,ql,m)}observe(m,b){var C=Ft(this,Va).get(m)||new Set;return C.add(b),Ft(this,Va).set(m,C),Hg(this,Zu,Xg).call(this).observe(m,Ft(this,ql)),()=>{var A=Ft(this,Va).get(m);A.delete(b),A.size===0&&(Ft(this,Va).delete(m),Ft(this,So).unobserve(m))}}};Va=new WeakMap,So=new WeakMap,ql=new WeakMap,Zu=new WeakSet,Xg=function(){return Ft(this,So)??au(this,So,new ResizeObserver(m=>{for(var b of m){Vu.entries.set(b.target,b);for(var C of Ft(this,Va).get(b.target)||[])C(b)}}))},Ts(Vu,"entries",new WeakMap);let bd=Vu;var oy=new bd({box:"border-box"});function Of(y,m,b){var C=oy.observe(y,()=>b(y[m]));xu(()=>(gd(()=>b(y[m])),C))}function jf(y,m){return y===m||(y==null?void 0:y[du])===m}function Ba(y={},m,b,C){return xu(()=>{var A,D;return ff(()=>{A=D,D=(C==null?void 0:C())||[],gd(()=>{y!==b(...D)&&(m(y,...D),A&&jf(b(...A),y)&&m(null,...A))})}),()=>{bf(()=>{D&&jf(b(...D),y)&&m(null,...D)})}}),y}function Nf(y){Br===null&&__(),fo(()=>{const m=gd(y);if(typeof m=="function")return m})}const ly="5";typeof window<"u"&&((um=window.__svelte??(window.__svelte={})).v??(um.v=new Set)).add(ly);function Zf(y){return Object.prototype.toString.call(y)==="[object Date]"}function cy(y){return y}function uy(y){return-.5*(Math.cos(Math.PI*y)-1)}function wd(y,m){if(y===m||y!==y)return()=>y;const b=typeof y;if(b!==typeof m||Array.isArray(y)!==Array.isArray(m))throw new Error("Cannot interpolate values of different type");if(Array.isArray(y)){const C=m.map((A,D)=>wd(y[D],A));return A=>C.map(D=>D(A))}if(b==="object"){if(!y||!m)throw new Error("Object cannot be null");if(Zf(y)&&Zf(m)){const D=y.getTime(),o=m.getTime()-D;return le=>new Date(D+le*o)}const C=Object.keys(m),A={};return C.forEach(D=>{A[D]=wd(y[D],m[D])}),D=>{const S={};return C.forEach(o=>{S[o]=A[o](D)}),S}}if(b==="number"){const C=m-y;return A=>y+A*C}return()=>m}const zd=class zd{constructor(m,b={}){wr(this,pa,ho(void 0));wr(this,Mo,ho(void 0));wr(this,Wl);wr(this,Es,null);Ft(this,pa).v=Ft(this,Mo).v=m,au(this,Wl,b)}static of(m,b){const C=new zd(m(),b);return ff(()=>{C.set(m())}),C}set(m,b){var Re;ai(Ft(this,Mo),m);let{delay:C=0,duration:A=400,easing:D=cy,interpolate:S=wd}={...Ft(this,Wl),...b};if(A===0)return(Re=Ft(this,Es))==null||Re.abort(),ai(Ft(this,pa),m),Promise.resolve();const o=Nn.now()+C;let le,ue=!1,_e=Ft(this,Es);return au(this,Es,sy(xe=>{if(xe<o)return!0;if(!ue){ue=!0;const De=Ft(this,pa).v;le=S(De,m),typeof A=="function"&&(A=A(De,m)),_e==null||_e.abort()}const ie=xe-o;return ie>A?(ai(Ft(this,pa),m),!1):(ai(Ft(this,pa),le(D(ie/A))),!0)})),Ft(this,Es).promise}get current(){return tt(Ft(this,pa))}get target(){return tt(Ft(this,Mo))}set target(m){this.set(m)}};pa=new WeakMap,Mo=new WeakMap,Wl=new WeakMap,Es=new WeakMap;let Td=zd;function Vf(y,m,b){const C=b*(Math.PI/180),A=y/2,D=m/2,S=Math.sqrt(A*A+D*D),o=Math.atan(D/A)*(180/Math.PI),le=o,ue=180-o,_e=180+o,Re=360-o;switch(!0){case(le<=b&&b<=ue):return{offsetX:S*Math.cos(C)-A,offsetY:0};case(ue<=b&&b<=_e):return{offsetX:-y,offsetY:S*Math.sin(C)-D};case(_e<=b&&b<=Re):return{offsetX:S*Math.cos(C)-A,offsetY:-m};default:return{offsetX:0,offsetY:S*Math.sin(C)-D}}}function hy(y,m,b){const C=Vf(y,m,b),A=C.offsetX,D=C.offsetY,S=m,o=y,le=Vf(S,o,b),ue=S/2+le.offsetX,_e=o/2+le.offsetY,xe=Math.atan2(_e,ue)/Math.PI*180-45,ie=0,De=30,gt=A+y/2,$t=D+m/2,_t=Math.sqrt(gt*gt+$t*$t),Rt=Math.min(y,m)/2,Mi=Math.sqrt(y*y+m*m)/2,Jt=(_t-Rt)/(Mi-Rt),pi=ie+Jt*(De-ie);return{markerOffsetX:A,markerOffsetY:D,pinAngleDeg:xe,pinSkewDeg:pi}}const Uf=512,dy=0,$f=18,py=10,Gf=3,fy=.5,Pd=270,my=8;var gy=go('<div><div class="pin svelte-p9fs91"></div> <div class="marker svelte-p9fs91"><div class="popup svelte-p9fs91"><!></div></div></div>');function _y(y,m){fu(m,!0);let b=Pi(!0),C=Pi(!1);function A(yt){ai(b,yt,!0)}function D(yt){ai(C,!yt)}function S(){return!tt(C)}let o=Pd,le=Pd,ue=new Td(Pd,{easing:uy,interpolate:Re}),_e=!1;fo(()=>{tt(C)&&(ue.set(o,{duration:0}),le=o,Mi(le))}),fo(()=>{le=ue.current});function Re(yt,ui){if(Math.abs(ui-yt)<180)return At=>yt+At*(ui-yt);{const At=360-Math.abs(ui-yt),nr=yt<ui?-1:1;return Tt=>(360+yt+Tt*At*nr)%360}}function xe(){o!=le&&(Mi(le),window.requestAnimationFrame(xe))}function ie(yt){yt!=o&&(o=yt,_e?(ue.set(yt,{duration:400}),window.requestAnimationFrame(xe)):(ue.set(yt,{duration:0}),le=yt,Mi(le))),_e=!0}let De=Pi(0),gt=Pi(0),$t,_t,Rt;fo(()=>{tt(De)&&tt(gt)&&(Rt.style.width=`${Math.min(tt(De),tt(gt))/4}px`,Rt.style.height=`${Math.min(tt(De),tt(gt))/4}px`)}),fo(()=>{tt(De)&&tt(gt)&&Mi(le)});function Mi(yt){if(!$t||!_t||!Rt)return;const ui=hy(tt(De),tt(gt),yt),At=Math.round(ui.markerOffsetX),nr=Math.round(ui.markerOffsetY);_t.style.transform=`translate(${At}px, ${nr}px)`;const Tt=ui.pinAngleDeg,dr=ui.pinSkewDeg;Rt.style.transform=`rotate(${Tt}deg) skew(${dr}deg, ${dr}deg)`;const Or=-1-2*(At/tt(De)),Wr=-1-2*(nr/tt(gt));$t.style.filter=` drop-shadow(0px 0px 4px rgba(0,0,0,0.
|
|
2
|
+
\r\f \v\uFEFF`];function ry(y,m,b){var C=y==null?"":""+y;if(b){for(var A in b)if(b[A])C=C?C+" "+A:A;else if(C.length)for(var D=A.length,S=0;(S=C.indexOf(A,S))>=0;){var o=S+D;(S===0||Df.includes(C[S-1]))&&(o===C.length||Df.includes(C[o]))?C=(S===0?"":C.substring(0,S))+C.substring(o+1):S=o}}return C===""?null:C}function Lf(y,m=!1){var b=m?" !important;":";",C="";for(var A in y){var D=y[A];D!=null&&D!==""&&(C+=" "+A+": "+D+b)}return C}function xd(y){return y[0]!=="-"||y[1]!=="-"?y.toLowerCase():y}function ny(y,m){if(m){var b="",C,A;if(Array.isArray(m)?(C=m[0],A=m[1]):C=m,y){y=String(y).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var D=!1,S=0,o=!1,le=[];C&&le.push(...Object.keys(C).map(xd)),A&&le.push(...Object.keys(A).map(xd));var ue=0,_e=-1;const gt=y.length;for(var Re=0;Re<gt;Re++){var xe=y[Re];if(o?xe==="/"&&y[Re-1]==="*"&&(o=!1):D?D===xe&&(D=!1):xe==="/"&&y[Re+1]==="*"?o=!0:xe==='"'||xe==="'"?D=xe:xe==="("?S++:xe===")"&&S--,!o&&D===!1&&S===0){if(xe===":"&&_e===-1)_e=Re;else if(xe===";"||Re===gt-1){if(_e!==-1){var ie=xd(y.substring(ue,_e).trim());if(!le.includes(ie)){xe!==";"&&Re++;var De=y.substring(ue,Re).trim();b+=" "+De+";"}}ue=Re+1,_e=-1}}}}return C&&(b+=Lf(C)),A&&(b+=Lf(A,!0)),b=b.trim(),b===""?null:b}return y==null?null:String(y)}function Ff(y,m,b,C,A,D){var S=y.__className;if(S!==b||S===void 0){var o=ry(b,C,D);o==null?y.removeAttribute("class"):y.className=o,y.__className=b}else if(D&&A!==D)for(var le in D){var ue=!!D[le];(A==null||ue!==!!A[le])&&y.classList.toggle(le,ue)}return D}function vd(y,m={},b,C){for(var A in b){var D=b[A];m[A]!==D&&(b[A]==null?y.style.removeProperty(A):y.style.setProperty(A,D,C))}}function Au(y,m,b,C){var A=y.__style;if(A!==m){var D=ny(m,C);D==null?y.removeAttribute("style"):y.style.cssText=D,y.__style=m}else C&&(Array.isArray(C)?(vd(y,b==null?void 0:b[0],C[0]),vd(y,b==null?void 0:b[1],C[1],"important")):vd(y,b,C));return C}const ay=()=>performance.now(),Nn={tick:y=>requestAnimationFrame(y),now:()=>ay(),tasks:new Set};function Bf(){const y=Nn.now();Nn.tasks.forEach(m=>{m.c(y)||(Nn.tasks.delete(m),m.f())}),Nn.tasks.size!==0&&Nn.tick(Bf)}function sy(y){let m;return Nn.tasks.size===0&&Nn.tick(Bf),{promise:new Promise(b=>{Nn.tasks.add(m={c:y,f:b})}),abort(){Nn.tasks.delete(m)}}}const Vu=class Vu{constructor(m){wr(this,Zu);wr(this,Va,new WeakMap);wr(this,So);wr(this,ql);au(this,ql,m)}observe(m,b){var C=Ft(this,Va).get(m)||new Set;return C.add(b),Ft(this,Va).set(m,C),Hg(this,Zu,Xg).call(this).observe(m,Ft(this,ql)),()=>{var A=Ft(this,Va).get(m);A.delete(b),A.size===0&&(Ft(this,Va).delete(m),Ft(this,So).unobserve(m))}}};Va=new WeakMap,So=new WeakMap,ql=new WeakMap,Zu=new WeakSet,Xg=function(){return Ft(this,So)??au(this,So,new ResizeObserver(m=>{for(var b of m){Vu.entries.set(b.target,b);for(var C of Ft(this,Va).get(b.target)||[])C(b)}}))},Ts(Vu,"entries",new WeakMap);let bd=Vu;var oy=new bd({box:"border-box"});function Of(y,m,b){var C=oy.observe(y,()=>b(y[m]));xu(()=>(gd(()=>b(y[m])),C))}function jf(y,m){return y===m||(y==null?void 0:y[du])===m}function Ba(y={},m,b,C){return xu(()=>{var A,D;return ff(()=>{A=D,D=(C==null?void 0:C())||[],gd(()=>{y!==b(...D)&&(m(y,...D),A&&jf(b(...A),y)&&m(null,...A))})}),()=>{bf(()=>{D&&jf(b(...D),y)&&m(null,...D)})}}),y}function Nf(y){Br===null&&__(),fo(()=>{const m=gd(y);if(typeof m=="function")return m})}const ly="5";typeof window<"u"&&((um=window.__svelte??(window.__svelte={})).v??(um.v=new Set)).add(ly);function Zf(y){return Object.prototype.toString.call(y)==="[object Date]"}function cy(y){return y}function uy(y){return-.5*(Math.cos(Math.PI*y)-1)}function wd(y,m){if(y===m||y!==y)return()=>y;const b=typeof y;if(b!==typeof m||Array.isArray(y)!==Array.isArray(m))throw new Error("Cannot interpolate values of different type");if(Array.isArray(y)){const C=m.map((A,D)=>wd(y[D],A));return A=>C.map(D=>D(A))}if(b==="object"){if(!y||!m)throw new Error("Object cannot be null");if(Zf(y)&&Zf(m)){const D=y.getTime(),o=m.getTime()-D;return le=>new Date(D+le*o)}const C=Object.keys(m),A={};return C.forEach(D=>{A[D]=wd(y[D],m[D])}),D=>{const S={};return C.forEach(o=>{S[o]=A[o](D)}),S}}if(b==="number"){const C=m-y;return A=>y+A*C}return()=>m}const zd=class zd{constructor(m,b={}){wr(this,pa,ho(void 0));wr(this,Mo,ho(void 0));wr(this,Wl);wr(this,Es,null);Ft(this,pa).v=Ft(this,Mo).v=m,au(this,Wl,b)}static of(m,b){const C=new zd(m(),b);return ff(()=>{C.set(m())}),C}set(m,b){var Re;ai(Ft(this,Mo),m);let{delay:C=0,duration:A=400,easing:D=cy,interpolate:S=wd}={...Ft(this,Wl),...b};if(A===0)return(Re=Ft(this,Es))==null||Re.abort(),ai(Ft(this,pa),m),Promise.resolve();const o=Nn.now()+C;let le,ue=!1,_e=Ft(this,Es);return au(this,Es,sy(xe=>{if(xe<o)return!0;if(!ue){ue=!0;const De=Ft(this,pa).v;le=S(De,m),typeof A=="function"&&(A=A(De,m)),_e==null||_e.abort()}const ie=xe-o;return ie>A?(ai(Ft(this,pa),m),!1):(ai(Ft(this,pa),le(D(ie/A))),!0)})),Ft(this,Es).promise}get current(){return tt(Ft(this,pa))}get target(){return tt(Ft(this,Mo))}set target(m){this.set(m)}};pa=new WeakMap,Mo=new WeakMap,Wl=new WeakMap,Es=new WeakMap;let Td=zd;function Vf(y,m,b){const C=b*(Math.PI/180),A=y/2,D=m/2,S=Math.sqrt(A*A+D*D),o=Math.atan(D/A)*(180/Math.PI),le=o,ue=180-o,_e=180+o,Re=360-o;switch(!0){case(le<=b&&b<=ue):return{offsetX:S*Math.cos(C)-A,offsetY:0};case(ue<=b&&b<=_e):return{offsetX:-y,offsetY:S*Math.sin(C)-D};case(_e<=b&&b<=Re):return{offsetX:S*Math.cos(C)-A,offsetY:-m};default:return{offsetX:0,offsetY:S*Math.sin(C)-D}}}function hy(y,m,b){const C=Vf(y,m,b),A=C.offsetX,D=C.offsetY,S=m,o=y,le=Vf(S,o,b),ue=S/2+le.offsetX,_e=o/2+le.offsetY,xe=Math.atan2(_e,ue)/Math.PI*180-45,ie=0,De=30,gt=A+y/2,$t=D+m/2,_t=Math.sqrt(gt*gt+$t*$t),Rt=Math.min(y,m)/2,Mi=Math.sqrt(y*y+m*m)/2,Jt=(_t-Rt)/(Mi-Rt),pi=ie+Jt*(De-ie);return{markerOffsetX:A,markerOffsetY:D,pinAngleDeg:xe,pinSkewDeg:pi}}const Uf=512,dy=0,$f=18,py=10,Gf=3,fy=.5,Pd=270,my=8;var gy=go('<div><div class="pin svelte-p9fs91"></div> <div class="marker svelte-p9fs91"><div class="popup svelte-p9fs91"><!></div></div></div>');function _y(y,m){fu(m,!0);let b=Pi(!0),C=Pi(!1);function A(yt){ai(b,yt,!0)}function D(yt){ai(C,!yt)}function S(){return!tt(C)}let o=Pd,le=Pd,ue=new Td(Pd,{easing:uy,interpolate:Re}),_e=!1;fo(()=>{tt(C)&&(ue.set(o,{duration:0}),le=o,Mi(le))}),fo(()=>{le=ue.current});function Re(yt,ui){if(Math.abs(ui-yt)<180)return At=>yt+At*(ui-yt);{const At=360-Math.abs(ui-yt),nr=yt<ui?-1:1;return Tt=>(360+yt+Tt*At*nr)%360}}function xe(){o!=le&&(Mi(le),window.requestAnimationFrame(xe))}function ie(yt){yt!=o&&(o=yt,_e?(ue.set(yt,{duration:400}),window.requestAnimationFrame(xe)):(ue.set(yt,{duration:0}),le=yt,Mi(le))),_e=!0}let De=Pi(0),gt=Pi(0),$t,_t,Rt;fo(()=>{tt(De)&&tt(gt)&&(Rt.style.width=`${Math.min(tt(De),tt(gt))/4}px`,Rt.style.height=`${Math.min(tt(De),tt(gt))/4}px`)}),fo(()=>{tt(De)&&tt(gt)&&Mi(le)});function Mi(yt){if(!$t||!_t||!Rt)return;const ui=hy(tt(De),tt(gt),yt),At=Math.round(ui.markerOffsetX),nr=Math.round(ui.markerOffsetY);_t.style.transform=`translate(${At}px, ${nr}px)`;const Tt=ui.pinAngleDeg,dr=ui.pinSkewDeg;Rt.style.transform=`rotate(${Tt}deg) skew(${dr}deg, ${dr}deg)`;const Or=-1-2*(At/tt(De)),Wr=-1-2*(nr/tt(gt));$t.style.filter=` drop-shadow(0px 0px 4px rgba(0,0,0,0.4)) drop-shadow(${Or}px ${Wr}px 2px rgba(0,0,0,0.4))`}const Jt=()=>tt(De),pi=()=>tt(gt);var Bt=gy();let vt;var Ot=Pl(Bt);Ba(Ot,yt=>Rt=yt,()=>Rt);var rr=dd(Ot,2);Au(rr,"",{},{padding:my+"px"});var on=Pl(rr),Mr=Pl(on);return iy(Mr,()=>m.children),Ba(rr,yt=>_t=yt,()=>_t),Ba(Bt,yt=>$t=yt,()=>$t),vu(yt=>vt=Ff(Bt,1,"anchor svelte-p9fs91",null,vt,yt),[()=>({collapsed:tt(b),hidden:tt(C)})]),Of(rr,"clientWidth",yt=>ai(De,yt)),Of(rr,"clientHeight",yt=>ai(gt,yt)),_o(y,Bt),mu({setCollapsed:A,setDisplayed:D,getDisplayed:S,setAngle:ie,getWidth:Jt,getHeight:pi})}var yy=go("<div></div>");function xy(y,m){fu(m,!0);let b=Pi(!0),C=Pi(0),A=gu(()=>1-.5*tt(C)),D=gu(()=>tt(b)?"":`scale(${tt(A)})`),S=gu(()=>tt(b)?"":`grayscale(${.5*tt(C)})`),o=gu(()=>tt(b)||tt(C)>0?"":"pulsing");function le(ie){ai(b,ie,!0)}function ue(ie){ai(C,Math.max(0,Math.min(1,ie)),!0)}var _e=yy();let Re,xe;return vu(ie=>{Re=Ff(_e,1,"circle svelte-1bhyg2m",null,Re,ie),xe=Au(_e,"",xe,{transform:tt(D),filter:tt(S)})},[()=>({collapsed:tt(b),pulsing:tt(o)})]),_o(y,_e),mu({setCollapsed:le,setDistance:ue})}async function vy(y){return await by(y)}async function by(y){const b=await fetch("https://arenarium-maps-api.marko-smilja.workers.dev/v1/markers",{method:"POST",body:JSON.stringify(y)});if(!b.ok||!b.body)throw new Error("Failed to get markers");return await b.json()}function wy(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var zu={exports:{}};/**
|
|
3
3
|
* MapLibre GL JS
|
|
4
4
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.3.1/LICENSE.txt
|
|
5
5
|
*/var Ty=zu.exports,qf;function Py(){return qf||(qf=1,function(y,m){(function(b,C){y.exports=C()})(Ty,function(){var b={},C={};function A(S,o,le){if(C[S]=le,S==="index"){var ue="var sharedModule = {}; ("+C.shared+")(sharedModule); ("+C.worker+")(sharedModule);",_e={};return C.shared(_e),C.index(b,_e),typeof window<"u"&&b.setWorkerUrl(window.URL.createObjectURL(new Blob([ue],{type:"text/javascript"}))),b}}A("shared",["exports"],function(S){function o(r,t,n,a){return new(n||(n=Promise))(function(c,d){function p(w){try{x(a.next(w))}catch(P){d(P)}}function g(w){try{x(a.throw(w))}catch(P){d(P)}}function x(w){var P;w.done?c(w.value):(P=w.value,P instanceof n?P:new n(function(M){M(P)})).then(p,g)}x((a=a.apply(r,t||[])).next())})}function le(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ue,_e;function Re(){if(_e)return ue;function r(t,n){this.x=t,this.y=n}return _e=1,ue=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,n){return this.clone()._rotateAround(t,n)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var n=t.x-this.x,a=t.y-this.y;return n*n+a*a},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult:function(t){var n=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var n=Math.cos(t),a=Math.sin(t),c=a*this.x+n*this.y;return this.x=n*this.x-a*this.y,this.y=c,this},_rotateAround:function(t,n){var a=Math.cos(t),c=Math.sin(t),d=n.y+c*(this.x-n.x)+a*(this.y-n.y);return this.x=n.x+a*(this.x-n.x)-c*(this.y-n.y),this.y=d,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(t){return t instanceof r?t:Array.isArray(t)?new r(t[0],t[1]):t},ue}typeof SuppressedError=="function"&&SuppressedError;var xe,ie,De=le(Re()),gt=function(){if(ie)return xe;function r(t,n,a,c){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(c-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=a,this.p2y=c}return ie=1,xe=r,r.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(n===void 0&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,c=0;c<8;c++){var d=this.sampleCurveX(a)-t;if(Math.abs(d)<n)return a;var p=this.sampleCurveDerivativeX(a);if(Math.abs(p)<1e-6)break;a-=d/p}var g=0,x=1;for(a=t,c=0;c<20&&(d=this.sampleCurveX(a),!(Math.abs(d-t)<n));c++)t>d?g=a:x=a,a=.5*(x-g)+g;return a},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},xe}(),$t=le(gt);let _t,Rt;function Mi(){return _t==null&&(_t=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),_t}function Jt(){if(Rt==null&&(Rt=!1,Mi())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let a=0;a<5*5;a++){const c=4*a;t.fillStyle=`rgb(${c},${c+1},${c+2})`,t.fillRect(a%5,Math.floor(a/5),1,1)}const n=t.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&n[a]!==a){Rt=!0;break}}}return Rt||!1}var pi,Bt=1e-6,vt=typeof Float32Array<"u"?Float32Array:Array;function Ot(){var r=new vt(9);return vt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function rr(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function on(){var r=new vt(3);return vt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function Mr(r,t,n){var a=new vt(3);return a[0]=r,a[1]=t,a[2]=n,a}function yt(r,t,n){var a=t[0],c=t[1],d=t[2],p=t[3];return r[0]=n[0]*a+n[4]*c+n[8]*d+n[12]*p,r[1]=n[1]*a+n[5]*c+n[9]*d+n[13]*p,r[2]=n[2]*a+n[6]*c+n[10]*d+n[14]*p,r[3]=n[3]*a+n[7]*c+n[11]*d+n[15]*p,r}function ui(){var r=new vt(4);return vt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function At(){var r=new vt(2);return vt!=Float32Array&&(r[0]=0,r[1]=0),r}function nr(r,t){var n=new vt(2);return n[0]=r,n[1]=t,n}Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)}),on(),pi=new vt(4),vt!=Float32Array&&(pi[0]=0,pi[1]=0,pi[2]=0,pi[3]=0),on(),Mr(1,0,0),Mr(0,1,0),ui(),ui(),Ot(),At();const Tt=8192;function dr(r,t,n){return t*(Tt/(r.tileSize*Math.pow(2,n-r.tileID.overscaledZ)))}function Or(r,t){return(r%t+t)%t}function Wr(r,t,n){return r*(1-n)+t*n}function wn(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,n=t*r;return 4*(r<.5?n:3*(r-t)+n-.75)}function $n(r,t,n,a){const c=new $t(r,t,n,a);return d=>c.solve(d)}const jr=$n(.25,.1,.25,1);function Ir(r,t,n){return Math.min(n,Math.max(t,r))}function Ji(r,t,n){const a=n-t,c=((r-t)%a+a)%a+t;return c===t?n:c}function Ei(r,...t){for(const n of t)for(const a in n)r[a]=n[a];return r}let Tn=1;function Cr(r,t,n){const a={};for(const c in r)a[c]=t.call(this,r[c],c,r);return a}function kr(r,t,n){const a={};for(const c in r)t.call(this,r[c],c,r)&&(a[c]=r[c]);return a}function Di(r){return Array.isArray(r)?r.map(Di):typeof r=="object"&&r?Cr(r,Di):r}const Hr={};function vi(r){Hr[r]||(typeof console<"u"&&console.warn(r),Hr[r]=!0)}function si(r,t,n){return(n.y-r.y)*(t.x-r.x)>(t.y-r.y)*(n.x-r.x)}function ar(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let Ve=null;function Ye(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}const Zt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Gt(r,t,n,a,c){return o(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const d=new VideoFrame(r,{timestamp:0});try{const p=d==null?void 0:d.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);const g=p.startsWith("BGR"),x=new Uint8ClampedArray(a*c*4);if(yield d.copyTo(x,function(w,P,M,z,L){const B=4*Math.max(1,0),j=(Math.max(0,M)-M)*z*4+B,$=4*z,H=Math.max(0,P),ne=Math.max(0,M);return{rect:{x:H,y:ne,width:Math.min(w.width,P+z)-H,height:Math.min(w.height,M+L)-ne},layout:[{offset:j,stride:$}]}}(r,t,n,a,c)),g)for(let w=0;w<x.length;w+=4){const P=x[w];x[w]=x[w+2],x[w+2]=P}return x}finally{d.close()}})}let bi,Pt;function st(r,t,n,a){return r.addEventListener(t,n,a),{unsubscribe:()=>{r.removeEventListener(t,n,a)}}}function It(r){return r/Math.PI*180}const qt={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},qi={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},fi="AbortError";function sr(){return new Error(fi)}const pr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function fr(r){return pr.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}const Xr="global-dispatcher";class ln extends Error{constructor(t,n,a,c){super(`AJAXError: ${n} (${t}): ${a}`),this.status=t,this.statusText=n,this.url=a,this.body=c}}const Pn=()=>ar(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Ua=function(r,t){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){const a=fr(r.url);if(a)return a(r,t);if(ar(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:Xr},t)}if(!(/^file:/.test(n=r.url)||/^file:/.test(Pn())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(a,c){return o(this,void 0,void 0,function*(){const d=new Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:Pn(),signal:c.signal});let p,g;a.type!=="json"||d.headers.has("Accept")||d.headers.set("Accept","application/json");try{p=yield fetch(d)}catch(w){throw new ln(0,w.message,a.url,new Blob)}if(!p.ok){const w=yield p.blob();throw new ln(p.status,p.statusText,a.url,w)}g=a.type==="arrayBuffer"||a.type==="image"?p.arrayBuffer():a.type==="json"?p.json():p.text();const x=yield g;if(c.signal.aborted)throw sr();return{data:x,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires")}})}(r,t);if(ar(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:Xr},t)}var n;return function(a,c){return new Promise((d,p)=>{var g;const x=new XMLHttpRequest;x.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(x.responseType="arraybuffer");for(const w in a.headers)x.setRequestHeader(w,a.headers[w]);a.type==="json"&&(x.responseType="text",!((g=a.headers)===null||g===void 0)&&g.Accept||x.setRequestHeader("Accept","application/json")),x.withCredentials=a.credentials==="include",x.onerror=()=>{p(new Error(x.statusText))},x.onload=()=>{if(!c.signal.aborted)if((x.status>=200&&x.status<300||x.status===0)&&x.response!==null){let w=x.response;if(a.type==="json")try{w=JSON.parse(x.response)}catch(P){return void p(P)}d({data:w,cacheControl:x.getResponseHeader("Cache-Control"),expires:x.getResponseHeader("Expires")})}else{const w=new Blob([x.response],{type:x.getResponseHeader("Content-Type")});p(new ln(x.status,x.statusText,a.url,w))}},c.signal.addEventListener("abort",()=>{x.abort(),p(sr())}),x.send(a.body)})}(r,t)};function As(r){if(!r||r.indexOf("://")<=0||r.indexOf("data:image/")===0||r.indexOf("blob:")===0)return!0;const t=new URL(r),n=window.location;return t.protocol===n.protocol&&t.host===n.host}function Io(r,t,n){n[r]&&n[r].indexOf(t)!==-1||(n[r]=n[r]||[],n[r].push(t))}function Sn(r,t,n){if(n&&n[r]){const a=n[r].indexOf(t);a!==-1&&n[r].splice(a,1)}}class he{constructor(t,n={}){Ei(this,n),this.type=t}}class N extends he{constructor(t,n={}){super("error",Ei({error:t},n))}}class V{on(t,n){return this._listeners=this._listeners||{},Io(t,n,this._listeners),{unsubscribe:()=>{this.off(t,n)}}}off(t,n){return Sn(t,n,this._listeners),Sn(t,n,this._oneTimeListeners),this}once(t,n){return n?(this._oneTimeListeners=this._oneTimeListeners||{},Io(t,n,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,n){typeof t=="string"&&(t=new he(t,n||{}));const a=t.type;if(this.listens(a)){t.target=this;const c=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const g of c)g.call(this,t);const d=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const g of d)Sn(a,g,this._oneTimeListeners),g.call(this,t);const p=this._eventedParent;p&&(Ei(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(t))}else t instanceof N&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,n){return this._eventedParent=t,this._eventedParentData=n,this}}var F={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const Y=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function se(r,t){const n={};for(const a in r)a!=="ref"&&(n[a]=r[a]);return Y.forEach(a=>{a in t&&(n[a]=t[a])}),n}function ae(r,t){if(Array.isArray(r)){if(!Array.isArray(t)||r.length!==t.length)return!1;for(let n=0;n<r.length;n++)if(!ae(r[n],t[n]))return!1;return!0}if(typeof r=="object"&&r!==null&&t!==null){if(typeof t!="object"||Object.keys(r).length!==Object.keys(t).length)return!1;for(const n in r)if(!ae(r[n],t[n]))return!1;return!0}return r===t}function pe(r,t){r.push(t)}function ce(r,t,n){pe(n,{command:"addSource",args:[r,t[r]]})}function Pe(r,t,n){pe(t,{command:"removeSource",args:[r]}),n[r]=!0}function ve(r,t,n,a){Pe(r,n,a),ce(r,t,n)}function de(r,t,n){let a;for(a in r[n])if(Object.prototype.hasOwnProperty.call(r[n],a)&&a!=="data"&&!ae(r[n][a],t[n][a]))return!1;for(a in t[n])if(Object.prototype.hasOwnProperty.call(t[n],a)&&a!=="data"&&!ae(r[n][a],t[n][a]))return!1;return!0}function ke(r,t,n,a,c,d){r=r||{},t=t||{};for(const p in r)Object.prototype.hasOwnProperty.call(r,p)&&(ae(r[p],t[p])||n.push({command:d,args:[a,p,t[p],c]}));for(const p in t)Object.prototype.hasOwnProperty.call(t,p)&&!Object.prototype.hasOwnProperty.call(r,p)&&(ae(r[p],t[p])||n.push({command:d,args:[a,p,t[p],c]}))}function Ze(r){return r.id}function Ue(r,t){return r[t.id]=t,r}class be{constructor(t,n,a,c){this.message=(t?`${t}: `:"")+a,c&&(this.identifier=c),n!=null&&n.__line__&&(this.line=n.__line__)}}function lt(r,...t){for(const n of t)for(const a in n)r[a]=n[a];return r}class et extends Error{constructor(t,n){super(n),this.message=n,this.key=t}}class ot{constructor(t,n=[]){this.parent=t,this.bindings={};for(const[a,c]of n)this.bindings[a]=c}concat(t){return new ot(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const kt={kind:"null"},ze={kind:"number"},We={kind:"string"},Ne={kind:"boolean"},ht={kind:"color"},mi={kind:"projectionDefinition"},Mn={kind:"object"},at={kind:"value"},Li={kind:"collator"},Qt={kind:"formatted"},Co={kind:"padding"},$a={kind:"resolvedImage"},Gn={kind:"variableAnchorOffsetCollection"};function mr(r,t){return{kind:"array",itemType:r,N:t}}function hi(r){if(r.kind==="array"){const t=hi(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const Rd=[kt,ze,We,Ne,ht,mi,Qt,Mn,mr(at),Co,$a,Gn];function Ga(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ga(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const n of Rd)if(!Ga(n,t))return null}}return`Expected ${hi(r)} but found ${hi(t)} instead.`}function Hl(r,t){return t.some(n=>n.kind===r.kind)}function qn(r,t){return t.some(n=>n==="null"?r===null:n==="array"?Array.isArray(r):n==="object"?r&&!Array.isArray(r)&&typeof r=="object":n===typeof r)}function qa(r,t){return r.kind==="array"&&t.kind==="array"?r.itemType.kind===t.itemType.kind&&typeof r.N=="number":r.kind===t.kind}const Uu=.96422,$u=.82521,Gu=4/29,Wa=6/29,qu=3*Wa*Wa,Dd=Wa*Wa*Wa,Wu=Math.PI/180,zs=180/Math.PI;function Hu(r){return(r%=360)<0&&(r+=360),r}function Xu([r,t,n,a]){let c,d;const p=Xl((.2225045*(r=fa(r))+.7168786*(t=fa(t))+.0606169*(n=fa(n)))/1);r===t&&t===n?c=d=p:(c=Xl((.4360747*r+.3850649*t+.1430804*n)/Uu),d=Xl((.0139322*r+.0971045*t+.7141733*n)/$u));const g=116*p-16;return[g<0?0:g,500*(c-p),200*(p-d),a]}function fa(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Xl(r){return r>Dd?Math.pow(r,1/3):r/qu+Gu}function Ku([r,t,n,a]){let c=(r+16)/116,d=isNaN(t)?c:c+t/500,p=isNaN(n)?c:c-n/200;return c=1*ko(c),d=Uu*ko(d),p=$u*ko(p),[Kl(3.1338561*d-1.6168667*c-.4906146*p),Kl(-.9787684*d+1.9161415*c+.033454*p),Kl(.0719453*d-.2289914*c+1.4052427*p),a]}function Kl(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function ko(r){return r>Wa?r*r*r:qu*(r-Gu)}function Rs(r){return parseInt(r.padEnd(2,r),16)/255}function Kr(r,t){return bt(t?r/100:r,0,1)}function bt(r,t,n){return Math.min(Math.max(t,r),n)}function ma(r){return!r.some(Number.isNaN)}const Wn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function In(r,t,n){return r+n*(t-r)}function Ha(r,t,n){return r.map((a,c)=>In(a,t[c],n))}class Et{constructor(t,n,a,c=1,d=!0){this.r=t,this.g=n,this.b=a,this.a=c,d||(this.r*=c,this.g*=c,this.b*=c,c||this.overwriteGetter("rgb",[t,n,a,c]))}static parse(t){if(t instanceof Et)return t;if(typeof t!="string")return;const n=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const c=Wn[a];if(c){const[p,g,x]=c;return[p/255,g/255,x/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const p=a.length<6?1:2;let g=1;return[Rs(a.slice(g,g+=p)),Rs(a.slice(g,g+=p)),Rs(a.slice(g,g+=p)),Rs(a.slice(g,g+p)||"ff")]}if(a.startsWith("rgb")){const p=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[g,x,w,P,M,z,L,B,j,$,H,ne]=p,K=[P||" ",L||" ",$].join("");if(K===" "||K===" /"||K===",,"||K===",,,"){const R=[w,z,j].join(""),U=R==="%%%"?100:R===""?255:0;if(U){const J=[bt(+x/U,0,1),bt(+M/U,0,1),bt(+B/U,0,1),H?Kr(+H,ne):1];if(ma(J))return J}}return}}const d=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[p,g,x,w,P,M,z,L,B]=d,j=[x||" ",P||" ",z].join("");if(j===" "||j===" /"||j===",,"||j===",,,"){const $=[+g,bt(+w,0,100),bt(+M,0,100),L?Kr(+L,B):1];if(ma($))return function([H,ne,K,R]){function U(J){const ge=(J+H/30)%12,Ee=ne*Math.min(K,1-K);return K-Ee*Math.max(-1,Math.min(ge-3,9-ge,1))}return H=Hu(H),ne/=100,K/=100,[U(0),U(8),U(4),R]}($)}}}(t);return n?new Et(...n,!1):void 0}get rgb(){const{r:t,g:n,b:a,a:c}=this,d=c||1/0;return this.overwriteGetter("rgb",[t/d,n/d,a/d,c])}get hcl(){return this.overwriteGetter("hcl",function(t){const[n,a,c,d]=Xu(t),p=Math.sqrt(a*a+c*c);return[Math.round(1e4*p)?Hu(Math.atan2(c,a)*zs):NaN,p,n,d]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Xu(this.rgb))}overwriteGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}toString(){const[t,n,a,c]=this.rgb;return`rgba(${[t,n,a].map(d=>Math.round(255*d)).join(",")},${c})`}static interpolate(t,n,a,c="rgb"){switch(c){case"rgb":{const[d,p,g,x]=Ha(t.rgb,n.rgb,a);return new Et(d,p,g,x,!1)}case"hcl":{const[d,p,g,x]=t.hcl,[w,P,M,z]=n.hcl;let L,B;if(isNaN(d)||isNaN(w))isNaN(d)?isNaN(w)?L=NaN:(L=w,g!==1&&g!==0||(B=P)):(L=d,M!==1&&M!==0||(B=p));else{let K=w-d;w>d&&K>180?K-=360:w<d&&d-w>180&&(K+=360),L=d+a*K}const[j,$,H,ne]=function([K,R,U,J]){return K=isNaN(K)?0:K*Wu,Ku([U,Math.cos(K)*R,Math.sin(K)*R,J])}([L,B??In(p,P,a),In(g,M,a),In(x,z,a)]);return new Et(j,$,H,ne,!1)}case"lab":{const[d,p,g,x]=Ku(Ha(t.lab,n.lab,a));return new Et(d,p,g,x,!1)}}}}Et.black=new Et(0,0,0,1),Et.white=new Et(1,1,1,1),Et.transparent=new Et(0,0,0,0),Et.red=new Et(1,0,0,1);class Nr{constructor(t,n,a){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,n){return this.collator.compare(t,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Ds=["bottom","center","top"];class Xa{constructor(t,n,a,c,d,p){this.text=t,this.image=n,this.scale=a,this.fontStack=c,this.textColor=d,this.verticalAlign=p}}class or{constructor(t){this.sections=t}static fromString(t){return new or([new Xa(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof or?t:or.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class Wi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Wi)return t;if(typeof t=="number")return new Wi([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const n of t)if(typeof n!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Wi(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,a){return new Wi(Ha(t.values,n.values,a))}}class oi{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Eo=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class lr{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof lr)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let n=0;n<t.length;n+=2){const a=t[n],c=t[n+1];if(typeof a!="string"||!Eo.has(a)||!Array.isArray(c)||c.length!==2||typeof c[0]!="number"||typeof c[1]!="number")return}return new lr(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,a){const c=t.values,d=n.values;if(c.length!==d.length)throw new oi(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`);const p=[];for(let g=0;g<c.length;g+=2){if(c[g]!==d[g])throw new oi(`Cannot interpolate values containing mismatched anchors. from[${g}]: ${c[g]}, to[${g}]: ${d[g]}`);p.push(c[g]);const[x,w]=c[g+1],[P,M]=d[g+1];p.push([In(x,P,a),In(w,M,a)])}return new lr(p)}}class gr{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new gr({name:t,available:!1}):null}}class Fi{constructor(t,n,a){this.from=t,this.to=n,this.transition=a}static interpolate(t,n,a){return new Fi(t,n,a)}static parse(t){return t instanceof Fi?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new Fi(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new Fi(t.from,t.to,t.transition):typeof t=="string"?new Fi(t,t,1):void 0}}function Yu(r,t,n,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof n=="number"&&n>=0&&n<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,t,n,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,t,n,a]:[r,t,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Hn(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Fi||r instanceof Et||r instanceof Nr||r instanceof or||r instanceof Wi||r instanceof lr||r instanceof gr)return!0;if(Array.isArray(r)){for(const t of r)if(!Hn(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Hn(r[t]))return!1;return!0}return!1}function li(r){if(r===null)return kt;if(typeof r=="string")return We;if(typeof r=="boolean")return Ne;if(typeof r=="number")return ze;if(r instanceof Et)return ht;if(r instanceof Fi)return mi;if(r instanceof Nr)return Li;if(r instanceof or)return Qt;if(r instanceof Wi)return Co;if(r instanceof lr)return Gn;if(r instanceof gr)return $a;if(Array.isArray(r)){const t=r.length;let n;for(const a of r){const c=li(a);if(n){if(n===c)continue;n=at;break}n=c}return mr(n||at,t)}return Mn}function Ka(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof Et||r instanceof Fi||r instanceof or||r instanceof Wi||r instanceof lr||r instanceof gr?r.toString():JSON.stringify(r)}class Xn{constructor(t,n){this.type=t,this.value=n}static parse(t,n){if(t.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Hn(t[1]))return n.error("invalid value");const a=t[1];let c=li(a);const d=n.expectedType;return c.kind!=="array"||c.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(c=d),new Xn(c,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Ls={string:We,number:ze,boolean:Ne,object:Mn};class _r{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let a,c=1;const d=t[0];if(d==="array"){let g,x;if(t.length>2){const w=t[1];if(typeof w!="string"||!(w in Ls)||w==="object")return n.error('The item type argument of "array" must be one of string, number, boolean',1);g=Ls[w],c++}else g=at;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);x=t[2],c++}a=mr(g,x)}else{if(!Ls[d])throw new Error(`Types doesn't contain name = ${d}`);a=Ls[d]}const p=[];for(;c<t.length;c++){const g=n.parse(t[c],c,at);if(!g)return null;p.push(g)}return new _r(a,p)}evaluate(t){for(let n=0;n<this.args.length;n++){const a=this.args[n].evaluate(t);if(!Ga(this.type,li(a)))return a;if(n===this.args.length-1)throw new oi(`Expected value to be of type ${hi(this.type)}, but found ${hi(li(a))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const ei={"to-boolean":Ne,"to-color":ht,"to-number":ze,"to-string":We};class cn{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const a=t[0];if(!ei[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&t.length!==2)return n.error("Expected one argument.");const c=ei[a],d=[];for(let p=1;p<t.length;p++){const g=n.parse(t[p],p,at);if(!g)return null;d.push(g)}return new cn(c,d)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let n,a;for(const c of this.args){if(n=c.evaluate(t),a=null,n instanceof Et)return n;if(typeof n=="string"){const d=t.parseColor(n);if(d)return d}else if(Array.isArray(n)&&(a=n.length<3||n.length>4?`Invalid rgba value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:Yu(n[0],n[1],n[2],n[3]),!a))return new Et(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new oi(a||`Could not parse color from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"padding":{let n;for(const a of this.args){n=a.evaluate(t);const c=Wi.parse(n);if(c)return c}throw new oi(`Could not parse padding from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"variableAnchorOffsetCollection":{let n;for(const a of this.args){n=a.evaluate(t);const c=lr.parse(n);if(c)return c}throw new oi(`Could not parse variableAnchorOffsetCollection from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"number":{let n=null;for(const a of this.args){if(n=a.evaluate(t),n===null)return 0;const c=Number(n);if(!isNaN(c))return c}throw new oi(`Could not convert ${JSON.stringify(n)} to number.`)}case"formatted":return or.fromString(Ka(this.args[0].evaluate(t)));case"resolvedImage":return gr.fromString(Ka(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return Ka(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Dt=["Unknown","Point","LineString","Polygon"];class ft{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Dt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let n=this._parseColorCache[t];return n||(n=this._parseColorCache[t]=Et.parse(t)),n}}class Ya{constructor(t,n,a=[],c,d=new ot,p=[]){this.registry=t,this.path=a,this.key=a.map(g=>`[${g}]`).join(""),this.scope=d,this.errors=p,this.expectedType=c,this._isConstant=n}parse(t,n,a,c,d={}){return n?this.concat(n,a,c)._parse(t,d):this._parse(t,d)}_parse(t,n){function a(c,d,p){return p==="assert"?new _r(d,[c]):p==="coerce"?new cn(d,[c]):c}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const c=t[0];if(typeof c!="string")return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const d=this.registry[c];if(d){let p=d.parse(t,this);if(!p)return null;if(this.expectedType){const g=this.expectedType,x=p.type;if(g.kind!=="string"&&g.kind!=="number"&&g.kind!=="boolean"&&g.kind!=="object"&&g.kind!=="array"||x.kind!=="value")if(g.kind!=="projectionDefinition"||x.kind!=="string"&&x.kind!=="array")if(g.kind!=="color"&&g.kind!=="formatted"&&g.kind!=="resolvedImage"||x.kind!=="value"&&x.kind!=="string")if(g.kind!=="padding"||x.kind!=="value"&&x.kind!=="number"&&x.kind!=="array")if(g.kind!=="variableAnchorOffsetCollection"||x.kind!=="value"&&x.kind!=="array"){if(this.checkSubtype(g,x))return null}else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"assert")}if(!(p instanceof Xn)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const g=new ft;try{p=new Xn(p.type,p.evaluate(g))}catch(x){return this.error(x.message),null}}return p}return this.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,n,a){const c=typeof t=="number"?this.path.concat(t):this.path,d=a?this.scope.concat(a):this.scope;return new Ya(this.registry,this._isConstant,c,n||null,d,this.errors)}error(t,...n){const a=`${this.key}${n.map(c=>`[${c}]`).join("")}`;this.errors.push(new et(a,t))}checkSubtype(t,n){const a=Ga(t,n);return a&&this.error(a),a}}class Ct{constructor(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const n of this.bindings)t(n[1]);t(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let d=1;d<t.length-1;d+=2){const p=t[d];if(typeof p!="string")return n.error(`Expected string, but found ${typeof p} instead.`,d);if(/[^a-zA-Z0-9_]/.test(p))return n.error("Variable names must contain only alphanumeric characters or '_'.",d);const g=n.parse(t[d+1],d+1);if(!g)return null;a.push([p,g])}const c=n.parse(t[t.length-1],t.length-1,n.expectedType,a);return c?new Ct(a,c):null}outputDefined(){return this.result.outputDefined()}}class Ja{constructor(t,n){this.type=n.type,this.name=t,this.boundExpression=n}static parse(t,n){if(t.length!==2||typeof t[1]!="string")return n.error("'var' expression requires exactly one string literal argument.");const a=t[1];return n.scope.has(a)?new Ja(a,n.scope.get(a)):n.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Yr{constructor(t,n,a){this.type=t,this.index=n,this.input=a}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,ze),c=n.parse(t[2],2,mr(n.expectedType||at));return a&&c?new Yr(c.type.itemType,a,c):null}evaluate(t){const n=this.index.evaluate(t),a=this.input.evaluate(t);if(n<0)throw new oi(`Array index out of bounds: ${n} < 0.`);if(n>=a.length)throw new oi(`Array index out of bounds: ${n} > ${a.length-1}.`);if(n!==Math.floor(n))throw new oi(`Array index must be an integer, but found ${n} instead.`);return a[n]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Fs{constructor(t,n){this.type=Ne,this.needle=t,this.haystack=n}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,at),c=n.parse(t[2],2,at);return a&&c?Hl(a.type,[Ne,We,ze,kt,at])?new Fs(a,c):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${hi(a.type)} instead`):null}evaluate(t){const n=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!a)return!1;if(!qn(n,["boolean","string","number","null"]))throw new oi(`Expected first argument to be of type boolean, string, number or null, but found ${hi(li(n))} instead.`);if(!qn(a,["string","array"]))throw new oi(`Expected second argument to be of type array or string, but found ${hi(li(a))} instead.`);return a.indexOf(n)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Bs{constructor(t,n,a){this.type=ze,this.needle=t,this.haystack=n,this.fromIndex=a}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,at),c=n.parse(t[2],2,at);if(!a||!c)return null;if(!Hl(a.type,[Ne,We,ze,kt,at]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${hi(a.type)} instead`);if(t.length===4){const d=n.parse(t[3],3,ze);return d?new Bs(a,c,d):null}return new Bs(a,c)}evaluate(t){const n=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!qn(n,["boolean","string","number","null"]))throw new oi(`Expected first argument to be of type boolean, string, number or null, but found ${hi(li(n))} instead.`);let c;if(this.fromIndex&&(c=this.fromIndex.evaluate(t)),qn(a,["string"])){const d=a.indexOf(n,c);return d===-1?-1:[...a.slice(0,d)].length}if(qn(a,["array"]))return a.indexOf(n,c);throw new oi(`Expected second argument to be of type array or string, but found ${hi(li(a))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Ao{constructor(t,n,a,c,d,p){this.inputType=t,this.type=n,this.input=a,this.cases=c,this.outputs=d,this.otherwise=p}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error("Expected an even number of arguments.");let a,c;n.expectedType&&n.expectedType.kind!=="value"&&(c=n.expectedType);const d={},p=[];for(let w=2;w<t.length-1;w+=2){let P=t[w];const M=t[w+1];Array.isArray(P)||(P=[P]);const z=n.concat(w);if(P.length===0)return z.error("Expected at least one branch label.");for(const B of P){if(typeof B!="number"&&typeof B!="string")return z.error("Branch labels must be numbers or strings.");if(typeof B=="number"&&Math.abs(B)>Number.MAX_SAFE_INTEGER)return z.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof B=="number"&&Math.floor(B)!==B)return z.error("Numeric branch labels must be integer values.");if(a){if(z.checkSubtype(a,li(B)))return null}else a=li(B);if(d[String(B)]!==void 0)return z.error("Branch labels must be unique.");d[String(B)]=p.length}const L=n.parse(M,w,c);if(!L)return null;c=c||L.type,p.push(L)}const g=n.parse(t[1],1,at);if(!g)return null;const x=n.parse(t[t.length-1],t.length-1,c);return x?g.type.kind!=="value"&&n.concat(1).checkSubtype(a,g.type)?null:new Ao(a,c,g,d,p,x):null}evaluate(t){const n=this.input.evaluate(t);return(li(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Os{constructor(t,n,a){this.type=t,this.branches=n,this.otherwise=a}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error("Expected an odd number of arguments.");let a;n.expectedType&&n.expectedType.kind!=="value"&&(a=n.expectedType);const c=[];for(let p=1;p<t.length-1;p+=2){const g=n.parse(t[p],p,Ne);if(!g)return null;const x=n.parse(t[p+1],p+1,a);if(!x)return null;c.push([g,x]),a=a||x.type}const d=n.parse(t[t.length-1],t.length-1,a);if(!d)return null;if(!a)throw new Error("Can't infer output type");return new Os(a,c,d)}evaluate(t){for(const[n,a]of this.branches)if(n.evaluate(t))return a.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[n,a]of this.branches)t(n),t(a);t(this.otherwise)}outputDefined(){return this.branches.every(([t,n])=>n.outputDefined())&&this.otherwise.outputDefined()}}class js{constructor(t,n,a,c){this.type=t,this.input=n,this.beginIndex=a,this.endIndex=c}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,at),c=n.parse(t[2],2,ze);if(!a||!c)return null;if(!Hl(a.type,[mr(at),We,at]))return n.error(`Expected first argument to be of type array or string, but found ${hi(a.type)} instead`);if(t.length===4){const d=n.parse(t[3],3,ze);return d?new js(a.type,a,c,d):null}return new js(a.type,a,c)}evaluate(t){const n=this.input.evaluate(t),a=this.beginIndex.evaluate(t);let c;if(this.endIndex&&(c=this.endIndex.evaluate(t)),qn(n,["string"]))return[...n].slice(a,c).join("");if(qn(n,["array"]))return n.slice(a,c);throw new oi(`Expected first argument to be of type array or string, but found ${hi(li(n))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function zo(r,t){const n=r.length-1;let a,c,d=0,p=n,g=0;for(;d<=p;)if(g=Math.floor((d+p)/2),a=r[g],c=r[g+1],a<=t){if(g===n||t<c)return g;d=g+1}else{if(!(a>t))throw new oi("Input is not a number.");p=g-1}return 0}class Qa{constructor(t,n,a){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(const[c,d]of a)this.labels.push(c),this.outputs.push(d)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");const a=n.parse(t[1],1,ze);if(!a)return null;const c=[];let d=null;n.expectedType&&n.expectedType.kind!=="value"&&(d=n.expectedType);for(let p=1;p<t.length;p+=2){const g=p===1?-1/0:t[p],x=t[p+1],w=p,P=p+1;if(typeof g!="number")return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',w);if(c.length&&c[c.length-1][0]>=g)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',w);const M=n.parse(x,P,d);if(!M)return null;d=d||M.type,c.push([g,M])}return new Qa(d,a,c)}evaluate(t){const n=this.labels,a=this.outputs;if(n.length===1)return a[0].evaluate(t);const c=this.input.evaluate(t);if(c<=n[0])return a[0].evaluate(t);const d=n.length;return c>=n[d-1]?a[d-1].evaluate(t):a[zo(n,c)].evaluate(t)}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ju(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ga,Hi,Ro=function(){if(Hi)return ga;function r(t,n,a,c){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(c-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=a,this.p2y=c}return Hi=1,ga=r,r.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(n===void 0&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,c=0;c<8;c++){var d=this.sampleCurveX(a)-t;if(Math.abs(d)<n)return a;var p=this.sampleCurveDerivativeX(a);if(Math.abs(p)<1e-6)break;a-=d/p}var g=0,x=1;for(a=t,c=0;c<20&&(d=this.sampleCurveX(a),!(Math.abs(d-t)<n));c++)t>d?g=a:x=a,a=.5*(x-g)+g;return a},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},ga}(),Qu=Ju(Ro);class Qi{constructor(t,n,a,c,d){this.type=t,this.operator=n,this.interpolation=a,this.input=c,this.labels=[],this.outputs=[];for(const[p,g]of d)this.labels.push(p),this.outputs.push(g)}static interpolationFactor(t,n,a,c){let d=0;if(t.name==="exponential")d=Ai(n,t.base,a,c);else if(t.name==="linear")d=Ai(n,1,a,c);else if(t.name==="cubic-bezier"){const p=t.controlPoints;d=new Qu(p[0],p[1],p[2],p[3]).solve(Ai(n,1,a,c))}return d}static parse(t,n){let[a,c,d,...p]=t;if(!Array.isArray(c)||c.length===0)return n.error("Expected an interpolation type expression.",1);if(c[0]==="linear")c={name:"linear"};else if(c[0]==="exponential"){const w=c[1];if(typeof w!="number")return n.error("Exponential interpolation requires a numeric base.",1,1);c={name:"exponential",base:w}}else{if(c[0]!=="cubic-bezier")return n.error(`Unknown interpolation type ${String(c[0])}`,1,0);{const w=c.slice(1);if(w.length!==4||w.some(P=>typeof P!="number"||P<0||P>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:w}}}if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(d=n.parse(d,2,ze),!d)return null;const g=[];let x=null;a==="interpolate-hcl"||a==="interpolate-lab"?x=ht:n.expectedType&&n.expectedType.kind!=="value"&&(x=n.expectedType);for(let w=0;w<p.length;w+=2){const P=p[w],M=p[w+1],z=w+3,L=w+4;if(typeof P!="number")return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(g.length&&g[g.length-1][0]>=P)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);const B=n.parse(M,L,x);if(!B)return null;x=x||B.type,g.push([P,B])}return qa(x,ze)||qa(x,mi)||qa(x,ht)||qa(x,Co)||qa(x,Gn)||qa(x,mr(ze))?new Qi(x,a,c,d,g):n.error(`Type ${hi(x)} is not interpolatable.`)}evaluate(t){const n=this.labels,a=this.outputs;if(n.length===1)return a[0].evaluate(t);const c=this.input.evaluate(t);if(c<=n[0])return a[0].evaluate(t);const d=n.length;if(c>=n[d-1])return a[d-1].evaluate(t);const p=zo(n,c),g=Qi.interpolationFactor(this.interpolation,c,n[p],n[p+1]),x=a[p].evaluate(t),w=a[p+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return In(x,w,g);case"color":return Et.interpolate(x,w,g);case"padding":return Wi.interpolate(x,w,g);case"variableAnchorOffsetCollection":return lr.interpolate(x,w,g);case"array":return Ha(x,w,g);case"projectionDefinition":return Fi.interpolate(x,w,g)}case"interpolate-hcl":return Et.interpolate(x,w,g,"hcl");case"interpolate-lab":return Et.interpolate(x,w,g,"lab")}}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ai(r,t,n,a){const c=a-n,d=r-n;return c===0?0:t===1?d/c:(Math.pow(t,d)-1)/(Math.pow(t,c)-1)}const Jr={color:Et.interpolate,number:In,padding:Wi.interpolate,variableAnchorOffsetCollection:lr.interpolate,array:Ha};class es{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let a=null;const c=n.expectedType;c&&c.kind!=="value"&&(a=c);const d=[];for(const g of t.slice(1)){const x=n.parse(g,1+d.length,a,void 0,{typeAnnotation:"omit"});if(!x)return null;a=a||x.type,d.push(x)}if(!a)throw new Error("No output type");const p=c&&d.some(g=>Ga(c,g.type));return new es(p?at:a,d)}evaluate(t){let n,a=null,c=0;for(const d of this.args)if(c++,a=d.evaluate(t),a&&a instanceof gr&&!a.available&&(n||(n=a.name),a=null,c===this.args.length&&(a=n)),a!==null)break;return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Yl(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function eh(r,t,n,a){return a.compare(t,n)===0}function Cn(r,t,n){const a=r!=="=="&&r!=="!=";return class Kg{constructor(d,p,g){this.type=Ne,this.lhs=d,this.rhs=p,this.collator=g,this.hasUntypedArgument=d.type.kind==="value"||p.type.kind==="value"}static parse(d,p){if(d.length!==3&&d.length!==4)return p.error("Expected two or three arguments.");const g=d[0];let x=p.parse(d[1],1,at);if(!x)return null;if(!Yl(g,x.type))return p.concat(1).error(`"${g}" comparisons are not supported for type '${hi(x.type)}'.`);let w=p.parse(d[2],2,at);if(!w)return null;if(!Yl(g,w.type))return p.concat(2).error(`"${g}" comparisons are not supported for type '${hi(w.type)}'.`);if(x.type.kind!==w.type.kind&&x.type.kind!=="value"&&w.type.kind!=="value")return p.error(`Cannot compare types '${hi(x.type)}' and '${hi(w.type)}'.`);a&&(x.type.kind==="value"&&w.type.kind!=="value"?x=new _r(w.type,[x]):x.type.kind!=="value"&&w.type.kind==="value"&&(w=new _r(x.type,[w])));let P=null;if(d.length===4){if(x.type.kind!=="string"&&w.type.kind!=="string"&&x.type.kind!=="value"&&w.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(P=p.parse(d[3],3,Li),!P)return null}return new Kg(x,w,P)}evaluate(d){const p=this.lhs.evaluate(d),g=this.rhs.evaluate(d);if(a&&this.hasUntypedArgument){const x=li(p),w=li(g);if(x.kind!==w.kind||x.kind!=="string"&&x.kind!=="number")throw new oi(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${x.kind}, ${w.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const x=li(p),w=li(g);if(x.kind!=="string"||w.kind!=="string")return t(d,p,g)}return this.collator?n(d,p,g,this.collator.evaluate(d)):t(d,p,g)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}const Jl=Cn("==",function(r,t,n){return t===n},eh),Ld=Cn("!=",function(r,t,n){return t!==n},function(r,t,n,a){return!eh(0,t,n,a)}),Do=Cn("<",function(r,t,n){return t<n},function(r,t,n,a){return a.compare(t,n)<0}),Lo=Cn(">",function(r,t,n){return t>n},function(r,t,n,a){return a.compare(t,n)>0}),Qr=Cn("<=",function(r,t,n){return t<=n},function(r,t,n,a){return a.compare(t,n)<=0}),th=Cn(">=",function(r,t,n){return t>=n},function(r,t,n,a){return a.compare(t,n)>=0});class _a{constructor(t,n,a){this.type=Li,this.locale=a,this.caseSensitive=t,this.diacriticSensitive=n}static parse(t,n){if(t.length!==2)return n.error("Expected one argument.");const a=t[1];if(typeof a!="object"||Array.isArray(a))return n.error("Collator options argument must be an object.");const c=n.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Ne);if(!c)return null;const d=n.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Ne);if(!d)return null;let p=null;return a.locale&&(p=n.parse(a.locale,1,We),!p)?null:new _a(c,d,p)}evaluate(t){return new Nr(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Ql{constructor(t,n,a,c,d){this.type=We,this.number=t,this.locale=n,this.currency=a,this.minFractionDigits=c,this.maxFractionDigits=d}static parse(t,n){if(t.length!==3)return n.error("Expected two arguments.");const a=n.parse(t[1],1,ze);if(!a)return null;const c=t[2];if(typeof c!="object"||Array.isArray(c))return n.error("NumberFormat options argument must be an object.");let d=null;if(c.locale&&(d=n.parse(c.locale,1,We),!d))return null;let p=null;if(c.currency&&(p=n.parse(c.currency,1,We),!p))return null;let g=null;if(c["min-fraction-digits"]&&(g=n.parse(c["min-fraction-digits"],1,ze),!g))return null;let x=null;return c["max-fraction-digits"]&&(x=n.parse(c["max-fraction-digits"],1,ze),!x)?null:new Ql(a,d,p,g,x)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class ts{constructor(t){this.type=Qt,this.sections=t}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return n.error("First argument must be an image or text section.");const c=[];let d=!1;for(let p=1;p<=t.length-1;++p){const g=t[p];if(d&&typeof g=="object"&&!Array.isArray(g)){d=!1;let x=null;if(g["font-scale"]&&(x=n.parse(g["font-scale"],1,ze),!x))return null;let w=null;if(g["text-font"]&&(w=n.parse(g["text-font"],1,mr(We)),!w))return null;let P=null;if(g["text-color"]&&(P=n.parse(g["text-color"],1,ht),!P))return null;let M=null;if(g["vertical-align"]){if(typeof g["vertical-align"]=="string"&&!Ds.includes(g["vertical-align"]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${g["vertical-align"]}' instead.`);if(M=n.parse(g["vertical-align"],1,We),!M)return null}const z=c[c.length-1];z.scale=x,z.font=w,z.textColor=P,z.verticalAlign=M}else{const x=n.parse(t[p],1,at);if(!x)return null;const w=x.type.kind;if(w!=="string"&&w!=="value"&&w!=="null"&&w!=="resolvedImage")return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,c.push({content:x,scale:null,font:null,textColor:null,verticalAlign:null})}}return new ts(c)}evaluate(t){return new or(this.sections.map(n=>{const a=n.content.evaluate(t);return li(a)===$a?new Xa("",a,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(t):null):new Xa(Ka(a),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null,n.verticalAlign?n.verticalAlign.evaluate(t):null)}))}eachChild(t){for(const n of this.sections)t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor),n.verticalAlign&&t(n.verticalAlign)}outputDefined(){return!1}}class ec{constructor(t){this.type=$a,this.input=t}static parse(t,n){if(t.length!==2)return n.error("Expected two arguments.");const a=n.parse(t[1],1,We);return a?new ec(a):n.error("No image name provided.")}evaluate(t){const n=this.input.evaluate(t),a=gr.fromString(n);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(n)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}}class tc{constructor(t){this.type=ze,this.input=t}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=n.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?n.error(`Expected argument of type string or array, but found ${hi(a.type)} instead.`):new tc(a):null}evaluate(t){const n=this.input.evaluate(t);if(typeof n=="string")return[...n].length;if(Array.isArray(n))return n.length;throw new oi(`Expected value to be of type string or array, but found ${hi(li(n))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const un=8192;function Fd(r,t){const n=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,c=Math.pow(2,t.z);return[Math.round(n*c*un),Math.round(a*c*un)]}function is(r,t){const n=Math.pow(2,t.z);return[(c=(r[0]/un+t.x)/n,360*c-180),(a=(r[1]/un+t.y)/n,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,c}function Ns(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}function rs(r,t){return!(r[0]<=t[0]||r[2]>=t[2]||r[1]<=t[1]||r[3]>=t[3])}function ih(r,t,n){const a=r[0]-t[0],c=r[1]-t[1],d=r[0]-n[0],p=r[1]-n[1];return a*p-d*c==0&&a*d<=0&&c*p<=0}function Fo(r,t,n,a){return(c=[a[0]-n[0],a[1]-n[1]])[0]*(d=[t[0]-r[0],t[1]-r[1]])[1]-c[1]*d[0]!=0&&!(!ah(r,t,n,a)||!ah(n,a,r,t));var c,d}function rh(r,t,n){for(const a of n)for(let c=0;c<a.length-1;++c)if(Fo(r,t,a[c],a[c+1]))return!0;return!1}function ns(r,t,n=!1){let a=!1;for(const g of t)for(let x=0;x<g.length-1;x++){if(ih(r,g[x],g[x+1]))return n;(d=g[x])[1]>(c=r)[1]!=(p=g[x+1])[1]>c[1]&&c[0]<(p[0]-d[0])*(c[1]-d[1])/(p[1]-d[1])+d[0]&&(a=!a)}var c,d,p;return a}function Bd(r,t){for(const n of t)if(ns(r,n))return!0;return!1}function nh(r,t){for(const n of r)if(!ns(n,t))return!1;for(let n=0;n<r.length-1;++n)if(rh(r[n],r[n+1],t))return!1;return!0}function Od(r,t){for(const n of t)if(nh(r,n))return!0;return!1}function ah(r,t,n,a){const c=a[0]-n[0],d=a[1]-n[1],p=(r[0]-n[0])*d-c*(r[1]-n[1]),g=(t[0]-n[0])*d-c*(t[1]-n[1]);return p>0&&g<0||p<0&&g>0}function Bo(r,t,n){const a=[];for(let c=0;c<r.length;c++){const d=[];for(let p=0;p<r[c].length;p++){const g=Fd(r[c][p],n);Ns(t,g),d.push(g)}a.push(d)}return a}function ic(r,t,n){const a=[];for(let c=0;c<r.length;c++){const d=Bo(r[c],t,n);a.push(d)}return a}function rc(r,t,n,a){if(r[0]<n[0]||r[0]>n[2]){const c=.5*a;let d=r[0]-n[0]>c?-a:n[0]-r[0]>c?a:0;d===0&&(d=r[0]-n[2]>c?-a:n[2]-r[0]>c?a:0),r[0]+=d}Ns(t,r)}function sh(r,t,n,a){const c=Math.pow(2,a.z)*un,d=[a.x*un,a.y*un],p=[];for(const g of r)for(const x of g){const w=[x.x+d[0],x.y+d[1]];rc(w,t,n,c),p.push(w)}return p}function oh(r,t,n,a){const c=Math.pow(2,a.z)*un,d=[a.x*un,a.y*un],p=[];for(const x of r){const w=[];for(const P of x){const M=[P.x+d[0],P.y+d[1]];Ns(t,M),w.push(M)}p.push(w)}if(t[2]-t[0]<=c/2){(g=t)[0]=g[1]=1/0,g[2]=g[3]=-1/0;for(const x of p)for(const w of x)rc(w,t,n,c)}var g;return p}class ya{constructor(t,n){this.type=Ne,this.geojson=t,this.geometries=n}static parse(t,n){if(t.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hn(t[1])){const a=t[1];if(a.type==="FeatureCollection"){const c=[];for(const d of a.features){const{type:p,coordinates:g}=d.geometry;p==="Polygon"&&c.push(g),p==="MultiPolygon"&&c.push(...g)}if(c.length)return new ya(a,{type:"MultiPolygon",coordinates:c})}else if(a.type==="Feature"){const c=a.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new ya(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new ya(a,a)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(n,a){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=n.canonicalID();if(a.type==="Polygon"){const g=Bo(a.coordinates,d,p),x=sh(n.geometry(),c,d,p);if(!rs(c,d))return!1;for(const w of x)if(!ns(w,g))return!1}if(a.type==="MultiPolygon"){const g=ic(a.coordinates,d,p),x=sh(n.geometry(),c,d,p);if(!rs(c,d))return!1;for(const w of x)if(!Bd(w,g))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(n,a){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=n.canonicalID();if(a.type==="Polygon"){const g=Bo(a.coordinates,d,p),x=oh(n.geometry(),c,d,p);if(!rs(c,d))return!1;for(const w of x)if(!nh(w,g))return!1}if(a.type==="MultiPolygon"){const g=ic(a.coordinates,d,p),x=oh(n.geometry(),c,d,p);if(!rs(c,d))return!1;for(const w of x)if(!Od(w,g))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Oo=class{constructor(r=[],t=(n,a)=>n<a?-1:n>a?1:0){if(this.data=r,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:t,compare:n}=this,a=t[r];for(;r>0;){const c=r-1>>1,d=t[c];if(n(a,d)>=0)break;t[r]=d,r=c}t[r]=a}_down(r){const{data:t,compare:n}=this,a=this.length>>1,c=t[r];for(;r<a;){let d=1+(r<<1);const p=d+1;if(p<this.length&&n(t[p],t[d])<0&&(d=p),n(t[d],c)>=0)break;t[r]=t[d],r=d}t[r]=c}};function lh(r,t,n=0,a=r.length-1,c=jd){for(;a>n;){if(a-n>600){const x=a-n+1,w=t-n+1,P=Math.log(x),M=.5*Math.exp(2*P/3),z=.5*Math.sqrt(P*M*(x-M)/x)*(w-x/2<0?-1:1);lh(r,t,Math.max(n,Math.floor(t-w*M/x+z)),Math.min(a,Math.floor(t+(x-w)*M/x+z)),c)}const d=r[t];let p=n,g=a;for(Zs(r,n,t),c(r[a],d)>0&&Zs(r,n,a);p<g;){for(Zs(r,p,g),p++,g--;c(r[p],d)<0;)p++;for(;c(r[g],d)>0;)g--}c(r[n],d)===0?Zs(r,n,g):(g++,Zs(r,g,a)),g<=t&&(n=g+1),t<=g&&(a=g-1)}}function Zs(r,t,n){const a=r[t];r[t]=r[n],r[n]=a}function jd(r,t){return r<t?-1:r>t?1:0}function Vs(r,t){if(r.length<=1)return[r];const n=[];let a,c;for(const d of r){const p=Nd(d);p!==0&&(d.area=Math.abs(p),c===void 0&&(c=p<0),c===p<0?(a&&n.push(a),a=[d]):a.push(d))}if(a&&n.push(a),t>1)for(let d=0;d<n.length;d++)n[d].length<=t||(lh(n[d],t,1,n[d].length-1,ch),n[d]=n[d].slice(0,t));return n}function ch(r,t){return t.area-r.area}function Nd(r){let t=0;for(let n,a,c=0,d=r.length,p=d-1;c<d;p=c++)n=r[c],a=r[p],t+=(a.x-n.x)*(n.y+a.y);return t}const uh=1/298.257223563,nc=uh*(2-uh),ac=Math.PI/180;class sc{constructor(t){const n=6378.137*ac*1e3,a=Math.cos(t*ac),c=1/(1-nc*(1-a*a)),d=Math.sqrt(c);this.kx=n*d*a,this.ky=n*d*c*(1-nc)}distance(t,n){const a=this.wrap(t[0]-n[0])*this.kx,c=(t[1]-n[1])*this.ky;return Math.sqrt(a*a+c*c)}pointOnLine(t,n){let a,c,d,p,g=1/0;for(let x=0;x<t.length-1;x++){let w=t[x][0],P=t[x][1],M=this.wrap(t[x+1][0]-w)*this.kx,z=(t[x+1][1]-P)*this.ky,L=0;M===0&&z===0||(L=(this.wrap(n[0]-w)*this.kx*M+(n[1]-P)*this.ky*z)/(M*M+z*z),L>1?(w=t[x+1][0],P=t[x+1][1]):L>0&&(w+=M/this.kx*L,P+=z/this.ky*L)),M=this.wrap(n[0]-w)*this.kx,z=(n[1]-P)*this.ky;const B=M*M+z*z;B<g&&(g=B,a=w,c=P,d=x,p=L)}return{point:[a,c],index:d,t:Math.max(0,Math.min(1,p))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function hh(r,t){return t[0]-r[0]}function jo(r){return r[1]-r[0]+1}function hn(r,t){return r[1]>=r[0]&&r[1]<t}function oc(r,t){if(r[0]>r[1])return[null,null];const n=jo(r);if(t){if(n===2)return[r,null];const c=Math.floor(n/2);return[[r[0],r[0]+c],[r[0]+c,r[1]]]}if(n===1)return[r,null];const a=Math.floor(n/2)-1;return[[r[0],r[0]+a],[r[0]+a+1,r[1]]]}function lc(r,t){if(!hn(t,r.length))return[1/0,1/0,-1/0,-1/0];const n=[1/0,1/0,-1/0,-1/0];for(let a=t[0];a<=t[1];++a)Ns(n,r[a]);return n}function cc(r){const t=[1/0,1/0,-1/0,-1/0];for(const n of r)for(const a of n)Ns(t,a);return t}function dh(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function Lt(r,t,n){if(!dh(r)||!dh(t))return NaN;let a=0,c=0;return r[2]<t[0]&&(a=t[0]-r[2]),r[0]>t[2]&&(a=r[0]-t[2]),r[1]>t[3]&&(c=r[1]-t[3]),r[3]<t[1]&&(c=t[1]-r[3]),n.distance([0,0],[a,c])}function xa(r,t,n){const a=n.pointOnLine(t,r);return n.distance(r,a.point)}function uc(r,t,n,a,c){const d=Math.min(xa(r,[n,a],c),xa(t,[n,a],c)),p=Math.min(xa(n,[r,t],c),xa(a,[r,t],c));return Math.min(d,p)}function Zd(r,t,n,a,c){if(!hn(t,r.length)||!hn(a,n.length))return 1/0;let d=1/0;for(let p=t[0];p<t[1];++p){const g=r[p],x=r[p+1];for(let w=a[0];w<a[1];++w){const P=n[w],M=n[w+1];if(Fo(g,x,P,M))return 0;d=Math.min(d,uc(g,x,P,M,c))}}return d}function Vd(r,t,n,a,c){if(!hn(t,r.length)||!hn(a,n.length))return NaN;let d=1/0;for(let p=t[0];p<=t[1];++p)for(let g=a[0];g<=a[1];++g)if(d=Math.min(d,c.distance(r[p],n[g])),d===0)return d;return d}function Ud(r,t,n){if(ns(r,t,!0))return 0;let a=1/0;for(const c of t){const d=c[0],p=c[c.length-1];if(d!==p&&(a=Math.min(a,xa(r,[p,d],n)),a===0))return a;const g=n.pointOnLine(c,r);if(a=Math.min(a,n.distance(r,g.point)),a===0)return a}return a}function $d(r,t,n,a){if(!hn(t,r.length))return NaN;for(let d=t[0];d<=t[1];++d)if(ns(r[d],n,!0))return 0;let c=1/0;for(let d=t[0];d<t[1];++d){const p=r[d],g=r[d+1];for(const x of n)for(let w=0,P=x.length,M=P-1;w<P;M=w++){const z=x[M],L=x[w];if(Fo(p,g,z,L))return 0;c=Math.min(c,uc(p,g,z,L,a))}}return c}function ph(r,t){for(const n of r)for(const a of n)if(ns(a,t,!0))return!0;return!1}function Gd(r,t,n,a=1/0){const c=cc(r),d=cc(t);if(a!==1/0&&Lt(c,d,n)>=a)return a;if(rs(c,d)){if(ph(r,t))return 0}else if(ph(t,r))return 0;let p=1/0;for(const g of r)for(let x=0,w=g.length,P=w-1;x<w;P=x++){const M=g[P],z=g[x];for(const L of t)for(let B=0,j=L.length,$=j-1;B<j;$=B++){const H=L[$],ne=L[B];if(Fo(M,z,H,ne))return 0;p=Math.min(p,uc(M,z,H,ne,n))}}return p}function fh(r,t,n,a,c,d){if(!d)return;const p=Lt(lc(a,d),c,n);p<t&&r.push([p,d,[0,0]])}function No(r,t,n,a,c,d,p){if(!d||!p)return;const g=Lt(lc(a,d),lc(c,p),n);g<t&&r.push([g,d,p])}function Zo(r,t,n,a,c=1/0){let d=Math.min(a.distance(r[0],n[0][0]),c);if(d===0)return d;const p=new Oo([[0,[0,r.length-1],[0,0]]],hh),g=cc(n);for(;p.length>0;){const x=p.pop();if(x[0]>=d)continue;const w=x[1],P=t?50:100;if(jo(w)<=P){if(!hn(w,r.length))return NaN;if(t){const M=$d(r,w,n,a);if(isNaN(M)||M===0)return M;d=Math.min(d,M)}else for(let M=w[0];M<=w[1];++M){const z=Ud(r[M],n,a);if(d=Math.min(d,z),d===0)return 0}}else{const M=oc(w,t);fh(p,d,a,r,g,M[0]),fh(p,d,a,r,g,M[1])}}return d}function Vo(r,t,n,a,c,d=1/0){let p=Math.min(d,c.distance(r[0],n[0]));if(p===0)return p;const g=new Oo([[0,[0,r.length-1],[0,n.length-1]]],hh);for(;g.length>0;){const x=g.pop();if(x[0]>=p)continue;const w=x[1],P=x[2],M=t?50:100,z=a?50:100;if(jo(w)<=M&&jo(P)<=z){if(!hn(w,r.length)&&hn(P,n.length))return NaN;let L;if(t&&a)L=Zd(r,w,n,P,c),p=Math.min(p,L);else if(t&&!a){const B=r.slice(w[0],w[1]+1);for(let j=P[0];j<=P[1];++j)if(L=xa(n[j],B,c),p=Math.min(p,L),p===0)return p}else if(!t&&a){const B=n.slice(P[0],P[1]+1);for(let j=w[0];j<=w[1];++j)if(L=xa(r[j],B,c),p=Math.min(p,L),p===0)return p}else L=Vd(r,w,n,P,c),p=Math.min(p,L)}else{const L=oc(w,t),B=oc(P,a);No(g,p,c,r,n,L[0],B[0]),No(g,p,c,r,n,L[0],B[1]),No(g,p,c,r,n,L[1],B[0]),No(g,p,c,r,n,L[1],B[1])}}return p}function hc(r){return r.type==="MultiPolygon"?r.coordinates.map(t=>({type:"Polygon",coordinates:t})):r.type==="MultiLineString"?r.coordinates.map(t=>({type:"LineString",coordinates:t})):r.type==="MultiPoint"?r.coordinates.map(t=>({type:"Point",coordinates:t})):[r]}class va{constructor(t,n){this.type=ze,this.geojson=t,this.geometries=n}static parse(t,n){if(t.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hn(t[1])){const a=t[1];if(a.type==="FeatureCollection")return new va(a,a.features.map(c=>hc(c.geometry)).flat());if(a.type==="Feature")return new va(a,hc(a.geometry));if("type"in a&&"coordinates"in a)return new va(a,hc(a))}return n.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(n,a){const c=n.geometry(),d=c.flat().map(x=>is([x.x,x.y],n.canonical));if(c.length===0)return NaN;const p=new sc(d[0][1]);let g=1/0;for(const x of a){switch(x.type){case"Point":g=Math.min(g,Vo(d,!1,[x.coordinates],!1,p,g));break;case"LineString":g=Math.min(g,Vo(d,!1,x.coordinates,!0,p,g));break;case"Polygon":g=Math.min(g,Zo(d,!1,x.coordinates,p,g))}if(g===0)return g}return g}(t,this.geometries);if(t.geometryType()==="LineString")return function(n,a){const c=n.geometry(),d=c.flat().map(x=>is([x.x,x.y],n.canonical));if(c.length===0)return NaN;const p=new sc(d[0][1]);let g=1/0;for(const x of a){switch(x.type){case"Point":g=Math.min(g,Vo(d,!0,[x.coordinates],!1,p,g));break;case"LineString":g=Math.min(g,Vo(d,!0,x.coordinates,!0,p,g));break;case"Polygon":g=Math.min(g,Zo(d,!0,x.coordinates,p,g))}if(g===0)return g}return g}(t,this.geometries);if(t.geometryType()==="Polygon")return function(n,a){const c=n.geometry();if(c.length===0||c[0].length===0)return NaN;const d=Vs(c,0).map(x=>x.map(w=>w.map(P=>is([P.x,P.y],n.canonical)))),p=new sc(d[0][0][0][1]);let g=1/0;for(const x of a)for(const w of d){switch(x.type){case"Point":g=Math.min(g,Zo([x.coordinates],!1,w,p,g));break;case"LineString":g=Math.min(g,Zo(x.coordinates,!0,w,p,g));break;case"Polygon":g=Math.min(g,Gd(w,x.coordinates,p,g))}if(g===0)return g}return g}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const as={"==":Jl,"!=":Ld,">":Lo,"<":Do,">=":th,"<=":Qr,array:_r,at:Yr,boolean:_r,case:Os,coalesce:es,collator:_a,format:ts,image:ec,in:Fs,"index-of":Bs,interpolate:Qi,"interpolate-hcl":Qi,"interpolate-lab":Qi,length:tc,let:Ct,literal:Xn,match:Ao,number:_r,"number-format":Ql,object:_r,slice:js,step:Qa,string:_r,"to-boolean":cn,"to-color":cn,"to-number":cn,"to-string":cn,var:Ja,within:ya,distance:va};class Zr{constructor(t,n,a,c){this.name=t,this.type=n,this._evaluate=a,this.args=c}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,n){const a=t[0],c=Zr.definitions[a];if(!c)return n.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const d=Array.isArray(c)?c[0]:c.type,p=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,g=p.filter(([w])=>!Array.isArray(w)||w.length===t.length-1);let x=null;for(const[w,P]of g){x=new Ya(n.registry,Uo,n.path,null,n.scope);const M=[];let z=!1;for(let L=1;L<t.length;L++){const B=t[L],j=Array.isArray(w)?w[L-1]:w.type,$=x.parse(B,1+M.length,j);if(!$){z=!0;break}M.push($)}if(!z)if(Array.isArray(w)&&w.length!==M.length)x.error(`Expected ${w.length} arguments, but found ${M.length} instead.`);else{for(let L=0;L<M.length;L++){const B=Array.isArray(w)?w[L]:w.type,j=M[L];x.concat(L+1).checkSubtype(B,j.type)}if(x.errors.length===0)return new Zr(a,d,P,M)}}if(g.length===1)n.errors.push(...x.errors);else{const w=(g.length?g:p).map(([M])=>{return z=M,Array.isArray(z)?`(${z.map(hi).join(", ")})`:`(${hi(z.type)}...)`;var z}).join(" | "),P=[];for(let M=1;M<t.length;M++){const z=n.parse(t[M],1+P.length);if(!z)return null;P.push(hi(z.type))}n.error(`Expected arguments of type ${w}, but found (${P.join(", ")}) instead.`)}return null}static register(t,n){Zr.definitions=n;for(const a in n)t[a]=Zr}}function mh(r,[t,n,a,c]){t=t.evaluate(r),n=n.evaluate(r),a=a.evaluate(r);const d=c?c.evaluate(r):1,p=Yu(t,n,a,d);if(p)throw new oi(p);return new Et(t/255,n/255,a/255,d,!1)}function gh(r,t){return r in t}function dc(r,t){const n=t[r];return n===void 0?null:n}function ba(r){return{type:r}}function Uo(r){if(r instanceof Ja)return Uo(r.boundExpression);if(r instanceof Zr&&r.name==="error"||r instanceof _a||r instanceof ya||r instanceof va)return!1;const t=r instanceof cn||r instanceof _r;let n=!0;return r.eachChild(a=>{n=t?n&&Uo(a):n&&a instanceof Xn}),!!n&&$o(r)&&Go(r,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function $o(r){if(r instanceof Zr&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof ya||r instanceof va)return!1;let t=!0;return r.eachChild(n=>{t&&!$o(n)&&(t=!1)}),t}function Us(r){if(r instanceof Zr&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(n=>{t&&!Us(n)&&(t=!1)}),t}function Go(r,t){if(r instanceof Zr&&t.indexOf(r.name)>=0)return!1;let n=!0;return r.eachChild(a=>{n&&!Go(a,t)&&(n=!1)}),n}function _h(r){return{result:"success",value:r}}function ss(r){return{result:"error",value:r}}function os(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function yh(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function pc(r){return!!r.expression&&r.expression.interpolated}function zt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function qo(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function fc(r){return r}function xh(r,t){const n=t.type==="color",a=r.stops&&typeof r.stops[0][0]=="object",c=a||!(a||r.property!==void 0),d=r.type||(pc(t)?"exponential":"interval");if(n||t.type==="padding"){const P=n?Et.parse:Wi.parse;(r=lt({},r)).stops&&(r.stops=r.stops.map(M=>[M[0],P(M[1])])),r.default=P(r.default?r.default:t.default)}if(r.colorSpace&&(p=r.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var p;let g,x,w;if(d==="exponential")g=bh;else if(d==="interval")g=vh;else if(d==="categorical"){g=qd,x=Object.create(null);for(const P of r.stops)x[P[0]]=P[1];w=typeof r.stops[0][0]}else{if(d!=="identity")throw new Error(`Unknown function type "${d}"`);g=Wd}if(a){const P={},M=[];for(let B=0;B<r.stops.length;B++){const j=r.stops[B],$=j[0].zoom;P[$]===void 0&&(P[$]={zoom:$,type:r.type,property:r.property,default:r.default,stops:[]},M.push($)),P[$].stops.push([j[0].value,j[1]])}const z=[];for(const B of M)z.push([P[B].zoom,xh(P[B],t)]);const L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:Qi.interpolationFactor.bind(void 0,L),zoomStops:z.map(B=>B[0]),evaluate:({zoom:B},j)=>bh({stops:z,base:r.base},t,B).evaluate(B,j)}}if(c){const P=d==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:P,interpolationFactor:Qi.interpolationFactor.bind(void 0,P),zoomStops:r.stops.map(M=>M[0]),evaluate:({zoom:M})=>g(r,t,M,x,w)}}return{kind:"source",evaluate(P,M){const z=M&&M.properties?M.properties[r.property]:void 0;return z===void 0?$s(r.default,t.default):g(r,t,z,x,w)}}}function $s(r,t,n){return r!==void 0?r:t!==void 0?t:n!==void 0?n:void 0}function qd(r,t,n,a,c){return $s(typeof n===c?a[n]:void 0,r.default,t.default)}function vh(r,t,n){if(zt(n)!=="number")return $s(r.default,t.default);const a=r.stops.length;if(a===1||n<=r.stops[0][0])return r.stops[0][1];if(n>=r.stops[a-1][0])return r.stops[a-1][1];const c=zo(r.stops.map(d=>d[0]),n);return r.stops[c][1]}function bh(r,t,n){const a=r.base!==void 0?r.base:1;if(zt(n)!=="number")return $s(r.default,t.default);const c=r.stops.length;if(c===1||n<=r.stops[0][0])return r.stops[0][1];if(n>=r.stops[c-1][0])return r.stops[c-1][1];const d=zo(r.stops.map(P=>P[0]),n),p=function(P,M,z,L){const B=L-z,j=P-z;return B===0?0:M===1?j/B:(Math.pow(M,j)-1)/(Math.pow(M,B)-1)}(n,a,r.stops[d][0],r.stops[d+1][0]),g=r.stops[d][1],x=r.stops[d+1][1],w=Jr[t.type]||fc;return typeof g.evaluate=="function"?{evaluate(...P){const M=g.evaluate.apply(void 0,P),z=x.evaluate.apply(void 0,P);if(M!==void 0&&z!==void 0)return w(M,z,p,r.colorSpace)}}:w(g,x,p,r.colorSpace)}function Wd(r,t,n){switch(t.type){case"color":n=Et.parse(n);break;case"formatted":n=or.fromString(n.toString());break;case"resolvedImage":n=gr.fromString(n.toString());break;case"padding":n=Wi.parse(n);break;default:zt(n)===t.type||t.type==="enum"&&t.values[n]||(n=void 0)}return $s(n,r.default,t.default)}Zr.register(as,{error:[{kind:"error"},[We],(r,[t])=>{throw new oi(t.evaluate(r))}],typeof:[We,[at],(r,[t])=>hi(li(t.evaluate(r)))],"to-rgba":[mr(ze,4),[ht],(r,[t])=>{const[n,a,c,d]=t.evaluate(r).rgb;return[255*n,255*a,255*c,d]}],rgb:[ht,[ze,ze,ze],mh],rgba:[ht,[ze,ze,ze,ze],mh],has:{type:Ne,overloads:[[[We],(r,[t])=>gh(t.evaluate(r),r.properties())],[[We,Mn],(r,[t,n])=>gh(t.evaluate(r),n.evaluate(r))]]},get:{type:at,overloads:[[[We],(r,[t])=>dc(t.evaluate(r),r.properties())],[[We,Mn],(r,[t,n])=>dc(t.evaluate(r),n.evaluate(r))]]},"feature-state":[at,[We],(r,[t])=>dc(t.evaluate(r),r.featureState||{})],properties:[Mn,[],r=>r.properties()],"geometry-type":[We,[],r=>r.geometryType()],id:[at,[],r=>r.id()],zoom:[ze,[],r=>r.globals.zoom],"heatmap-density":[ze,[],r=>r.globals.heatmapDensity||0],"line-progress":[ze,[],r=>r.globals.lineProgress||0],accumulated:[at,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[ze,ba(ze),(r,t)=>{let n=0;for(const a of t)n+=a.evaluate(r);return n}],"*":[ze,ba(ze),(r,t)=>{let n=1;for(const a of t)n*=a.evaluate(r);return n}],"-":{type:ze,overloads:[[[ze,ze],(r,[t,n])=>t.evaluate(r)-n.evaluate(r)],[[ze],(r,[t])=>-t.evaluate(r)]]},"/":[ze,[ze,ze],(r,[t,n])=>t.evaluate(r)/n.evaluate(r)],"%":[ze,[ze,ze],(r,[t,n])=>t.evaluate(r)%n.evaluate(r)],ln2:[ze,[],()=>Math.LN2],pi:[ze,[],()=>Math.PI],e:[ze,[],()=>Math.E],"^":[ze,[ze,ze],(r,[t,n])=>Math.pow(t.evaluate(r),n.evaluate(r))],sqrt:[ze,[ze],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[ze,[ze],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[ze,[ze],(r,[t])=>Math.log(t.evaluate(r))],log2:[ze,[ze],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[ze,[ze],(r,[t])=>Math.sin(t.evaluate(r))],cos:[ze,[ze],(r,[t])=>Math.cos(t.evaluate(r))],tan:[ze,[ze],(r,[t])=>Math.tan(t.evaluate(r))],asin:[ze,[ze],(r,[t])=>Math.asin(t.evaluate(r))],acos:[ze,[ze],(r,[t])=>Math.acos(t.evaluate(r))],atan:[ze,[ze],(r,[t])=>Math.atan(t.evaluate(r))],min:[ze,ba(ze),(r,t)=>Math.min(...t.map(n=>n.evaluate(r)))],max:[ze,ba(ze),(r,t)=>Math.max(...t.map(n=>n.evaluate(r)))],abs:[ze,[ze],(r,[t])=>Math.abs(t.evaluate(r))],round:[ze,[ze],(r,[t])=>{const n=t.evaluate(r);return n<0?-Math.round(-n):Math.round(n)}],floor:[ze,[ze],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[ze,[ze],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[Ne,[We,at],(r,[t,n])=>r.properties()[t.value]===n.value],"filter-id-==":[Ne,[at],(r,[t])=>r.id()===t.value],"filter-type-==":[Ne,[We],(r,[t])=>r.geometryType()===t.value],"filter-<":[Ne,[We,at],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a<c}],"filter-id-<":[Ne,[at],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n<a}],"filter->":[Ne,[We,at],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a>c}],"filter-id->":[Ne,[at],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n>a}],"filter-<=":[Ne,[We,at],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a<=c}],"filter-id-<=":[Ne,[at],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n<=a}],"filter->=":[Ne,[We,at],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a>=c}],"filter-id->=":[Ne,[at],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n>=a}],"filter-has":[Ne,[at],(r,[t])=>t.value in r.properties()],"filter-has-id":[Ne,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ne,[mr(We)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ne,[mr(at)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[Ne,[We,mr(at)],(r,[t,n])=>n.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[Ne,[We,mr(at)],(r,[t,n])=>function(a,c,d,p){for(;d<=p;){const g=d+p>>1;if(c[g]===a)return!0;c[g]>a?p=g-1:d=g+1}return!1}(r.properties()[t.value],n.value,0,n.value.length-1)],all:{type:Ne,overloads:[[[Ne,Ne],(r,[t,n])=>t.evaluate(r)&&n.evaluate(r)],[ba(Ne),(r,t)=>{for(const n of t)if(!n.evaluate(r))return!1;return!0}]]},any:{type:Ne,overloads:[[[Ne,Ne],(r,[t,n])=>t.evaluate(r)||n.evaluate(r)],[ba(Ne),(r,t)=>{for(const n of t)if(n.evaluate(r))return!0;return!1}]]},"!":[Ne,[Ne],(r,[t])=>!t.evaluate(r)],"is-supported-script":[Ne,[We],(r,[t])=>{const n=r.globals&&r.globals.isSupportedScript;return!n||n(t.evaluate(r))}],upcase:[We,[We],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[We,[We],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[We,ba(at),(r,t)=>t.map(n=>Ka(n.evaluate(r))).join("")],"resolved-locale":[We,[Li],(r,[t])=>t.evaluate(r).resolvedLocale()]});class ls{constructor(t,n){var a;this.expression=t,this._warningHistory={},this._evaluator=new ft,this._defaultValue=n?(a=n).type==="color"&&qo(a.default)?new Et(0,0,0,0):a.type==="color"?Et.parse(a.default)||null:a.type==="padding"?Wi.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?lr.parse(a.default)||null:a.type==="projectionDefinition"?Fi.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=n&&n.type==="enum"?n.values:null}evaluateWithoutErrorHandling(t,n,a,c,d,p){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=a,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(t,n,a,c,d,p){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=a||null,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p||null;try{const g=this.expression.evaluate(this._evaluator);if(g==null||typeof g=="number"&&g!=g)return this._defaultValue;if(this._enumValues&&!(g in this._enumValues))throw new oi(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(g)} instead.`);return g}catch(g){return this._warningHistory[g.message]||(this._warningHistory[g.message]=!0,typeof console<"u"&&console.warn(g.message)),this._defaultValue}}}function Gs(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in as}function Wo(r,t){const n=new Ya(as,Uo,[],t?function(c){const d={color:ht,string:We,number:ze,enum:We,boolean:Ne,formatted:Qt,padding:Co,projectionDefinition:mi,resolvedImage:$a,variableAnchorOffsetCollection:Gn};return c.type==="array"?mr(d[c.value]||at,c.length):d[c.type]}(t):void 0),a=n.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?_h(new ls(a,t)):ss(n.errors)}class mc{constructor(t,n){this.kind=t,this._styleExpression=n,this.isStateDependent=t!=="constant"&&!Us(n.expression)}evaluateWithoutErrorHandling(t,n,a,c,d,p){return this._styleExpression.evaluateWithoutErrorHandling(t,n,a,c,d,p)}evaluate(t,n,a,c,d,p){return this._styleExpression.evaluate(t,n,a,c,d,p)}}class gc{constructor(t,n,a,c){this.kind=t,this.zoomStops=a,this._styleExpression=n,this.isStateDependent=t!=="camera"&&!Us(n.expression),this.interpolationType=c}evaluateWithoutErrorHandling(t,n,a,c,d,p){return this._styleExpression.evaluateWithoutErrorHandling(t,n,a,c,d,p)}evaluate(t,n,a,c,d,p){return this._styleExpression.evaluate(t,n,a,c,d,p)}interpolationFactor(t,n,a){return this.interpolationType?Qi.interpolationFactor(this.interpolationType,t,n,a):0}}function wh(r,t){const n=Wo(r,t);if(n.result==="error")return n;const a=n.value.expression,c=$o(a);if(!c&&!os(t))return ss([new et("","data expressions not supported")]);const d=Go(a,["zoom"]);if(!d&&!yh(t))return ss([new et("","zoom expressions not supported")]);const p=qs(a);return p||d?p instanceof et?ss([p]):p instanceof Qi&&!pc(t)?ss([new et("",'"interpolate" expressions cannot be used with this property')]):_h(p?new gc(c?"camera":"composite",n.value,p.labels,p instanceof Qi?p.interpolation:void 0):new mc(c?"constant":"source",n.value)):ss([new et("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ho{constructor(t,n){this._parameters=t,this._specification=n,lt(this,xh(this._parameters,this._specification))}static deserialize(t){return new Ho(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function qs(r){let t=null;if(r instanceof Ct)t=qs(r.result);else if(r instanceof es){for(const n of r.args)if(t=qs(n),t)break}else(r instanceof Qa||r instanceof Qi)&&r.input instanceof Zr&&r.input.name==="zoom"&&(t=r);return t instanceof et||r.eachChild(n=>{const a=qs(n);a instanceof et?t=a:!t&&a?t=new et("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new et("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function Xo(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!Xo(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Hd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function _c(r){if(r==null)return{filter:()=>!0,needGeometry:!1};Xo(r)||(r=Ws(r));const t=Wo(r,Hd);if(t.result==="error")throw new Error(t.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,c)=>t.value.evaluate(n,a,{},c),needGeometry:yc(r)}}function Th(r,t){return r<t?-1:r>t?1:0}function yc(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let t=1;t<r.length;t++)if(yc(r[t]))return!0;return!1}function Ws(r){if(!r)return!0;const t=r[0];return r.length<=1?t!=="any":t==="=="?Ko(r[1],r[2],"=="):t==="!="?cs(Ko(r[1],r[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Ko(r[1],r[2],t):t==="any"?(n=r.slice(1),["any"].concat(n.map(Ws))):t==="all"?["all"].concat(r.slice(1).map(Ws)):t==="none"?["all"].concat(r.slice(1).map(Ws).map(cs)):t==="in"?Yo(r[1],r.slice(2)):t==="!in"?cs(Yo(r[1],r.slice(2))):t==="has"?Jo(r[1]):t!=="!has"||cs(Jo(r[1]));var n}function Ko(r,t,n){switch(r){case"$type":return[`filter-type-${n}`,t];case"$id":return[`filter-id-${n}`,t];default:return[`filter-${n}`,r,t]}}function Yo(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(n=>typeof n!=typeof t[0])?["filter-in-large",r,["literal",t.sort(Th)]]:["filter-in-small",r,["literal",t]]}}function Jo(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function cs(r){return["!",r]}function us(r){const t=typeof r;if(t==="number"||t==="boolean"||t==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let c="[";for(const d of r)c+=`${us(d)},`;return`${c}]`}const n=Object.keys(r).sort();let a="{";for(let c=0;c<n.length;c++)a+=`${JSON.stringify(n[c])}:${us(r[n[c]])},`;return`${a}}`}function Xd(r){let t="";for(const n of Y)t+=`/${us(r[n])}`;return t}function Ph(r){const t=r.value;return t?[new be(r.key,t,"constants have been deprecated as of v8")]:[]}function wi(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function wa(r){if(Array.isArray(r))return r.map(wa);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const n in r)t[n]=wa(r[n]);return t}return wi(r)}function Vr(r){const t=r.key,n=r.value,a=r.valueSpec||{},c=r.objectElementValidators||{},d=r.style,p=r.styleSpec,g=r.validateSpec;let x=[];const w=zt(n);if(w!=="object")return[new be(t,n,`object expected, ${w} found`)];for(const P in n){const M=P.split(".")[0],z=a[M]||a["*"];let L;if(c[M])L=c[M];else if(a[M])L=g;else if(c["*"])L=c["*"];else{if(!a["*"]){x.push(new be(t,n[P],`unknown property "${P}"`));continue}L=g}x=x.concat(L({key:(t&&`${t}.`)+P,value:n[P],valueSpec:z,style:d,styleSpec:p,object:n,objectKey:P,validateSpec:g},n))}for(const P in a)c[P]||a[P].required&&a[P].default===void 0&&n[P]===void 0&&x.push(new be(t,n,`missing required property "${P}"`));return x}function xc(r){const t=r.value,n=r.valueSpec,a=r.style,c=r.styleSpec,d=r.key,p=r.arrayElementValidator||r.validateSpec;if(zt(t)!=="array")return[new be(d,t,`array expected, ${zt(t)} found`)];if(n.length&&t.length!==n.length)return[new be(d,t,`array length ${n.length} expected, length ${t.length} found`)];if(n["min-length"]&&t.length<n["min-length"])return[new be(d,t,`array length at least ${n["min-length"]} expected, length ${t.length} found`)];let g={type:n.value,values:n.values};c.$version<7&&(g.function=n.function),zt(n.value)==="object"&&(g=n.value);let x=[];for(let w=0;w<t.length;w++)x=x.concat(p({array:t,arrayIndex:w,value:t[w],valueSpec:g,validateSpec:r.validateSpec,style:a,styleSpec:c,key:`${d}[${w}]`}));return x}function Qo(r){const t=r.key,n=r.value,a=r.valueSpec;let c=zt(n);return c==="number"&&n!=n&&(c="NaN"),c!=="number"?[new be(t,n,`number expected, ${c} found`)]:"minimum"in a&&n<a.minimum?[new be(t,n,`${n} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&n>a.maximum?[new be(t,n,`${n} is greater than the maximum value ${a.maximum}`)]:[]}function vc(r){const t=r.valueSpec,n=wi(r.value.type);let a,c,d,p={};const g=n!=="categorical"&&r.value.property===void 0,x=!g,w=zt(r.value.stops)==="array"&&zt(r.value.stops[0])==="array"&&zt(r.value.stops[0][0])==="object",P=Vr({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(n==="identity")return[new be(L.key,L.value,'identity function may not have a "stops" property')];let B=[];const j=L.value;return B=B.concat(xc({key:L.key,value:j,valueSpec:L.valueSpec,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:M})),zt(j)==="array"&&j.length===0&&B.push(new be(L.key,j,"array must have at least one stop")),B},default:function(L){return L.validateSpec({key:L.key,value:L.value,valueSpec:t,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec})}}});return n==="identity"&&g&&P.push(new be(r.key,r.value,'missing required property "property"')),n==="identity"||r.value.stops||P.push(new be(r.key,r.value,'missing required property "stops"')),n==="exponential"&&r.valueSpec.expression&&!pc(r.valueSpec)&&P.push(new be(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(x&&!os(r.valueSpec)?P.push(new be(r.key,r.value,"property functions not supported")):g&&!yh(r.valueSpec)&&P.push(new be(r.key,r.value,"zoom functions not supported"))),n!=="categorical"&&!w||r.value.property!==void 0||P.push(new be(r.key,r.value,'"property" property is required')),P;function M(L){let B=[];const j=L.value,$=L.key;if(zt(j)!=="array")return[new be($,j,`array expected, ${zt(j)} found`)];if(j.length!==2)return[new be($,j,`array length 2 expected, length ${j.length} found`)];if(w){if(zt(j[0])!=="object")return[new be($,j,`object expected, ${zt(j[0])} found`)];if(j[0].zoom===void 0)return[new be($,j,"object stop key must have zoom")];if(j[0].value===void 0)return[new be($,j,"object stop key must have value")];if(d&&d>wi(j[0].zoom))return[new be($,j[0].zoom,"stop zoom values must appear in ascending order")];wi(j[0].zoom)!==d&&(d=wi(j[0].zoom),c=void 0,p={}),B=B.concat(Vr({key:`${$}[0]`,value:j[0],valueSpec:{zoom:{}},validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Qo,value:z}}))}else B=B.concat(z({key:`${$}[0]`,value:j[0],validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec},j));return Gs(wa(j[1]))?B.concat([new be(`${$}[1]`,j[1],"expressions are not allowed in function stops.")]):B.concat(L.validateSpec({key:`${$}[1]`,value:j[1],valueSpec:t,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec}))}function z(L,B){const j=zt(L.value),$=wi(L.value),H=L.value!==null?L.value:B;if(a){if(j!==a)return[new be(L.key,H,`${j} stop domain type must match previous stop domain type ${a}`)]}else a=j;if(j!=="number"&&j!=="string"&&j!=="boolean")return[new be(L.key,H,"stop domain value must be a number, string, or boolean")];if(j!=="number"&&n!=="categorical"){let ne=`number expected, ${j} found`;return os(t)&&n===void 0&&(ne+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new be(L.key,H,ne)]}return n!=="categorical"||j!=="number"||isFinite($)&&Math.floor($)===$?n!=="categorical"&&j==="number"&&c!==void 0&&$<c?[new be(L.key,H,"stop domain values must appear in ascending order")]:(c=$,n==="categorical"&&$ in p?[new be(L.key,H,"stop domain values must be unique")]:(p[$]=!0,[])):[new be(L.key,H,`integer expected, found ${$}`)]}}function kn(r){const t=(r.expressionContext==="property"?wh:Wo)(wa(r.value),r.valueSpec);if(t.result==="error")return t.value.map(a=>new be(`${r.key}${a.key}`,r.value,a.message));const n=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!n.outputDefined())return[new be(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Us(n))return[new be(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Us(n))return[new be(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!Go(n,["zoom","feature-state"]))return[new be(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!$o(n))return[new be(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Hs(r){const t=r.key,n=r.value,a=r.valueSpec,c=[];return Array.isArray(a.values)?a.values.indexOf(wi(n))===-1&&c.push(new be(t,n,`expected one of [${a.values.join(", ")}], ${JSON.stringify(n)} found`)):Object.keys(a.values).indexOf(wi(n))===-1&&c.push(new be(t,n,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(n)} found`)),c}function el(r){return Xo(wa(r.value))?kn(lt({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):bc(r)}function bc(r){const t=r.value,n=r.key;if(zt(t)!=="array")return[new be(n,t,`array expected, ${zt(t)} found`)];const a=r.styleSpec;let c,d=[];if(t.length<1)return[new be(n,t,"filter array must have at least 1 element")];switch(d=d.concat(Hs({key:`${n}[0]`,value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),wi(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&wi(t[1])==="$type"&&d.push(new be(n,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&d.push(new be(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(c=zt(t[1]),c!=="string"&&d.push(new be(`${n}[1]`,t[1],`string expected, ${c} found`)));for(let p=2;p<t.length;p++)c=zt(t[p]),wi(t[1])==="$type"?d=d.concat(Hs({key:`${n}[${p}]`,value:t[p],valueSpec:a.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&d.push(new be(`${n}[${p}]`,t[p],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let p=1;p<t.length;p++)d=d.concat(bc({key:`${n}[${p}]`,value:t[p],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=zt(t[1]),t.length!==2?d.push(new be(n,t,`filter array for "${t[0]}" operator must have 2 elements`)):c!=="string"&&d.push(new be(`${n}[1]`,t[1],`string expected, ${c} found`))}return d}function Sh(r,t){const n=r.key,a=r.validateSpec,c=r.style,d=r.styleSpec,p=r.value,g=r.objectKey,x=d[`${t}_${r.layerType}`];if(!x)return[];const w=g.match(/^(.*)-transition$/);if(t==="paint"&&w&&x[w[1]]&&x[w[1]].transition)return a({key:n,value:p,valueSpec:d.transition,style:c,styleSpec:d});const P=r.valueSpec||x[g];if(!P)return[new be(n,p,`unknown property "${g}"`)];let M;if(zt(p)==="string"&&os(P)&&!P.tokens&&(M=/^{([^}]+)}$/.exec(p)))return[new be(n,p,`"${g}" does not support interpolation syntax
|
|
@@ -726,4 +726,4 @@ uniform ${I} ${E} u_${k};
|
|
|
726
726
|
`),te=Q.concat(Kr.prelude.vertexSource,_.vertexSource,i.vertexSource).join(`
|
|
727
727
|
`);Yr(T)||(ee=function(fe){return fe.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(ee),te=function(fe){return fe.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(te));const oe=T.createShader(T.FRAGMENT_SHADER);if(T.isContextLost())return void(this.failedToCreate=!0);if(T.shaderSource(oe,ee),T.compileShader(oe),!T.getShaderParameter(oe,T.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${T.getShaderInfoLog(oe)}`);T.attachShader(this.program,oe);const re=T.createShader(T.VERTEX_SHADER);if(T.isContextLost())return void(this.failedToCreate=!0);if(T.shaderSource(re,te),T.compileShader(re),!T.getShaderParameter(re,T.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${T.getShaderInfoLog(re)}`);T.attachShader(this.program,re),this.attributes={};const me={};this.numAttributes=k.length;for(let fe=0;fe<this.numAttributes;fe++)k[fe]&&(T.bindAttribLocation(this.program,fe,k[fe]),this.attributes[k[fe]]=fe);if(T.linkProgram(this.program),!T.getProgramParameter(this.program,T.LINK_STATUS))throw new Error(`Program failed to link: ${T.getProgramInfoLog(this.program)}`);T.deleteShader(re),T.deleteShader(oe);for(let fe=0;fe<X.length;fe++){const Se=X[fe];if(Se&&!me[Se]){const Ie=T.getUniformLocation(this.program,Se);Ie&&(me[Se]=Ie)}}this.fixedUniforms=l(e,me),this.terrainUniforms=((fe,Se)=>({u_depth:new o.bF(fe,Se.u_depth),u_terrain:new o.bF(fe,Se.u_terrain),u_terrain_dim:new o.b8(fe,Se.u_terrain_dim),u_terrain_matrix:new o.bH(fe,Se.u_terrain_matrix),u_terrain_unpack:new o.bI(fe,Se.u_terrain_unpack),u_terrain_exaggeration:new o.b8(fe,Se.u_terrain_exaggeration)}))(e,me),this.projectionUniforms=((fe,Se)=>({u_projection_matrix:new o.bH(fe,Se.u_projection_matrix),u_projection_tile_mercator_coords:new o.bI(fe,Se.u_projection_tile_mercator_coords),u_projection_clipping_plane:new o.bI(fe,Se.u_projection_clipping_plane),u_projection_transition:new o.b8(fe,Se.u_projection_transition),u_projection_fallback_matrix:new o.bH(fe,Se.u_projection_fallback_matrix)}))(e,me),this.binderUniforms=s?s.getUniforms(e,me):[]}draw(e,i,s,l,h,f,_,v,T,I,E,k,O,Z,q,G,W,X,Q){const ee=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(s),e.setStencilMode(l),e.setColorMode(h),e.setCullFace(f),v){e.activeTexture.set(ee.TEXTURE2),ee.bindTexture(ee.TEXTURE_2D,v.depthTexture),e.activeTexture.set(ee.TEXTURE3),ee.bindTexture(ee.TEXTURE_2D,v.texture);for(const oe in this.terrainUniforms)this.terrainUniforms[oe].set(v[oe])}if(T)for(const oe in T)this.projectionUniforms[Fd[oe]].set(T[oe]);if(_)for(const oe in this.fixedUniforms)this.fixedUniforms[oe].set(_[oe]);G&&G.setUniforms(e,this.binderUniforms,Z,{zoom:q});let te=0;switch(i){case ee.LINES:te=2;break;case ee.TRIANGLES:te=3;break;case ee.LINE_STRIP:te=1}for(const oe of O.get()){const re=oe.vaos||(oe.vaos={});(re[I]||(re[I]=new tc)).bind(e,this,E,G?G.getPaintVertexBuffers():[],k,oe.vertexOffset,W,X,Q),ee.drawElements(i,oe.primitiveLength*te,ee.UNSIGNED_SHORT,oe.primitiveOffset*te*2)}}}function rs(u,e,i){const s=1/o.aw(i,1,e.transform.tileZoom),l=Math.pow(2,i.tileID.overscaledZ),h=i.tileSize*Math.pow(2,e.transform.tileZoom)/l,f=h*(i.tileID.canonical.x+i.tileID.wrap*l),_=h*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[s,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[f>>16,_>>16],u_pixel_coord_lower:[65535&f,65535&_]}}const ih=(u,e,i,s)=>{const l=u.style.light,h=l.properties.get("position"),f=[h.x,h.y,h.z],_=o.bL();l.properties.get("anchor")==="viewport"&&o.bM(_,u.transform.bearingInRadians),o.bN(f,f,_);const v=u.transform.transformLightDirection(f),T=l.properties.get("color");return{u_lightpos:f,u_lightpos_globe:v,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_vertical_gradient:+e,u_opacity:i,u_fill_translate:s}},Fo=(u,e,i,s,l,h,f)=>o.e(ih(u,e,i,s),rs(h,u,f),{u_height_factor:-Math.pow(2,l.overscaledZ)/f.tileSize/8}),rh=(u,e,i,s)=>o.e(rs(e,u,i),{u_fill_translate:s}),ns=(u,e)=>({u_world:u,u_fill_translate:e}),Bd=(u,e,i,s,l)=>o.e(rh(u,e,i,l),{u_world:s}),nh=(u,e,i,s,l)=>{const h=u.transform;let f,_,v=0;if(i.paint.get("circle-pitch-alignment")==="map"){const T=o.aw(e,1,h.zoom);f=!0,_=[T,T],v=T/(o.Z*Math.pow(2,e.tileID.overscaledZ))*2*Math.PI*l}else f=!1,_=h.pixelsToGLUnits;return{u_camera_to_center_distance:h.cameraToCenterDistance,u_scale_with_map:+(i.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+f,u_device_pixel_ratio:u.pixelRatio,u_extrude_scale:_,u_globe_extrude_scale:v,u_translate:s}},Od=u=>({u_pixel_extrude_scale:[1/u.width,1/u.height]}),ah=u=>({u_viewport_size:[u.width,u.height]}),Bo=(u,e=1)=>({u_color:u,u_overlay:0,u_overlay_scale:e}),ic=(u,e,i,s)=>{const l=o.aw(u,1,e)/(o.Z*Math.pow(2,u.tileID.overscaledZ))*2*Math.PI*s;return{u_extrude_scale:o.aw(u,1,e),u_intensity:i,u_globe_extrude_scale:l}},rc=(u,e,i,s)=>{const l=o.K();o.bO(l,0,u.width,u.height,0,0,1);const h=u.context.gl;return{u_matrix:l,u_world:[h.drawingBufferWidth,h.drawingBufferHeight],u_image:i,u_color_ramp:s,u_opacity:e.paint.get("heatmap-opacity")}},sh=(u,e,i)=>{const s=i.paint.get("hillshade-shadow-color"),l=i.paint.get("hillshade-highlight-color"),h=i.paint.get("hillshade-accent-color");let f=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);return i.paint.get("hillshade-illumination-anchor")==="viewport"&&(f+=u.transform.bearingInRadians),{u_image:0,u_latrange:ya(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),f],u_shadow:s,u_highlight:l,u_accent:h}},oh=(u,e)=>{const i=e.stride,s=o.K();return o.bO(s,0,o.Z,-8192,0,0,1),o.L(s,s,[0,-8192,0]),{u_matrix:s,u_image:1,u_dimension:[i,i],u_zoom:u.overscaledZ,u_unpack:e.getUnpackVector()}};function ya(u,e){const i=Math.pow(2,e.canonical.z),s=e.canonical.y;return[new o.$(0,s/i).toLngLat().lat,new o.$(0,(s+1)/i).toLngLat().lat]}const Oo=(u,e,i,s)=>{const l=u.transform;return{u_translation:ch(u,e,i),u_ratio:s/o.aw(e,1,l.zoom),u_device_pixel_ratio:u.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},lh=(u,e,i,s,l)=>o.e(Oo(u,e,i,s),{u_image:0,u_image_height:l}),Zs=(u,e,i,s,l)=>{const h=u.transform,f=Vs(e,h);return{u_translation:ch(u,e,i),u_texsize:e.imageAtlasTexture.size,u_ratio:s/o.aw(e,1,h.zoom),u_device_pixel_ratio:u.pixelRatio,u_image:0,u_scale:[f,l.fromScale,l.toScale],u_fade:l.t,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},jd=(u,e,i,s,l,h)=>{const f=u.lineAtlas,_=Vs(e,u.transform),v=i.layout.get("line-cap")==="round",T=f.getDash(l.from,v),I=f.getDash(l.to,v),E=T.width*h.fromScale,k=I.width*h.toScale;return o.e(Oo(u,e,i,s),{u_patternscale_a:[_/E,-T.height/2],u_patternscale_b:[_/k,-I.height/2],u_sdfgamma:f.width/(256*Math.min(E,k)*u.pixelRatio)/2,u_image:0,u_tex_y_a:T.y,u_tex_y_b:I.y,u_mix:h.t})};function Vs(u,e){return 1/o.aw(u,1,e.tileZoom)}function ch(u,e,i){return o.ax(u.transform,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const Nd=(u,e,i,s,l)=>{return{u_tl_parent:u,u_scale_parent:e,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*s.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:s.paint.get("raster-brightness-min"),u_brightness_high:s.paint.get("raster-brightness-max"),u_saturation_factor:(f=s.paint.get("raster-saturation"),f>0?1-1/(1.001-f):-f),u_contrast_factor:(h=s.paint.get("raster-contrast"),h>0?1/(1-h):1+h),u_spin_weights:uh(s.paint.get("raster-hue-rotate")),u_coords_top:[l[0].x,l[0].y,l[1].x,l[1].y],u_coords_bottom:[l[3].x,l[3].y,l[2].x,l[2].y]};var h,f};function uh(u){u*=Math.PI/180;const e=Math.sin(u),i=Math.cos(u);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const nc=(u,e,i,s,l,h,f,_,v,T,I,E,k)=>{const O=f.transform;return{u_is_size_zoom_constant:+(u==="constant"||u==="source"),u_is_size_feature_constant:+(u==="constant"||u==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:O.cameraToCenterDistance,u_pitch:O.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:O.width/O.height,u_fade_change:f.options.fadeDuration?f.symbolFadeChange:1,u_label_plane_matrix:_,u_coord_matrix:v,u_is_text:+I,u_pitch_with_map:+s,u_is_along_line:l,u_is_variable_anchor:h,u_texsize:E,u_texture:0,u_translation:T,u_pitched_scale:k}},ac=(u,e,i,s,l,h,f,_,v,T,I,E,k,O)=>{const Z=f.transform;return o.e(nc(u,e,i,s,l,h,f,_,v,T,I,E,O),{u_gamma_scale:s?Math.cos(Z.pitch*Math.PI/180)*Z.cameraToCenterDistance:1,u_device_pixel_ratio:f.pixelRatio,u_is_halo:1})},sc=(u,e,i,s,l,h,f,_,v,T,I,E,k)=>o.e(ac(u,e,i,s,l,h,f,_,v,T,!0,I,0,k),{u_texsize_icon:E,u_texture_icon:1}),hh=(u,e)=>({u_opacity:u,u_color:e}),jo=(u,e,i,s,l)=>o.e(function(h,f,_,v){const T=_.imageManager.getPattern(h.from.toString()),I=_.imageManager.getPattern(h.to.toString()),{width:E,height:k}=_.imageManager.getPixelSize(),O=Math.pow(2,v.tileID.overscaledZ),Z=v.tileSize*Math.pow(2,_.transform.tileZoom)/O,q=Z*(v.tileID.canonical.x+v.tileID.wrap*O),G=Z*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:I.tl,u_pattern_br_b:I.br,u_texsize:[E,k],u_mix:f.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:I.displaySize,u_scale_a:f.fromScale,u_scale_b:f.toScale,u_tile_units_to_pixels:1/o.aw(v,1,_.transform.tileZoom),u_pixel_coord_upper:[q>>16,G>>16],u_pixel_coord_lower:[65535&q,65535&G]}}(i,l,e,s),{u_opacity:u}),hn=(u,e)=>{},oc={fillExtrusion:(u,e)=>({u_lightpos:new o.bJ(u,e.u_lightpos),u_lightpos_globe:new o.bJ(u,e.u_lightpos_globe),u_lightintensity:new o.b8(u,e.u_lightintensity),u_lightcolor:new o.bJ(u,e.u_lightcolor),u_vertical_gradient:new o.b8(u,e.u_vertical_gradient),u_opacity:new o.b8(u,e.u_opacity),u_fill_translate:new o.bK(u,e.u_fill_translate)}),fillExtrusionPattern:(u,e)=>({u_lightpos:new o.bJ(u,e.u_lightpos),u_lightpos_globe:new o.bJ(u,e.u_lightpos_globe),u_lightintensity:new o.b8(u,e.u_lightintensity),u_lightcolor:new o.bJ(u,e.u_lightcolor),u_vertical_gradient:new o.b8(u,e.u_vertical_gradient),u_height_factor:new o.b8(u,e.u_height_factor),u_opacity:new o.b8(u,e.u_opacity),u_fill_translate:new o.bK(u,e.u_fill_translate),u_image:new o.bF(u,e.u_image),u_texsize:new o.bK(u,e.u_texsize),u_pixel_coord_upper:new o.bK(u,e.u_pixel_coord_upper),u_pixel_coord_lower:new o.bK(u,e.u_pixel_coord_lower),u_scale:new o.bJ(u,e.u_scale),u_fade:new o.b8(u,e.u_fade)}),fill:(u,e)=>({u_fill_translate:new o.bK(u,e.u_fill_translate)}),fillPattern:(u,e)=>({u_image:new o.bF(u,e.u_image),u_texsize:new o.bK(u,e.u_texsize),u_pixel_coord_upper:new o.bK(u,e.u_pixel_coord_upper),u_pixel_coord_lower:new o.bK(u,e.u_pixel_coord_lower),u_scale:new o.bJ(u,e.u_scale),u_fade:new o.b8(u,e.u_fade),u_fill_translate:new o.bK(u,e.u_fill_translate)}),fillOutline:(u,e)=>({u_world:new o.bK(u,e.u_world),u_fill_translate:new o.bK(u,e.u_fill_translate)}),fillOutlinePattern:(u,e)=>({u_world:new o.bK(u,e.u_world),u_image:new o.bF(u,e.u_image),u_texsize:new o.bK(u,e.u_texsize),u_pixel_coord_upper:new o.bK(u,e.u_pixel_coord_upper),u_pixel_coord_lower:new o.bK(u,e.u_pixel_coord_lower),u_scale:new o.bJ(u,e.u_scale),u_fade:new o.b8(u,e.u_fade),u_fill_translate:new o.bK(u,e.u_fill_translate)}),circle:(u,e)=>({u_camera_to_center_distance:new o.b8(u,e.u_camera_to_center_distance),u_scale_with_map:new o.bF(u,e.u_scale_with_map),u_pitch_with_map:new o.bF(u,e.u_pitch_with_map),u_extrude_scale:new o.bK(u,e.u_extrude_scale),u_device_pixel_ratio:new o.b8(u,e.u_device_pixel_ratio),u_globe_extrude_scale:new o.b8(u,e.u_globe_extrude_scale),u_translate:new o.bK(u,e.u_translate)}),collisionBox:(u,e)=>({u_pixel_extrude_scale:new o.bK(u,e.u_pixel_extrude_scale)}),collisionCircle:(u,e)=>({u_viewport_size:new o.bK(u,e.u_viewport_size)}),debug:(u,e)=>({u_color:new o.bG(u,e.u_color),u_overlay:new o.bF(u,e.u_overlay),u_overlay_scale:new o.b8(u,e.u_overlay_scale)}),depth:hn,clippingMask:hn,heatmap:(u,e)=>({u_extrude_scale:new o.b8(u,e.u_extrude_scale),u_intensity:new o.b8(u,e.u_intensity),u_globe_extrude_scale:new o.b8(u,e.u_globe_extrude_scale)}),heatmapTexture:(u,e)=>({u_matrix:new o.bH(u,e.u_matrix),u_world:new o.bK(u,e.u_world),u_image:new o.bF(u,e.u_image),u_color_ramp:new o.bF(u,e.u_color_ramp),u_opacity:new o.b8(u,e.u_opacity)}),hillshade:(u,e)=>({u_image:new o.bF(u,e.u_image),u_latrange:new o.bK(u,e.u_latrange),u_light:new o.bK(u,e.u_light),u_shadow:new o.bG(u,e.u_shadow),u_highlight:new o.bG(u,e.u_highlight),u_accent:new o.bG(u,e.u_accent)}),hillshadePrepare:(u,e)=>({u_matrix:new o.bH(u,e.u_matrix),u_image:new o.bF(u,e.u_image),u_dimension:new o.bK(u,e.u_dimension),u_zoom:new o.b8(u,e.u_zoom),u_unpack:new o.bI(u,e.u_unpack)}),line:(u,e)=>({u_translation:new o.bK(u,e.u_translation),u_ratio:new o.b8(u,e.u_ratio),u_device_pixel_ratio:new o.b8(u,e.u_device_pixel_ratio),u_units_to_pixels:new o.bK(u,e.u_units_to_pixels)}),lineGradient:(u,e)=>({u_translation:new o.bK(u,e.u_translation),u_ratio:new o.b8(u,e.u_ratio),u_device_pixel_ratio:new o.b8(u,e.u_device_pixel_ratio),u_units_to_pixels:new o.bK(u,e.u_units_to_pixels),u_image:new o.bF(u,e.u_image),u_image_height:new o.b8(u,e.u_image_height)}),linePattern:(u,e)=>({u_translation:new o.bK(u,e.u_translation),u_texsize:new o.bK(u,e.u_texsize),u_ratio:new o.b8(u,e.u_ratio),u_device_pixel_ratio:new o.b8(u,e.u_device_pixel_ratio),u_image:new o.bF(u,e.u_image),u_units_to_pixels:new o.bK(u,e.u_units_to_pixels),u_scale:new o.bJ(u,e.u_scale),u_fade:new o.b8(u,e.u_fade)}),lineSDF:(u,e)=>({u_translation:new o.bK(u,e.u_translation),u_ratio:new o.b8(u,e.u_ratio),u_device_pixel_ratio:new o.b8(u,e.u_device_pixel_ratio),u_units_to_pixels:new o.bK(u,e.u_units_to_pixels),u_patternscale_a:new o.bK(u,e.u_patternscale_a),u_patternscale_b:new o.bK(u,e.u_patternscale_b),u_sdfgamma:new o.b8(u,e.u_sdfgamma),u_image:new o.bF(u,e.u_image),u_tex_y_a:new o.b8(u,e.u_tex_y_a),u_tex_y_b:new o.b8(u,e.u_tex_y_b),u_mix:new o.b8(u,e.u_mix)}),raster:(u,e)=>({u_tl_parent:new o.bK(u,e.u_tl_parent),u_scale_parent:new o.b8(u,e.u_scale_parent),u_buffer_scale:new o.b8(u,e.u_buffer_scale),u_fade_t:new o.b8(u,e.u_fade_t),u_opacity:new o.b8(u,e.u_opacity),u_image0:new o.bF(u,e.u_image0),u_image1:new o.bF(u,e.u_image1),u_brightness_low:new o.b8(u,e.u_brightness_low),u_brightness_high:new o.b8(u,e.u_brightness_high),u_saturation_factor:new o.b8(u,e.u_saturation_factor),u_contrast_factor:new o.b8(u,e.u_contrast_factor),u_spin_weights:new o.bJ(u,e.u_spin_weights),u_coords_top:new o.bI(u,e.u_coords_top),u_coords_bottom:new o.bI(u,e.u_coords_bottom)}),symbolIcon:(u,e)=>({u_is_size_zoom_constant:new o.bF(u,e.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bF(u,e.u_is_size_feature_constant),u_size_t:new o.b8(u,e.u_size_t),u_size:new o.b8(u,e.u_size),u_camera_to_center_distance:new o.b8(u,e.u_camera_to_center_distance),u_pitch:new o.b8(u,e.u_pitch),u_rotate_symbol:new o.bF(u,e.u_rotate_symbol),u_aspect_ratio:new o.b8(u,e.u_aspect_ratio),u_fade_change:new o.b8(u,e.u_fade_change),u_label_plane_matrix:new o.bH(u,e.u_label_plane_matrix),u_coord_matrix:new o.bH(u,e.u_coord_matrix),u_is_text:new o.bF(u,e.u_is_text),u_pitch_with_map:new o.bF(u,e.u_pitch_with_map),u_is_along_line:new o.bF(u,e.u_is_along_line),u_is_variable_anchor:new o.bF(u,e.u_is_variable_anchor),u_texsize:new o.bK(u,e.u_texsize),u_texture:new o.bF(u,e.u_texture),u_translation:new o.bK(u,e.u_translation),u_pitched_scale:new o.b8(u,e.u_pitched_scale)}),symbolSDF:(u,e)=>({u_is_size_zoom_constant:new o.bF(u,e.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bF(u,e.u_is_size_feature_constant),u_size_t:new o.b8(u,e.u_size_t),u_size:new o.b8(u,e.u_size),u_camera_to_center_distance:new o.b8(u,e.u_camera_to_center_distance),u_pitch:new o.b8(u,e.u_pitch),u_rotate_symbol:new o.bF(u,e.u_rotate_symbol),u_aspect_ratio:new o.b8(u,e.u_aspect_ratio),u_fade_change:new o.b8(u,e.u_fade_change),u_label_plane_matrix:new o.bH(u,e.u_label_plane_matrix),u_coord_matrix:new o.bH(u,e.u_coord_matrix),u_is_text:new o.bF(u,e.u_is_text),u_pitch_with_map:new o.bF(u,e.u_pitch_with_map),u_is_along_line:new o.bF(u,e.u_is_along_line),u_is_variable_anchor:new o.bF(u,e.u_is_variable_anchor),u_texsize:new o.bK(u,e.u_texsize),u_texture:new o.bF(u,e.u_texture),u_gamma_scale:new o.b8(u,e.u_gamma_scale),u_device_pixel_ratio:new o.b8(u,e.u_device_pixel_ratio),u_is_halo:new o.bF(u,e.u_is_halo),u_translation:new o.bK(u,e.u_translation),u_pitched_scale:new o.b8(u,e.u_pitched_scale)}),symbolTextAndIcon:(u,e)=>({u_is_size_zoom_constant:new o.bF(u,e.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bF(u,e.u_is_size_feature_constant),u_size_t:new o.b8(u,e.u_size_t),u_size:new o.b8(u,e.u_size),u_camera_to_center_distance:new o.b8(u,e.u_camera_to_center_distance),u_pitch:new o.b8(u,e.u_pitch),u_rotate_symbol:new o.bF(u,e.u_rotate_symbol),u_aspect_ratio:new o.b8(u,e.u_aspect_ratio),u_fade_change:new o.b8(u,e.u_fade_change),u_label_plane_matrix:new o.bH(u,e.u_label_plane_matrix),u_coord_matrix:new o.bH(u,e.u_coord_matrix),u_is_text:new o.bF(u,e.u_is_text),u_pitch_with_map:new o.bF(u,e.u_pitch_with_map),u_is_along_line:new o.bF(u,e.u_is_along_line),u_is_variable_anchor:new o.bF(u,e.u_is_variable_anchor),u_texsize:new o.bK(u,e.u_texsize),u_texsize_icon:new o.bK(u,e.u_texsize_icon),u_texture:new o.bF(u,e.u_texture),u_texture_icon:new o.bF(u,e.u_texture_icon),u_gamma_scale:new o.b8(u,e.u_gamma_scale),u_device_pixel_ratio:new o.b8(u,e.u_device_pixel_ratio),u_is_halo:new o.bF(u,e.u_is_halo),u_translation:new o.bK(u,e.u_translation),u_pitched_scale:new o.b8(u,e.u_pitched_scale)}),background:(u,e)=>({u_opacity:new o.b8(u,e.u_opacity),u_color:new o.bG(u,e.u_color)}),backgroundPattern:(u,e)=>({u_opacity:new o.b8(u,e.u_opacity),u_image:new o.bF(u,e.u_image),u_pattern_tl_a:new o.bK(u,e.u_pattern_tl_a),u_pattern_br_a:new o.bK(u,e.u_pattern_br_a),u_pattern_tl_b:new o.bK(u,e.u_pattern_tl_b),u_pattern_br_b:new o.bK(u,e.u_pattern_br_b),u_texsize:new o.bK(u,e.u_texsize),u_mix:new o.b8(u,e.u_mix),u_pattern_size_a:new o.bK(u,e.u_pattern_size_a),u_pattern_size_b:new o.bK(u,e.u_pattern_size_b),u_scale_a:new o.b8(u,e.u_scale_a),u_scale_b:new o.b8(u,e.u_scale_b),u_pixel_coord_upper:new o.bK(u,e.u_pixel_coord_upper),u_pixel_coord_lower:new o.bK(u,e.u_pixel_coord_lower),u_tile_units_to_pixels:new o.b8(u,e.u_tile_units_to_pixels)}),terrain:(u,e)=>({u_texture:new o.bF(u,e.u_texture),u_ele_delta:new o.b8(u,e.u_ele_delta),u_fog_matrix:new o.bH(u,e.u_fog_matrix),u_fog_color:new o.bG(u,e.u_fog_color),u_fog_ground_blend:new o.b8(u,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new o.b8(u,e.u_fog_ground_blend_opacity),u_horizon_color:new o.bG(u,e.u_horizon_color),u_horizon_fog_blend:new o.b8(u,e.u_horizon_fog_blend),u_is_globe_mode:new o.b8(u,e.u_is_globe_mode)}),terrainDepth:(u,e)=>({u_ele_delta:new o.b8(u,e.u_ele_delta)}),terrainCoords:(u,e)=>({u_texture:new o.bF(u,e.u_texture),u_terrain_coords_id:new o.b8(u,e.u_terrain_coords_id),u_ele_delta:new o.b8(u,e.u_ele_delta)}),projectionErrorMeasurement:(u,e)=>({u_input:new o.b8(u,e.u_input),u_output_expected:new o.b8(u,e.u_output_expected)}),atmosphere:(u,e)=>({u_sun_pos:new o.bJ(u,e.u_sun_pos),u_atmosphere_blend:new o.b8(u,e.u_atmosphere_blend),u_globe_position:new o.bJ(u,e.u_globe_position),u_globe_radius:new o.b8(u,e.u_globe_radius),u_inv_proj_matrix:new o.bH(u,e.u_inv_proj_matrix)}),sky:(u,e)=>({u_sky_color:new o.bG(u,e.u_sky_color),u_horizon_color:new o.bG(u,e.u_horizon_color),u_horizon:new o.bK(u,e.u_horizon),u_horizon_normal:new o.bK(u,e.u_horizon_normal),u_sky_horizon_blend:new o.b8(u,e.u_sky_horizon_blend),u_sky_blend:new o.b8(u,e.u_sky_blend)})};class lc{constructor(e,i,s){this.context=e;const l=e.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,i.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete i.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const i=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const cc={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class dh{constructor(e,i,s,l){this.length=i.length,this.attributes=s,this.itemSize=i.bytesPerElement,this.dynamicDraw=l,this.context=e;const h=e.gl;this.buffer=h.createBuffer(),e.bindVertexBuffer.set(this.buffer),h.bufferData(h.ARRAY_BUFFER,i.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete i.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const i=this.context.gl;this.bind(),i.bufferSubData(i.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,i){for(let s=0;s<this.attributes.length;s++){const l=i.attributes[this.attributes[s].name];l!==void 0&&e.enableVertexAttribArray(l)}}setVertexAttribPointers(e,i,s){for(let l=0;l<this.attributes.length;l++){const h=this.attributes[l],f=i.attributes[h.name];f!==void 0&&e.vertexAttribPointer(f,h.components,e[cc[h.type]],!1,this.itemSize,h.offset+this.itemSize*(s||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Lt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class xa extends Lt{getDefault(){return o.b7.transparent}set(e){const i=this.current;(e.r!==i.r||e.g!==i.g||e.b!==i.b||e.a!==i.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class uc extends Lt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Zd extends Lt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class Vd extends Lt{getDefault(){return[!0,!0,!0,!0]}set(e){const i=this.current;(e[0]!==i[0]||e[1]!==i[1]||e[2]!==i[2]||e[3]!==i[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ud extends Lt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class $d extends Lt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class ph extends Lt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const i=this.current;(e.func!==i.func||e.ref!==i.ref||e.mask!==i.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Gd extends Lt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const i=this.current;(e[0]!==i[0]||e[1]!==i[1]||e[2]!==i[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class fh extends Lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;e?i.enable(i.STENCIL_TEST):i.disable(i.STENCIL_TEST),this.current=e,this.dirty=!1}}class No extends Lt{getDefault(){return[0,1]}set(e){const i=this.current;(e[0]!==i[0]||e[1]!==i[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Zo extends Lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;e?i.enable(i.DEPTH_TEST):i.disable(i.DEPTH_TEST),this.current=e,this.dirty=!1}}class Vo extends Lt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class hc extends Lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;e?i.enable(i.BLEND):i.disable(i.BLEND),this.current=e,this.dirty=!1}}class va extends Lt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const i=this.current;(e[0]!==i[0]||e[1]!==i[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class as extends Lt{getDefault(){return o.b7.transparent}set(e){const i=this.current;(e.r!==i.r||e.g!==i.g||e.b!==i.b||e.a!==i.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Zr extends Lt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class mh extends Lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;e?i.enable(i.CULL_FACE):i.disable(i.CULL_FACE),this.current=e,this.dirty=!1}}class gh extends Lt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class dc extends Lt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class ba extends Lt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Uo extends Lt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class $o extends Lt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const i=this.current;(e[0]!==i[0]||e[1]!==i[1]||e[2]!==i[2]||e[3]!==i[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Us extends Lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;i.bindFramebuffer(i.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Go extends Lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;i.bindRenderbuffer(i.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class _h extends Lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;i.bindTexture(i.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class ss extends Lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;i.bindBuffer(i.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class os extends Lt{getDefault(){return null}set(e){const i=this.gl;i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class yh extends Lt{getDefault(){return null}set(e){var i;if(e===this.current&&!this.dirty)return;const s=this.gl;Yr(s)?s.bindVertexArray(e):(i=s.getExtension("OES_vertex_array_object"))===null||i===void 0||i.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class pc extends Lt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;i.pixelStorei(i.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class zt extends Lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class qo extends Lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const i=this.gl;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class fc extends Lt{constructor(e,i){super(e),this.context=e,this.parent=i}getDefault(){return null}}class xh extends fc{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const i=this.gl;i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class $s extends fc{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const i=this.gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class qd extends fc{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const i=this.gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,e),this.current=e,this.dirty=!1}}const vh="Framebuffer is not complete";class bh{constructor(e,i,s,l,h){this.context=e,this.width=i,this.height=s;const f=e.gl,_=this.framebuffer=f.createFramebuffer();if(this.colorAttachment=new xh(e,_),l)this.depthAttachment=h?new qd(e,_):new $s(e,_);else if(h)throw new Error("Stencil cannot be set without depth");if(f.checkFramebufferStatus(f.FRAMEBUFFER)!==f.FRAMEBUFFER_COMPLETE)throw new Error(vh)}destroy(){const e=this.context.gl,i=this.colorAttachment.get();if(i&&e.deleteTexture(i),this.depthAttachment){const s=this.depthAttachment.get();s&&e.deleteRenderbuffer(s)}e.deleteFramebuffer(this.framebuffer)}}class Wd{constructor(e){var i,s;if(this.gl=e,this.clearColor=new xa(this),this.clearDepth=new uc(this),this.clearStencil=new Zd(this),this.colorMask=new Vd(this),this.depthMask=new Ud(this),this.stencilMask=new $d(this),this.stencilFunc=new ph(this),this.stencilOp=new Gd(this),this.stencilTest=new fh(this),this.depthRange=new No(this),this.depthTest=new Zo(this),this.depthFunc=new Vo(this),this.blend=new hc(this),this.blendFunc=new va(this),this.blendColor=new as(this),this.blendEquation=new Zr(this),this.cullFace=new mh(this),this.cullFaceSide=new gh(this),this.frontFace=new dc(this),this.program=new ba(this),this.activeTexture=new Uo(this),this.viewport=new $o(this),this.bindFramebuffer=new Us(this),this.bindRenderbuffer=new Go(this),this.bindTexture=new _h(this),this.bindVertexBuffer=new ss(this),this.bindElementBuffer=new os(this),this.bindVertexArray=new yh(this),this.pixelStoreUnpack=new pc(this),this.pixelStoreUnpackPremultiplyAlpha=new zt(this),this.pixelStoreUnpackFlipY=new qo(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),Yr(e)){this.HALF_FLOAT=e.HALF_FLOAT;const l=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(i=e.RGBA16F)!==null&&i!==void 0?i:l==null?void 0:l.RGBA16F_EXT,this.RGB16F=(s=e.RGB16F)!==null&&s!==void 0?s:l==null?void 0:l.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const l=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=l==null?void 0:l.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,i){return new lc(this,e,i)}createVertexBuffer(e,i,s){return new dh(this,e,i,s)}createRenderbuffer(e,i,s){const l=this.gl,h=l.createRenderbuffer();return this.bindRenderbuffer.set(h),l.renderbufferStorage(l.RENDERBUFFER,e,i,s),this.bindRenderbuffer.set(null),h}createFramebuffer(e,i,s,l){return new bh(this,e,i,s,l)}clear({color:e,depth:i,stencil:s}){const l=this.gl;let h=0;e&&(h|=l.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),i!==void 0&&(h|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),s!==void 0&&(h|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(s),this.stencilMask.set(255)),l.clear(h)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){o.bC(e.blendFunction,ei.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return Yr(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var i;return Yr(this.gl)?this.gl.deleteVertexArray(e):(i=this.gl.getExtension("OES_vertex_array_object"))===null||i===void 0?void 0:i.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}let ls;function Gs(u,e,i,s,l){const h=u.context,f=u.transform,_=h.gl,v=u.useProgram("collisionBox"),T=[];let I=0,E=0;for(let W=0;W<s.length;W++){const X=s[W],Q=e.getTile(X).getBucket(i);if(!Q)continue;const ee=l?Q.textCollisionBox:Q.iconCollisionBox,te=Q.collisionCircleArray;te.length>0&&(T.push({circleArray:te,circleOffset:E,coord:X}),I+=te.length/4,E=I),ee&&v.draw(h,_.LINES,ft.disabled,Ct.disabled,u.colorModeForRenderPass(),Dt.disabled,Od(u.transform),u.style.map.terrain&&u.style.map.terrain.getTerrainData(X),f.getProjectionData({overscaledTileID:X,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),i.id,ee.layoutVertexBuffer,ee.indexBuffer,ee.segments,null,u.transform.zoom,null,null,ee.collisionVertexBuffer)}if(!l||!T.length)return;const k=u.useProgram("collisionCircle"),O=new o.bP;O.resize(4*I),O._trim();let Z=0;for(const W of T)for(let X=0;X<W.circleArray.length/4;X++){const Q=4*X,ee=W.circleArray[Q+0],te=W.circleArray[Q+1],oe=W.circleArray[Q+2],re=W.circleArray[Q+3];O.emplace(Z++,ee,te,oe,re,0),O.emplace(Z++,ee,te,oe,re,1),O.emplace(Z++,ee,te,oe,re,2),O.emplace(Z++,ee,te,oe,re,3)}(!ls||ls.length<2*I)&&(ls=function(W){const X=2*W,Q=new o.bR;Q.resize(X),Q._trim();for(let ee=0;ee<X;ee++){const te=6*ee;Q.uint16[te+0]=4*ee+0,Q.uint16[te+1]=4*ee+1,Q.uint16[te+2]=4*ee+2,Q.uint16[te+3]=4*ee+2,Q.uint16[te+4]=4*ee+3,Q.uint16[te+5]=4*ee+0}return Q}(I));const q=h.createIndexBuffer(ls,!0),G=h.createVertexBuffer(O,o.bQ.members,!0);for(const W of T){const X=ah(u.transform);k.draw(h,_.TRIANGLES,ft.disabled,Ct.disabled,u.colorModeForRenderPass(),Dt.disabled,X,u.style.map.terrain&&u.style.map.terrain.getTerrainData(W.coord),null,i.id,G,q,o.aG.simpleSegment(0,2*W.circleOffset,W.circleArray.length,W.circleArray.length/2),null,u.transform.zoom,null,null,null)}G.destroy(),q.destroy()}const Wo=o.at(new Float32Array(16));function mc(u,e,i,s,l,h){const{horizontalAlign:f,verticalAlign:_}=o.aB(u);return new o.P((-(f-.5)*e/l+s[0])*h,(-(_-.5)*i/l+s[1])*h)}function gc(u,e,i,s,l,h){const f=e.tileAnchorPoint.add(new o.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let _=s.mult(h);i||(_=_.rotate(-l));const v=f.add(_);return ve(v.x,v.y,e.pitchedLabelPlaneMatrix,e.getElevation).point}if(i){const _=kt(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(u),v=Math.atan(_.y/_.x)+(_.x<0?Math.PI:0);return u.add(s.rotate(v))}return u.add(s)}function wh(u,e,i,s,l,h,f,_,v,T,I,E){const k=u.text.placedSymbolArray,O=u.text.dynamicLayoutVertexArray,Z=u.icon.dynamicLayoutVertexArray,q={};O.clear();for(let G=0;G<k.length;G++){const W=k.get(G),X=W.hidden||!W.crossTileID||u.allowVerticalPlacement&&!W.placedOrientation?null:s[W.crossTileID];if(X){const Q=new o.P(W.anchorX,W.anchorY),ee={getElevation:E,width:l.width,height:l.height,pitchedLabelPlaneMatrix:h,pitchWithMap:i,transform:l,tileAnchorPoint:Q,translation:T,unwrappedTileID:I},te=i?We(Q.x,Q.y,ee):kt(Q.x,Q.y,ee),oe=de(l.cameraToCenterDistance,te.signedDistanceFromCamera);let re=o.ai(u.textSizeData,_,W)*oe/o.av;i&&(re*=u.tilePixelRatio/f);const{width:me,height:fe,anchor:Se,textOffset:Ie,textBoxScale:Te}=X,je=mc(Se,me,fe,Ie,Te,re),Be=l.getPitchedTextCorrection(Q.x+T[0],Q.y+T[1],I),Ce=gc(te.point,ee,e,je,-l.bearingInRadians,Be),He=u.allowVerticalPlacement&&W.placedOrientation===o.ah.vertical?Math.PI/2:0;for(let pt=0;pt<W.numGlyphs;pt++)o.ao(O,Ce,He);v&&W.associatedIconIndex>=0&&(q[W.associatedIconIndex]={shiftedAnchor:Ce,angle:He})}else at(W.numGlyphs,O)}if(v){Z.clear();const G=u.icon.placedSymbolArray;for(let W=0;W<G.length;W++){const X=G.get(W);if(X.hidden)at(X.numGlyphs,Z);else{const Q=q[W];if(Q)for(let ee=0;ee<X.numGlyphs;ee++)o.ao(Z,Q.shiftedAnchor,Q.angle);else at(X.numGlyphs,Z)}}u.icon.dynamicLayoutVertexBuffer.updateData(Z)}u.text.dynamicLayoutVertexBuffer.updateData(O)}function Ho(u,e,i){return i.iconsInText&&e?"symbolTextAndIcon":u?"symbolSDF":"symbolIcon"}function qs(u,e,i,s,l,h,f,_,v,T,I,E,k){const O=u.context,Z=O.gl,q=u.transform,G=_==="map",W=v==="map",X=_!=="viewport"&&i.layout.get("symbol-placement")!=="point",Q=G&&!W&&!X,ee=!i.layout.get("symbol-sort-key").isConstant();let te=!1;const oe=u.getDepthModeForSublayer(0,ft.ReadOnly),re=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),me=[],fe=q.getCircleRadiusCorrection();for(const Se of s){const Ie=e.getTile(Se),Te=Ie.getBucket(i);if(!Te)continue;const je=l?Te.text:Te.icon;if(!je||!je.segments.get().length||!je.hasVisibleVertices)continue;const Be=je.programConfigurations.get(i.id),Ce=l||Te.sdfIcons,He=l?Te.textSizeData:Te.iconSizeData,pt=W||q.pitch!==0,jt=u.useProgram(Ho(Ce,l,Te),Be),mt=o.ag(He,q.zoom),Wt=u.style.map.terrain&&u.style.map.terrain.getTerrainData(Se);let Yt,ii,Ut,Ht,Ii=[0,0],Bi=null;if(l)ii=Ie.glyphAtlasTexture,Ut=Z.LINEAR,Yt=Ie.glyphAtlasTexture.size,Te.iconsInText&&(Ii=Ie.imageAtlasTexture.size,Bi=Ie.imageAtlasTexture,Ht=pt||u.options.rotating||u.options.zooming||He.kind==="composite"||He.kind==="camera"?Z.LINEAR:Z.NEAREST);else{const _i=i.layout.get("icon-size").constantOr(0)!==1||Te.iconsNeedLinear;ii=Ie.imageAtlasTexture,Ut=Ce||u.options.rotating||u.options.zooming||_i||pt?Z.LINEAR:Z.NEAREST,Yt=Ie.imageAtlasTexture.size}const Zi=o.aw(Ie,1,u.transform.zoom),vr=pe(G,u.transform,Zi),An=o.K();o.aj(An,vr);const mn=ce(W,G,u.transform,Zi),Yn=o.ax(q,Ie,h,f),Jn=q.getProjectionData({overscaledTileID:Se,applyGlobeMatrix:!k,applyTerrainMatrix:!0}),ka=re&&Te.hasTextData(),gn=i.layout.get("icon-text-fit")!=="none"&&ka&&Te.hasIconData();if(X){const _i=u.style.map.terrain?(zi,Kt)=>u.style.map.terrain.getElevation(Se,zi,Kt):null,yi=i.layout.get("text-rotation-alignment")==="map";Ze(Te,u,l,vr,An,W,T,yi,Se.toUnwrapped(),q.width,q.height,Yn,_i)}const zn=l&&re||gn,Ar=X||zn?Wo:W?vr:u.transform.clipSpaceToPixelsMatrix,Rn=Ce&&i.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ea;Ea=Ce?Te.iconsInText?sc(He.kind,mt,Q,W,X,zn,u,Ar,mn,Yn,Yt,Ii,fe):ac(He.kind,mt,Q,W,X,zn,u,Ar,mn,Yn,l,Yt,0,fe):nc(He.kind,mt,Q,W,X,zn,u,Ar,mn,Yn,l,Yt,fe);const Aa={program:jt,buffers:je,uniformValues:Ea,projectionData:Jn,atlasTexture:ii,atlasTextureIcon:Bi,atlasInterpolation:Ut,atlasInterpolationIcon:Ht,isSDF:Ce,hasHalo:Rn};if(ee&&Te.canOverlap){te=!0;const _i=je.segments.get();for(const yi of _i)me.push({segments:new o.aG([yi]),sortKey:yi.sortKey,state:Aa,terrainData:Wt})}else me.push({segments:je.segments,sortKey:0,state:Aa,terrainData:Wt})}te&&me.sort((Se,Ie)=>Se.sortKey-Ie.sortKey);for(const Se of me){const Ie=Se.state;if(O.activeTexture.set(Z.TEXTURE0),Ie.atlasTexture.bind(Ie.atlasInterpolation,Z.CLAMP_TO_EDGE),Ie.atlasTextureIcon&&(O.activeTexture.set(Z.TEXTURE1),Ie.atlasTextureIcon&&Ie.atlasTextureIcon.bind(Ie.atlasInterpolationIcon,Z.CLAMP_TO_EDGE)),Ie.isSDF){const Te=Ie.uniformValues;Ie.hasHalo&&(Te.u_is_halo=1,Xo(Ie.buffers,Se.segments,i,u,Ie.program,oe,I,E,Te,Ie.projectionData,Se.terrainData)),Te.u_is_halo=0}Xo(Ie.buffers,Se.segments,i,u,Ie.program,oe,I,E,Ie.uniformValues,Ie.projectionData,Se.terrainData)}}function Xo(u,e,i,s,l,h,f,_,v,T,I){const E=s.context;l.draw(E,E.gl.TRIANGLES,h,f,_,Dt.backCCW,v,I,T,i.id,u.layoutVertexBuffer,u.indexBuffer,e,i.paint,s.transform.zoom,u.programConfigurations.get(i.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}function Hd(u,e,i,s,l){const h=u.context,f=h.gl,_=Ct.disabled,v=new ei([f.ONE,f.ONE],o.b7.transparent,[!0,!0,!0,!0]),T=e.getBucket(i);if(!T)return;const I=s.key;let E=i.heatmapFbos.get(I);E||(E=Th(h,e.tileSize,e.tileSize),i.heatmapFbos.set(I,E)),h.bindFramebuffer.set(E.framebuffer),h.viewport.set([0,0,e.tileSize,e.tileSize]),h.clear({color:o.b7.transparent});const k=T.programConfigurations.get(i.id),O=u.useProgram("heatmap",k,!l),Z=u.transform.getProjectionData({overscaledTileID:e.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),q=u.style.map.terrain.getTerrainData(s);O.draw(h,f.TRIANGLES,ft.disabled,_,v,Dt.disabled,ic(e,u.transform.zoom,i.paint.get("heatmap-intensity"),1),q,Z,i.id,T.layoutVertexBuffer,T.indexBuffer,T.segments,i.paint,u.transform.zoom,k)}function _c(u,e,i,s,l){const h=u.context,f=h.gl,_=u.transform;h.setColorMode(u.colorModeForRenderPass());const v=yc(h,e),T=i.key,I=e.heatmapFbos.get(T);if(!I)return;h.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,I.colorAttachment.get()),h.activeTexture.set(f.TEXTURE1),v.bind(f.LINEAR,f.CLAMP_TO_EDGE);const E=_.getProjectionData({overscaledTileID:i,applyTerrainMatrix:l,applyGlobeMatrix:!s});u.useProgram("heatmapTexture").draw(h,f.TRIANGLES,ft.disabled,Ct.disabled,u.colorModeForRenderPass(),Dt.disabled,rc(u,e,0,1),null,E,e.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments,e.paint,_.zoom),I.destroy(),e.heatmapFbos.delete(T)}function Th(u,e,i){var s,l;const h=u.gl,f=h.createTexture();h.bindTexture(h.TEXTURE_2D,f),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.LINEAR),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.LINEAR);const _=(s=u.HALF_FLOAT)!==null&&s!==void 0?s:h.UNSIGNED_BYTE,v=(l=u.RGBA16F)!==null&&l!==void 0?l:h.RGBA;h.texImage2D(h.TEXTURE_2D,0,v,e,i,0,h.RGBA,_,null);const T=u.createFramebuffer(e,i,!1,!1);return T.colorAttachment.set(f),T}function yc(u,e){return e.colorRampTexture||(e.colorRampTexture=new Ot(u,e.colorRamp,u.gl.RGBA)),e.colorRampTexture}function Ws(u,e,i,s,l){if(!i||!s||!s.imageAtlas)return;const h=s.imageAtlas.patternPositions;let f=h[i.to.toString()],_=h[i.from.toString()];if(!f&&_&&(f=_),!_&&f&&(_=f),!f||!_){const v=l.getPaintProperty(e);f=h[v],_=h[v]}f&&_&&u.setConstantPatternPositions(f,_)}function Ko(u,e,i,s,l,h,f,_){const v=u.context.gl,T="fill-pattern",I=i.paint.get(T),E=I&&I.constantOr(1),k=i.getCrossfadeParameters();let O,Z,q,G,W;const X=u.transform,Q=i.paint.get("fill-translate"),ee=i.paint.get("fill-translate-anchor");f?(Z=E&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",O=v.LINES):(Z=E?"fillPattern":"fill",O=v.TRIANGLES);const te=I.constantOr(null);for(const oe of s){const re=e.getTile(oe);if(E&&!re.patternsLoaded())continue;const me=re.getBucket(i);if(!me)continue;const fe=me.programConfigurations.get(i.id),Se=u.useProgram(Z,fe),Ie=u.style.map.terrain&&u.style.map.terrain.getTerrainData(oe);E&&(u.context.activeTexture.set(v.TEXTURE0),re.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),fe.updatePaintBuffers(k)),Ws(fe,T,te,re,i);const Te=X.getProjectionData({overscaledTileID:oe,applyGlobeMatrix:!_,applyTerrainMatrix:!0}),je=o.ax(X,re,Q,ee);if(f){G=me.indexBuffer2,W=me.segments2;const Ce=[v.drawingBufferWidth,v.drawingBufferHeight];q=Z==="fillOutlinePattern"&&E?Bd(u,k,re,Ce,je):ns(Ce,je)}else G=me.indexBuffer,W=me.segments,q=E?rh(u,k,re,je):{u_fill_translate:je};let Be;if(u.renderPass==="translucent"&&_){const[Ce]=u.getStencilConfigForOverlapAndUpdateStencilID(s);Be=Ce[oe.overscaledZ]}else Be=u.stencilModeForClipping(oe);Se.draw(u.context,O,l,Be,h,Dt.backCCW,q,Ie,Te,i.id,me.layoutVertexBuffer,G,W,i.paint,u.transform.zoom,fe)}}function Yo(u,e,i,s,l,h,f,_){const v=u.context,T=v.gl,I="fill-extrusion-pattern",E=i.paint.get(I),k=E.constantOr(1),O=i.getCrossfadeParameters(),Z=i.paint.get("fill-extrusion-opacity"),q=E.constantOr(null),G=u.transform;for(const W of s){const X=e.getTile(W),Q=X.getBucket(i);if(!Q)continue;const ee=u.style.map.terrain&&u.style.map.terrain.getTerrainData(W),te=Q.programConfigurations.get(i.id),oe=u.useProgram(k?"fillExtrusionPattern":"fillExtrusion",te);k&&(u.context.activeTexture.set(T.TEXTURE0),X.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),te.updatePaintBuffers(O));const re=G.getProjectionData({overscaledTileID:W,applyGlobeMatrix:!_,applyTerrainMatrix:!0});Ws(te,I,q,X,i);const me=o.ax(G,X,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),fe=i.paint.get("fill-extrusion-vertical-gradient"),Se=k?Fo(u,fe,Z,me,W,O,X):ih(u,fe,Z,me);oe.draw(v,v.gl.TRIANGLES,l,h,f,Dt.backCCW,Se,ee,re,i.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,i.paint,u.transform.zoom,te,u.style.map.terrain&&Q.centroidVertexBuffer)}}function Jo(u,e,i,s,l,h,f,_,v){var T;const I=u.style.projection,E=u.context,k=u.transform,O=E.gl,Z=u.useProgram("hillshade"),q=!u.options.moving;for(const G of s){const W=e.getTile(G),X=W.fbo;if(!X)continue;const Q=I.getMeshFromTileID(E,G.canonical,_,!0,"raster"),ee=(T=u.style.map.terrain)===null||T===void 0?void 0:T.getTerrainData(G);E.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,X.colorAttachment.get());const te=k.getProjectionData({overscaledTileID:G,aligned:q,applyGlobeMatrix:!v,applyTerrainMatrix:!0});Z.draw(E,O.TRIANGLES,h,l[G.overscaledZ],f,Dt.backCCW,sh(u,W,i),ee,te,i.id,Q.vertexBuffer,Q.indexBuffer,Q.segments)}}const cs=[new o.P(0,0),new o.P(o.Z,0),new o.P(o.Z,o.Z),new o.P(0,o.Z)];function us(u,e,i,s,l,h,f,_,v=!1,T=!1){const I=s[s.length-1].overscaledZ,E=u.context,k=E.gl,O=u.useProgram("raster"),Z=u.transform,q=u.style.projection,G=u.colorModeForRenderPass(),W=!u.options.moving;for(const X of s){const Q=u.getDepthModeForSublayer(X.overscaledZ-I,i.paint.get("raster-opacity")===1?ft.ReadWrite:ft.ReadOnly,k.LESS),ee=e.getTile(X);ee.registerFadeDuration(i.paint.get("raster-fade-duration"));const te=e.findLoadedParent(X,0),oe=e.findLoadedSibling(X),re=Xd(ee,te||oe||null,e,i,u.transform,u.style.map.terrain);let me,fe;const Se=i.paint.get("raster-resampling")==="nearest"?k.NEAREST:k.LINEAR;E.activeTexture.set(k.TEXTURE0),ee.texture.bind(Se,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),E.activeTexture.set(k.TEXTURE1),te?(te.texture.bind(Se,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),me=Math.pow(2,te.tileID.overscaledZ-ee.tileID.overscaledZ),fe=[ee.tileID.canonical.x*me%1,ee.tileID.canonical.y*me%1]):ee.texture.bind(Se,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),ee.texture.useMipmap&&E.extTextureFilterAnisotropic&&u.transform.pitch>20&&k.texParameterf(k.TEXTURE_2D,E.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,E.extTextureFilterAnisotropicMax);const Ie=u.style.map.terrain&&u.style.map.terrain.getTerrainData(X),Te=Z.getProjectionData({overscaledTileID:X,aligned:W,applyGlobeMatrix:!T,applyTerrainMatrix:!0}),je=Nd(fe||[0,0],me||1,re,i,_),Be=q.getMeshFromTileID(E,X.canonical,h,f,"raster");O.draw(E,k.TRIANGLES,Q,l?l[X.overscaledZ]:Ct.disabled,G,v?Dt.frontCCW:Dt.backCCW,je,Ie,Te,i.id,Be.vertexBuffer,Be.indexBuffer,Be.segments)}}function Xd(u,e,i,s,l,h){const f=s.paint.get("raster-fade-duration");if(!h&&f>0){const _=xe.now(),v=(_-u.timeAdded)/f,T=e?(_-e.timeAdded)/f:-1,I=i.getSource(),E=Sn(l,{tileSize:I.tileSize,roundZoom:I.roundZoom}),k=!e||Math.abs(e.tileID.overscaledZ-E)>Math.abs(u.tileID.overscaledZ-E),O=k&&u.refreshedUponExpiration?1:o.ae(k?v:1-T,0,1);return u.refreshedUponExpiration&&v>=1&&(u.refreshedUponExpiration=!1),e?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}const Ph=new o.b7(1,0,0,1),wi=new o.b7(0,1,0,1),wa=new o.b7(0,0,1,1),Vr=new o.b7(1,0,1,1),xc=new o.b7(0,1,1,1);function Qo(u,e,i,s){kn(u,0,e+i/2,u.transform.width,i,s)}function vc(u,e,i,s){kn(u,e-i/2,0,i,u.transform.height,s)}function kn(u,e,i,s,l,h){const f=u.context,_=f.gl;_.enable(_.SCISSOR_TEST),_.scissor(e*u.pixelRatio,i*u.pixelRatio,s*u.pixelRatio,l*u.pixelRatio),f.clear({color:h}),_.disable(_.SCISSOR_TEST)}function Hs(u,e,i){const s=u.context,l=s.gl,h=u.useProgram("debug"),f=ft.disabled,_=Ct.disabled,v=u.colorModeForRenderPass(),T="$debug",I=u.style.map.terrain&&u.style.map.terrain.getTerrainData(i);s.activeTexture.set(l.TEXTURE0);const E=e.getTileByID(i.key).latestRawTileData,k=Math.floor((E&&E.byteLength||0)/1024),O=e.getTile(i).tileSize,Z=512/Math.min(O,512)*(i.overscaledZ/u.transform.zoom)*.5;let q=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(q+=` => ${i.overscaledZ}`),function(W,X){W.initDebugOverlayCanvas();const Q=W.debugOverlayCanvas,ee=W.context.gl,te=W.debugOverlayCanvas.getContext("2d");te.clearRect(0,0,Q.width,Q.height),te.shadowColor="white",te.shadowBlur=2,te.lineWidth=1.5,te.strokeStyle="white",te.textBaseline="top",te.font="bold 36px Open Sans, sans-serif",te.fillText(X,5,5),te.strokeText(X,5,5),W.debugOverlayTexture.update(Q),W.debugOverlayTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE)}(u,`${q} ${k}kB`);const G=u.transform.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!0,applyTerrainMatrix:!0});h.draw(s,l.TRIANGLES,f,_,ei.alphaBlended,Dt.disabled,Bo(o.b7.transparent,Z),null,G,T,u.debugBuffer,u.quadTriangleIndexBuffer,u.debugSegments),h.draw(s,l.LINE_STRIP,f,_,v,Dt.disabled,Bo(o.b7.red),I,G,T,u.debugBuffer,u.tileBorderIndexBuffer,u.debugSegments)}function el(u,e,i,s){const{isRenderingGlobe:l}=s,h=u.context,f=h.gl,_=u.transform,v=u.colorModeForRenderPass(),T=u.getDepthModeFor3D(),I=u.useProgram("terrain");h.bindFramebuffer.set(null),h.viewport.set([0,0,u.width,u.height]);for(const E of i){const k=e.getTerrainMesh(E.tileID),O=u.renderToTexture.getTexture(E),Z=e.getTerrainData(E.tileID);h.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,O.texture);const q=e.getMeshFrameDelta(_.zoom),G=_.calculateFogMatrix(E.tileID.toUnwrapped()),W=un(q,G,u.style.sky,_.pitch,l),X=_.getProjectionData({overscaledTileID:E.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});I.draw(h,f.TRIANGLES,T,Ct.disabled,v,Dt.backCCW,W,Z,X,"terrain",k.vertexBuffer,k.indexBuffer,k.segments)}}function bc(u,e){if(!e.mesh){const i=new o.aF;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1);const s=new o.aH;s.emplaceBack(0,1,2),s.emplaceBack(0,2,3),e.mesh=new ma(u.createVertexBuffer(i,Wn.members),u.createIndexBuffer(s),o.aG.simpleSegment(0,0,i.length,s.length))}return e.mesh}class Sh{constructor(e,i){this.context=new Wd(e),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:o.at(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=N.maxUnderzooming+N.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ko}resize(e,i,s){if(this.width=Math.floor(e*s),this.height=Math.floor(i*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const e=this.context,i=new o.aF;i.emplaceBack(0,0),i.emplaceBack(o.Z,0),i.emplaceBack(0,o.Z),i.emplaceBack(o.Z,o.Z),this.tileExtentBuffer=e.createVertexBuffer(i,Wn.members),this.tileExtentSegments=o.aG.simpleSegment(0,0,4,2);const s=new o.aF;s.emplaceBack(0,0),s.emplaceBack(o.Z,0),s.emplaceBack(0,o.Z),s.emplaceBack(o.Z,o.Z),this.debugBuffer=e.createVertexBuffer(s,Wn.members),this.debugSegments=o.aG.simpleSegment(0,0,4,5);const l=new o.bW;l.emplaceBack(0,0,0,0),l.emplaceBack(o.Z,0,o.Z,0),l.emplaceBack(0,o.Z,0,o.Z),l.emplaceBack(o.Z,o.Z,o.Z,o.Z),this.rasterBoundsBuffer=e.createVertexBuffer(l,ec.members),this.rasterBoundsSegments=o.aG.simpleSegment(0,0,4,2);const h=new o.aF;h.emplaceBack(0,0),h.emplaceBack(o.Z,0),h.emplaceBack(0,o.Z),h.emplaceBack(o.Z,o.Z),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(h,Wn.members),this.rasterBoundsSegmentsPosOnly=o.aG.simpleSegment(0,0,4,5);const f=new o.aF;f.emplaceBack(0,0),f.emplaceBack(1,0),f.emplaceBack(0,1),f.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(f,Wn.members),this.viewportSegments=o.aG.simpleSegment(0,0,4,2);const _=new o.bX;_.emplaceBack(0),_.emplaceBack(1),_.emplaceBack(3),_.emplaceBack(2),_.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(_);const v=new o.aH;v.emplaceBack(1,0,2),v.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(v);const T=this.context.gl;this.stencilClearMode=new Ct({func:T.ALWAYS,mask:0},0,255,T.ZERO,T.ZERO,T.ZERO),this.tileExtentMesh=new ma(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=o.K();o.bO(s,0,this.width,this.height,0,0,1),o.M(s,s,[i.drawingBufferWidth,i.drawingBufferHeight,0]);const l={mainMatrix:s,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:s};this.useProgram("clippingMask",null,!0).draw(e,i.TRIANGLES,ft.disabled,this.stencilClearMode,ei.disabled,Dt.disabled,null,null,l,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,i,s){if(this.currentStencilSource===e.source||!e.isTileClipped()||!i||!i.length)return;this.currentStencilSource=e.source,this.nextStencilID+i.length>256&&this.clearStencil();const l=this.context;l.setColorMode(ei.disabled),l.setDepthMode(ft.disabled);const h={};for(const f of i)h[f.key]=this.nextStencilID++;this._renderTileMasks(h,i,s,!0),this._renderTileMasks(h,i,s,!1),this._tileClippingMaskIDs=h}_renderTileMasks(e,i,s,l){const h=this.context,f=h.gl,_=this.style.projection,v=this.transform,T=this.useProgram("clippingMask");for(const I of i){const E=e[I.key],k=this.style.map.terrain&&this.style.map.terrain.getTerrainData(I),O=_.getMeshFromTileID(this.context,I.canonical,l,!0,"stencil"),Z=v.getProjectionData({overscaledTileID:I,applyGlobeMatrix:!0,applyTerrainMatrix:!0});T.draw(h,f.TRIANGLES,ft.disabled,new Ct({func:f.ALWAYS,mask:0},E,255,f.KEEP,f.KEEP,f.REPLACE),ei.disabled,s?Dt.disabled:Dt.backCCW,null,k,Z,"$clipping",O.vertexBuffer,O.indexBuffer,O.segments)}}_renderTilesDepthBuffer(){const e=this.context,i=e.gl,s=this.style.projection,l=this.transform,h=this.useProgram("depth"),f=this.getDepthModeFor3D(),_=he(l,{tileSize:l.tileSize});for(const v of _){const T=this.style.map.terrain&&this.style.map.terrain.getTerrainData(v),I=s.getMeshFromTileID(this.context,v.canonical,!0,!0,"raster"),E=l.getProjectionData({overscaledTileID:v,applyGlobeMatrix:!0,applyTerrainMatrix:!0});h.draw(e,i.TRIANGLES,f,Ct.disabled,ei.disabled,Dt.backCCW,null,T,E,"$clipping",I.vertexBuffer,I.indexBuffer,I.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,i=this.context.gl;return new Ct({func:i.NOTEQUAL,mask:255},e,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(e){const i=this.context.gl;return new Ct({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,i.KEEP,i.KEEP,i.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){const i=this.context.gl,s=e.sort((f,_)=>_.overscaledZ-f.overscaledZ),l=s[s.length-1].overscaledZ,h=s[0].overscaledZ-l+1;if(h>1){this.currentStencilSource=void 0,this.nextStencilID+h>256&&this.clearStencil();const f={};for(let _=0;_<h;_++)f[_+l]=new Ct({func:i.GEQUAL,mask:255},_+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=h,[f,s]}return[{[l]:Ct.disabled},s]}stencilConfigForOverlapTwoPass(e){const i=this.context.gl,s=e.sort((f,_)=>_.overscaledZ-f.overscaledZ),l=s[s.length-1].overscaledZ,h=s[0].overscaledZ-l+1;if(this.clearStencil(),h>1){const f={},_={};for(let v=0;v<h;v++)f[v+l]=new Ct({func:i.GREATER,mask:255},h+1+v,255,i.KEEP,i.KEEP,i.REPLACE),_[v+l]=new Ct({func:i.GREATER,mask:255},1+v,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID=2*h+1,[f,_,s]}return this.nextStencilID=3,[{[l]:new Ct({func:i.GREATER,mask:255},2,255,i.KEEP,i.KEEP,i.REPLACE)},{[l]:new Ct({func:i.GREATER,mask:255},1,255,i.KEEP,i.KEEP,i.REPLACE)},s]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new ei([e.CONSTANT_COLOR,e.ONE],new o.b7(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?ei.unblended:ei.alphaBlended}getDepthModeForSublayer(e,i,s){if(!this.opaquePassEnabledForLayer())return ft.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new ft(s||this.context.gl.LEQUAL,i,[l,l])}getDepthModeFor3D(){return new ft(this.context.gl.LEQUAL,ft.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,i){var s,l;this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(xe.now()),this.imageManager.beginFrame();const h=this.style._order,f=this.style.sourceCaches,_={},v={},T={},I={isRenderingToTexture:!1,isRenderingGlobe:((s=e.projection)===null||s===void 0?void 0:s.transitionState)>0};for(const k in f){const O=f[k];O.used&&O.prepare(this.context),_[k]=O.getVisibleCoordinates(!1),v[k]=_[k].slice().reverse(),T[k]=O.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let k=0;k<h.length;k++)if(this.style._layers[h[k]].is3D()){this.opaquePassCutoff=k;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const k of h){const O=this.style._layers[k];if(!O.hasOffscreenPass()||O.isHidden(this.transform.zoom))continue;const Z=v[O.source];(O.type==="custom"||Z.length)&&this.renderLayer(this,f[O.source],O,Z,I)}if((l=this.style.projection)===null||l===void 0||l.updateGPUdependent({context:this.context,useProgram:k=>this.useProgram(k)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?o.b7.black:o.b7.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(k,O){const Z=k.context,q=Z.gl,G=((oe,re,me)=>{const fe=Math.cos(re.rollInRadians),Se=Math.sin(re.rollInRadians),Ie=Xa(re),Te=re.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:oe.properties.get("sky-color"),u_horizon_color:oe.properties.get("horizon-color"),u_horizon:[(re.width/2-Ie*Se)*me,(re.height/2+Ie*fe)*me],u_horizon_normal:[-Se,fe],u_sky_horizon_blend:oe.properties.get("sky-horizon-blend")*re.height/2*me,u_sky_blend:Te}})(O,k.style.map.transform,k.pixelRatio),W=new ft(q.LEQUAL,ft.ReadWrite,[0,1]),X=Ct.disabled,Q=k.colorModeForRenderPass(),ee=k.useProgram("sky"),te=bc(Z,O);ee.draw(Z,q.TRIANGLES,W,X,Q,Dt.disabled,G,null,void 0,"sky",te.vertexBuffer,te.indexBuffer,te.segments)}(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=h.length-1;this.currentLayer>=0;this.currentLayer--){const k=this.style._layers[h[this.currentLayer]],O=f[k.source],Z=_[k.source];this._renderTileClippingMasks(k,Z,!1),this.renderLayer(this,O,k,Z,I)}this.renderPass="translucent";let E=!1;for(this.currentLayer=0;this.currentLayer<h.length;this.currentLayer++){const k=this.style._layers[h[this.currentLayer]],O=f[k.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(k,I))continue;this.opaquePassEnabledForLayer()||E||(E=!0,I.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const Z=(k.type==="symbol"?T:v)[k.source];this._renderTileClippingMasks(k,_[k.source],!1),this.renderLayer(this,O,k,Z,I)}if(I.isRenderingGlobe&&function(k,O,Z){const q=k.context,G=q.gl,W=k.useProgram("atmosphere"),X=new ft(G.LEQUAL,ft.ReadOnly,[0,1]),Q=k.transform,ee=function(Te,je){const Be=Te.properties.get("position"),Ce=[-Be.x,-Be.y,-Be.z],He=o.at(new Float64Array(16));return Te.properties.get("anchor")==="map"&&(o.a_(He,He,je.rollInRadians),o.a$(He,He,-je.pitchInRadians),o.a_(He,He,je.bearingInRadians),o.a$(He,He,je.center.lat*Math.PI/180),o.bm(He,He,-je.center.lng*Math.PI/180)),o.bV(Ce,Ce,He),Ce}(Z,k.transform),te=Q.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),oe=O.properties.get("atmosphere-blend")*te.projectionTransition;if(oe===0)return;const re=Ro(Q.worldSize,Q.center.lat),me=Q.inverseProjectionMatrix,fe=new Float64Array(4);fe[3]=1,o.ap(fe,fe,Q.modelViewProjectionMatrix),fe[0]/=fe[3],fe[1]/=fe[3],fe[2]/=fe[3],fe[3]=1,o.ap(fe,fe,me),fe[0]/=fe[3],fe[1]/=fe[3],fe[2]/=fe[3],fe[3]=1;const Se=((Te,je,Be,Ce,He)=>({u_sun_pos:Te,u_atmosphere_blend:je,u_globe_position:Be,u_globe_radius:Ce,u_inv_proj_matrix:He}))(ee,oe,[fe[0],fe[1],fe[2]],re,me),Ie=bc(q,O);W.draw(q,G.TRIANGLES,X,Ct.disabled,ei.alphaBlended,Dt.disabled,Se,null,null,"atmosphere",Ie.vertexBuffer,Ie.indexBuffer,Ie.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const k=function(O,Z){let q=null;const G=Object.values(O._layers).flatMap(ee=>ee.source&&!ee.isHidden(Z)?[O.sourceCaches[ee.source]]:[]),W=G.filter(ee=>ee.getSource().type==="vector"),X=G.filter(ee=>ee.getSource().type!=="vector"),Q=ee=>{(!q||q.getSource().maxzoom<ee.getSource().maxzoom)&&(q=ee)};return W.forEach(ee=>Q(ee)),q||X.forEach(ee=>Q(ee)),q}(this.style,this.transform.zoom);k&&function(O,Z,q){for(let G=0;G<q.length;G++)Hs(O,Z,q[G])}(this,k,k.getVisibleCoordinates())}this.options.showPadding&&function(k){const O=k.transform.padding;Qo(k,k.transform.height-(O.top||0),3,Ph),Qo(k,O.bottom||0,3,wi),vc(k,O.left||0,3,wa),vc(k,k.transform.width-(O.right||0),3,Vr);const Z=k.transform.centerPoint;(function(q,G,W,X){kn(q,G-1,W-10,2,20,X),kn(q,G-10,W-1,20,2,X)})(k,Z.x,k.transform.height-Z.y,xc)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const i=this.terrainFacilitator.matrix,s=this.transform.modelViewProjectionMatrix;let l=this.terrainFacilitator.dirty;l||(l=e?!o.bY(i,s):!o.bZ(i,s)),l||(l=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),l&&(o.b_(i,s),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(h,f){const _=h.context,v=_.gl,T=h.transform,I=ei.unblended,E=new ft(v.LEQUAL,ft.ReadWrite,[0,1]),k=f.sourceCache.getRenderableTiles(),O=h.useProgram("terrainDepth");_.bindFramebuffer.set(f.getFramebuffer("depth").framebuffer),_.viewport.set([0,0,h.width/devicePixelRatio,h.height/devicePixelRatio]),_.clear({color:o.b7.transparent,depth:1});for(const Z of k){const q=f.getTerrainMesh(Z.tileID),G=f.getTerrainData(Z.tileID),W=T.getProjectionData({overscaledTileID:Z.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),X={u_ele_delta:f.getMeshFrameDelta(T.zoom)};O.draw(_,v.TRIANGLES,E,Ct.disabled,I,Dt.backCCW,X,G,W,"terrain",q.vertexBuffer,q.indexBuffer,q.segments)}_.bindFramebuffer.set(null),_.viewport.set([0,0,h.width,h.height])}(this,this.style.map.terrain),function(h,f){const _=h.context,v=_.gl,T=h.transform,I=ei.unblended,E=new ft(v.LEQUAL,ft.ReadWrite,[0,1]),k=f.getCoordsTexture(),O=f.sourceCache.getRenderableTiles(),Z=h.useProgram("terrainCoords");_.bindFramebuffer.set(f.getFramebuffer("coords").framebuffer),_.viewport.set([0,0,h.width/devicePixelRatio,h.height/devicePixelRatio]),_.clear({color:o.b7.transparent,depth:1}),f.coordsIndex=[];for(const q of O){const G=f.getTerrainMesh(q.tileID),W=f.getTerrainData(q.tileID);_.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,k.texture);const X={u_terrain_coords_id:(255-f.coordsIndex.length)/255,u_texture:0,u_ele_delta:f.getMeshFrameDelta(T.zoom)},Q=T.getProjectionData({overscaledTileID:q.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});Z.draw(_,v.TRIANGLES,E,Ct.disabled,I,Dt.backCCW,X,W,Q,"terrain",G.vertexBuffer,G.indexBuffer,G.segments),f.coordsIndex.push(q.tileID.key)}_.bindFramebuffer.set(null),_.viewport.set([0,0,h.width,h.height])}(this,this.style.map.terrain))}renderLayer(e,i,s,l,h){s.isHidden(this.transform.zoom)||(s.type==="background"||s.type==="custom"||(l||[]).length)&&(this.id=s.id,o.b$(s)?function(f,_,v,T,I,E){if(f.renderPass!=="translucent")return;const{isRenderingToTexture:k}=E,O=Ct.disabled,Z=f.colorModeForRenderPass();(v._unevaluatedLayout.hasValue("text-variable-anchor")||v._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(q,G,W,X,Q,ee,te,oe,re){const me=G.transform,fe=G.style.map.terrain,Se=Q==="map",Ie=ee==="map";for(const Te of q){const je=X.getTile(Te),Be=je.getBucket(W);if(!Be||!Be.text||!Be.text.segments.get().length)continue;const Ce=o.ag(Be.textSizeData,me.zoom),He=o.aw(je,1,G.transform.zoom),pt=pe(Se,G.transform,He),jt=W.layout.get("icon-text-fit")!=="none"&&Be.hasIconData();if(Ce){const mt=Math.pow(2,me.zoom-je.tileID.overscaledZ),Wt=fe?(Yt,ii)=>fe.getElevation(Te,Yt,ii):null;wh(Be,Se,Ie,re,me,pt,mt,Ce,jt,o.ax(me,je,te,oe),Te.toUnwrapped(),Wt)}}}(T,f,v,_,v.layout.get("text-rotation-alignment"),v.layout.get("text-pitch-alignment"),v.paint.get("text-translate"),v.paint.get("text-translate-anchor"),I),v.paint.get("icon-opacity").constantOr(1)!==0&&qs(f,_,v,T,!1,v.paint.get("icon-translate"),v.paint.get("icon-translate-anchor"),v.layout.get("icon-rotation-alignment"),v.layout.get("icon-pitch-alignment"),v.layout.get("icon-keep-upright"),O,Z,k),v.paint.get("text-opacity").constantOr(1)!==0&&qs(f,_,v,T,!0,v.paint.get("text-translate"),v.paint.get("text-translate-anchor"),v.layout.get("text-rotation-alignment"),v.layout.get("text-pitch-alignment"),v.layout.get("text-keep-upright"),O,Z,k),_.map.showCollisionBoxes&&(Gs(f,_,v,T,!0),Gs(f,_,v,T,!1))}(e,i,s,l,this.style.placement.variableOffsets,h):o.c0(s)?function(f,_,v,T,I){if(f.renderPass!=="translucent")return;const{isRenderingToTexture:E}=I,k=v.paint.get("circle-opacity"),O=v.paint.get("circle-stroke-width"),Z=v.paint.get("circle-stroke-opacity"),q=!v.layout.get("circle-sort-key").isConstant();if(k.constantOr(1)===0&&(O.constantOr(1)===0||Z.constantOr(1)===0))return;const G=f.context,W=G.gl,X=f.transform,Q=f.getDepthModeForSublayer(0,ft.ReadOnly),ee=Ct.disabled,te=f.colorModeForRenderPass(),oe=[],re=X.getCircleRadiusCorrection();for(let me=0;me<T.length;me++){const fe=T[me],Se=_.getTile(fe),Ie=Se.getBucket(v);if(!Ie)continue;const Te=v.paint.get("circle-translate"),je=v.paint.get("circle-translate-anchor"),Be=o.ax(X,Se,Te,je),Ce=Ie.programConfigurations.get(v.id),He=f.useProgram("circle",Ce),pt=Ie.layoutVertexBuffer,jt=Ie.indexBuffer,mt=f.style.map.terrain&&f.style.map.terrain.getTerrainData(fe),Wt={programConfiguration:Ce,program:He,layoutVertexBuffer:pt,indexBuffer:jt,uniformValues:nh(f,Se,v,Be,re),terrainData:mt,projectionData:X.getProjectionData({overscaledTileID:fe,applyGlobeMatrix:!E,applyTerrainMatrix:!0})};if(q){const Yt=Ie.segments.get();for(const ii of Yt)oe.push({segments:new o.aG([ii]),sortKey:ii.sortKey,state:Wt})}else oe.push({segments:Ie.segments,sortKey:0,state:Wt})}q&&oe.sort((me,fe)=>me.sortKey-fe.sortKey);for(const me of oe){const{programConfiguration:fe,program:Se,layoutVertexBuffer:Ie,indexBuffer:Te,uniformValues:je,terrainData:Be,projectionData:Ce}=me.state;Se.draw(G,W.TRIANGLES,Q,ee,te,Dt.backCCW,je,Be,Ce,v.id,Ie,Te,me.segments,v.paint,f.transform.zoom,fe)}}(e,i,s,l,h):o.c1(s)?function(f,_,v,T,I){if(v.paint.get("heatmap-opacity")===0)return;const E=f.context,{isRenderingToTexture:k,isRenderingGlobe:O}=I;if(f.style.map.terrain){for(const Z of T){const q=_.getTile(Z);_.hasRenderableParent(Z)||(f.renderPass==="offscreen"?Hd(f,q,v,Z,O):f.renderPass==="translucent"&&_c(f,v,Z,k,O))}E.viewport.set([0,0,f.width,f.height])}else f.renderPass==="offscreen"?function(Z,q,G,W){const X=Z.context,Q=X.gl,ee=Z.transform,te=Ct.disabled,oe=new ei([Q.ONE,Q.ONE],o.b7.transparent,[!0,!0,!0,!0]);(function(re,me,fe){const Se=re.gl;re.activeTexture.set(Se.TEXTURE1),re.viewport.set([0,0,me.width/4,me.height/4]);let Ie=fe.heatmapFbos.get(o.bS);Ie?(Se.bindTexture(Se.TEXTURE_2D,Ie.colorAttachment.get()),re.bindFramebuffer.set(Ie.framebuffer)):(Ie=Th(re,me.width/4,me.height/4),fe.heatmapFbos.set(o.bS,Ie))})(X,Z,G),X.clear({color:o.b7.transparent});for(let re=0;re<W.length;re++){const me=W[re];if(q.hasRenderableParent(me))continue;const fe=q.getTile(me),Se=fe.getBucket(G);if(!Se)continue;const Ie=Se.programConfigurations.get(G.id),Te=Z.useProgram("heatmap",Ie),je=ee.getProjectionData({overscaledTileID:me,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Be=ee.getCircleRadiusCorrection();Te.draw(X,Q.TRIANGLES,ft.disabled,te,oe,Dt.backCCW,ic(fe,ee.zoom,G.paint.get("heatmap-intensity"),Be),null,je,G.id,Se.layoutVertexBuffer,Se.indexBuffer,Se.segments,G.paint,ee.zoom,Ie)}X.viewport.set([0,0,Z.width,Z.height])}(f,_,v,T):f.renderPass==="translucent"&&function(Z,q){const G=Z.context,W=G.gl;G.setColorMode(Z.colorModeForRenderPass());const X=q.heatmapFbos.get(o.bS);X&&(G.activeTexture.set(W.TEXTURE0),W.bindTexture(W.TEXTURE_2D,X.colorAttachment.get()),G.activeTexture.set(W.TEXTURE1),yc(G,q).bind(W.LINEAR,W.CLAMP_TO_EDGE),Z.useProgram("heatmapTexture").draw(G,W.TRIANGLES,ft.disabled,Ct.disabled,Z.colorModeForRenderPass(),Dt.disabled,rc(Z,q,0,1),null,null,q.id,Z.viewportBuffer,Z.quadTriangleIndexBuffer,Z.viewportSegments,q.paint,Z.transform.zoom))}(f,v)}(e,i,s,l,h):o.c2(s)?function(f,_,v,T,I){if(f.renderPass!=="translucent")return;const{isRenderingToTexture:E}=I,k=v.paint.get("line-opacity"),O=v.paint.get("line-width");if(k.constantOr(1)===0||O.constantOr(1)===0)return;const Z=f.getDepthModeForSublayer(0,ft.ReadOnly),q=f.colorModeForRenderPass(),G=v.paint.get("line-dasharray"),W=v.paint.get("line-pattern"),X=W.constantOr(1),Q=v.paint.get("line-gradient"),ee=v.getCrossfadeParameters(),te=X?"linePattern":G?"lineSDF":Q?"lineGradient":"line",oe=f.context,re=oe.gl,me=f.transform;let fe=!0;for(const Se of T){const Ie=_.getTile(Se);if(X&&!Ie.patternsLoaded())continue;const Te=Ie.getBucket(v);if(!Te)continue;const je=Te.programConfigurations.get(v.id),Be=f.context.program.get(),Ce=f.useProgram(te,je),He=fe||Ce.program!==Be,pt=f.style.map.terrain&&f.style.map.terrain.getTerrainData(Se),jt=W.constantOr(null);if(jt&&Ie.imageAtlas){const Ut=Ie.imageAtlas,Ht=Ut.patternPositions[jt.to.toString()],Ii=Ut.patternPositions[jt.from.toString()];Ht&&Ii&&je.setConstantPatternPositions(Ht,Ii)}const mt=me.getProjectionData({overscaledTileID:Se,applyGlobeMatrix:!E,applyTerrainMatrix:!0}),Wt=me.getPixelScale(),Yt=X?Zs(f,Ie,v,Wt,ee):G?jd(f,Ie,v,Wt,G,ee):Q?lh(f,Ie,v,Wt,Te.lineClipsArray.length):Oo(f,Ie,v,Wt);if(X)oe.activeTexture.set(re.TEXTURE0),Ie.imageAtlasTexture.bind(re.LINEAR,re.CLAMP_TO_EDGE),je.updatePaintBuffers(ee);else if(G&&(He||f.lineAtlas.dirty))oe.activeTexture.set(re.TEXTURE0),f.lineAtlas.bind(oe);else if(Q){const Ut=Te.gradients[v.id];let Ht=Ut.texture;if(v.gradientVersion!==Ut.version){let Ii=256;if(v.stepInterpolant){const Bi=_.getSource().maxzoom,Zi=Se.canonical.z===Bi?Math.ceil(1<<f.transform.maxZoom-Se.canonical.z):1;Ii=o.ae(o.bT(Te.maxLineLength/o.Z*1024*Zi),256,oe.maxTextureSize)}Ut.gradient=o.bU({expression:v.gradientExpression(),evaluationKey:"lineProgress",resolution:Ii,image:Ut.gradient||void 0,clips:Te.lineClipsArray}),Ut.texture?Ut.texture.update(Ut.gradient):Ut.texture=new Ot(oe,Ut.gradient,re.RGBA),Ut.version=v.gradientVersion,Ht=Ut.texture}oe.activeTexture.set(re.TEXTURE0),Ht.bind(v.stepInterpolant?re.NEAREST:re.LINEAR,re.CLAMP_TO_EDGE)}let ii;if(E){const[Ut]=f.getStencilConfigForOverlapAndUpdateStencilID(T);ii=Ut[Se.overscaledZ]}else ii=f.stencilModeForClipping(Se);Ce.draw(oe,re.TRIANGLES,Z,ii,q,Dt.disabled,Yt,pt,mt,v.id,Te.layoutVertexBuffer,Te.indexBuffer,Te.segments,v.paint,f.transform.zoom,je,Te.layoutVertexBuffer2),fe=!1}}(e,i,s,l,h):o.c3(s)?function(f,_,v,T,I){const E=v.paint.get("fill-color"),k=v.paint.get("fill-opacity");if(k.constantOr(1)===0)return;const{isRenderingToTexture:O}=I,Z=f.colorModeForRenderPass(),q=v.paint.get("fill-pattern"),G=f.opaquePassEnabledForLayer()&&!q.constantOr(1)&&E.constantOr(o.b7.transparent).a===1&&k.constantOr(0)===1?"opaque":"translucent";if(f.renderPass===G){const W=f.getDepthModeForSublayer(1,f.renderPass==="opaque"?ft.ReadWrite:ft.ReadOnly);Ko(f,_,v,T,W,Z,!1,O)}if(f.renderPass==="translucent"&&v.paint.get("fill-antialias")){const W=f.getDepthModeForSublayer(v.getPaintProperty("fill-outline-color")?2:0,ft.ReadOnly);Ko(f,_,v,T,W,Z,!0,O)}}(e,i,s,l,h):o.c4(s)?function(f,_,v,T,I){const E=v.paint.get("fill-extrusion-opacity");if(E===0)return;const{isRenderingToTexture:k}=I;if(f.renderPass==="translucent"){const O=new ft(f.context.gl.LEQUAL,ft.ReadWrite,f.depthRangeFor3D);if(E!==1||v.paint.get("fill-extrusion-pattern").constantOr(1))Yo(f,_,v,T,O,Ct.disabled,ei.disabled,k),Yo(f,_,v,T,O,f.stencilModeFor3D(),f.colorModeForRenderPass(),k);else{const Z=f.colorModeForRenderPass();Yo(f,_,v,T,O,Ct.disabled,Z,k)}}}(e,i,s,l,h):o.c5(s)?function(f,_,v,T,I){if(f.renderPass!=="offscreen"&&f.renderPass!=="translucent")return;const{isRenderingToTexture:E}=I,k=f.context,O=f.style.projection.useSubdivision,Z=f.getDepthModeForSublayer(0,ft.ReadOnly),q=f.colorModeForRenderPass();if(f.renderPass==="offscreen")(function(G,W,X,Q,ee,te,oe){const re=G.context,me=re.gl;for(const fe of X){const Se=W.getTile(fe),Ie=Se.dem;if(!Ie||!Ie.data||!Se.needsHillshadePrepare)continue;const Te=Ie.dim,je=Ie.stride,Be=Ie.getPixels();if(re.activeTexture.set(me.TEXTURE1),re.pixelStoreUnpackPremultiplyAlpha.set(!1),Se.demTexture=Se.demTexture||G.getTileTexture(je),Se.demTexture){const He=Se.demTexture;He.update(Be,{premultiply:!1}),He.bind(me.NEAREST,me.CLAMP_TO_EDGE)}else Se.demTexture=new Ot(re,Be,me.RGBA,{premultiply:!1}),Se.demTexture.bind(me.NEAREST,me.CLAMP_TO_EDGE);re.activeTexture.set(me.TEXTURE0);let Ce=Se.fbo;if(!Ce){const He=new Ot(re,{width:Te,height:Te,data:null},me.RGBA);He.bind(me.LINEAR,me.CLAMP_TO_EDGE),Ce=Se.fbo=re.createFramebuffer(Te,Te,!0,!1),Ce.colorAttachment.set(He.texture)}re.bindFramebuffer.set(Ce.framebuffer),re.viewport.set([0,0,Te,Te]),G.useProgram("hillshadePrepare").draw(re,me.TRIANGLES,ee,te,oe,Dt.disabled,oh(Se.tileID,Ie),null,null,Q.id,G.rasterBoundsBuffer,G.quadTriangleIndexBuffer,G.rasterBoundsSegments),Se.needsHillshadePrepare=!1}})(f,_,T,v,Z,Ct.disabled,q),k.viewport.set([0,0,f.width,f.height]);else if(f.renderPass==="translucent")if(O){const[G,W,X]=f.stencilConfigForOverlapTwoPass(T);Jo(f,_,v,X,G,Z,q,!1,E),Jo(f,_,v,X,W,Z,q,!0,E)}else{const[G,W]=f.getStencilConfigForOverlapAndUpdateStencilID(T);Jo(f,_,v,W,G,Z,q,!1,E)}}(e,i,s,l,h):o.c6(s)?function(f,_,v,T,I){if(f.renderPass!=="translucent"||v.paint.get("raster-opacity")===0||!T.length)return;const{isRenderingToTexture:E}=I,k=_.getSource(),O=f.style.projection.useSubdivision;if(k instanceof st)us(f,_,v,T,null,!1,!1,k.tileCoords,k.flippedWindingOrder,E);else if(O){const[Z,q,G]=f.stencilConfigForOverlapTwoPass(T);us(f,_,v,G,Z,!1,!0,cs,!1,E),us(f,_,v,G,q,!0,!0,cs,!1,E)}else{const[Z,q]=f.getStencilConfigForOverlapAndUpdateStencilID(T);us(f,_,v,q,Z,!1,!0,cs,!1,E)}}(e,i,s,l,h):o.c7(s)?function(f,_,v,T,I){const E=v.paint.get("background-color"),k=v.paint.get("background-opacity");if(k===0)return;const{isRenderingToTexture:O}=I,Z=f.context,q=Z.gl,G=f.style.projection,W=f.transform,X=W.tileSize,Q=v.paint.get("background-pattern");if(f.isPatternMissing(Q))return;const ee=!Q&&E.a===1&&k===1&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==ee)return;const te=Ct.disabled,oe=f.getDepthModeForSublayer(0,ee==="opaque"?ft.ReadWrite:ft.ReadOnly),re=f.colorModeForRenderPass(),me=f.useProgram(Q?"backgroundPattern":"background"),fe=T||he(W,{tileSize:X,terrain:f.style.map.terrain});Q&&(Z.activeTexture.set(q.TEXTURE0),f.imageManager.bind(f.context));const Se=v.getCrossfadeParameters();for(const Ie of fe){const Te=W.getProjectionData({overscaledTileID:Ie,applyGlobeMatrix:!O,applyTerrainMatrix:!0}),je=Q?jo(k,f,Q,{tileID:Ie,tileSize:X},Se):hh(k,E),Be=f.style.map.terrain&&f.style.map.terrain.getTerrainData(Ie),Ce=G.getMeshFromTileID(Z,Ie.canonical,!1,!0,"raster");me.draw(Z,q.TRIANGLES,oe,te,re,Dt.backCCW,je,Be,Te,v.id,Ce.vertexBuffer,Ce.indexBuffer,Ce.segments)}}(e,0,s,l,h):o.c8(s)&&function(f,_,v,T){const{isRenderingGlobe:I}=T,E=f.context,k=v.implementation,O=f.style.projection,Z=f.transform,q=Z.getProjectionDataForCustomLayer(I),G={farZ:Z.farZ,nearZ:Z.nearZ,fov:Z.fov*Math.PI/180,modelViewProjectionMatrix:Z.modelViewProjectionMatrix,projectionMatrix:Z.projectionMatrix,shaderData:{variantName:O.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
|
|
728
728
|
uniform mat4 u_projection_matrix;
|
|
729
|
-
${O.shaderPreludeCode.vertexSource}`,define:O.shaderDefine},defaultProjectionData:q},W=k.renderingMode?k.renderingMode:"2d";if(f.renderPass==="offscreen"){const X=k.prerender;X&&(f.setCustomLayerDefaults(),E.setColorMode(f.colorModeForRenderPass()),X.call(k,E.gl,G),E.setDirty(),f.setBaseState())}else if(f.renderPass==="translucent"){f.setCustomLayerDefaults(),E.setColorMode(f.colorModeForRenderPass()),E.setStencilMode(Ct.disabled);const X=W==="3d"?f.getDepthModeFor3D():f.getDepthModeForSublayer(0,ft.ReadOnly);E.setDepthMode(X),k.render(E.gl,G),E.setDirty(),f.setBaseState(),E.bindFramebuffer.set(null)}}(e,0,s,h))}saveTileTexture(e){const i=this._tileTextures[e.size[0]];i?i.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const i=this._tileTextures[e];return i&&i.length>0?i.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const i=this.imageManager.getPattern(e.from.toString()),s=this.imageManager.getPattern(e.to.toString());return!i||!s}useProgram(e,i,s=!1){this.cache=this.cache||{};const l=!!this.style.map.terrain,h=this.style.projection,f=e+(i?i.cacheKey:"")+`/${s?Ha:h.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(l?"/terrain":"");return this.cache[f]||(this.cache[f]=new Ns(this.context,Kr[e],i,oc[e],this._showOverdrawInspector,l,s?Kr.projectionMercator:h.shaderPreludeCode,s?In:h.shaderDefine)),this.cache[f]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ot(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:i}=this.context.gl;return this.width!==e||this.height!==i}}function wc(u,e){let i,s=!1,l=null,h=null;const f=()=>{l=null,s&&(u.apply(h,i),l=setTimeout(f,e),s=!1)};return(..._)=>(s=!0,h=this,i=_,l||f(),l)}class Tc{constructor(e){this._getCurrentHash=()=>{const i=window.location.hash.replace("#","");if(this._hashName){let s;return i.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(s=l)}),(s&&s[1]||"").split("/")}return i.split("/")},this._onHashChange=()=>{const i=this._getCurrentHash();if(!this._isValidHash(i))return!1;const s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:s,pitch:+(i[4]||0)}),!0},this._updateHashUnthrottled=()=>{const i=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,i)},this._removeHash=()=>{const i=this._getCurrentHash();if(i.length===0)return;const s=i.join("/");let l=s;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l=`${this._hashName}=${s}`);let h=window.location.hash.replace(l,"");h.startsWith("#&")?h=h.slice(0,1)+h.slice(2):h==="#"&&(h="");let f=window.location.href.replace(/(#.+)?$/,h);f=f.replace("&&","&"),window.history.replaceState(window.history.state,null,f)},this._updateHash=wc(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const i=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,l=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),h=Math.pow(10,l),f=Math.round(i.lng*h)/h,_=Math.round(i.lat*h)/h,v=this._map.getBearing(),T=this._map.getPitch();let I="";if(I+=e?`/${f}/${_}/${s}`:`${s}/${_}/${f}`,(v||T)&&(I+="/"+Math.round(10*v)/10),T&&(I+=`/${Math.round(T)}`),this._hashName){const E=this._hashName;let k=!1;const O=window.location.hash.slice(1).split("&").map(Z=>{const q=Z.split("=")[0];return q===E?(k=!0,`${q}=${I}`):Z}).filter(Z=>Z);return k||O.push(`${E}=${I}`),`#${O.join("&")}`}return`#${I}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new o.Q(+e[2],+e[1])}catch{return!1}const i=+e[0],s=+(e[3]||0),l=+(e[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&s>=-180&&s<=180&&l>=this._map.getMinPitch()&&l<=this._map.getMaxPitch()}}const hs={linearity:.3,easing:o.c9(0,0,.3,1)},Ta=o.e({deceleration:2500,maxSpeed:1400},hs),Mh=o.e({deceleration:20,maxSpeed:1400},hs),Ih=o.e({deceleration:1e3,maxSpeed:360},hs),Ch=o.e({deceleration:1e3,maxSpeed:90},hs),kh=o.e({deceleration:1e3,maxSpeed:360},hs);class Eh{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:xe.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,i=xe.now();for(;e.length>0&&i-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,roll:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:h}of this._inertiaBuffer)i.zoom+=h.zoomDelta||0,i.bearing+=h.bearingDelta||0,i.pitch+=h.pitchDelta||0,i.roll+=h.rollDelta||0,h.panDelta&&i.pan._add(h.panDelta),h.around&&(i.around=h.around),h.pinchAround&&(i.pinchAround=h.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(i.pan.mag()){const h=ps(i.pan.mag(),s,o.e({},Ta,e||{})),f=i.pan.mult(h.amount/i.pan.mag()),_=this._map.cameraHelper.handlePanInertia(f,this._map.transform);l.center=_.easingCenter,l.offset=_.easingOffset,ds(l,h)}if(i.zoom){const h=ps(i.zoom,s,Mh);l.zoom=this._map.transform.zoom+h.amount,ds(l,h)}if(i.bearing){const h=ps(i.bearing,s,Ih);l.bearing=this._map.transform.bearing+o.ae(h.amount,-179,179),ds(l,h)}if(i.pitch){const h=ps(i.pitch,s,Ch);l.pitch=this._map.transform.pitch+h.amount,ds(l,h)}if(i.roll){const h=ps(i.roll,s,kh);l.roll=this._map.transform.roll+o.ae(h.amount,-179,179),ds(l,h)}if(l.zoom||l.bearing){const h=i.pinchAround===void 0?i.around:i.pinchAround;l.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),o.e(l,{noMoveStart:!0})}}function ds(u,e){(!u.duration||u.duration<e.duration)&&(u.duration=e.duration,u.easing=e.easing)}function ps(u,e,i){const{maxSpeed:s,linearity:l,deceleration:h}=i,f=o.ae(u*l/(e/1e3),-s,s),_=Math.abs(f)/(h*l);return{easing:i.easing,duration:1e3*_,amount:f*(_/2)}}class er extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,s,l={}){s=s instanceof MouseEvent?s:new MouseEvent(e,s);const h=ie.mousePos(i.getCanvas(),s),f=i.unproject(h);super(e,o.e({point:h,lngLat:f,originalEvent:s},l)),this._defaultPrevented=!1,this.target=i}}class fs extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,s){const l=e==="touchend"?s.changedTouches:s.touches,h=ie.touchPos(i.getCanvasContainer(),l),f=h.map(v=>i.unproject(v)),_=h.reduce((v,T,I,E)=>v.add(T.div(E.length)),new o.P(0,0));super(e,{points:h,point:_,lngLats:f,lngLat:i.unproject(_),originalEvent:s}),this._defaultPrevented=!1}}class Ur extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,s){super(e,{originalEvent:s}),this._defaultPrevented=!1}}class dn{constructor(e,i){this._map=e,this._clickTolerance=i.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Ur(e.type,this._map,e))}mousedown(e,i){return this._mousedownPos=i,this._firePreventable(new er(e.type,this._map,e))}mouseup(e){this._map.fire(new er(e.type,this._map,e))}click(e,i){this._mousedownPos&&this._mousedownPos.dist(i)>=this._clickTolerance||this._map.fire(new er(e.type,this._map,e))}dblclick(e){return this._firePreventable(new er(e.type,this._map,e))}mouseover(e){this._map.fire(new er(e.type,this._map,e))}mouseout(e){this._map.fire(new er(e.type,this._map,e))}touchstart(e){return this._firePreventable(new fs(e.type,this._map,e))}touchmove(e){this._map.fire(new fs(e.type,this._map,e))}touchend(e){this._map.fire(new fs(e.type,this._map,e))}touchcancel(e){this._map.fire(new fs(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ah{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new er(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new er("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new er(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class yr{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(o.P.convert(e),this._map.terrain)}}class Pa{constructor(e,i){this._map=e,this._tr=new yr(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=i.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,i){this.isEnabled()&&e.shiftKey&&e.button===0&&(ie.disableDrag(),this._startPos=this._lastPos=i,this._active=!0)}mousemoveWindow(e,i){if(!this._active)return;const s=i;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=s,this._box||(this._box=ie.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const h=Math.min(l.x,s.x),f=Math.max(l.x,s.x),_=Math.min(l.y,s.y),v=Math.max(l.y,s.y);ie.setTransform(this._box,`translate(${h}px,${_}px)`),this._box.style.width=f-h+"px",this._box.style.height=v-_+"px"}mouseupWindow(e,i){if(!this._active||e.button!==0)return;const s=this._startPos,l=i;if(this.reset(),ie.suppressClick(),s.x!==l.x||s.y!==l.y)return this._map.fire(new o.l("boxzoomend",{originalEvent:e})),{cameraAnimation:h=>h.fitScreenCoordinates(s,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(ie.remove(this._box),this._box=null),ie.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,i){return this._map.fire(new o.l(e,{originalEvent:i}))}}function Pc(u,e){if(u.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${e.length}`);const i={};for(let s=0;s<u.length;s++)i[u[s].identifier]=e[s];return i}class Kd{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,i,s){(this.centroid||s.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),s.length===this.numTouches&&(this.centroid=function(l){const h=new o.P(0,0);for(const f of l)h._add(f);return h.div(l.length)}(i),this.touches=Pc(s,i)))}touchmove(e,i,s){if(this.aborted||!this.centroid)return;const l=Pc(s,i);for(const h in this.touches){const f=l[h];(!f||f.dist(this.touches[h])>30)&&(this.aborted=!0)}}touchend(e,i,s){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Sc{constructor(e){this.singleTap=new Kd(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,i,s){this.singleTap.touchstart(e,i,s)}touchmove(e,i,s){this.singleTap.touchmove(e,i,s)}touchend(e,i,s){const l=this.singleTap.touchend(e,i,s);if(l){const h=e.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(l)<30;if(h&&f||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Yd{constructor(e){this._tr=new yr(e),this._zoomIn=new Sc({numTouches:1,numTaps:2}),this._zoomOut=new Sc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,i,s){this._zoomIn.touchstart(e,i,s),this._zoomOut.touchstart(e,i,s)}touchmove(e,i,s){this._zoomIn.touchmove(e,i,s),this._zoomOut.touchmove(e,i,s)}touchend(e,i,s){const l=this._zoomIn.touchend(e,i,s),h=this._zoomOut.touchend(e,i,s),f=this._tr;return l?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:f.zoom+1,around:f.unproject(l)},{originalEvent:e})}):h?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:f.zoom-1,around:f.unproject(h)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ms{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const i=this._moveFunction(...e);if(i.bearingDelta||i.pitchDelta||i.rollDelta||i.around||i.panDelta)return this._active=!0,i}dragStart(e,i){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(i)?i[0]:i,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,i){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const l=Array.isArray(i)?i[0]:i;return!this._moved&&l.dist(s)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(s,l))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&ie.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Xs={0:1,2:2};class Er{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const i=ie.mouseButton(e);this._eventButton=i}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(i,s){const l=Xs[s];return i.buttons===void 0||(i.buttons&l)!==l}(e,this._eventButton)}isValidEndEvent(e){return ie.mouseButton(e)===this._eventButton}}class $e{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class zh{constructor(e=new Er({checkCorrectEvent:()=>!0}),i=new $e){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=i}_executeRelevantHandler(e,i,s){return e instanceof MouseEvent?i(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?s(e):void 0}startMove(e){this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.startMove(i),i=>this.oneFingerTouchMoveStateManager.startMove(i))}endMove(e){this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.endMove(i),i=>this.oneFingerTouchMoveStateManager.endMove(i))}isValidStartEvent(e){return this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.isValidStartEvent(i),i=>this.oneFingerTouchMoveStateManager.isValidStartEvent(i))}isValidMoveEvent(e){return this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.isValidMoveEvent(i),i=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(i))}isValidEndEvent(e){return this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.isValidEndEvent(i),i=>this.oneFingerTouchMoveStateManager.isValidEndEvent(i))}}const gs=u=>{u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=e=>{e.preventDefault()}};class Rh{constructor(e,i){this._clickTolerance=e.clickTolerance||1,this._map=i,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,i,s){return this._calculateTransform(e,i,s)}touchmove(e,i,s){if(this._active){if(!this._shouldBePrevented(s.length))return e.preventDefault(),this._calculateTransform(e,i,s);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,i,s){this._calculateTransform(e,i,s),this._active&&this._shouldBePrevented(s.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,i,s){s.length>0&&(this._active=!0);const l=Pc(s,i),h=new o.P(0,0),f=new o.P(0,0);let _=0;for(const T in l){const I=l[T],E=this._touches[T];E&&(h._add(I),f._add(I.sub(E)),_++,l[T]=I)}if(this._touches=l,this._shouldBePrevented(_)||!f.mag())return;const v=f.div(_);return this._sum._add(v),this._sum.mag()<this._clickTolerance?void 0:{around:h.div(_),panDelta:v}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Sa{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,i,s){this._firstTwoTouches||s.length<2||(this._firstTwoTouches=[s[0].identifier,s[1].identifier],this._start([i[0],i[1]]))}touchmove(e,i,s){if(!this._firstTwoTouches)return;e.preventDefault();const[l,h]=this._firstTwoTouches,f=Kn(s,i,l),_=Kn(s,i,h);if(!f||!_)return;const v=this._aroundCenter?null:f.add(_).div(2);return this._move([f,_],v,e)}touchend(e,i,s){if(!this._firstTwoTouches)return;const[l,h]=this._firstTwoTouches,f=Kn(s,i,l),_=Kn(s,i,h);f&&_||(this._active&&ie.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Kn(u,e,i){for(let s=0;s<u.length;s++)if(u[s].identifier===i)return e[s]}function Mc(u,e){return Math.log(u/e)/Math.LN2}class wt extends Sa{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,i){const s=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Mc(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Mc(this._distance,s),pinchAround:i}}}function tl(u,e){return 180*u.angleWith(e)/Math.PI}class Dh extends Sa{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,i,s){const l=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:tl(this._vector,l),pinchAround:i}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const i=25/(Math.PI*this._minDiameter)*360,s=tl(e,this._startVector);return Math.abs(s)<i}}function Ks(u){return Math.abs(u.y)>Math.abs(u.x)}class Lh extends Sa{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,i,s){super.touchstart(e,i,s),this._currentTouchCount=s.length}_start(e){this._lastPoints=e,Ks(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,i,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=e[0].sub(this._lastPoints[0]),h=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,h,s.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(l.y+h.y)/2*-.5}):void 0}gestureBeginsVertically(e,i,s){if(this._valid!==void 0)return this._valid;const l=e.mag()>=2,h=i.mag()>=2;if(!l&&!h)return;if(!l||!h)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;const f=e.y>0==i.y>0;return Ks(e)&&Ks(i)&&f}}const Jd={panStep:100,bearingStep:15,pitchStep:10};class Ic{constructor(e){this._tr=new yr(e);const i=Jd;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let i=0,s=0,l=0,h=0,f=0;switch(e.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:e.shiftKey?s=-1:(e.preventDefault(),h=-1);break;case 39:e.shiftKey?s=1:(e.preventDefault(),h=1);break;case 38:e.shiftKey?l=1:(e.preventDefault(),f=-1);break;case 40:e.shiftKey?l=-1:(e.preventDefault(),f=1);break;default:return}return this._rotationDisabled&&(s=0,l=0),{cameraAnimation:_=>{const v=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:Cc,zoom:i?Math.round(v.zoom)+i*(e.shiftKey?2:1):v.zoom,bearing:v.bearing+s*this._bearingStep,pitch:v.pitch+l*this._pitchStep,offset:[-h*this._panStep,-f*this._panStep],center:v.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Cc(u){return u*(2-u)}const kc=4.000244140625;class Fh{constructor(e,i){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=e,this._tr=new yr(e),this._triggerRenderFrame=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let i=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const s=xe.now(),l=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,i!==0&&i%kc==0?this._type="wheel":i!==0&&Math.abs(i)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(l*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const i=ie.mousePos(this._map.getCanvas(),e),s=this._tr;this._aroundPoint=this._aroundCenter?s.transform.locationToScreenPoint(o.Q.convert(s.center)):i,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const _=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=_),typeof this._targetZoom=="number"&&(this._targetZoom+=_)}if(this._delta!==0){const _=this._type==="wheel"&&Math.abs(this._delta)>kc?this._wheelZoomRate:this._defaultZoomRate;let v=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&v!==0&&(v=1/v);const T=typeof this._targetZoom!="number"?e.scale:o.aI(this._targetZoom);this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,o.ab(T*v))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const i=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,s=this._startZoom,l=this._easing;let h,f=!1;if(this._type==="wheel"&&s&&l){const _=xe.now()-this._lastWheelEventTime,v=Math.min((_+5)/200,1),T=l(v);h=o.B.number(s,i,T),v<1?this._frameId||(this._frameId=!0):f=!0}else h=i,f=!0;return this._active=!0,f&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=h,{noInertia:!0,needsRenderFrame:!f,zoomDelta:h-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let i=o.cb;if(this._prevEase){const s=this._prevEase,l=(xe.now()-s.start)/s.duration,h=s.easing(l+.01)-s.easing(l),f=.27/Math.sqrt(h*h+1e-4)*.01,_=Math.sqrt(.0729-f*f);i=o.c9(f,_,.25,1)}return this._prevEase={start:xe.now(),duration:e,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ec{constructor(e,i){this._clickZoom=e,this._tapZoom=i}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Qd{constructor(e){this._tr=new yr(e),this.reset()}reset(){this._active=!1}dblclick(e,i){return e.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(i)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ep{constructor(){this._tap=new Sc({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,i,s){if(!this._swipePoint)if(this._tapTime){const l=i[0],h=e.timeStamp-this._tapTime<500,f=this._tapPoint.dist(l)<30;h&&f?s.length>0&&(this._swipePoint=l,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(e,i,s)}touchmove(e,i,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const l=i[0],h=l.y-this._swipePoint.y;return this._swipePoint=l,e.preventDefault(),this._active=!0,{zoomDelta:h/128}}}else this._tap.touchmove(e,i,s)}touchend(e,i,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{const l=this._tap.touchend(e,i,s);l&&(this._tapTime=e.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class En{constructor(e,i,s){this._el=e,this._mousePan=i,this._touchPan=s}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ti{constructor(e,i,s,l){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=i,this._mousePitch=s,this._mouseRoll=l}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Ys{constructor(e,i,s,l){this._el=e,this._touchZoom=i,this._touchRotate=s,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class il{constructor(e,i){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=i,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=ie.create("div","maplibregl-cooperative-gesture-screen",e);let i=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(i=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const s=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=i,this._container.appendChild(l);const h=document.createElement("div");h.className="maplibregl-mobile-message",h.textContent=s,this._container.appendChild(h),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(ie.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,i){this._enabled&&(this._map.fire(new o.l("cooperativegestureprevented",{gestureType:e,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Js=u=>u.zoom||u.drag||u.roll||u.pitch||u.rotate;class Bh extends o.l{}function rl(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta||u.rollDelta}class tp{constructor(e,i){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,h)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const f=l.type==="renderFrame"?void 0:l,_={needsRenderFrame:!1},v={},T={};for(const{handlerName:k,handler:O,allowed:Z}of this._handlers){if(!O.isEnabled())continue;let q;if(this._blockedByActive(T,Z,k))O.reset();else if(O[h||l.type]){if(o.cc(l,h||l.type)){const G=ie.mousePos(this._map.getCanvas(),l);q=O[h||l.type](l,G)}else if(o.cd(l,h||l.type)){const G=this._getMapTouches(l.touches),W=ie.touchPos(this._map.getCanvas(),G);q=O[h||l.type](l,W,G)}else o.ce(h||l.type)||(q=O[h||l.type](l));this.mergeHandlerResult(_,v,q,k,f),q&&q.needsRenderFrame&&this._triggerRenderFrame()}(q||O.isActive())&&(T[k]=O)}const I={};for(const k in this._previousActiveHandlers)T[k]||(I[k]=f);this._previousActiveHandlers=T,(Object.keys(I).length||rl(_))&&(this._changes.push([_,v,I]),this._triggerRenderFrame()),(Object.keys(T).length||rl(_))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:E}=_;E&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],E(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Eh(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);const s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,h,f]of this._listeners)ie.addEventListener(l,h,l===document?this.handleWindowEvent:this.handleEvent,f)}destroy(){for(const[e,i,s]of this._listeners)ie.removeEventListener(e,i,e===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(e){const i=this._map,s=i.getCanvasContainer();this._add("mapEvent",new dn(i,e));const l=i.boxZoom=new Pa(i,e);this._add("boxZoom",l),e.interactive&&e.boxZoom&&l.enable();const h=i.cooperativeGestures=new il(i,e.cooperativeGestures);this._add("cooperativeGestures",h),e.cooperativeGestures&&h.enable();const f=new Yd(i),_=new Qd(i);i.doubleClickZoom=new Ec(_,f),this._add("tapZoom",f),this._add("clickZoom",_),e.interactive&&e.doubleClickZoom&&i.doubleClickZoom.enable();const v=new ep;this._add("tapDragZoom",v);const T=i.touchPitch=new Lh(i);this._add("touchPitch",T),e.interactive&&e.touchPitch&&i.touchPitch.enable(e.touchPitch);const I=()=>i.project(i.getCenter()),E=function({enable:ee,clickTolerance:te,aroundCenter:oe=!0,minPixelCenterThreshold:re=100,rotateDegreesPerPixelMoved:me=.8},fe){const Se=new Er({checkCorrectEvent:Ie=>ie.mouseButton(Ie)===0&&Ie.ctrlKey||ie.mouseButton(Ie)===2&&!Ie.ctrlKey});return new ms({clickTolerance:te,move:(Ie,Te)=>{const je=fe();if(oe&&Math.abs(je.y-Ie.y)>re)return{bearingDelta:o.ca(new o.P(Ie.x,Te.y),Te,je)};let Be=(Te.x-Ie.x)*me;return oe&&Te.y<je.y&&(Be=-Be),{bearingDelta:Be}},moveStateManager:Se,enable:ee,assignEvents:gs})}(e,I),k=function({enable:ee,clickTolerance:te,pitchDegreesPerPixelMoved:oe=-.5}){const re=new Er({checkCorrectEvent:me=>ie.mouseButton(me)===0&&me.ctrlKey||ie.mouseButton(me)===2});return new ms({clickTolerance:te,move:(me,fe)=>({pitchDelta:(fe.y-me.y)*oe}),moveStateManager:re,enable:ee,assignEvents:gs})}(e),O=function({enable:ee,clickTolerance:te,rollDegreesPerPixelMoved:oe=.3},re){const me=new Er({checkCorrectEvent:fe=>ie.mouseButton(fe)===2&&fe.ctrlKey});return new ms({clickTolerance:te,move:(fe,Se)=>{const Ie=re();let Te=(Se.x-fe.x)*oe;return Se.y<Ie.y&&(Te=-Te),{rollDelta:Te}},moveStateManager:me,enable:ee,assignEvents:gs})}(e,I);i.dragRotate=new ti(e,E,k,O),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",k,["mouseRotate","mouseRoll"]),this._add("mouseRoll",O,["mousePitch"]),e.interactive&&e.dragRotate&&i.dragRotate.enable();const Z=function({enable:ee,clickTolerance:te}){const oe=new Er({checkCorrectEvent:re=>ie.mouseButton(re)===0&&!re.ctrlKey});return new ms({clickTolerance:te,move:(re,me)=>({around:me,panDelta:me.sub(re)}),activateOnStart:!0,moveStateManager:oe,enable:ee,assignEvents:gs})}(e),q=new Rh(e,i);i.dragPan=new En(s,Z,q),this._add("mousePan",Z),this._add("touchPan",q,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&i.dragPan.enable(e.dragPan);const G=new Dh,W=new wt;i.touchZoomRotate=new Ys(s,W,G,v),this._add("touchRotate",G,["touchPan","touchZoom"]),this._add("touchZoom",W,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&i.touchZoomRotate.enable(e.touchZoomRotate);const X=i.scrollZoom=new Fh(i,()=>this._triggerRenderFrame());this._add("scrollZoom",X,["mousePan"]),e.interactive&&e.scrollZoom&&i.scrollZoom.enable(e.scrollZoom);const Q=i.keyboard=new Ic(i);this._add("keyboard",Q),e.interactive&&e.keyboard&&i.keyboard.enable(),this._add("blockableMapEvent",new Ah(i))}_add(e,i,s){this._handlers.push({handlerName:e,handler:i,allowed:s}),this._handlersById[e]=i}stop(e){if(!this._updatingCamera){for(const{handler:i}of this._handlers)i.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Js(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,i,s){for(const l in e)if(l!==s&&(!i||i.indexOf(l)<0))return!0;return!1}_getMapTouches(e){const i=[];for(const s of e)this._el.contains(s.target)&&i.push(s);return i}mergeHandlerResult(e,i,s,l,h){if(!s)return;o.e(e,s);const f={handlerName:l,originalEvent:s.originalEvent||h};s.zoomDelta!==void 0&&(i.zoom=f),s.panDelta!==void 0&&(i.drag=f),s.rollDelta!==void 0&&(i.roll=f),s.pitchDelta!==void 0&&(i.pitch=f),s.bearingDelta!==void 0&&(i.rotate=f)}_applyChanges(){const e={},i={},s={};for(const[l,h,f]of this._changes)l.panDelta&&(e.panDelta=(e.panDelta||new o.P(0,0))._add(l.panDelta)),l.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+l.pitchDelta),l.rollDelta&&(e.rollDelta=(e.rollDelta||0)+l.rollDelta),l.around!==void 0&&(e.around=l.around),l.pinchAround!==void 0&&(e.pinchAround=l.pinchAround),l.noInertia&&(e.noInertia=l.noInertia),o.e(i,h),o.e(s,f);this._updateMapTransform(e,i,s),this._changes=[]}_updateMapTransform(e,i,s){const l=this._map,h=l._getTransformForUpdate(),f=l.terrain;if(!(rl(e)||f&&this._terrainMovement))return this._fireEvents(i,s,!0);l._stop(!0);let{panDelta:_,zoomDelta:v,bearingDelta:T,pitchDelta:I,rollDelta:E,around:k,pinchAround:O}=e;O!==void 0&&(k=O),k=k||l.transform.centerPoint,f&&!h.isPointOnMapSurface(k)&&(k=h.centerPoint);const Z={panDelta:_,zoomDelta:v,rollDelta:E,pitchDelta:I,bearingDelta:T,around:k};this._map.cameraHelper.useGlobeControls&&!h.isPointOnMapSurface(k)&&(k=h.centerPoint);const q=k.distSqr(h.centerPoint)<.01?h.center:h.screenPointToLocation(_?k.sub(_):k);f?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(Z,h),this._terrainMovement||!i.drag&&!i.zoom?i.drag&&this._terrainMovement?h.setCenter(h.screenPointToLocation(h.centerPoint.sub(_))):this._map.cameraHelper.handleMapControlsPan(Z,h,q):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(Z,h,q))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(Z,h),this._map.cameraHelper.handleMapControlsPan(Z,h,q)),l._applyUpdatedTransform(h),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(i,s,!0)}_fireEvents(e,i,s){const l=Js(this._eventsInProgress),h=Js(e),f={};for(const E in e){const{originalEvent:k}=e[E];this._eventsInProgress[E]||(f[`${E}start`]=k),this._eventsInProgress[E]=e[E]}!l&&h&&this._fireEvent("movestart",h.originalEvent);for(const E in f)this._fireEvent(E,f[E]);h&&this._fireEvent("move",h.originalEvent);for(const E in e){const{originalEvent:k}=e[E];this._fireEvent(E,k)}const _={};let v;for(const E in this._eventsInProgress){const{handlerName:k,originalEvent:O}=this._eventsInProgress[E];this._handlersById[k].isActive()||(delete this._eventsInProgress[E],v=i[k]||O,_[`${E}end`]=v)}for(const E in _)this._fireEvent(E,_[E]);const T=Js(this._eventsInProgress),I=(l||h)&&!T;if(I&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const E=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&E.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(E)}if(s&&I){this._updatingCamera=!0;const E=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),k=O=>O!==0&&-this._bearingSnap<O&&O<this._bearingSnap;!E||!E.essential&&xe.prefersReducedMotion?(this._map.fire(new o.l("moveend",{originalEvent:v})),k(this._map.getBearing())&&this._map.resetNorth()):(k(E.bearing||this._map.getBearing())&&(E.bearing=0),E.freezeElevation=!0,this._map.easeTo(E,{originalEvent:v})),this._updatingCamera=!1}}_fireEvent(e,i){this._map.fire(new o.l(e,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new Bh("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class pn extends o.E{constructor(e,i,s){super(),this._renderFrameCallback=()=>{const l=Math.min((xe.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=s.bearingSnap,this.cameraHelper=i,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,i){e.apply(this.transform),this.transform=e,this.cameraHelper=i}getCenter(){return new o.Q(this.transform.center.lng,this.transform.center.lat)}setCenter(e,i){return this.jumpTo({center:e},i)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,i){return this.jumpTo({elevation:e},i),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,i,s){return e=o.P.convert(e).mult(-1),this.panTo(this.transform.center,o.e({offset:e},i),s)}panTo(e,i,s){return this.easeTo(o.e({center:e},i),s)}getZoom(){return this.transform.zoom}setZoom(e,i){return this.jumpTo({zoom:e},i),this}zoomTo(e,i,s){return this.easeTo(o.e({zoom:e},i),s)}zoomIn(e,i){return this.zoomTo(this.getZoom()+1,e,i),this}zoomOut(e,i){return this.zoomTo(this.getZoom()-1,e,i),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,i){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new o.l("movestart",i)).fire(new o.l("move",i)).fire(new o.l("moveend",i))),this}getBearing(){return this.transform.bearing}setBearing(e,i){return this.jumpTo({bearing:e},i),this}getPadding(){return this.transform.padding}setPadding(e,i){return this.jumpTo({padding:e},i),this}rotateTo(e,i,s){return this.easeTo(o.e({bearing:e},i),s)}resetNorth(e,i){return this.rotateTo(0,o.e({duration:1e3},e),i),this}resetNorthPitch(e,i){return this.easeTo(o.e({bearing:0,pitch:0,roll:0,duration:1e3},e),i),this}snapToNorth(e,i){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,i):this}getPitch(){return this.transform.pitch}setPitch(e,i){return this.jumpTo({pitch:e},i),this}getRoll(){return this.transform.roll}setRoll(e,i){return this.jumpTo({roll:e},i),this}cameraForBounds(e,i){e=Ve.convert(e).adjustAntiMeridian();const s=i&&i.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),s,i)}_cameraForBoxAndBearing(e,i,s,l){const h={top:0,bottom:0,right:0,left:0};if(typeof(l=o.e({padding:h,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const T=l.padding;l.padding={top:T,bottom:T,right:T,left:T}}const f=o.e(h,l.padding);l.padding=f;const _=this.transform,v=new Ve(e,i);return this.cameraHelper.cameraForBoxAndBearing(l,f,v,s,_)}fitBounds(e,i,s){return this._fitInternal(this.cameraForBounds(e,i),i,s)}fitScreenCoordinates(e,i,s,l,h){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(o.P.convert(e)),this.transform.screenPointToLocation(o.P.convert(i)),s,l),l,h)}_fitInternal(e,i,s){return e?(delete(i=o.e(e,i)).padding,i.linear?this.easeTo(i,s):this.flyTo(i,s)):this}jumpTo(e,i){this.stop();const s=this._getTransformForUpdate();let l=!1,h=!1,f=!1;const _=s.zoom;this.cameraHelper.handleJumpToCenterZoom(s,e);const v=s.zoom!==_;return"elevation"in e&&s.elevation!==+e.elevation&&s.setElevation(+e.elevation),"bearing"in e&&s.bearing!==+e.bearing&&(l=!0,s.setBearing(+e.bearing)),"pitch"in e&&s.pitch!==+e.pitch&&(h=!0,s.setPitch(+e.pitch)),"roll"in e&&s.roll!==+e.roll&&(f=!0,s.setRoll(+e.roll)),e.padding==null||s.isPaddingEqual(e.padding)||s.setPadding(e.padding),this._applyUpdatedTransform(s),this.fire(new o.l("movestart",i)).fire(new o.l("move",i)),v&&this.fire(new o.l("zoomstart",i)).fire(new o.l("zoom",i)).fire(new o.l("zoomend",i)),l&&this.fire(new o.l("rotatestart",i)).fire(new o.l("rotate",i)).fire(new o.l("rotateend",i)),h&&this.fire(new o.l("pitchstart",i)).fire(new o.l("pitch",i)).fire(new o.l("pitchend",i)),f&&this.fire(new o.l("rollstart",i)).fire(new o.l("roll",i)).fire(new o.l("rollend",i)),this.fire(new o.l("moveend",i))}calculateCameraOptionsFromTo(e,i,s,l=0){const h=o.$.fromLngLat(e,i),f=o.$.fromLngLat(s,l),_=f.x-h.x,v=f.y-h.y,T=f.z-h.z,I=Math.hypot(_,v,T);if(I===0)throw new Error("Can't calculate camera options with same From and To");const E=Math.hypot(_,v),k=o.ab(this.transform.cameraToCenterDistance/I/this.transform.tileSize),O=180*Math.atan2(_,-v)/Math.PI;let Z=180*Math.acos(E/I)/Math.PI;return Z=T<0?90-Z:90+Z,{center:f.toLngLat(),elevation:l,zoom:k,pitch:Z,bearing:O}}calculateCameraOptionsFromCameraLngLatAltRotation(e,i,s,l,h){const f=this.transform.calculateCenterFromCameraLngLatAlt(e,i,s,l);return{center:f.center,elevation:f.elevation,zoom:f.zoom,bearing:s,pitch:l,roll:h}}easeTo(e,i){this._stop(!1,e.easeId),((e=o.e({offset:[0,0],duration:500,easing:o.cb},e)).animate===!1||!e.essential&&xe.prefersReducedMotion)&&(e.duration=0);const s=this._getTransformForUpdate(),l=this.getBearing(),h=s.pitch,f=s.roll,_="bearing"in e?this._normalizeBearing(e.bearing,l):l,v="pitch"in e?+e.pitch:h,T="roll"in e?this._normalizeBearing(e.roll,f):f,I="padding"in e?e.padding:s.padding,E=o.P.convert(e.offset);let k,O;e.around&&(k=o.Q.convert(e.around),O=s.locationToScreenPoint(k));const Z={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},q=this.cameraHelper.handleEaseTo(s,{bearing:_,pitch:v,roll:T,padding:I,around:k,aroundPoint:O,offsetAsPoint:E,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||l!==_,this._pitching=this._pitching||v!==h,this._rolling=this._rolling||T!==f,this._padding=!s.isPaddingEqual(I),this._zooming=this._zooming||q.isZooming,this._easeId=e.easeId,this._prepareEase(i,e.noMoveStart,Z),this.terrain&&this._prepareElevation(q.elevationCenter),this._ease(G=>{q.easeFunc(G),this.terrain&&!e.freezeElevation&&this._updateElevation(G),this._applyUpdatedTransform(s),this._fireMoveEvents(i)},G=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(i,G)},e),this}_prepareEase(e,i,s={}){this._moving=!0,i||s.moving||this.fire(new o.l("movestart",e)),this._zooming&&!s.zooming&&this.fire(new o.l("zoomstart",e)),this._rotating&&!s.rotating&&this.fire(new o.l("rotatestart",e)),this._pitching&&!s.pitching&&this.fire(new o.l("pitchstart",e)),this._rolling&&!s.rolling&&this.fire(new o.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&i!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(s-(i-(s*e+this._elevationStart))/(1-e)),this._elevationTarget=i}this.transform.setElevation(o.B.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const i=e.getCameraLngLat(),s=e.getCameraAltitude(),l=this.terrain?this.terrain.getElevationForLngLatZoom(i,e.zoom):0;if(s<l){const h=this.calculateCameraOptionsFromTo(i,l,e.center,e.elevation);return{pitch:h.pitch,zoom:h.zoom}}return{}}_applyUpdatedTransform(e){const i=[];if(i.push(l=>this._elevateCameraIfInsideTerrain(l)),this.transformCameraUpdate&&i.push(l=>this.transformCameraUpdate(l)),!i.length)return;const s=e.clone();for(const l of i){const h=s.clone(),{center:f,zoom:_,roll:v,pitch:T,bearing:I,elevation:E}=l(h);f&&h.setCenter(f),E!==void 0&&h.setElevation(E),_!==void 0&&h.setZoom(_),v!==void 0&&h.setRoll(v),T!==void 0&&h.setPitch(T),I!==void 0&&h.setBearing(I),s.apply(h)}this.transform.apply(s)}_fireMoveEvents(e){this.fire(new o.l("move",e)),this._zooming&&this.fire(new o.l("zoom",e)),this._rotating&&this.fire(new o.l("rotate",e)),this._pitching&&this.fire(new o.l("pitch",e)),this._rolling&&this.fire(new o.l("roll",e))}_afterEase(e,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;const s=this._zooming,l=this._rotating,h=this._pitching,f=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,s&&this.fire(new o.l("zoomend",e)),l&&this.fire(new o.l("rotateend",e)),h&&this.fire(new o.l("pitchend",e)),f&&this.fire(new o.l("rollend",e)),this.fire(new o.l("moveend",e))}flyTo(e,i){if(!e.essential&&xe.prefersReducedMotion){const Te=o.O(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(Te,i)}this.stop(),e=o.e({offset:[0,0],speed:1.2,curve:1.42,easing:o.cb},e);const s=this._getTransformForUpdate(),l=s.bearing,h=s.pitch,f=s.roll,_=s.padding,v="bearing"in e?this._normalizeBearing(e.bearing,l):l,T="pitch"in e?+e.pitch:h,I="roll"in e?this._normalizeBearing(e.roll,f):f,E="padding"in e?e.padding:s.padding,k=o.P.convert(e.offset);let O=s.centerPoint.add(k);const Z=s.screenPointToLocation(O),q=this.cameraHelper.handleFlyTo(s,{bearing:v,pitch:T,roll:I,padding:E,locationAtOffset:Z,offsetAsPoint:k,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let G=e.curve;const W=Math.max(s.width,s.height),X=W/q.scaleOfZoom,Q=q.pixelPathLength;typeof q.scaleOfMinZoom=="number"&&(G=Math.sqrt(W/q.scaleOfMinZoom/Q*2));const ee=G*G;function te(Te){const je=(X*X-W*W+(Te?-1:1)*ee*ee*Q*Q)/(2*(Te?X:W)*ee*Q);return Math.log(Math.sqrt(je*je+1)-je)}function oe(Te){return(Math.exp(Te)-Math.exp(-Te))/2}function re(Te){return(Math.exp(Te)+Math.exp(-Te))/2}const me=te(!1);let fe=function(Te){return re(me)/re(me+G*Te)},Se=function(Te){return W*((re(me)*(oe(je=me+G*Te)/re(je))-oe(me))/ee)/Q;var je},Ie=(te(!0)-me)/G;if(Math.abs(Q)<2e-6||!isFinite(Ie)){if(Math.abs(W-X)<1e-6)return this.easeTo(e,i);const Te=X<W?-1:1;Ie=Math.abs(Math.log(X/W))/G,Se=()=>0,fe=je=>Math.exp(Te*G*je)}return e.duration="duration"in e?+e.duration:1e3*Ie/("screenSpeed"in e?+e.screenSpeed/G:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=l!==v,this._pitching=T!==h,this._rolling=I!==f,this._padding=!s.isPaddingEqual(E),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(q.targetCenter),this._ease(Te=>{const je=Te*Ie,Be=1/fe(je),Ce=Se(je);this._rotating&&s.setBearing(o.B.number(l,v,Te)),this._pitching&&s.setPitch(o.B.number(h,T,Te)),this._rolling&&s.setRoll(o.B.number(f,I,Te)),this._padding&&(s.interpolatePadding(_,E,Te),O=s.centerPoint.add(k)),q.easeFunc(Te,Be,Ce,O),this.terrain&&!e.freezeElevation&&this._updateElevation(Te),this._applyUpdatedTransform(s),this._fireMoveEvents(i)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,i){var s;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,i)}return e||(s=this.handlers)===null||s===void 0||s.stop(!1),this}_ease(e,i,s){s.animate===!1||s.duration===0?(e(1),i()):(this._easeStart=xe.now(),this._easeOptions=s,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,i){e=o.aL(e,-180,180);const s=Math.abs(e-i);return Math.abs(e-360-i)<s&&(e-=360),Math.abs(e+360-i)<s&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(o.Q.convert(e),this.transform.tileZoom):null}}const Qs={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Je{constructor(e=Qs){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=i=>{!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"&&i.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=ie.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ie.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ie.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){ie.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,i){const s=this._map._getUIString(`AttributionControl.${i}`);e.title=s,e.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const i=this._map.style.sourceCaches;for(const l in i){const h=i[l];if(h.used||h.usedForTerrain){const f=h.getSource();f.attribution&&e.indexOf(f.attribution)<0&&e.push(f.attribution)}}e=e.filter(l=>String(l).trim()),e.sort((l,h)=>l.length-h.length),e=e.filter((l,h)=>{for(let f=h+1;f<e.length;f++)if(e[f].indexOf(l)>=0)return!1;return!0});const s=e.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,e.length?(this._innerContainer.innerHTML=ie.sanitize(s),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class nt{constructor(e={}){this._updateCompact=()=>{const i=this._container.children;if(i.length){const s=i[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=ie.create("div","maplibregl-ctrl");const i=ie.create("a","maplibregl-ctrl-logo");return i.target="_blank",i.rel="noopener nofollow",i.href="https://maplibre.org/",i.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),i.setAttribute("rel","noopener nofollow"),this._container.appendChild(i),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){ie.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class nl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const i=++this._id;return this._queue.push({callback:e,id:i,cancelled:!1}),i}remove(e){const i=this._currentlyRunning,s=i?this._queue.concat(i):this._queue;for(const l of s)if(l.id===e)return void(l.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const i=this._currentlyRunning=this._queue;this._queue=[];for(const s of i)if(!s.cancelled&&(s.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ac=o.aD([{name:"a_pos3d",type:"Int16",components:3}]);class zc extends o.E{constructor(e){super(),this._lastTilesetChange=xe.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,i){this.sourceCache.update(e,i),this._renderableTilesKeys=[];const s={};for(const l of he(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))s[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.terrainRttPosMatrix32f=new Float64Array(16),o.bO(l.terrainRttPosMatrix32f,0,o.Z,o.Z,0,0,1),this._tiles[l.key]=new ln(l,this.tileSize),this._lastTilesetChange=xe.now());for(const l in this._tiles)s[l]||delete this._tiles[l]}freeRtt(e){for(const i in this._tiles){const s=this._tiles[i];(!e||s.tileID.equals(e)||s.tileID.isChildOf(e)||e.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,i){return i?this._getTerrainCoordsForTileRanges(e,i):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){const i={};for(const s of this._renderableTilesKeys){const l=this._tiles[s].tileID,h=e.clone(),f=o.b2();if(l.canonical.equals(e.canonical))o.bO(f,0,o.Z,o.Z,0,0,1);else if(l.canonical.isChildOf(e.canonical)){const _=l.canonical.z-e.canonical.z,v=l.canonical.x-(l.canonical.x>>_<<_),T=l.canonical.y-(l.canonical.y>>_<<_),I=o.Z>>_;o.bO(f,0,I,I,0,0,1),o.L(f,f,[-v*I,-T*I,0])}else{if(!e.canonical.isChildOf(l.canonical))continue;{const _=e.canonical.z-l.canonical.z,v=e.canonical.x-(e.canonical.x>>_<<_),T=e.canonical.y-(e.canonical.y>>_<<_),I=o.Z>>_;o.bO(f,0,o.Z,o.Z,0,0,1),o.L(f,f,[v*I,T*I,0]),o.M(f,f,[1/2**_,1/2**_,0])}}h.terrainRttPosMatrix32f=new Float32Array(f),i[s]=h}return i}_getTerrainCoordsForTileRanges(e,i){const s={};for(const l of this._renderableTilesKeys){const h=this._tiles[l].tileID;if(!this._isWithinTileRanges(h,i))continue;const f=e.clone(),_=o.b2();if(h.canonical.z===e.canonical.z){const v=e.canonical.x-h.canonical.x,T=e.canonical.y-h.canonical.y;o.bO(_,0,o.Z,o.Z,0,0,1),o.L(_,_,[v*o.Z,T*o.Z,0])}else if(h.canonical.z>e.canonical.z){const v=h.canonical.z-e.canonical.z,T=h.canonical.x-(h.canonical.x>>v<<v),I=h.canonical.y-(h.canonical.y>>v<<v),E=e.canonical.x-(h.canonical.x>>v),k=e.canonical.y-(h.canonical.y>>v),O=o.Z>>v;o.bO(_,0,O,O,0,0,1),o.L(_,_,[-T*O+E*o.Z,-I*O+k*o.Z,0])}else{const v=e.canonical.z-h.canonical.z,T=e.canonical.x-(e.canonical.x>>v<<v),I=e.canonical.y-(e.canonical.y>>v<<v),E=(e.canonical.x>>v)-h.canonical.x,k=(e.canonical.y>>v)-h.canonical.y,O=o.Z<<v;o.bO(_,0,O,O,0,0,1),o.L(_,_,[T*o.Z+E*O,I*o.Z+k*O,0])}f.terrainRttPosMatrix32f=new Float32Array(_),s[l]=f}return s}getSourceTile(e,i){const s=this.sourceCache._source;let l=e.overscaledZ-this.deltaZoom;if(l>s.maxzoom&&(l=s.maxzoom),l<s.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(l).key);let h=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!h||!h.dem)&&i)for(;l>=s.minzoom&&(!h||!h.dem);)h=this.sourceCache.getTileByID(e.scaledTo(l--).key);return h}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,i){return i[e.canonical.z]&&e.canonical.x>=i[e.canonical.z].minTileX&&e.canonical.x<=i[e.canonical.z].maxTileX&&e.canonical.y>=i[e.canonical.z].minTileY&&e.canonical.y<=i[e.canonical.z].maxTileY}}class xr{constructor(e,i,s){this._meshCache={},this.painter=e,this.sourceCache=new zc(i),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,i,s,l=o.Z){var h;if(!(i>=0&&i<l&&s>=0&&s<l))return 0;const f=this.getTerrainData(e),_=(h=f.tile)===null||h===void 0?void 0:h.dem;if(!_)return 0;const v=o.cf([],[i/l*o.Z,s/l*o.Z],f.u_terrain_matrix),T=[v[0]*_.dim,v[1]*_.dim],I=Math.floor(T[0]),E=Math.floor(T[1]),k=T[0]-I,O=T[1]-E;return _.get(I,E)*(1-k)*(1-O)+_.get(I+1,E)*k*(1-O)+_.get(I,E+1)*(1-k)*O+_.get(I+1,E+1)*k*O}getElevationForLngLatZoom(e,i){if(!o.cg(i,e.wrap()))return 0;const{tileID:s,mercatorX:l,mercatorY:h}=this._getOverscaledTileIDFromLngLatZoom(e,i);return this.getElevation(s,l%o.Z,h%o.Z,o.Z)}getElevation(e,i,s,l=o.Z){return this.getDEMElevation(e,i,s,l)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const l=this.painter.context,h=new o.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ot(l,h,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ot(l,new o.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.at([])}const i=this.sourceCache.getSourceTile(e,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const l=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new Ot(l,i.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),i.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}const s=i&&i+i.tileID.key+e.key;if(s&&!this._demMatrixCache[s]){const l=this.sourceCache.sourceCache._source.maxzoom;let h=e.canonical.z-i.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=l?h=e.canonical.z-l:o.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const f=e.canonical.x-(e.canonical.x>>h<<h),_=e.canonical.y-(e.canonical.y>>h<<h),v=o.ch(new Float64Array(16),[1/(o.Z<<h),1/(o.Z<<h),0]);o.L(v,v,[f*o.Z,_*o.Z,0]),this._demMatrixCache[e.key]={matrix:v,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:s?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(e){const i=this.painter,s=i.width/devicePixelRatio,l=i.height/devicePixelRatio;return!this._fbo||this._fbo.width===s&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Ot(i.context,{width:s,height:l,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Ot(i.context,{width:s,height:l,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=i.context.createFramebuffer(s,l,!0,!1),this._fbo.depthAttachment.set(i.context.createRenderbuffer(i.context.gl.DEPTH_COMPONENT16,s,l))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let h=0,f=0;h<this._coordsTextureSize;h++)for(let _=0;_<this._coordsTextureSize;_++,f+=4)i[f+0]=255&_,i[f+1]=255&h,i[f+2]=_>>8<<4|h>>8,i[f+3]=0;const s=new o.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),l=new Ot(e,s,e.gl.RGBA,{premultiply:!1});return l.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const i=new Uint8Array(4),s=this.painter.context,l=s.gl,h=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),f=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),_=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(h,_-f-1,1,1,l.RGBA,l.UNSIGNED_BYTE,i),s.bindFramebuffer.set(null);const v=i[0]+(i[2]>>4<<8),T=i[1]+((15&i[2])<<8),I=this.coordsIndex[255-i[3]],E=I&&this.sourceCache.getTileByID(I);if(!E)return null;const k=this._coordsTextureSize,O=(1<<E.tileID.canonical.z)*k;return new o.$((E.tileID.canonical.x*k+v)/O+E.tileID.wrap,(E.tileID.canonical.y*k+T)/O,this.getElevation(E.tileID,v,T,k))}depthAtPoint(e){const i=new Uint8Array(4),s=this.painter.context,l=s.gl;return s.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,i),s.bindFramebuffer.set(null),(i[0]/16777216+i[1]/65536+i[2]/256+i[3])/256}getTerrainMesh(e){var i;const s=((i=this.painter.style.projection)===null||i===void 0?void 0:i.transitionState)>0,l=s&&e.canonical.y===0,h=s&&e.canonical.y===(1<<e.canonical.z)-1,f=`m_${l?"n":""}_${h?"s":""}`;if(this._meshCache[f])return this._meshCache[f];const _=this.painter.context,v=new o.ci,T=new o.aH,I=this.meshSize,E=o.Z/I,k=I*I;for(let re=0;re<=I;re++)for(let me=0;me<=I;me++)v.emplaceBack(me*E,re*E,0);for(let re=0;re<k;re+=I+1)for(let me=0;me<I;me++)T.emplaceBack(me+re,I+me+re+1,I+me+re+2),T.emplaceBack(me+re,I+me+re+2,me+re+1);const O=v.length,Z=O+(I+1),q=(I+1)*I,G=l?o.b9:0,W=l?0:1,X=h?o.ba:o.Z,Q=h?0:1;for(let re=0;re<=I;re++)v.emplaceBack(re*E,G,W);for(let re=0;re<=I;re++)v.emplaceBack(re*E,X,Q);for(let re=0;re<I;re++)T.emplaceBack(q+re,Z+re,Z+re+1),T.emplaceBack(q+re,Z+re+1,q+re+1),T.emplaceBack(0+re,O+re+1,O+re),T.emplaceBack(0+re,0+re+1,O+re+1);const ee=v.length,te=ee+2*(I+1);for(const re of[0,1])for(let me=0;me<=I;me++)for(const fe of[0,1])v.emplaceBack(re*o.Z,me*E,fe);for(let re=0;re<2*I;re+=2)T.emplaceBack(ee+re,ee+re+1,ee+re+3),T.emplaceBack(ee+re,ee+re+3,ee+re+2),T.emplaceBack(te+re,te+re+3,te+re+1),T.emplaceBack(te+re,te+re+2,te+re+3);const oe=new ma(_.createVertexBuffer(v,Ac.members),_.createIndexBuffer(T),o.aG.simpleSegment(0,0,v.length,T.length));return this._meshCache[f]=oe,oe}getMeshFrameDelta(e){return 2*Math.PI*o.br/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,i){var s;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(e,i);return(s=this.getMinMaxElevation(l).minElevation)!==null&&s!==void 0?s:0}getMinMaxElevation(e){const i=this.getTerrainData(e).tile,s={minElevation:null,maxElevation:null};return i&&i.dem&&(s.minElevation=i.dem.min*this.exaggeration,s.maxElevation=i.dem.max*this.exaggeration),s}_getOverscaledTileIDFromLngLatZoom(e,i){const s=o.$.fromLngLat(e.wrap()),l=(1<<i)*o.Z,h=s.x*l,f=s.y*l,_=Math.floor(h/o.Z),v=Math.floor(f/o.Z);return{tileID:new o.Y(i,0,i,_,v),mercatorX:h,mercatorY:f}}}class Oh{constructor(e,i,s){this._context=e,this._size=i,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const i=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new Ot(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),i.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),i.colorAttachment.set(s.texture),{id:e,fbo:i,texture:s,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(i=>e.id!==i),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const i of this._recentlyUsed)if(!this._objects[i].inUse)return this._objects[i];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const cr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ip{constructor(e,i){this.painter=e,this.terrain=i,this.pool=new Oh(e.context,30,i.sourceCache.tileSize*i.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,i){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(s=>!e._layers[s].isHidden(i)),this._coordsAscending={};for(const s in e.sourceCaches){this._coordsAscending[s]={};const l=e.sourceCaches[s].getVisibleCoordinates(),h=e.sourceCaches[s].getSource(),f=h instanceof st?h.terrainTileRanges:null;for(const _ of l){const v=this.terrain.sourceCache.getTerrainCoords(_,f);for(const T in v)this._coordsAscending[s][T]||(this._coordsAscending[s][T]=[]),this._coordsAscending[s][T].push(v[T])}}this._coordsAscendingStr={};for(const s of e._order){const l=e._layers[s],h=l.source;if(cr[l.type]&&!this._coordsAscendingStr[h]){this._coordsAscendingStr[h]={};for(const f in this._coordsAscending[h])this._coordsAscendingStr[h][f]=this._coordsAscending[h][f].map(_=>_.key).sort().join()}}for(const s of this._renderableTiles)for(const l in this._coordsAscendingStr){const h=this._coordsAscendingStr[l][s.tileID.key];h&&h!==s.rttCoords[l]&&(s.rtt=[])}}renderLayer(e,i){if(e.isHidden(this.painter.transform.zoom))return!1;const s=Object.assign(Object.assign({},i),{isRenderingToTexture:!0}),l=e.type,h=this.painter,f=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(cr[l]&&(this._prevType&&cr[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(e.id),!f))return!0;if(cr[this._prevType]||cr[l]&&f){this._prevType=l;const _=this._stacks.length-1,v=this._stacks[_]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(el(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[_]){const E=this.pool.getObjectForId(T.rtt[_].id);if(E.stamp===T.rtt[_].stamp){this.pool.useObject(E);continue}}const I=this.pool.getOrCreateFreeObject();this.pool.useObject(I),this.pool.stampObject(I),T.rtt[_]={id:I.id,stamp:I.stamp},h.context.bindFramebuffer.set(I.fbo.framebuffer),h.context.clear({color:o.b7.transparent,stencil:0}),h.currentStencilSource=void 0;for(let E=0;E<v.length;E++){const k=h.style._layers[v[E]],O=k.source?this._coordsAscending[k.source][T.tileID.key]:[T.tileID];h.context.viewport.set([0,0,I.fbo.width,I.fbo.height]),h._renderTileClippingMasks(k,O,!0),h.renderLayer(h,h.style.sourceCaches[k.source],k,O,s),k.source&&(T.rttCoords[k.source]=this._coordsAscendingStr[k.source][T.tileID.key])}}return el(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects(),cr[l]}return!1}}const eo={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},gi=le,Ti={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Qs,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:o.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},jh={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class to{constructor(e,i,s=!1){this.mousedown=h=>{this.startMove(h,ie.mousePos(this.element,h)),ie.addEventListener(window,"mousemove",this.mousemove),ie.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=h=>{this.move(h,ie.mousePos(this.element,h))},this.mouseup=h=>{this._rotatePitchHanlder.dragEnd(h),this.offTemp()},this.touchstart=h=>{h.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ie.touchPos(this.element,h.targetTouches)[0],this.startMove(h,this._startPos),ie.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),ie.addEventListener(window,"touchend",this.touchend))},this.touchmove=h=>{h.targetTouches.length!==1?this.reset():(this._lastPos=ie.touchPos(this.element,h.targetTouches)[0],this.move(h,this._lastPos))},this.touchend=h=>{h.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHanlder.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;const l=new zh;this._rotatePitchHanlder=new ms({clickTolerance:3,move:(h,f)=>{const _=i.getBoundingClientRect(),v=new o.P((_.bottom-_.top)/2,(_.right-_.left)/2);return{bearingDelta:o.ca(new o.P(h.x,f.y),f,v),pitchDelta:s?-.5*(f.y-h.y):void 0}},moveStateManager:l,enable:!0,assignEvents:()=>{}}),this.map=e,ie.addEventListener(i,"mousedown",this.mousedown),ie.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),ie.addEventListener(i,"touchcancel",this.reset)}startMove(e,i){this._rotatePitchHanlder.dragStart(e,i),ie.disableDrag()}move(e,i){const s=this.map,{bearingDelta:l,pitchDelta:h}=this._rotatePitchHanlder.dragMove(e,i)||{};l&&s.setBearing(s.getBearing()+l),h&&s.setPitch(s.getPitch()+h)}off(){const e=this.element;ie.removeEventListener(e,"mousedown",this.mousedown),ie.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),ie.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ie.removeEventListener(window,"touchend",this.touchend),ie.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){ie.enableDrag(),ie.removeEventListener(window,"mousemove",this.mousemove),ie.removeEventListener(window,"mouseup",this.mouseup),ie.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ie.removeEventListener(window,"touchend",this.touchend)}}let fn;function al(u,e,i){const s=new o.Q(u.lng,u.lat);if(u=new o.Q(u.lng,u.lat),e){const l=new o.Q(u.lng-360,u.lat),h=new o.Q(u.lng+360,u.lat),f=i.locationToScreenPoint(u).distSqr(e);i.locationToScreenPoint(l).distSqr(e)<f?u=l:i.locationToScreenPoint(h).distSqr(e)<f&&(u=h)}for(;Math.abs(u.lng-i.center.lng)>180;){const l=i.locationToScreenPoint(u);if(l.x>=0&&l.y>=0&&l.x<=i.width&&l.y<=i.height)break;u.lng>i.center.lng?u.lng-=360:u.lng+=360}return u.lng!==s.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(u))?u:s}const io={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function sl(u,e,i){const s=u.classList;for(const l in io)s.remove(`maplibregl-${i}-anchor-${l}`);s.add(`maplibregl-${i}-anchor-${e}`)}class Ma extends o.E{constructor(e){if(super(),this._onKeyPress=i=>{const s=i.code,l=i.charCode||i.keyCode;s!=="Space"&&s!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=i=>{const s=i.originalEvent.target,l=this._element;this._popup&&(s===l||l.contains(s))&&this.togglePopup()},this._update=i=>{var s;if(!this._map)return;const l=this._map.loaded()&&!this._map.isMoving();((i==null?void 0:i.type)==="terrain"||(i==null?void 0:i.type)==="render"&&!l)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?al(this._lngLat,this._flatPos,this._map.transform):(s=this._lngLat)===null||s===void 0?void 0:s.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let h="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?h=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let f="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?f="rotateX(0deg)":this._pitchAlignment==="map"&&(f=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||i&&i.type!=="moveend"||(this._pos=this._pos.round()),ie.setTransform(this._element,`${io[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${f} ${h}`),xe.frameAsync(new AbortController).then(()=>{this._updateOpacity(i&&i.type==="moveend")}).catch(()=>{})},this._onMove=i=>{if(!this._isDragging){const s=this._clickTolerance||this._map._clickTolerance;this._isDragging=i.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=i.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.l("dragstart"))),this.fire(new o.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.l("dragend")),this._state="inactive"},this._addDragHandler=i=>{this._element.contains(i.originalEvent.target)&&(i.preventDefault(),this._positionDelta=i.point.sub(this._pos).add(this._offset),this._pointerdownPos=i.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=o.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=ie.create("div");const i=ie.createNS("http://www.w3.org/2000/svg","svg"),s=41,l=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${s}px`),i.setAttributeNS(null,"width",`${l}px`),i.setAttributeNS(null,"viewBox",`0 0 ${l} ${s}`);const h=ie.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"stroke","none"),h.setAttributeNS(null,"stroke-width","1"),h.setAttributeNS(null,"fill","none"),h.setAttributeNS(null,"fill-rule","evenodd");const f=ie.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill-rule","nonzero");const _=ie.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const v=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const W of v){const X=ie.createNS("http://www.w3.org/2000/svg","ellipse");X.setAttributeNS(null,"opacity","0.04"),X.setAttributeNS(null,"cx","10.5"),X.setAttributeNS(null,"cy","5.80029008"),X.setAttributeNS(null,"rx",W.rx),X.setAttributeNS(null,"ry",W.ry),_.appendChild(X)}const T=ie.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill",this._color);const I=ie.createNS("http://www.w3.org/2000/svg","path");I.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),T.appendChild(I);const E=ie.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"opacity","0.25"),E.setAttributeNS(null,"fill","#000000");const k=ie.createNS("http://www.w3.org/2000/svg","path");k.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),E.appendChild(k);const O=ie.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(6.0, 7.0)"),O.setAttributeNS(null,"fill","#FFFFFF");const Z=ie.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(8.0, 8.0)");const q=ie.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#000000"),q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962");const G=ie.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#FFFFFF"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962"),Z.appendChild(q),Z.appendChild(G),f.appendChild(_),f.appendChild(T),f.appendChild(E),f.appendChild(O),f.appendChild(Z),i.appendChild(f),i.setAttributeNS(null,"height",s*this._scale+"px"),i.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(i),this._offset=o.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",i=>{i.preventDefault()}),this._element.addEventListener("mousedown",i=>{i.preventDefault()}),sl(this._element,this._anchor,"marker"),e&&e.className)for(const i of e.className.split(" "))this._element.classList.add(i);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),ie.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=o.Q.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const l=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var i,s;if(!(!((i=this._map)===null||i===void 0)&&i.terrain)){const E=this._map.transform.isLocationOccluded(this._lngLat)?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==E&&(this._element.style.opacity=E))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const l=this._map,h=l.terrain.depthAtPoint(this._pos),f=l.terrain.getElevationForLngLatZoom(this._lngLat,l.transform.tileZoom);if(l.transform.lngLatToCameraDepth(this._lngLat,f)-h<.006)return void(this._element.style.opacity=this._opacity);const _=-this._offset.y/l.transform.pixelsPerMeter,v=Math.sin(l.getPitch()*Math.PI/180)*_,T=l.terrain.depthAtPoint(new o.P(this._pos.x,this._pos.y-this._offset.y)),I=l.transform.lngLatToCameraDepth(this._lngLat,f+v)-T>.006;!((s=this._popup)===null||s===void 0)&&s.isOpen()&&I&&this._popup.remove(),this._element.style.opacity=I?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=o.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,i){return(this._opacity===void 0||e===void 0&&i===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),i!==void 0&&(this._opacityWhenCovered=i),this._map&&this._updateOpacity(!0),this}}const Rc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let _s=0,Ia=!1;const Dc={maxWidth:100,unit:"metric"};function ol(u,e,i){const s=i&&i.maxWidth||100,l=u._container.clientHeight/2,h=u._container.clientWidth/2,f=u.unproject([h-s/2,l]),_=u.unproject([h+s/2,l]),v=Math.round(u.project(_).x-u.project(f).x),T=Math.min(s,v,u._container.clientWidth),I=f.distanceTo(_);if(i&&i.unit==="imperial"){const E=3.2808*I;E>5280?Ca(e,T,E/5280,u._getUIString("ScaleControl.Miles")):Ca(e,T,E,u._getUIString("ScaleControl.Feet"))}else i&&i.unit==="nautical"?Ca(e,T,I/1852,u._getUIString("ScaleControl.NauticalMiles")):I>=1e3?Ca(e,T,I/1e3,u._getUIString("ScaleControl.Kilometers")):Ca(e,T,I,u._getUIString("ScaleControl.Meters"))}function Ca(u,e,i,s){const l=function(h){const f=Math.pow(10,`${Math.floor(h)}`.length-1);let _=h/f;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:function(v){const T=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*T)/T}(_),f*_}(i);u.style.width=e*(l/i)+"px",u.innerHTML=`${l} ${s}`}const Lc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Fc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ro(u){if(u){if(typeof u=="number"){const e=Math.round(Math.abs(u)/Math.SQRT2);return{center:new o.P(0,0),top:new o.P(0,u),"top-left":new o.P(e,e),"top-right":new o.P(-e,e),bottom:new o.P(0,-u),"bottom-left":new o.P(e,-e),"bottom-right":new o.P(-e,-e),left:new o.P(u,0),right:new o.P(-u,0)}}if(u instanceof o.P||Array.isArray(u)){const e=o.P.convert(u);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:o.P.convert(u.center||[0,0]),top:o.P.convert(u.top||[0,0]),"top-left":o.P.convert(u["top-left"]||[0,0]),"top-right":o.P.convert(u["top-right"]||[0,0]),bottom:o.P.convert(u.bottom||[0,0]),"bottom-left":o.P.convert(u["bottom-left"]||[0,0]),"bottom-right":o.P.convert(u["bottom-right"]||[0,0]),left:o.P.convert(u.left||[0,0]),right:o.P.convert(u.right||[0,0])}}return ro(new o.P(0,0))}const Bc=le;S.AJAXError=o.cm,S.Event=o.l,S.Evented=o.E,S.LngLat=o.Q,S.MercatorCoordinate=o.$,S.Point=o.P,S.addProtocol=o.cn,S.config=o.a,S.removeProtocol=o.co,S.AttributionControl=Je,S.BoxZoomHandler=Pa,S.CanvasSource=qt,S.CooperativeGesturesHandler=il,S.DoubleClickZoomHandler=Ec,S.DragPanHandler=En,S.DragRotateHandler=ti,S.EdgeInsets=oi,S.FullscreenControl=class extends o.E{constructor(u={}){super(),this._onFullscreenChange=()=>{var e;let i=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=i==null?void 0:i.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)i=i.shadowRoot.fullscreenElement;i===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:o.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){ie.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=ie.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);ie.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new o.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new o.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},S.GeoJSONSource=Pt,S.GeolocateControl=class extends o.E{constructor(u){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new o.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new o.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{const i=new o.Q(e.coords.longitude,e.coords.latitude),s=e.coords.accuracy,l=this._map.getBearing(),h=o.e({bearing:l},this.options.fitBoundsOptions),f=Ve.fromLngLat(i,s);this._map.fitBounds(f,h,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const i=new o.Q(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Ia)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new o.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=ie.create("button","maplibregl-ctrl-geolocate",this._container),ie.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){o.w("Geolocation support is not available so the GeolocateControl will be disabled.");const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{const i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ie.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ma({element:this._dotElement}),this._circleElement=ie.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ma({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",i=>{i.geolocateSource||this._watchState!=="ACTIVE_LOCK"||i.originalEvent&&i.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new o.l("trackuserlocationend")),this.fire(new o.l("userlocationlostfocus")))})}},this.options=o.e({},Rc,u)}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return o._(this,arguments,void 0,function*(e=!1){if(fn!==void 0&&!e)return fn;if(window.navigator.permissions===void 0)return fn=!!window.navigator.geolocation,fn;try{fn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{fn=!!window.navigator.geolocation}return fn})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),ie.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,_s=0,Ia=!1}_isOutOfMapMaxBounds(u){const e=this._map.getMaxBounds(),i=u.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),e=u.getSouthEast(),i=u.getNorthEast(),s=e.distanceTo(i),l=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return o.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new o.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":_s--,Ia=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new o.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.l("trackuserlocationstart")),this.fire(new o.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),_s++,_s>1?(u={maximumAge:6e5,timeout:0},Ia=!0):(u=this.options.positionOptions,Ia=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},S.GlobeControl=class{constructor(){this._toggleProjection=()=>{var u;const e=(u=this._map.getProjection())===null||u===void 0?void 0:u.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var u;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((u=this._map.getProjection())===null||u===void 0?void 0:u.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=ie.create("button","maplibregl-ctrl-globe",this._container),ie.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){ie.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},S.Hash=Tc,S.ImageSource=st,S.KeyboardHandler=Ic,S.LngLatBounds=Ve,S.LogoControl=nt,S.Map=class extends pn{constructor(u){var e,i;o.cj.mark(o.ck.create);const s=Object.assign(Object.assign(Object.assign({},Ti),u),{canvasContextAttributes:Object.assign(Object.assign({},Ti.canvasContextAttributes),u.canvasContextAttributes)});if(s.minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const l=new li,h=new _r;if(s.minZoom!==void 0&&l.setMinZoom(s.minZoom),s.maxZoom!==void 0&&l.setMaxZoom(s.maxZoom),s.minPitch!==void 0&&l.setMinPitch(s.minPitch),s.maxPitch!==void 0&&l.setMaxPitch(s.maxPitch),s.renderWorldCopies!==void 0&&l.setRenderWorldCopies(s.renderWorldCopies),super(l,h,{bearingSnap:s.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new nl,this._controls=[],this._mapId=o.a4(),this._contextLost=_=>{_.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new o.l("webglcontextlost",{originalEvent:_}))},this._contextRestored=_=>{this._setupPainter(),this.resize(),this._update(),this.fire(new o.l("webglcontextrestored",{originalEvent:_}))},this._onMapScroll=_=>{if(_.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._maxTileCacheZoomLevels=s.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},s.canvasContextAttributes),this._trackResize=s.trackResize===!0,this._bearingSnap=s.bearingSnap,this._centerClampedToGround=s.centerClampedToGround,this._refreshExpiredTiles=s.refreshExpiredTiles===!0,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions===!0,this._collectResourceTiming=s.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},eo),s.locale),this._clickTolerance=s.clickTolerance,this._overridePixelRatio=s.pixelRatio,this._maxCanvasSize=s.maxCanvasSize,this.transformCameraUpdate=s.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=s.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=Jt.addThrottleControl(()=>this.isMoving()),this._requestManager=new pi(s.transformRequest),typeof s.container=="string"){if(this._container=document.getElementById(s.container),!this._container)throw new Error(`Container '${s.container}' not found.`)}else{if(!(s.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let _=!1;const v=wc(T=>{this._trackResize&&!this._removed&&(this.resize(T),this.redraw())},50);this._resizeObserver=new ResizeObserver(T=>{_?v(T):_=!0}),this._resizeObserver.observe(this._container)}this.handlers=new tp(this,s),this._hash=s.hash&&new Tc(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,elevation:s.elevation,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,roll:s.roll}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,o.e({},s.fitBoundsOptions,{duration:0}))));const f=typeof s.style=="string"||((i=(e=s.style)===null||e===void 0?void 0:e.projection)===null||i===void 0?void 0:i.type)!=="globe";this.resize(null,f),this._localIdeographFontFamily=s.localIdeographFontFamily,this._validateStyle=s.validateStyle,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Je(typeof s.attributionControl=="boolean"?void 0:s.attributionControl)),s.maplibreLogo&&this.addControl(new nt,s.logoPosition),this.on("style.load",()=>{if(f||this._resizeTransform(),this.transform.unmodified){const _=o.O(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(_)}}),this.on("data",_=>{this._update(_.dataType==="style"),this.fire(new o.l(`${_.dataType}data`,_))}),this.on("dataloading",_=>{this.fire(new o.l(`${_.dataType}dataloading`,_))}),this.on("dataabort",_=>{this.fire(new o.l("sourcedataabort",_))})}_getMapId(){return this._mapId}addControl(u,e){if(e===void 0&&(e=u.getDefaultPosition?u.getDefaultPosition():"top-right"),!u||!u.onAdd)return this.fire(new o.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const i=u.onAdd(this);this._controls.push(u);const s=this._controlPositions[e];return e.indexOf("bottom")!==-1?s.insertBefore(i,s.firstChild):s.appendChild(i),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new o.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(u);return e>-1&&this._controls.splice(e,1),u.onRemove(this),this}hasControl(u){return this._controls.indexOf(u)>-1}calculateCameraOptionsFromTo(u,e,i,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,e,i,s)}resize(u,e=!0){const[i,s]=this._containerDimensions(),l=this._getClampedPixelRatio(i,s);if(this._resizeCanvas(i,s,l),this.painter.resize(i,s,l),this.painter.overLimit()){const f=this.painter.context.gl;this._maxCanvasSize=[f.drawingBufferWidth,f.drawingBufferHeight];const _=this._getClampedPixelRatio(i,s);this._resizeCanvas(i,s,_),this.painter.resize(i,s,_)}this._resizeTransform(e);const h=!this._moving;return h&&(this.stop(),this.fire(new o.l("movestart",u)).fire(new o.l("move",u))),this.fire(new o.l("resize",u)),h&&this.fire(new o.l("moveend",u)),this}_resizeTransform(u=!0){var e;const[i,s]=this._containerDimensions();this.transform.resize(i,s,u),(e=this._requestedCameraState)===null||e===void 0||e.resize(i,s,u)}_getClampedPixelRatio(u,e){const{0:i,1:s}=this._maxCanvasSize,l=this.getPixelRatio(),h=u*l,f=e*l;return Math.min(h>i?i/h:1,f>s?s/f:1)*l}getPixelRatio(){var u;return(u=this._overridePixelRatio)!==null&&u!==void 0?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(Ve.convert(u)),this._update()}setMinZoom(u){if((u=u??-2)>=-2&&u<=this.transform.maxZoom)return this.transform.setMinZoom(u),this._update(),this.getZoom()<u&&this.setZoom(u),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(u){if((u=u??22)>=this.transform.minZoom)return this.transform.setMaxZoom(u),this._update(),this.getZoom()>u&&this.setZoom(u),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(u){if((u=u??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(u>=0&&u<=this.transform.maxPitch)return this.transform.setMinPitch(u),this._update(),this.getPitch()<u&&this.setPitch(u),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(u){if((u=u??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(u>=this.transform.minPitch)return this.transform.setMaxPitch(u),this._update(),this.getPitch()>u&&this.setPitch(u),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.setRenderWorldCopies(u),this._update()}project(u){return this.transform.locationToScreenPoint(o.Q.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.screenPointToLocation(o.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||((u=this.handlers)===null||u===void 0?void 0:u.isMoving())}isZooming(){var u;return this._zooming||((u=this.handlers)===null||u===void 0?void 0:u.isZooming())}isRotating(){var u;return this._rotating||((u=this.handlers)===null||u===void 0?void 0:u.isRotating())}_createDelegatedListener(u,e,i){if(u==="mouseenter"||u==="mouseover"){let s=!1;return{layers:e,listener:i,delegates:{mousemove:h=>{const f=e.filter(v=>this.getLayer(v)),_=f.length!==0?this.queryRenderedFeatures(h.point,{layers:f}):[];_.length?s||(s=!0,i.call(this,new er(u,this,h.originalEvent,{features:_}))):s=!1},mouseout:()=>{s=!1}}}}if(u==="mouseleave"||u==="mouseout"){let s=!1;return{layers:e,listener:i,delegates:{mousemove:f=>{const _=e.filter(v=>this.getLayer(v));(_.length!==0?this.queryRenderedFeatures(f.point,{layers:_}):[]).length?s=!0:s&&(s=!1,i.call(this,new er(u,this,f.originalEvent)))},mouseout:f=>{s&&(s=!1,i.call(this,new er(u,this,f.originalEvent)))}}}}{const s=l=>{const h=e.filter(_=>this.getLayer(_)),f=h.length!==0?this.queryRenderedFeatures(l.point,{layers:h}):[];f.length&&(l.features=f,i.call(this,l),delete l.features)};return{layers:e,listener:i,delegates:{[u]:s}}}}_saveDelegatedListener(u,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(e)}_removeDelegatedListener(u,e,i){if(!this._delegatedListeners||!this._delegatedListeners[u])return;const s=this._delegatedListeners[u];for(let l=0;l<s.length;l++){const h=s[l];if(h.listener===i&&h.layers.length===e.length&&h.layers.every(f=>e.includes(f))){for(const f in h.delegates)this.off(f,h.delegates[f]);return void s.splice(l,1)}}}on(u,e,i){if(i===void 0)return super.on(u,e);const s=typeof e=="string"?[e]:e,l=this._createDelegatedListener(u,s,i);this._saveDelegatedListener(u,l);for(const h in l.delegates)this.on(h,l.delegates[h]);return{unsubscribe:()=>{this._removeDelegatedListener(u,s,i)}}}once(u,e,i){if(i===void 0)return super.once(u,e);const s=typeof e=="string"?[e]:e,l=this._createDelegatedListener(u,s,i);for(const h in l.delegates){const f=l.delegates[h];l.delegates[h]=(..._)=>{this._removeDelegatedListener(u,s,i),f(..._)}}this._saveDelegatedListener(u,l);for(const h in l.delegates)this.once(h,l.delegates[h]);return this}off(u,e,i){return i===void 0?super.off(u,e):(this._removeDelegatedListener(u,typeof e=="string"?[e]:e,i),this)}queryRenderedFeatures(u,e){if(!this.style)return[];let i;const s=u instanceof o.P||Array.isArray(u),l=s?u:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(s?{}:u)||{},l instanceof o.P||typeof l[0]=="number")i=[o.P.convert(l)];else{const h=o.P.convert(l[0]),f=o.P.convert(l[1]);i=[h,new o.P(f.x,h.y),f,new o.P(h.x,f.y),h]}return this.style.queryRenderedFeatures(i,e,this.transform)}querySourceFeatures(u,e){return this.style.querySourceFeatures(u,e)}setStyle(u,e){return(e=o.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&u?(this._diffStyle(u,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(u,e))}setTransformRequest(u){return this._requestManager.setTransformRequest(u),this}_getUIString(u){const e=this._locale[u];if(e==null)throw new Error(`Missing UI string '${u}'`);return e}_updateStyle(u,e){var i,s;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(u,e));const l=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new ts(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof u=="string"?this.style.loadURL(u,e,l):this.style.loadJSON(u,e,l),this):((s=(i=this.style)===null||i===void 0?void 0:i.projection)===null||s===void 0||s.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ts(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,e){if(typeof u=="string"){const i=this._requestManager.transformRequest(u,"Style");o.j(i,new AbortController).then(s=>{this._updateDiff(s.data,e)}).catch(s=>{s&&this.fire(new o.k(s))})}else typeof u=="object"&&this._updateDiff(u,e)}_updateDiff(u,e){try{this.style.setState(u,e)&&this._update(!0)}catch(i){o.w(`Unable to perform style diff: ${i.message||i.error||i}. Rebuilding the style from scratch.`),this._updateStyle(u,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.w("There is no style added to the map.")}addSource(u,e){return this._lazyInitEmptyStyle(),this.style.addSource(u,e),this._update(!0)}isSourceLoaded(u){const e=this.style&&this.style.sourceCaches[u];if(e!==void 0)return e.loaded();this.fire(new o.k(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const e=this.style.sourceCaches[u.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);this.terrain===null&&e.reload();for(const i in this.style._layers){const s=this.style._layers[i];s.type==="hillshade"&&s.source===u.source&&o.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new xr(this.painter,e,u),this.painter.renderToTexture=new ip(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=i=>{var s;i.dataType==="style"?this.terrain.sourceCache.freeRtt():i.dataType==="source"&&i.tile&&(i.sourceId!==u.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((s=i.source)===null||s===void 0?void 0:s.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(i.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new o.l("terrain",{terrain:u})),this}getTerrain(){var u,e;return(e=(u=this.terrain)===null||u===void 0?void 0:u.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const e in u){const i=u[e]._tiles;for(const s in i){const l=i[s];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,e,i={}){const{pixelRatio:s=1,sdf:l=!1,stretchX:h,stretchY:f,content:_,textFitWidth:v,textFitHeight:T}=i;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||o.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new o.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:I,height:E,data:k}=e,O=e;return this.style.addImage(u,{data:new o.R({width:I,height:E},new Uint8Array(k)),pixelRatio:s,stretchX:h,stretchY:f,content:_,textFitWidth:v,textFitHeight:T,sdf:l,version:0,userImage:O}),O.onAdd&&O.onAdd(this,u),this}}{const{width:I,height:E,data:k}=xe.getImageData(e);this.style.addImage(u,{data:new o.R({width:I,height:E},k),pixelRatio:s,stretchX:h,stretchY:f,content:_,textFitWidth:v,textFitHeight:T,sdf:l,version:0})}}updateImage(u,e){const i=this.style.getImage(u);if(!i)return this.fire(new o.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=e instanceof HTMLImageElement||o.b(e)?xe.getImageData(e):e,{width:l,height:h,data:f}=s;if(l===void 0||h===void 0)return this.fire(new o.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==i.data.width||h!==i.data.height)return this.fire(new o.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const _=!(e instanceof HTMLImageElement||o.b(e));return i.data.replace(f,_),this.style.updateImage(u,i),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new o.k(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u){return Jt.getImage(this._requestManager.transformRequest(u,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(u,e){return this._lazyInitEmptyStyle(),this.style.addLayer(u,e),this._update(!0)}moveLayer(u,e){return this.style.moveLayer(u,e),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,e,i){return this.style.setLayerZoomRange(u,e,i),this._update(!0)}setFilter(u,e,i={}){return this.style.setFilter(u,e,i),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,e,i,s={}){return this.style.setPaintProperty(u,e,i,s),this._update(!0)}getPaintProperty(u,e){return this.style.getPaintProperty(u,e)}setLayoutProperty(u,e,i,s={}){return this.style.setLayoutProperty(u,e,i,s),this._update(!0)}getLayoutProperty(u,e){return this.style.getLayoutProperty(u,e)}setGlyphs(u,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,e,i,s=>{s||this._update(!0)}),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,e,i=>{i||this._update(!0)}),this}setLight(u,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(u,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(u,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(u,e){return this.style.setFeatureState(u,e),this._update()}removeFeatureState(u,e){return this.style.removeFeatureState(u,e),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,e=0;return this._container&&(u=this._container.clientWidth||400,e=this._container.clientHeight||300),[u,e]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const e=this._canvasContainer=ie.create("div","maplibregl-canvas-container",u);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=ie.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const i=this._containerDimensions(),s=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],s);const l=this._controlContainer=ie.create("div","maplibregl-control-container",u),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(f=>{h[f]=ie.create("div",`maplibregl-ctrl-${f} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(u,e,i){this._canvas.width=Math.floor(i*u),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const u=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{e={requestedAttributes:u},s&&(e.statusMessage=s.statusMessage,e.type=s.type)},{once:!0});let i=null;if(i=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,u):this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u),!i){const s="Failed to initialize WebGL";throw e?(e.message=s,new Error(JSON.stringify(e))):new Error(s)}this.painter=new Sh(i,this.transform),De.testSupport(i)}migrateProjection(u,e){super.migrateProjection(u,e),this.painter.transform=u,this.fire(new o.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){var e,i,s,l,h;const f=this._idleTriggered?this._fadeDuration:0,_=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let v=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const E=this.transform.zoom,k=xe.now();this.style.zoomHistory.update(E,k);const O=new o.C(E,{now:k,fadeDuration:f,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Z=O.crossFadingFactor();Z===1&&Z===this._crossFadingFactor||(v=!0,this._crossFadingFactor=Z),this.style.update(O)}const T=((i=this.style.projection)===null||i===void 0?void 0:i.transitionState)>0!==_;(s=this.style.projection)===null||s===void 0||s.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((l=this.style.projection)===null||l===void 0?void 0:l.transitionState,(h=this.style.projection)===null||h===void 0?void 0:h.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||T)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,f,this._crossSourceCollisions,T),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:f,showPadding:this.showPadding}),this.fire(new o.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.cj.mark(o.ck.load),this.fire(new o.l("load"))),this.style&&(this.style.hasTransitions()||v)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const I=this._sourcesDirty||this._styleDirty||this._placementDirty;return I||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.l("idle")),!this._loaded||this._fullyLoaded||I||(this._fullyLoaded=!0,o.cj.mark(o.ck.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const i of this._controls)i.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Jt.removeThrottleControl(this._imageQueueHandle),(u=this._resizeObserver)===null||u===void 0||u.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ie.remove(this._canvasContainer),ie.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),o.cj.clearMetrics(),this._removed=!0,this.fire(new o.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,xe.frame(this._frameRequest,u=>{o.cj.frame(u),this._frameRequest=null;try{this._render(u)}catch(e){if(!o.cl(e)&&!function(i){return i.message===vh}(e))throw e}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return gi}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(u){return this._lazyInitEmptyStyle(),this.style.setProjection(u),this._update(!0)}},S.MapMouseEvent=er,S.MapTouchEvent=fs,S.MapWheelEvent=Ur,S.Marker=Ma,S.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const e=this._map.getZoom(),i=e===this._map.getMaxZoom(),s=e===this._map.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,i)=>{const s=this._map._getUIString(`NavigationControl.${i}`);e.title=s,e.setAttribute("aria-label",s)},this.options=o.e({},jh,u),this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),ie.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),ie.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=ie.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new to(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ie.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(u,e){const i=ie.create("button",u,this._container);return i.type="button",i.addEventListener("click",e),i}},S.Popup=class extends o.E{constructor(u){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:void 0)},this.remove=()=>(this._content&&ie.remove(this._content),this._container&&(ie.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new o.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var i;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=ie.create("div","maplibregl-popup",this._map.getContainer()),this._tip=ie.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const _ of this.options.className.split(" "))this._container.classList.add(_);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?al(this._lngLat,this._flatPos,this._map.transform):(i=this._lngLat)===null||i===void 0?void 0:i.wrap(),this._trackPointer&&!e)return;const s=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let l=this.options.anchor;const h=ro(this.options.offset);if(!l){const _=this._container.offsetWidth,v=this._container.offsetHeight;let T;T=s.y+h.bottom.y<v?["top"]:s.y>this._map.transform.height-v?["bottom"]:[],s.x<_/2?T.push("left"):s.x>this._map.transform.width-_/2&&T.push("right"),l=T.length===0?"bottom":T.join("-")}let f=s.add(h[l]);this.options.subpixelPositioning||(f=f.round()),ie.setTransform(this._container,`${io[l]} translate(${f.x}px,${f.y}px)`),sl(this._container,l,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=o.e(Object.create(Lc),u)}addTo(u){return this._map&&this.remove(),this._map=u,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new o.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=o.Q.convert(u),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const e=document.createDocumentFragment(),i=document.createElement("body");let s;for(i.innerHTML=u;s=i.firstChild,s;)e.appendChild(s);return this.setDOMContent(e)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=ie.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){return this._container&&this._container.classList.add(u),this}removeClassName(u){return this._container&&this._container.classList.remove(u),this}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}setSubpixelPositioning(u){this.options.subpixelPositioning=u}_createCloseButton(){this.options.closeButton&&(this._closeButton=ie.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(Fc);u&&u.focus()}},S.RasterDEMTileSource=bi,S.RasterTileSource=Gt,S.ScaleControl=class{constructor(u){this._onMove=()=>{ol(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,ol(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Dc),u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ie.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},S.ScrollZoomHandler=Fh,S.Style=ts,S.TerrainControl=class{constructor(u){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=u}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=ie.create("button","maplibregl-ctrl-terrain",this._container),ie.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ie.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},S.TwoFingersTouchPitchHandler=Lh,S.TwoFingersTouchRotateHandler=Dh,S.TwoFingersTouchZoomHandler=wt,S.TwoFingersTouchZoomRotateHandler=Ys,S.VectorTileSource=Zt,S.VideoSource=It,S.addSourceType=(u,e)=>o._(void 0,void 0,void 0,function*(){if(fi(u))throw new Error(`A source type called "${u}" already exists.`);((i,s)=>{qi[i]=s})(u,e)}),S.clearPrewarmedResources=function(){const u=Ji;u&&(u.isPreloaded()&&u.numActive()===1?(u.release($n),Ji=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},S.createTileMesh=Ao,S.getMaxParallelImageRequests=function(){return o.a.MAX_PARALLEL_IMAGE_REQUESTS},S.getRTLTextPluginStatus=function(){return Xr().getRTLTextPluginStatus()},S.getVersion=function(){return Bc},S.getWorkerCount=function(){return jr.workerCount},S.getWorkerUrl=function(){return o.a.WORKER_URL},S.importScriptInWorkers=function(u){return kr().broadcast("IS",u)},S.prewarm=function(){Tn().acquire($n)},S.setMaxParallelImageRequests=function(u){o.a.MAX_PARALLEL_IMAGE_REQUESTS=u},S.setRTLTextPlugin=function(u,e){return Xr().setRTLTextPlugin(u,e)},S.setWorkerCount=function(u){jr.workerCount=u},S.setWorkerUrl=function(u){o.a.WORKER_URL=u}});var D=b;return D})}(zu)),zu.exports}var Sy=Py();const Sd=wy(Sy);class Wf{constructor(m,b,C,A,D){Ts(this,"bounds1");Ts(this,"bounds2");Ts(this,"getBounds",(m,b,C,A)=>new Sd.LngLatBounds([m,b],[C,A]));Ts(this,"contains",(m,b)=>this.bounds1.contains([b,m])||this.bounds2.contains([b,m]));const S=m.unproject([b,C]),o=m.unproject([A,D]);if(S.lng<-180){this.bounds1=this.getBounds(-180,S.lat,o.lng,o.lat),this.bounds2=this.getBounds(S.wrap().lng,S.lat,180,o.lat);return}if(o.lng>180){this.bounds1=this.getBounds(S.lng,S.lat,180,o.lat),this.bounds2=this.getBounds(-180,S.lat,o.wrap().lng,o.lat);return}this.bounds1=this.getBounds(S.lng,S.lat,o.lng,o.lat),this.bounds2=this.getBounds(0,0,0,0)}}const My={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(120, 120, 120, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(128, 128, 128, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(56, 56, 56, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(153, 153, 153, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(104, 104, 104, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(56, 56, 56, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(136, 136, 136, 1)","fill-outline-color":"rgba(102, 102, 102, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(50, 50, 50, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(52, 52, 52, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(88, 88, 88, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20],"line-color":"rgba(102, 102, 102, 1)"}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23],"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(51, 51, 51, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(51, 51, 51, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(255, 255, 255, 1)","text-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]},Iy={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(220, 220, 220, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(228, 228, 228, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(156, 156, 156, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(253, 253, 253, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(204, 204, 204, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(156, 156, 156, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(236, 236, 236, 1)","fill-outline-color":"rgba(202, 202, 202, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(185, 185, 185)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(150, 150, 150, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(152, 152, 152, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(188, 188, 188)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(185, 185, 185)","line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23]}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":2}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(151, 151, 151, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(151, 151, 151, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1.5}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(0, 0, 0, 1)","text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]};var Nt;(function(y){y.assertEqual=A=>A;function m(A){}y.assertIs=m;function b(A){throw new Error}y.assertNever=b,y.arrayToEnum=A=>{const D={};for(const S of A)D[S]=S;return D},y.getValidEnumValues=A=>{const D=y.objectKeys(A).filter(o=>typeof A[A[o]]!="number"),S={};for(const o of D)S[o]=A[o];return y.objectValues(S)},y.objectValues=A=>y.objectKeys(A).map(function(D){return A[D]}),y.objectKeys=typeof Object.keys=="function"?A=>Object.keys(A):A=>{const D=[];for(const S in A)Object.prototype.hasOwnProperty.call(A,S)&&D.push(S);return D},y.find=(A,D)=>{for(const S of A)if(D(S))return S},y.isInteger=typeof Number.isInteger=="function"?A=>Number.isInteger(A):A=>typeof A=="number"&&isFinite(A)&&Math.floor(A)===A;function C(A,D=" | "){return A.map(S=>typeof S=="string"?`'${S}'`:S).join(D)}y.joinValues=C,y.jsonStringifyReplacer=(A,D)=>typeof D=="bigint"?D.toString():D})(Nt||(Nt={}));var Md;(function(y){y.mergeShapes=(m,b)=>({...m,...b})})(Md||(Md={}));const Ke=Nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ua=y=>{switch(typeof y){case"undefined":return Ke.undefined;case"string":return Ke.string;case"number":return isNaN(y)?Ke.nan:Ke.number;case"boolean":return Ke.boolean;case"function":return Ke.function;case"bigint":return Ke.bigint;case"symbol":return Ke.symbol;case"object":return Array.isArray(y)?Ke.array:y===null?Ke.null:y.then&&typeof y.then=="function"&&y.catch&&typeof y.catch=="function"?Ke.promise:typeof Map<"u"&&y instanceof Map?Ke.map:typeof Set<"u"&&y instanceof Set?Ke.set:typeof Date<"u"&&y instanceof Date?Ke.date:Ke.object;default:return Ke.unknown}},Oe=Nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Cy=y=>JSON.stringify(y,null,2).replace(/"([^"]+)":/g,"$1:");class qr extends Error{get errors(){return this.issues}constructor(m){super(),this.issues=[],this.addIssue=C=>{this.issues=[...this.issues,C]},this.addIssues=(C=[])=>{this.issues=[...this.issues,...C]};const b=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,b):this.__proto__=b,this.name="ZodError",this.issues=m}format(m){const b=m||function(D){return D.message},C={_errors:[]},A=D=>{for(const S of D.issues)if(S.code==="invalid_union")S.unionErrors.map(A);else if(S.code==="invalid_return_type")A(S.returnTypeError);else if(S.code==="invalid_arguments")A(S.argumentsError);else if(S.path.length===0)C._errors.push(b(S));else{let o=C,le=0;for(;le<S.path.length;){const ue=S.path[le];le===S.path.length-1?(o[ue]=o[ue]||{_errors:[]},o[ue]._errors.push(b(S))):o[ue]=o[ue]||{_errors:[]},o=o[ue],le++}}};return A(this),C}static assert(m){if(!(m instanceof qr))throw new Error(`Not a ZodError: ${m}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Nt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(m=b=>b.message){const b={},C=[];for(const A of this.issues)A.path.length>0?(b[A.path[0]]=b[A.path[0]]||[],b[A.path[0]].push(m(A))):C.push(m(A));return{formErrors:C,fieldErrors:b}}get formErrors(){return this.flatten()}}qr.create=y=>new qr(y);const xo=(y,m)=>{let b;switch(y.code){case Oe.invalid_type:y.received===Ke.undefined?b="Required":b=`Expected ${y.expected}, received ${y.received}`;break;case Oe.invalid_literal:b=`Invalid literal value, expected ${JSON.stringify(y.expected,Nt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:b=`Unrecognized key(s) in object: ${Nt.joinValues(y.keys,", ")}`;break;case Oe.invalid_union:b="Invalid input";break;case Oe.invalid_union_discriminator:b=`Invalid discriminator value. Expected ${Nt.joinValues(y.options)}`;break;case Oe.invalid_enum_value:b=`Invalid enum value. Expected ${Nt.joinValues(y.options)}, received '${y.received}'`;break;case Oe.invalid_arguments:b="Invalid function arguments";break;case Oe.invalid_return_type:b="Invalid function return type";break;case Oe.invalid_date:b="Invalid date";break;case Oe.invalid_string:typeof y.validation=="object"?"includes"in y.validation?(b=`Invalid input: must include "${y.validation.includes}"`,typeof y.validation.position=="number"&&(b=`${b} at one or more positions greater than or equal to ${y.validation.position}`)):"startsWith"in y.validation?b=`Invalid input: must start with "${y.validation.startsWith}"`:"endsWith"in y.validation?b=`Invalid input: must end with "${y.validation.endsWith}"`:Nt.assertNever(y.validation):y.validation!=="regex"?b=`Invalid ${y.validation}`:b="Invalid";break;case Oe.too_small:y.type==="array"?b=`Array must contain ${y.exact?"exactly":y.inclusive?"at least":"more than"} ${y.minimum} element(s)`:y.type==="string"?b=`String must contain ${y.exact?"exactly":y.inclusive?"at least":"over"} ${y.minimum} character(s)`:y.type==="number"?b=`Number must be ${y.exact?"exactly equal to ":y.inclusive?"greater than or equal to ":"greater than "}${y.minimum}`:y.type==="date"?b=`Date must be ${y.exact?"exactly equal to ":y.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(y.minimum))}`:b="Invalid input";break;case Oe.too_big:y.type==="array"?b=`Array must contain ${y.exact?"exactly":y.inclusive?"at most":"less than"} ${y.maximum} element(s)`:y.type==="string"?b=`String must contain ${y.exact?"exactly":y.inclusive?"at most":"under"} ${y.maximum} character(s)`:y.type==="number"?b=`Number must be ${y.exact?"exactly":y.inclusive?"less than or equal to":"less than"} ${y.maximum}`:y.type==="bigint"?b=`BigInt must be ${y.exact?"exactly":y.inclusive?"less than or equal to":"less than"} ${y.maximum}`:y.type==="date"?b=`Date must be ${y.exact?"exactly":y.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(y.maximum))}`:b="Invalid input";break;case Oe.custom:b="Invalid input";break;case Oe.invalid_intersection_types:b="Intersection results could not be merged";break;case Oe.not_multiple_of:b=`Number must be a multiple of ${y.multipleOf}`;break;case Oe.not_finite:b="Number must be finite";break;default:b=m.defaultError,Nt.assertNever(y)}return{message:b}};let Hf=xo;function ky(y){Hf=y}function Ru(){return Hf}const Du=y=>{const{data:m,path:b,errorMaps:C,issueData:A}=y,D=[...b,...A.path||[]],S={...A,path:D};if(A.message!==void 0)return{...A,path:D,message:A.message};let o="";const le=C.filter(ue=>!!ue).slice().reverse();for(const ue of le)o=ue(S,{data:m,defaultError:o}).message;return{...A,path:D,message:o}},Ey=[];function qe(y,m){const b=Ru(),C=Du({issueData:m,data:y.data,path:y.path,errorMaps:[y.common.contextualErrorMap,y.schemaErrorMap,b,b===xo?void 0:xo].filter(A=>!!A)});y.common.issues.push(C)}class hr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(m,b){const C=[];for(const A of b){if(A.status==="aborted")return dt;A.status==="dirty"&&m.dirty(),C.push(A.value)}return{status:m.value,value:C}}static async mergeObjectAsync(m,b){const C=[];for(const A of b){const D=await A.key,S=await A.value;C.push({key:D,value:S})}return hr.mergeObjectSync(m,C)}static mergeObjectSync(m,b){const C={};for(const A of b){const{key:D,value:S}=A;if(D.status==="aborted"||S.status==="aborted")return dt;D.status==="dirty"&&m.dirty(),S.status==="dirty"&&m.dirty(),D.value!=="__proto__"&&(typeof S.value<"u"||A.alwaysSet)&&(C[D.value]=S.value)}return{status:m.value,value:C}}}const dt=Object.freeze({status:"aborted"}),vo=y=>({status:"dirty",value:y}),Sr=y=>({status:"valid",value:y}),Id=y=>y.status==="aborted",Cd=y=>y.status==="dirty",Ms=y=>y.status==="valid",El=y=>typeof Promise<"u"&&y instanceof Promise;function Lu(y,m,b,C){if(typeof m=="function"?y!==m||!0:!m.has(y))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m.get(y)}function Xf(y,m,b,C,A){if(typeof m=="function"?y!==m||!0:!m.has(y))throw new TypeError("Cannot write private member to an object whose class did not declare it");return m.set(y,b),b}typeof SuppressedError=="function"&&SuppressedError;var rt;(function(y){y.errToObj=m=>typeof m=="string"?{message:m}:m||{},y.toString=m=>typeof m=="string"?m:m==null?void 0:m.message})(rt||(rt={}));var Al,zl;class Zn{constructor(m,b,C,A){this._cachedPath=[],this.parent=m,this.data=b,this._path=C,this._key=A}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Kf=(y,m)=>{if(Ms(m))return{success:!0,data:m.value};if(!y.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const b=new qr(y.common.issues);return this._error=b,this._error}}};function xt(y){if(!y)return{};const{errorMap:m,invalid_type_error:b,required_error:C,description:A}=y;if(m&&(b||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return m?{errorMap:m,description:A}:{errorMap:(S,o)=>{var le,ue;const{message:_e}=y;return S.code==="invalid_enum_value"?{message:_e??o.defaultError}:typeof o.data>"u"?{message:(le=_e??C)!==null&&le!==void 0?le:o.defaultError}:S.code!=="invalid_type"?{message:o.defaultError}:{message:(ue=_e??b)!==null&&ue!==void 0?ue:o.defaultError}},description:A}}class Mt{get description(){return this._def.description}_getType(m){return ua(m.data)}_getOrReturnCtx(m,b){return b||{common:m.parent.common,data:m.data,parsedType:ua(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}_processInputParams(m){return{status:new hr,ctx:{common:m.parent.common,data:m.data,parsedType:ua(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}}_parseSync(m){const b=this._parse(m);if(El(b))throw new Error("Synchronous parse encountered promise.");return b}_parseAsync(m){const b=this._parse(m);return Promise.resolve(b)}parse(m,b){const C=this.safeParse(m,b);if(C.success)return C.data;throw C.error}safeParse(m,b){var C;const A={common:{issues:[],async:(C=b==null?void 0:b.async)!==null&&C!==void 0?C:!1,contextualErrorMap:b==null?void 0:b.errorMap},path:(b==null?void 0:b.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:ua(m)},D=this._parseSync({data:m,path:A.path,parent:A});return Kf(A,D)}"~validate"(m){var b,C;const A={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:ua(m)};if(!this["~standard"].async)try{const D=this._parseSync({data:m,path:[],parent:A});return Ms(D)?{value:D.value}:{issues:A.common.issues}}catch(D){!((C=(b=D==null?void 0:D.message)===null||b===void 0?void 0:b.toLowerCase())===null||C===void 0)&&C.includes("encountered")&&(this["~standard"].async=!0),A.common={issues:[],async:!0}}return this._parseAsync({data:m,path:[],parent:A}).then(D=>Ms(D)?{value:D.value}:{issues:A.common.issues})}async parseAsync(m,b){const C=await this.safeParseAsync(m,b);if(C.success)return C.data;throw C.error}async safeParseAsync(m,b){const C={common:{issues:[],contextualErrorMap:b==null?void 0:b.errorMap,async:!0},path:(b==null?void 0:b.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:ua(m)},A=this._parse({data:m,path:C.path,parent:C}),D=await(El(A)?A:Promise.resolve(A));return Kf(C,D)}refine(m,b){const C=A=>typeof b=="string"||typeof b>"u"?{message:b}:typeof b=="function"?b(A):b;return this._refinement((A,D)=>{const S=m(A),o=()=>D.addIssue({code:Oe.custom,...C(A)});return typeof Promise<"u"&&S instanceof Promise?S.then(le=>le?!0:(o(),!1)):S?!0:(o(),!1)})}refinement(m,b){return this._refinement((C,A)=>m(C)?!0:(A.addIssue(typeof b=="function"?b(C,A):b),!1))}_refinement(m){return new bn({schema:this,typeName:ut.ZodEffects,effect:{type:"refinement",refinement:m}})}superRefine(m){return this._refinement(m)}constructor(m){this.spa=this.safeParseAsync,this._def=m,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:b=>this["~validate"](b)}}optional(){return Un.create(this,this._def)}nullable(){return Za.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vn.create(this)}promise(){return Po.create(this,this._def)}or(m){return Fl.create([this,m],this._def)}and(m){return Bl.create(this,m,this._def)}transform(m){return new bn({...xt(this._def),schema:this,typeName:ut.ZodEffects,effect:{type:"transform",transform:m}})}default(m){const b=typeof m=="function"?m:()=>m;return new Vl({...xt(this._def),innerType:this,defaultValue:b,typeName:ut.ZodDefault})}brand(){return new Ad({typeName:ut.ZodBranded,type:this,...xt(this._def)})}catch(m){const b=typeof m=="function"?m:()=>m;return new Ul({...xt(this._def),innerType:this,catchValue:b,typeName:ut.ZodCatch})}describe(m){const b=this.constructor;return new b({...this._def,description:m})}pipe(m){return $l.create(this,m)}readonly(){return Gl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ay=/^c[^\s-]{8,}$/i,zy=/^[0-9a-z]+$/,Ry=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Dy=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ly=/^[a-z0-9_-]{21}$/i,Fy=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,By=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Oy=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kd;const Ny=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Vy=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Uy=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$y=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Gy=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qy=new RegExp(`^${Yf}$`);function Jf(y){let m="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return y.precision?m=`${m}\\.\\d{${y.precision}}`:y.precision==null&&(m=`${m}(\\.\\d+)?`),m}function Wy(y){return new RegExp(`^${Jf(y)}$`)}function Qf(y){let m=`${Yf}T${Jf(y)}`;const b=[];return b.push(y.local?"Z?":"Z"),y.offset&&b.push("([+-]\\d{2}:?\\d{2})"),m=`${m}(${b.join("|")})`,new RegExp(`^${m}$`)}function Hy(y,m){return!!((m==="v4"||!m)&&Ny.test(y)||(m==="v6"||!m)&&Vy.test(y))}function Xy(y,m){if(!Fy.test(y))return!1;try{const[b]=y.split("."),C=b.replace(/-/g,"+").replace(/_/g,"/").padEnd(b.length+(4-b.length%4)%4,"="),A=JSON.parse(atob(C));return!(typeof A!="object"||A===null||!A.typ||!A.alg||m&&A.alg!==m)}catch{return!1}}function Ky(y,m){return!!((m==="v4"||!m)&&Zy.test(y)||(m==="v6"||!m)&&Uy.test(y))}class xn extends Mt{_parse(m){if(this._def.coerce&&(m.data=String(m.data)),this._getType(m)!==Ke.string){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_type,expected:Ke.string,received:D.parsedType}),dt}const C=new hr;let A;for(const D of this._def.checks)if(D.kind==="min")m.data.length<D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_small,minimum:D.value,type:"string",inclusive:!0,exact:!1,message:D.message}),C.dirty());else if(D.kind==="max")m.data.length>D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_big,maximum:D.value,type:"string",inclusive:!0,exact:!1,message:D.message}),C.dirty());else if(D.kind==="length"){const S=m.data.length>D.value,o=m.data.length<D.value;(S||o)&&(A=this._getOrReturnCtx(m,A),S?qe(A,{code:Oe.too_big,maximum:D.value,type:"string",inclusive:!0,exact:!0,message:D.message}):o&&qe(A,{code:Oe.too_small,minimum:D.value,type:"string",inclusive:!0,exact:!0,message:D.message}),C.dirty())}else if(D.kind==="email")Oy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"email",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="emoji")kd||(kd=new RegExp(jy,"u")),kd.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"emoji",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="uuid")Dy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"uuid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="nanoid")Ly.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"nanoid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="cuid")Ay.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"cuid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="cuid2")zy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"cuid2",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="ulid")Ry.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"ulid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="url")try{new URL(m.data)}catch{A=this._getOrReturnCtx(m,A),qe(A,{validation:"url",code:Oe.invalid_string,message:D.message}),C.dirty()}else D.kind==="regex"?(D.regex.lastIndex=0,D.regex.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"regex",code:Oe.invalid_string,message:D.message}),C.dirty())):D.kind==="trim"?m.data=m.data.trim():D.kind==="includes"?m.data.includes(D.value,D.position)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:{includes:D.value,position:D.position},message:D.message}),C.dirty()):D.kind==="toLowerCase"?m.data=m.data.toLowerCase():D.kind==="toUpperCase"?m.data=m.data.toUpperCase():D.kind==="startsWith"?m.data.startsWith(D.value)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:{startsWith:D.value},message:D.message}),C.dirty()):D.kind==="endsWith"?m.data.endsWith(D.value)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:{endsWith:D.value},message:D.message}),C.dirty()):D.kind==="datetime"?Qf(D).test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:"datetime",message:D.message}),C.dirty()):D.kind==="date"?qy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:"date",message:D.message}),C.dirty()):D.kind==="time"?Wy(D).test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:"time",message:D.message}),C.dirty()):D.kind==="duration"?By.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"duration",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="ip"?Hy(m.data,D.version)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"ip",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="jwt"?Xy(m.data,D.alg)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"jwt",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="cidr"?Ky(m.data,D.version)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"cidr",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="base64"?$y.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"base64",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="base64url"?Gy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"base64url",code:Oe.invalid_string,message:D.message}),C.dirty()):Nt.assertNever(D);return{status:C.value,value:m.data}}_regex(m,b,C){return this.refinement(A=>m.test(A),{validation:b,code:Oe.invalid_string,...rt.errToObj(C)})}_addCheck(m){return new xn({...this._def,checks:[...this._def.checks,m]})}email(m){return this._addCheck({kind:"email",...rt.errToObj(m)})}url(m){return this._addCheck({kind:"url",...rt.errToObj(m)})}emoji(m){return this._addCheck({kind:"emoji",...rt.errToObj(m)})}uuid(m){return this._addCheck({kind:"uuid",...rt.errToObj(m)})}nanoid(m){return this._addCheck({kind:"nanoid",...rt.errToObj(m)})}cuid(m){return this._addCheck({kind:"cuid",...rt.errToObj(m)})}cuid2(m){return this._addCheck({kind:"cuid2",...rt.errToObj(m)})}ulid(m){return this._addCheck({kind:"ulid",...rt.errToObj(m)})}base64(m){return this._addCheck({kind:"base64",...rt.errToObj(m)})}base64url(m){return this._addCheck({kind:"base64url",...rt.errToObj(m)})}jwt(m){return this._addCheck({kind:"jwt",...rt.errToObj(m)})}ip(m){return this._addCheck({kind:"ip",...rt.errToObj(m)})}cidr(m){return this._addCheck({kind:"cidr",...rt.errToObj(m)})}datetime(m){var b,C;return typeof m=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:m}):this._addCheck({kind:"datetime",precision:typeof(m==null?void 0:m.precision)>"u"?null:m==null?void 0:m.precision,offset:(b=m==null?void 0:m.offset)!==null&&b!==void 0?b:!1,local:(C=m==null?void 0:m.local)!==null&&C!==void 0?C:!1,...rt.errToObj(m==null?void 0:m.message)})}date(m){return this._addCheck({kind:"date",message:m})}time(m){return typeof m=="string"?this._addCheck({kind:"time",precision:null,message:m}):this._addCheck({kind:"time",precision:typeof(m==null?void 0:m.precision)>"u"?null:m==null?void 0:m.precision,...rt.errToObj(m==null?void 0:m.message)})}duration(m){return this._addCheck({kind:"duration",...rt.errToObj(m)})}regex(m,b){return this._addCheck({kind:"regex",regex:m,...rt.errToObj(b)})}includes(m,b){return this._addCheck({kind:"includes",value:m,position:b==null?void 0:b.position,...rt.errToObj(b==null?void 0:b.message)})}startsWith(m,b){return this._addCheck({kind:"startsWith",value:m,...rt.errToObj(b)})}endsWith(m,b){return this._addCheck({kind:"endsWith",value:m,...rt.errToObj(b)})}min(m,b){return this._addCheck({kind:"min",value:m,...rt.errToObj(b)})}max(m,b){return this._addCheck({kind:"max",value:m,...rt.errToObj(b)})}length(m,b){return this._addCheck({kind:"length",value:m,...rt.errToObj(b)})}nonempty(m){return this.min(1,rt.errToObj(m))}trim(){return new xn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(m=>m.kind==="datetime")}get isDate(){return!!this._def.checks.find(m=>m.kind==="date")}get isTime(){return!!this._def.checks.find(m=>m.kind==="time")}get isDuration(){return!!this._def.checks.find(m=>m.kind==="duration")}get isEmail(){return!!this._def.checks.find(m=>m.kind==="email")}get isURL(){return!!this._def.checks.find(m=>m.kind==="url")}get isEmoji(){return!!this._def.checks.find(m=>m.kind==="emoji")}get isUUID(){return!!this._def.checks.find(m=>m.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(m=>m.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(m=>m.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(m=>m.kind==="cuid2")}get isULID(){return!!this._def.checks.find(m=>m.kind==="ulid")}get isIP(){return!!this._def.checks.find(m=>m.kind==="ip")}get isCIDR(){return!!this._def.checks.find(m=>m.kind==="cidr")}get isBase64(){return!!this._def.checks.find(m=>m.kind==="base64")}get isBase64url(){return!!this._def.checks.find(m=>m.kind==="base64url")}get minLength(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m}get maxLength(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m}}xn.create=y=>{var m;return new xn({checks:[],typeName:ut.ZodString,coerce:(m=y==null?void 0:y.coerce)!==null&&m!==void 0?m:!1,...xt(y)})};function Yy(y,m){const b=(y.toString().split(".")[1]||"").length,C=(m.toString().split(".")[1]||"").length,A=b>C?b:C,D=parseInt(y.toFixed(A).replace(".","")),S=parseInt(m.toFixed(A).replace(".",""));return D%S/Math.pow(10,A)}class Oa extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(m){if(this._def.coerce&&(m.data=Number(m.data)),this._getType(m)!==Ke.number){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_type,expected:Ke.number,received:D.parsedType}),dt}let C;const A=new hr;for(const D of this._def.checks)D.kind==="int"?Nt.isInteger(m.data)||(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.invalid_type,expected:"integer",received:"float",message:D.message}),A.dirty()):D.kind==="min"?(D.inclusive?m.data<D.value:m.data<=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_small,minimum:D.value,type:"number",inclusive:D.inclusive,exact:!1,message:D.message}),A.dirty()):D.kind==="max"?(D.inclusive?m.data>D.value:m.data>=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_big,maximum:D.value,type:"number",inclusive:D.inclusive,exact:!1,message:D.message}),A.dirty()):D.kind==="multipleOf"?Yy(m.data,D.value)!==0&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.not_multiple_of,multipleOf:D.value,message:D.message}),A.dirty()):D.kind==="finite"?Number.isFinite(m.data)||(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.not_finite,message:D.message}),A.dirty()):Nt.assertNever(D);return{status:A.value,value:m.data}}gte(m,b){return this.setLimit("min",m,!0,rt.toString(b))}gt(m,b){return this.setLimit("min",m,!1,rt.toString(b))}lte(m,b){return this.setLimit("max",m,!0,rt.toString(b))}lt(m,b){return this.setLimit("max",m,!1,rt.toString(b))}setLimit(m,b,C,A){return new Oa({...this._def,checks:[...this._def.checks,{kind:m,value:b,inclusive:C,message:rt.toString(A)}]})}_addCheck(m){return new Oa({...this._def,checks:[...this._def.checks,m]})}int(m){return this._addCheck({kind:"int",message:rt.toString(m)})}positive(m){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rt.toString(m)})}negative(m){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rt.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rt.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rt.toString(m)})}multipleOf(m,b){return this._addCheck({kind:"multipleOf",value:m,message:rt.toString(b)})}finite(m){return this._addCheck({kind:"finite",message:rt.toString(m)})}safe(m){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rt.toString(m)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rt.toString(m)})}get minValue(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m}get maxValue(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m}get isInt(){return!!this._def.checks.find(m=>m.kind==="int"||m.kind==="multipleOf"&&Nt.isInteger(m.value))}get isFinite(){let m=null,b=null;for(const C of this._def.checks){if(C.kind==="finite"||C.kind==="int"||C.kind==="multipleOf")return!0;C.kind==="min"?(b===null||C.value>b)&&(b=C.value):C.kind==="max"&&(m===null||C.value<m)&&(m=C.value)}return Number.isFinite(b)&&Number.isFinite(m)}}Oa.create=y=>new Oa({checks:[],typeName:ut.ZodNumber,coerce:(y==null?void 0:y.coerce)||!1,...xt(y)});class ja extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(m){if(this._def.coerce)try{m.data=BigInt(m.data)}catch{return this._getInvalidInput(m)}if(this._getType(m)!==Ke.bigint)return this._getInvalidInput(m);let C;const A=new hr;for(const D of this._def.checks)D.kind==="min"?(D.inclusive?m.data<D.value:m.data<=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_small,type:"bigint",minimum:D.value,inclusive:D.inclusive,message:D.message}),A.dirty()):D.kind==="max"?(D.inclusive?m.data>D.value:m.data>=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_big,type:"bigint",maximum:D.value,inclusive:D.inclusive,message:D.message}),A.dirty()):D.kind==="multipleOf"?m.data%D.value!==BigInt(0)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.not_multiple_of,multipleOf:D.value,message:D.message}),A.dirty()):Nt.assertNever(D);return{status:A.value,value:m.data}}_getInvalidInput(m){const b=this._getOrReturnCtx(m);return qe(b,{code:Oe.invalid_type,expected:Ke.bigint,received:b.parsedType}),dt}gte(m,b){return this.setLimit("min",m,!0,rt.toString(b))}gt(m,b){return this.setLimit("min",m,!1,rt.toString(b))}lte(m,b){return this.setLimit("max",m,!0,rt.toString(b))}lt(m,b){return this.setLimit("max",m,!1,rt.toString(b))}setLimit(m,b,C,A){return new ja({...this._def,checks:[...this._def.checks,{kind:m,value:b,inclusive:C,message:rt.toString(A)}]})}_addCheck(m){return new ja({...this._def,checks:[...this._def.checks,m]})}positive(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rt.toString(m)})}negative(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rt.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rt.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rt.toString(m)})}multipleOf(m,b){return this._addCheck({kind:"multipleOf",value:m,message:rt.toString(b)})}get minValue(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m}get maxValue(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m}}ja.create=y=>{var m;return new ja({checks:[],typeName:ut.ZodBigInt,coerce:(m=y==null?void 0:y.coerce)!==null&&m!==void 0?m:!1,...xt(y)})};class Rl extends Mt{_parse(m){if(this._def.coerce&&(m.data=!!m.data),this._getType(m)!==Ke.boolean){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.boolean,received:C.parsedType}),dt}return Sr(m.data)}}Rl.create=y=>new Rl({typeName:ut.ZodBoolean,coerce:(y==null?void 0:y.coerce)||!1,...xt(y)});class Is extends Mt{_parse(m){if(this._def.coerce&&(m.data=new Date(m.data)),this._getType(m)!==Ke.date){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_type,expected:Ke.date,received:D.parsedType}),dt}if(isNaN(m.data.getTime())){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_date}),dt}const C=new hr;let A;for(const D of this._def.checks)D.kind==="min"?m.data.getTime()<D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_small,message:D.message,inclusive:!0,exact:!1,minimum:D.value,type:"date"}),C.dirty()):D.kind==="max"?m.data.getTime()>D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_big,message:D.message,inclusive:!0,exact:!1,maximum:D.value,type:"date"}),C.dirty()):Nt.assertNever(D);return{status:C.value,value:new Date(m.data.getTime())}}_addCheck(m){return new Is({...this._def,checks:[...this._def.checks,m]})}min(m,b){return this._addCheck({kind:"min",value:m.getTime(),message:rt.toString(b)})}max(m,b){return this._addCheck({kind:"max",value:m.getTime(),message:rt.toString(b)})}get minDate(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m!=null?new Date(m):null}get maxDate(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m!=null?new Date(m):null}}Is.create=y=>new Is({checks:[],coerce:(y==null?void 0:y.coerce)||!1,typeName:ut.ZodDate,...xt(y)});class Fu extends Mt{_parse(m){if(this._getType(m)!==Ke.symbol){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.symbol,received:C.parsedType}),dt}return Sr(m.data)}}Fu.create=y=>new Fu({typeName:ut.ZodSymbol,...xt(y)});class Dl extends Mt{_parse(m){if(this._getType(m)!==Ke.undefined){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.undefined,received:C.parsedType}),dt}return Sr(m.data)}}Dl.create=y=>new Dl({typeName:ut.ZodUndefined,...xt(y)});class Ll extends Mt{_parse(m){if(this._getType(m)!==Ke.null){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.null,received:C.parsedType}),dt}return Sr(m.data)}}Ll.create=y=>new Ll({typeName:ut.ZodNull,...xt(y)});class bo extends Mt{constructor(){super(...arguments),this._any=!0}_parse(m){return Sr(m.data)}}bo.create=y=>new bo({typeName:ut.ZodAny,...xt(y)});class Cs extends Mt{constructor(){super(...arguments),this._unknown=!0}_parse(m){return Sr(m.data)}}Cs.create=y=>new Cs({typeName:ut.ZodUnknown,...xt(y)});class ha extends Mt{_parse(m){const b=this._getOrReturnCtx(m);return qe(b,{code:Oe.invalid_type,expected:Ke.never,received:b.parsedType}),dt}}ha.create=y=>new ha({typeName:ut.ZodNever,...xt(y)});class Bu extends Mt{_parse(m){if(this._getType(m)!==Ke.undefined){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.void,received:C.parsedType}),dt}return Sr(m.data)}}Bu.create=y=>new Bu({typeName:ut.ZodVoid,...xt(y)});class vn extends Mt{_parse(m){const{ctx:b,status:C}=this._processInputParams(m),A=this._def;if(b.parsedType!==Ke.array)return qe(b,{code:Oe.invalid_type,expected:Ke.array,received:b.parsedType}),dt;if(A.exactLength!==null){const S=b.data.length>A.exactLength.value,o=b.data.length<A.exactLength.value;(S||o)&&(qe(b,{code:S?Oe.too_big:Oe.too_small,minimum:o?A.exactLength.value:void 0,maximum:S?A.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:A.exactLength.message}),C.dirty())}if(A.minLength!==null&&b.data.length<A.minLength.value&&(qe(b,{code:Oe.too_small,minimum:A.minLength.value,type:"array",inclusive:!0,exact:!1,message:A.minLength.message}),C.dirty()),A.maxLength!==null&&b.data.length>A.maxLength.value&&(qe(b,{code:Oe.too_big,maximum:A.maxLength.value,type:"array",inclusive:!0,exact:!1,message:A.maxLength.message}),C.dirty()),b.common.async)return Promise.all([...b.data].map((S,o)=>A.type._parseAsync(new Zn(b,S,b.path,o)))).then(S=>hr.mergeArray(C,S));const D=[...b.data].map((S,o)=>A.type._parseSync(new Zn(b,S,b.path,o)));return hr.mergeArray(C,D)}get element(){return this._def.type}min(m,b){return new vn({...this._def,minLength:{value:m,message:rt.toString(b)}})}max(m,b){return new vn({...this._def,maxLength:{value:m,message:rt.toString(b)}})}length(m,b){return new vn({...this._def,exactLength:{value:m,message:rt.toString(b)}})}nonempty(m){return this.min(1,m)}}vn.create=(y,m)=>new vn({type:y,minLength:null,maxLength:null,exactLength:null,typeName:ut.ZodArray,...xt(m)});function wo(y){if(y instanceof Si){const m={};for(const b in y.shape){const C=y.shape[b];m[b]=Un.create(wo(C))}return new Si({...y._def,shape:()=>m})}else return y instanceof vn?new vn({...y._def,type:wo(y.element)}):y instanceof Un?Un.create(wo(y.unwrap())):y instanceof Za?Za.create(wo(y.unwrap())):y instanceof Vn?Vn.create(y.items.map(m=>wo(m))):y}class Si extends Mt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const m=this._def.shape(),b=Nt.objectKeys(m);return this._cached={shape:m,keys:b}}_parse(m){if(this._getType(m)!==Ke.object){const ue=this._getOrReturnCtx(m);return qe(ue,{code:Oe.invalid_type,expected:Ke.object,received:ue.parsedType}),dt}const{status:C,ctx:A}=this._processInputParams(m),{shape:D,keys:S}=this._getCached(),o=[];if(!(this._def.catchall instanceof ha&&this._def.unknownKeys==="strip"))for(const ue in A.data)S.includes(ue)||o.push(ue);const le=[];for(const ue of S){const _e=D[ue],Re=A.data[ue];le.push({key:{status:"valid",value:ue},value:_e._parse(new Zn(A,Re,A.path,ue)),alwaysSet:ue in A.data})}if(this._def.catchall instanceof ha){const ue=this._def.unknownKeys;if(ue==="passthrough")for(const _e of o)le.push({key:{status:"valid",value:_e},value:{status:"valid",value:A.data[_e]}});else if(ue==="strict")o.length>0&&(qe(A,{code:Oe.unrecognized_keys,keys:o}),C.dirty());else if(ue!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const ue=this._def.catchall;for(const _e of o){const Re=A.data[_e];le.push({key:{status:"valid",value:_e},value:ue._parse(new Zn(A,Re,A.path,_e)),alwaysSet:_e in A.data})}}return A.common.async?Promise.resolve().then(async()=>{const ue=[];for(const _e of le){const Re=await _e.key,xe=await _e.value;ue.push({key:Re,value:xe,alwaysSet:_e.alwaysSet})}return ue}).then(ue=>hr.mergeObjectSync(C,ue)):hr.mergeObjectSync(C,le)}get shape(){return this._def.shape()}strict(m){return rt.errToObj,new Si({...this._def,unknownKeys:"strict",...m!==void 0?{errorMap:(b,C)=>{var A,D,S,o;const le=(S=(D=(A=this._def).errorMap)===null||D===void 0?void 0:D.call(A,b,C).message)!==null&&S!==void 0?S:C.defaultError;return b.code==="unrecognized_keys"?{message:(o=rt.errToObj(m).message)!==null&&o!==void 0?o:le}:{message:le}}}:{}})}strip(){return new Si({...this._def,unknownKeys:"strip"})}passthrough(){return new Si({...this._def,unknownKeys:"passthrough"})}extend(m){return new Si({...this._def,shape:()=>({...this._def.shape(),...m})})}merge(m){return new Si({unknownKeys:m._def.unknownKeys,catchall:m._def.catchall,shape:()=>({...this._def.shape(),...m._def.shape()}),typeName:ut.ZodObject})}setKey(m,b){return this.augment({[m]:b})}catchall(m){return new Si({...this._def,catchall:m})}pick(m){const b={};return Nt.objectKeys(m).forEach(C=>{m[C]&&this.shape[C]&&(b[C]=this.shape[C])}),new Si({...this._def,shape:()=>b})}omit(m){const b={};return Nt.objectKeys(this.shape).forEach(C=>{m[C]||(b[C]=this.shape[C])}),new Si({...this._def,shape:()=>b})}deepPartial(){return wo(this)}partial(m){const b={};return Nt.objectKeys(this.shape).forEach(C=>{const A=this.shape[C];m&&!m[C]?b[C]=A:b[C]=A.optional()}),new Si({...this._def,shape:()=>b})}required(m){const b={};return Nt.objectKeys(this.shape).forEach(C=>{if(m&&!m[C])b[C]=this.shape[C];else{let D=this.shape[C];for(;D instanceof Un;)D=D._def.innerType;b[C]=D}}),new Si({...this._def,shape:()=>b})}keyof(){return em(Nt.objectKeys(this.shape))}}Si.create=(y,m)=>new Si({shape:()=>y,unknownKeys:"strip",catchall:ha.create(),typeName:ut.ZodObject,...xt(m)}),Si.strictCreate=(y,m)=>new Si({shape:()=>y,unknownKeys:"strict",catchall:ha.create(),typeName:ut.ZodObject,...xt(m)}),Si.lazycreate=(y,m)=>new Si({shape:y,unknownKeys:"strip",catchall:ha.create(),typeName:ut.ZodObject,...xt(m)});class Fl extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m),C=this._def.options;function A(D){for(const o of D)if(o.result.status==="valid")return o.result;for(const o of D)if(o.result.status==="dirty")return b.common.issues.push(...o.ctx.common.issues),o.result;const S=D.map(o=>new qr(o.ctx.common.issues));return qe(b,{code:Oe.invalid_union,unionErrors:S}),dt}if(b.common.async)return Promise.all(C.map(async D=>{const S={...b,common:{...b.common,issues:[]},parent:null};return{result:await D._parseAsync({data:b.data,path:b.path,parent:S}),ctx:S}})).then(A);{let D;const S=[];for(const le of C){const ue={...b,common:{...b.common,issues:[]},parent:null},_e=le._parseSync({data:b.data,path:b.path,parent:ue});if(_e.status==="valid")return _e;_e.status==="dirty"&&!D&&(D={result:_e,ctx:ue}),ue.common.issues.length&&S.push(ue.common.issues)}if(D)return b.common.issues.push(...D.ctx.common.issues),D.result;const o=S.map(le=>new qr(le));return qe(b,{code:Oe.invalid_union,unionErrors:o}),dt}}get options(){return this._def.options}}Fl.create=(y,m)=>new Fl({options:y,typeName:ut.ZodUnion,...xt(m)});const da=y=>y instanceof jl?da(y.schema):y instanceof bn?da(y.innerType()):y instanceof Nl?[y.value]:y instanceof Na?y.options:y instanceof Zl?Nt.objectValues(y.enum):y instanceof Vl?da(y._def.innerType):y instanceof Dl?[void 0]:y instanceof Ll?[null]:y instanceof Un?[void 0,...da(y.unwrap())]:y instanceof Za?[null,...da(y.unwrap())]:y instanceof Ad||y instanceof Gl?da(y.unwrap()):y instanceof Ul?da(y._def.innerType):[];class Ou extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m);if(b.parsedType!==Ke.object)return qe(b,{code:Oe.invalid_type,expected:Ke.object,received:b.parsedType}),dt;const C=this.discriminator,A=b.data[C],D=this.optionsMap.get(A);return D?b.common.async?D._parseAsync({data:b.data,path:b.path,parent:b}):D._parseSync({data:b.data,path:b.path,parent:b}):(qe(b,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[C]}),dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(m,b,C){const A=new Map;for(const D of b){const S=da(D.shape[m]);if(!S.length)throw new Error(`A discriminator value for key \`${m}\` could not be extracted from all schema options`);for(const o of S){if(A.has(o))throw new Error(`Discriminator property ${String(m)} has duplicate value ${String(o)}`);A.set(o,D)}}return new Ou({typeName:ut.ZodDiscriminatedUnion,discriminator:m,options:b,optionsMap:A,...xt(C)})}}function Ed(y,m){const b=ua(y),C=ua(m);if(y===m)return{valid:!0,data:y};if(b===Ke.object&&C===Ke.object){const A=Nt.objectKeys(m),D=Nt.objectKeys(y).filter(o=>A.indexOf(o)!==-1),S={...y,...m};for(const o of D){const le=Ed(y[o],m[o]);if(!le.valid)return{valid:!1};S[o]=le.data}return{valid:!0,data:S}}else if(b===Ke.array&&C===Ke.array){if(y.length!==m.length)return{valid:!1};const A=[];for(let D=0;D<y.length;D++){const S=y[D],o=m[D],le=Ed(S,o);if(!le.valid)return{valid:!1};A.push(le.data)}return{valid:!0,data:A}}else return b===Ke.date&&C===Ke.date&&+y==+m?{valid:!0,data:y}:{valid:!1}}class Bl extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m),A=(D,S)=>{if(Id(D)||Id(S))return dt;const o=Ed(D.value,S.value);return o.valid?((Cd(D)||Cd(S))&&b.dirty(),{status:b.value,value:o.data}):(qe(C,{code:Oe.invalid_intersection_types}),dt)};return C.common.async?Promise.all([this._def.left._parseAsync({data:C.data,path:C.path,parent:C}),this._def.right._parseAsync({data:C.data,path:C.path,parent:C})]).then(([D,S])=>A(D,S)):A(this._def.left._parseSync({data:C.data,path:C.path,parent:C}),this._def.right._parseSync({data:C.data,path:C.path,parent:C}))}}Bl.create=(y,m,b)=>new Bl({left:y,right:m,typeName:ut.ZodIntersection,...xt(b)});class Vn extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.array)return qe(C,{code:Oe.invalid_type,expected:Ke.array,received:C.parsedType}),dt;if(C.data.length<this._def.items.length)return qe(C,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dt;!this._def.rest&&C.data.length>this._def.items.length&&(qe(C,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b.dirty());const D=[...C.data].map((S,o)=>{const le=this._def.items[o]||this._def.rest;return le?le._parse(new Zn(C,S,C.path,o)):null}).filter(S=>!!S);return C.common.async?Promise.all(D).then(S=>hr.mergeArray(b,S)):hr.mergeArray(b,D)}get items(){return this._def.items}rest(m){return new Vn({...this._def,rest:m})}}Vn.create=(y,m)=>{if(!Array.isArray(y))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vn({items:y,typeName:ut.ZodTuple,rest:null,...xt(m)})};class Ol extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.object)return qe(C,{code:Oe.invalid_type,expected:Ke.object,received:C.parsedType}),dt;const A=[],D=this._def.keyType,S=this._def.valueType;for(const o in C.data)A.push({key:D._parse(new Zn(C,o,C.path,o)),value:S._parse(new Zn(C,C.data[o],C.path,o)),alwaysSet:o in C.data});return C.common.async?hr.mergeObjectAsync(b,A):hr.mergeObjectSync(b,A)}get element(){return this._def.valueType}static create(m,b,C){return b instanceof Mt?new Ol({keyType:m,valueType:b,typeName:ut.ZodRecord,...xt(C)}):new Ol({keyType:xn.create(),valueType:m,typeName:ut.ZodRecord,...xt(b)})}}class ju extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.map)return qe(C,{code:Oe.invalid_type,expected:Ke.map,received:C.parsedType}),dt;const A=this._def.keyType,D=this._def.valueType,S=[...C.data.entries()].map(([o,le],ue)=>({key:A._parse(new Zn(C,o,C.path,[ue,"key"])),value:D._parse(new Zn(C,le,C.path,[ue,"value"]))}));if(C.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const le of S){const ue=await le.key,_e=await le.value;if(ue.status==="aborted"||_e.status==="aborted")return dt;(ue.status==="dirty"||_e.status==="dirty")&&b.dirty(),o.set(ue.value,_e.value)}return{status:b.value,value:o}})}else{const o=new Map;for(const le of S){const ue=le.key,_e=le.value;if(ue.status==="aborted"||_e.status==="aborted")return dt;(ue.status==="dirty"||_e.status==="dirty")&&b.dirty(),o.set(ue.value,_e.value)}return{status:b.value,value:o}}}}ju.create=(y,m,b)=>new ju({valueType:m,keyType:y,typeName:ut.ZodMap,...xt(b)});class ks extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.set)return qe(C,{code:Oe.invalid_type,expected:Ke.set,received:C.parsedType}),dt;const A=this._def;A.minSize!==null&&C.data.size<A.minSize.value&&(qe(C,{code:Oe.too_small,minimum:A.minSize.value,type:"set",inclusive:!0,exact:!1,message:A.minSize.message}),b.dirty()),A.maxSize!==null&&C.data.size>A.maxSize.value&&(qe(C,{code:Oe.too_big,maximum:A.maxSize.value,type:"set",inclusive:!0,exact:!1,message:A.maxSize.message}),b.dirty());const D=this._def.valueType;function S(le){const ue=new Set;for(const _e of le){if(_e.status==="aborted")return dt;_e.status==="dirty"&&b.dirty(),ue.add(_e.value)}return{status:b.value,value:ue}}const o=[...C.data.values()].map((le,ue)=>D._parse(new Zn(C,le,C.path,ue)));return C.common.async?Promise.all(o).then(le=>S(le)):S(o)}min(m,b){return new ks({...this._def,minSize:{value:m,message:rt.toString(b)}})}max(m,b){return new ks({...this._def,maxSize:{value:m,message:rt.toString(b)}})}size(m,b){return this.min(m,b).max(m,b)}nonempty(m){return this.min(1,m)}}ks.create=(y,m)=>new ks({valueType:y,minSize:null,maxSize:null,typeName:ut.ZodSet,...xt(m)});class To extends Mt{constructor(){super(...arguments),this.validate=this.implement}_parse(m){const{ctx:b}=this._processInputParams(m);if(b.parsedType!==Ke.function)return qe(b,{code:Oe.invalid_type,expected:Ke.function,received:b.parsedType}),dt;function C(o,le){return Du({data:o,path:b.path,errorMaps:[b.common.contextualErrorMap,b.schemaErrorMap,Ru(),xo].filter(ue=>!!ue),issueData:{code:Oe.invalid_arguments,argumentsError:le}})}function A(o,le){return Du({data:o,path:b.path,errorMaps:[b.common.contextualErrorMap,b.schemaErrorMap,Ru(),xo].filter(ue=>!!ue),issueData:{code:Oe.invalid_return_type,returnTypeError:le}})}const D={errorMap:b.common.contextualErrorMap},S=b.data;if(this._def.returns instanceof Po){const o=this;return Sr(async function(...le){const ue=new qr([]),_e=await o._def.args.parseAsync(le,D).catch(ie=>{throw ue.addIssue(C(le,ie)),ue}),Re=await Reflect.apply(S,this,_e);return await o._def.returns._def.type.parseAsync(Re,D).catch(ie=>{throw ue.addIssue(A(Re,ie)),ue})})}else{const o=this;return Sr(function(...le){const ue=o._def.args.safeParse(le,D);if(!ue.success)throw new qr([C(le,ue.error)]);const _e=Reflect.apply(S,this,ue.data),Re=o._def.returns.safeParse(_e,D);if(!Re.success)throw new qr([A(_e,Re.error)]);return Re.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...m){return new To({...this._def,args:Vn.create(m).rest(Cs.create())})}returns(m){return new To({...this._def,returns:m})}implement(m){return this.parse(m)}strictImplement(m){return this.parse(m)}static create(m,b,C){return new To({args:m||Vn.create([]).rest(Cs.create()),returns:b||Cs.create(),typeName:ut.ZodFunction,...xt(C)})}}class jl extends Mt{get schema(){return this._def.getter()}_parse(m){const{ctx:b}=this._processInputParams(m);return this._def.getter()._parse({data:b.data,path:b.path,parent:b})}}jl.create=(y,m)=>new jl({getter:y,typeName:ut.ZodLazy,...xt(m)});class Nl extends Mt{_parse(m){if(m.data!==this._def.value){const b=this._getOrReturnCtx(m);return qe(b,{received:b.data,code:Oe.invalid_literal,expected:this._def.value}),dt}return{status:"valid",value:m.data}}get value(){return this._def.value}}Nl.create=(y,m)=>new Nl({value:y,typeName:ut.ZodLiteral,...xt(m)});function em(y,m){return new Na({values:y,typeName:ut.ZodEnum,...xt(m)})}class Na extends Mt{constructor(){super(...arguments),Al.set(this,void 0)}_parse(m){if(typeof m.data!="string"){const b=this._getOrReturnCtx(m),C=this._def.values;return qe(b,{expected:Nt.joinValues(C),received:b.parsedType,code:Oe.invalid_type}),dt}if(Lu(this,Al)||Xf(this,Al,new Set(this._def.values)),!Lu(this,Al).has(m.data)){const b=this._getOrReturnCtx(m),C=this._def.values;return qe(b,{received:b.data,code:Oe.invalid_enum_value,options:C}),dt}return Sr(m.data)}get options(){return this._def.values}get enum(){const m={};for(const b of this._def.values)m[b]=b;return m}get Values(){const m={};for(const b of this._def.values)m[b]=b;return m}get Enum(){const m={};for(const b of this._def.values)m[b]=b;return m}extract(m,b=this._def){return Na.create(m,{...this._def,...b})}exclude(m,b=this._def){return Na.create(this.options.filter(C=>!m.includes(C)),{...this._def,...b})}}Al=new WeakMap,Na.create=em;class Zl extends Mt{constructor(){super(...arguments),zl.set(this,void 0)}_parse(m){const b=Nt.getValidEnumValues(this._def.values),C=this._getOrReturnCtx(m);if(C.parsedType!==Ke.string&&C.parsedType!==Ke.number){const A=Nt.objectValues(b);return qe(C,{expected:Nt.joinValues(A),received:C.parsedType,code:Oe.invalid_type}),dt}if(Lu(this,zl)||Xf(this,zl,new Set(Nt.getValidEnumValues(this._def.values))),!Lu(this,zl).has(m.data)){const A=Nt.objectValues(b);return qe(C,{received:C.data,code:Oe.invalid_enum_value,options:A}),dt}return Sr(m.data)}get enum(){return this._def.values}}zl=new WeakMap,Zl.create=(y,m)=>new Zl({values:y,typeName:ut.ZodNativeEnum,...xt(m)});class Po extends Mt{unwrap(){return this._def.type}_parse(m){const{ctx:b}=this._processInputParams(m);if(b.parsedType!==Ke.promise&&b.common.async===!1)return qe(b,{code:Oe.invalid_type,expected:Ke.promise,received:b.parsedType}),dt;const C=b.parsedType===Ke.promise?b.data:Promise.resolve(b.data);return Sr(C.then(A=>this._def.type.parseAsync(A,{path:b.path,errorMap:b.common.contextualErrorMap})))}}Po.create=(y,m)=>new Po({type:y,typeName:ut.ZodPromise,...xt(m)});class bn extends Mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ut.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(m){const{status:b,ctx:C}=this._processInputParams(m),A=this._def.effect||null,D={addIssue:S=>{qe(C,S),S.fatal?b.abort():b.dirty()},get path(){return C.path}};if(D.addIssue=D.addIssue.bind(D),A.type==="preprocess"){const S=A.transform(C.data,D);if(C.common.async)return Promise.resolve(S).then(async o=>{if(b.value==="aborted")return dt;const le=await this._def.schema._parseAsync({data:o,path:C.path,parent:C});return le.status==="aborted"?dt:le.status==="dirty"||b.value==="dirty"?vo(le.value):le});{if(b.value==="aborted")return dt;const o=this._def.schema._parseSync({data:S,path:C.path,parent:C});return o.status==="aborted"?dt:o.status==="dirty"||b.value==="dirty"?vo(o.value):o}}if(A.type==="refinement"){const S=o=>{const le=A.refinement(o,D);if(C.common.async)return Promise.resolve(le);if(le instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(C.common.async===!1){const o=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});return o.status==="aborted"?dt:(o.status==="dirty"&&b.dirty(),S(o.value),{status:b.value,value:o.value})}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(o=>o.status==="aborted"?dt:(o.status==="dirty"&&b.dirty(),S(o.value).then(()=>({status:b.value,value:o.value}))))}if(A.type==="transform")if(C.common.async===!1){const S=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});if(!Ms(S))return S;const o=A.transform(S.value,D);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:b.value,value:o}}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(S=>Ms(S)?Promise.resolve(A.transform(S.value,D)).then(o=>({status:b.value,value:o})):S);Nt.assertNever(A)}}bn.create=(y,m,b)=>new bn({schema:y,typeName:ut.ZodEffects,effect:m,...xt(b)}),bn.createWithPreprocess=(y,m,b)=>new bn({schema:m,effect:{type:"preprocess",transform:y},typeName:ut.ZodEffects,...xt(b)});class Un extends Mt{_parse(m){return this._getType(m)===Ke.undefined?Sr(void 0):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}}Un.create=(y,m)=>new Un({innerType:y,typeName:ut.ZodOptional,...xt(m)});class Za extends Mt{_parse(m){return this._getType(m)===Ke.null?Sr(null):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}}Za.create=(y,m)=>new Za({innerType:y,typeName:ut.ZodNullable,...xt(m)});class Vl extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m);let C=b.data;return b.parsedType===Ke.undefined&&(C=this._def.defaultValue()),this._def.innerType._parse({data:C,path:b.path,parent:b})}removeDefault(){return this._def.innerType}}Vl.create=(y,m)=>new Vl({innerType:y,typeName:ut.ZodDefault,defaultValue:typeof m.default=="function"?m.default:()=>m.default,...xt(m)});class Ul extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m),C={...b,common:{...b.common,issues:[]}},A=this._def.innerType._parse({data:C.data,path:C.path,parent:{...C}});return El(A)?A.then(D=>({status:"valid",value:D.status==="valid"?D.value:this._def.catchValue({get error(){return new qr(C.common.issues)},input:C.data})})):{status:"valid",value:A.status==="valid"?A.value:this._def.catchValue({get error(){return new qr(C.common.issues)},input:C.data})}}removeCatch(){return this._def.innerType}}Ul.create=(y,m)=>new Ul({innerType:y,typeName:ut.ZodCatch,catchValue:typeof m.catch=="function"?m.catch:()=>m.catch,...xt(m)});class Nu extends Mt{_parse(m){if(this._getType(m)!==Ke.nan){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.nan,received:C.parsedType}),dt}return{status:"valid",value:m.data}}}Nu.create=y=>new Nu({typeName:ut.ZodNaN,...xt(y)});const Jy=Symbol("zod_brand");class Ad extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m),C=b.data;return this._def.type._parse({data:C,path:b.path,parent:b})}unwrap(){return this._def.type}}class $l extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.common.async)return(async()=>{const D=await this._def.in._parseAsync({data:C.data,path:C.path,parent:C});return D.status==="aborted"?dt:D.status==="dirty"?(b.dirty(),vo(D.value)):this._def.out._parseAsync({data:D.value,path:C.path,parent:C})})();{const A=this._def.in._parseSync({data:C.data,path:C.path,parent:C});return A.status==="aborted"?dt:A.status==="dirty"?(b.dirty(),{status:"dirty",value:A.value}):this._def.out._parseSync({data:A.value,path:C.path,parent:C})}}static create(m,b){return new $l({in:m,out:b,typeName:ut.ZodPipeline})}}class Gl extends Mt{_parse(m){const b=this._def.innerType._parse(m),C=A=>(Ms(A)&&(A.value=Object.freeze(A.value)),A);return El(b)?b.then(A=>C(A)):C(b)}unwrap(){return this._def.innerType}}Gl.create=(y,m)=>new Gl({innerType:y,typeName:ut.ZodReadonly,...xt(m)});function tm(y,m){const b=typeof y=="function"?y(m):typeof y=="string"?{message:y}:y;return typeof b=="string"?{message:b}:b}function im(y,m={},b){return y?bo.create().superRefine((C,A)=>{var D,S;const o=y(C);if(o instanceof Promise)return o.then(le=>{var ue,_e;if(!le){const Re=tm(m,C),xe=(_e=(ue=Re.fatal)!==null&&ue!==void 0?ue:b)!==null&&_e!==void 0?_e:!0;A.addIssue({code:"custom",...Re,fatal:xe})}});if(!o){const le=tm(m,C),ue=(S=(D=le.fatal)!==null&&D!==void 0?D:b)!==null&&S!==void 0?S:!0;A.addIssue({code:"custom",...le,fatal:ue})}}):bo.create()}const Qy={object:Si.lazycreate};var ut;(function(y){y.ZodString="ZodString",y.ZodNumber="ZodNumber",y.ZodNaN="ZodNaN",y.ZodBigInt="ZodBigInt",y.ZodBoolean="ZodBoolean",y.ZodDate="ZodDate",y.ZodSymbol="ZodSymbol",y.ZodUndefined="ZodUndefined",y.ZodNull="ZodNull",y.ZodAny="ZodAny",y.ZodUnknown="ZodUnknown",y.ZodNever="ZodNever",y.ZodVoid="ZodVoid",y.ZodArray="ZodArray",y.ZodObject="ZodObject",y.ZodUnion="ZodUnion",y.ZodDiscriminatedUnion="ZodDiscriminatedUnion",y.ZodIntersection="ZodIntersection",y.ZodTuple="ZodTuple",y.ZodRecord="ZodRecord",y.ZodMap="ZodMap",y.ZodSet="ZodSet",y.ZodFunction="ZodFunction",y.ZodLazy="ZodLazy",y.ZodLiteral="ZodLiteral",y.ZodEnum="ZodEnum",y.ZodEffects="ZodEffects",y.ZodNativeEnum="ZodNativeEnum",y.ZodOptional="ZodOptional",y.ZodNullable="ZodNullable",y.ZodDefault="ZodDefault",y.ZodCatch="ZodCatch",y.ZodPromise="ZodPromise",y.ZodBranded="ZodBranded",y.ZodPipeline="ZodPipeline",y.ZodReadonly="ZodReadonly"})(ut||(ut={}));const ex=(y,m={message:`Input not instance of ${y.name}`})=>im(b=>b instanceof y,m),rm=xn.create,nm=Oa.create,tx=Nu.create,ix=ja.create,am=Rl.create,rx=Is.create,nx=Fu.create,ax=Dl.create,sx=Ll.create,ox=bo.create,lx=Cs.create,cx=ha.create,ux=Bu.create,hx=vn.create,dx=Si.create,px=Si.strictCreate,fx=Fl.create,mx=Ou.create,gx=Bl.create,_x=Vn.create,yx=Ol.create,xx=ju.create,vx=ks.create,bx=To.create,wx=jl.create,Tx=Nl.create,Px=Na.create,Sx=Zl.create,Mx=Po.create,sm=bn.create,Ix=Un.create,Cx=Za.create,kx=bn.createWithPreprocess,Ex=$l.create;var ct=Object.freeze({__proto__:null,defaultErrorMap:xo,setErrorMap:ky,getErrorMap:Ru,makeIssue:Du,EMPTY_PATH:Ey,addIssueToContext:qe,ParseStatus:hr,INVALID:dt,DIRTY:vo,OK:Sr,isAborted:Id,isDirty:Cd,isValid:Ms,isAsync:El,get util(){return Nt},get objectUtil(){return Md},ZodParsedType:Ke,getParsedType:ua,ZodType:Mt,datetimeRegex:Qf,ZodString:xn,ZodNumber:Oa,ZodBigInt:ja,ZodBoolean:Rl,ZodDate:Is,ZodSymbol:Fu,ZodUndefined:Dl,ZodNull:Ll,ZodAny:bo,ZodUnknown:Cs,ZodNever:ha,ZodVoid:Bu,ZodArray:vn,ZodObject:Si,ZodUnion:Fl,ZodDiscriminatedUnion:Ou,ZodIntersection:Bl,ZodTuple:Vn,ZodRecord:Ol,ZodMap:ju,ZodSet:ks,ZodFunction:To,ZodLazy:jl,ZodLiteral:Nl,ZodEnum:Na,ZodNativeEnum:Zl,ZodPromise:Po,ZodEffects:bn,ZodTransformer:bn,ZodOptional:Un,ZodNullable:Za,ZodDefault:Vl,ZodCatch:Ul,ZodNaN:Nu,BRAND:Jy,ZodBranded:Ad,ZodPipeline:$l,ZodReadonly:Gl,custom:im,Schema:Mt,ZodSchema:Mt,late:Qy,get ZodFirstPartyTypeKind(){return ut},coerce:{string:y=>xn.create({...y,coerce:!0}),number:y=>Oa.create({...y,coerce:!0}),boolean:y=>Rl.create({...y,coerce:!0}),bigint:y=>ja.create({...y,coerce:!0}),date:y=>Is.create({...y,coerce:!0})},any:ox,array:hx,bigint:ix,boolean:am,date:rx,discriminatedUnion:mx,effect:sm,enum:Px,function:bx,instanceof:ex,intersection:gx,lazy:wx,literal:Tx,map:xx,nan:tx,nativeEnum:Sx,never:cx,null:sx,nullable:Cx,number:nm,object:dx,oboolean:()=>am().optional(),onumber:()=>nm().optional(),optional:Ix,ostring:()=>rm().optional(),pipeline:Ex,preprocess:kx,promise:Mx,record:yx,set:vx,strictObject:px,string:rm,symbol:nx,transformer:sm,tuple:_x,undefined:ax,union:fx,unknown:lx,void:ux,NEVER:dt,ZodIssueCode:Oe,quotelessJson:Cy,ZodError:qr});const om=ct.object({lat:ct.number(),lng:ct.number()}),Ax=ct.object({sw:om,ne:om}),zx=ct.object({name:ct.literal("dark").or(ct.literal("light")),url:ct.string().optional(),colors:ct.object({primary:ct.string().max(64),background:ct.string().max(64),text:ct.string().max(64)})}),Rx=ct.object({container:ct.string(),position:ct.object({center:ct.object({lat:ct.number(),lng:ct.number()}),zoom:ct.number()}),style:zx,events:ct.object({onMapIdle:ct.function().returns(ct.void()).optional(),onMapMove:ct.function().args(ct.object({lat:ct.number(),lng:ct.number(),zoom:ct.number()})).returns(ct.void()).optional(),onMapClick:ct.function().returns(ct.void()).optional(),onPopupClick:ct.function().args(ct.string()).returns(ct.void()).optional(),onLoadingStart:ct.function().returns(ct.void()).optional(),onLoadingEnd:ct.function().returns(ct.void()).optional()}).optional()}),Dx=ct.object({id:ct.string(),rank:ct.number(),lat:ct.number(),lng:ct.number(),width:ct.number(),height:ct.number()}),lm=ct.array(Dx);ct.function().args(Ax).returns(ct.promise(lm));const Lx=ct.function().args(ct.string()).returns(ct.promise(ct.any()));var Fx=(y,m,b)=>m(tt(b).marker.id),Bx=go('<div class="popup svelte-jr9286"></div>'),Ox=go("<!> <!>",1),jx=go('<div class="marker"><!></div>'),Nx=go('<div class="container svelte-jr9286"><div class="map svelte-jr9286"></div> <div class="markers svelte-jr9286"></div></div>');function cm(y,m){var Cr,kr,Di,Hr,vi,si,ar;fu(m,!0);let b,C,A=0,D=Pi(!1);Nf(()=>{Rx.parse(m.options),S(),o()});function S(){const Ve=m.options.position;b=new Sd.Map({style:Ot(m.options.style),center:{lat:Ve.center.lat,lng:Ve.center.lng},zoom:Ve.zoom,minZoom:De(),maxZoom:$f,container:C,pitchWithRotate:!1,attributionControl:{compact:!1}})}function o(){b.on("load",le),b.on("move",ue),b.on("idle",_e),b.on("click",Re),b.dragRotate.disable(),b.keyboard.disable(),b.touchZoomRotate.disableRotation(),b.touchPitch.disable()}function le(){ai(D,!0)}function ue(){var Ve;if((Ve=m.options.events)!=null&&Ve.onMapMove){const Ye=b.getCenter(),Zt=b.getZoom();m.options.events.onMapMove({lat:Ye.lat,lng:Ye.lng,zoom:Zt})}}function _e(){var Ve,Ye;(Ye=(Ve=m.options.events)==null?void 0:Ve.onMapIdle)==null||Ye.call(null)}function Re(Ve){var Ye,Zt;(Zt=(Ye=m.options.events)==null?void 0:Ye.onMapClick)==null||Zt.call(null)}function xe(Ve){var Ye,Zt;(Zt=(Ye=m.options.events)==null?void 0:Ye.onPopupClick)==null||Zt.call(null,Ve)}function ie(){gt(De())}function De(){const Ye=Math.ceil(Math.log2(A/Uf));return Math.max(dy,Ye)}function gt(Ve){b==null||b.setMinZoom(Ve)}function $t(){const Ve=b==null?void 0:b.getCenter();return Ve?{lat:Ve.lat,lng:Ve.lng}:{lat:m.options.position.center.lat,lng:m.options.position.center.lng}}function _t(Ve){b==null||b.setCenter(Ve)}function Rt(){return(b==null?void 0:b.getZoom())??m.options.position.zoom}function Mi(Ve){b==null||b.setZoom(Ve)}function Jt(){const Ve=b==null?void 0:b.getBounds();if(Ve)return{sw:{lat:Ve.getSouthWest().lat,lng:Ve.getSouthWest().lng},ne:{lat:Ve.getNorthEast().lat,lng:Ve.getNorthEast().lng}}}function pi(){b==null||b.zoomIn()}function Bt(){b==null||b.zoomOut()}let vt=Pi(la(m.options.style));fo(()=>{tt(D)&&b.setStyle(Ot(tt(vt)),{diff:!0})});function Ot(Ve){if(Ve.url)return Ve.url;switch(Ve.name){case"light":return Iy;case"dark":return My}}function rr(){return g_(tt(vt))}function on(Ve){ai(vt,Ve,!0),b.setStyle(Ot(tt(vt)),{diff:!0})}class Mr{constructor(Ye){Ts(this,"marker");Ts(this,"libreMarker");wr(this,Cr,Pi());wr(this,kr,Pi(!1));wr(this,Di,Pi());wr(this,Hr,Pi());wr(this,vi,Pi(!1));wr(this,si,Pi());wr(this,ar,Pi());this.marker=Ye,this.libreMarker=void 0,this.element=void 0,this.rendered=!1,this.content=void 0,this.contentLoading=!1,this.component=void 0,this.circle=void 0}get element(){return tt(Ft(this,Cr))}set element(Ye){ai(Ft(this,Cr),Ye,!0)}get rendered(){return tt(Ft(this,kr))}set rendered(Ye){ai(Ft(this,kr),Ye,!0)}get popup(){return tt(Ft(this,Di))}set popup(Ye){ai(Ft(this,Di),Ye,!0)}get content(){return tt(Ft(this,Hr))}set content(Ye){ai(Ft(this,Hr),Ye,!0)}get contentLoading(){return tt(Ft(this,vi))}set contentLoading(Ye){ai(Ft(this,vi),Ye,!0)}get component(){return tt(Ft(this,si))}set component(Ye){ai(Ft(this,si),Ye,!0)}get circle(){return tt(Ft(this,ar))}set circle(Ye){ai(Ft(this,ar),Ye,!0)}getAngle(Ye){let Zt=this.marker.angs,Gt=Zt[0],bi=0;for(;Gt[0]<Ye&&(bi++,bi!=Zt.length);)Gt=Zt[bi];return Gt[1]}getDistance(Ye){return(this.marker.zet-Ye)/Gf}updateZIndex(){var Gt;const Ye=(Gt=this.libreMarker)==null?void 0:Gt.getElement();if(!Ye)throw new Error("Failed to update zIndex");const Zt=Math.round(($f-this.marker.zet)*py);Ye.style.zIndex=Zt.toString()}}Cr=new WeakMap,kr=new WeakMap,Di=new WeakMap,Hr=new WeakMap,vi=new WeakMap,si=new WeakMap,ar=new WeakMap;let yt,ui,At=la(new Array),nr=la(new Map),Tt=new Array,dr;Nf(()=>{const Ve=()=>{Or(),yt=window.setTimeout(Ve,25)};return Ve(),()=>{clearInterval(yt),clearInterval(ui)}});function Or(){if(tt(D)==!1||At.length==0||dr==null)return;const Ve=b.getZoom();if(!Ve)return;const Ye=new Array,Zt=Uf,Gt=new Wf(b,-512,window.innerHeight+Zt,window.innerWidth+Zt,-512),bi=new Wf(b,0,window.innerHeight,window.innerWidth,0);for(let Pt=0;Pt<At.length;Pt++){const st=At[Pt],It=st.marker,qt=st.libreMarker;if(qt){if(It.zet<=Ve&&Gt.contains(It.lat,It.lng)){qt._map!=b&&qt.addTo(b),Ye.push(st);continue}if(It.zet<=Ve+Gf&&bi.contains(It.lat,It.lng)){qt._map!=b&&qt.addTo(b),Ye.push(st);continue}qt._map!=null&&qt.remove()}}for(let Pt=0;Pt<Ye.length;Pt++){const st=Ye[Pt],It=st.marker;st.rendered||(st.rendered=!0);const qt=st.component,qi=st.circle;if(!qi||!qt)continue;It.zet<=Ve+fy?qt.setDisplayed(!0):qt.setDisplayed(!1),It.zet<=Ve?(qi.setCollapsed(!0),qt.setCollapsed(!1),qt.setAngle(st.getAngle(Ve))):(qt.setCollapsed(!0),qi==null||qi.setCollapsed(!1),qi==null||qi.setDistance(st.getDistance(Ve)));const fi=st.popup;if(!fi)continue;st.content==null&&st.contentLoading==!1&&(st.contentLoading=!0,dr(It.id).then(fr=>{st.content=fr,st.contentLoading=!1}));const sr=st.content;if(!sr)continue;fi.firstElementChild==null&&fi.appendChild(sr)}}async function Wr(Ve){var bi;const Ye=new Map(Ve.map(Pt=>[Pt.id,new Mr(Pt)])),Zt=new Array,Gt=Array.from(At);for(const Pt of Gt)Ye.has(Pt.marker.id)==!1&&((bi=Pt.libreMarker)==null||bi.remove(),nr.delete(Pt.marker.id),At.splice(At.indexOf(Pt),1));for(const Pt of Ve){const st=nr.get(Pt.id);if(st)st.marker=Pt,st.updateZIndex();else{const It=new Mr(Pt);nr.set(Pt.id,It),At.push(It),Zt.push(It)}}await O_();for(const Pt of Zt){const st=Pt.marker,It=Pt.element;if(!It)throw new Error("Failed to render marker element.");const qt=new Sd.Marker({element:It});qt.setLngLat([st.lng,st.lat]),Pt.libreMarker=qt,Pt.updateZIndex()}}function wn(){var Ve;for(let Ye=0;Ye<At.length;Ye++)(Ve=At[Ye].libreMarker)==null||Ve.remove();At.length=0,nr.clear()}function $n(Ve){if(!Lx.safeParse(Ve).success)throw new Error("Invalid popup content callback");dr=Ve}async function jr(Ve){var Zt,Gt,bi,Pt;if(dr==null)throw new Error("Popup content callback not set");if(!(await lm.safeParseAsync(Ve)).success)throw new Error("Invalid popups");try{(Gt=(Zt=m.options.events)==null?void 0:Zt.onLoadingStart)==null||Gt.call(null);for(const st of Ve){const It=Tt.findIndex(qt=>qt.id==st.id);It==-1?Tt.push(st):Tt[It]=st}await Wr(await vy(Tt))}finally{(Pt=(bi=m.options.events)==null?void 0:bi.onLoadingEnd)==null||Pt.call(null)}}function Ir(){wn()}var Ji=Nx();$_("resize",hd,ie);var Ei=Pl(Ji);Ba(Ei,Ve=>C=Ve,()=>C);var Tn=dd(Ei,2);return J_(Tn,21,()=>At,Ve=>Ve.marker.id,(Ve,Ye,Zt)=>{var Gt=jx(),bi=Pl(Gt);{var Pt=st=>{var It=Ox(),qt=T_(It);Ba(xy(qt,{}),(fi,sr)=>sr.circle=fi,fi=>fi==null?void 0:fi.circle,()=>[tt(Ye)]);var qi=dd(qt,2);Ba(_y(qi,{children:(fi,sr)=>{var pr=Bx();pr.__click=[Fx,xe,Ye],Ba(pr,(fr,Xr)=>Xr.popup=fr,fr=>fr==null?void 0:fr.popup,()=>[tt(Ye)]),vu(()=>Au(pr,`width: ${tt(Ye).marker.width??""}px; height: ${tt(Ye).marker.height??""}px;`)),_o(fi,pr)},$$slots:{default:!0}}),(fi,sr)=>sr.component=fi,fi=>fi==null?void 0:fi.component,()=>[tt(Ye)]),_o(st,It)};K_(bi,st=>{tt(Ye).rendered&&st(Pt)})}Ba(Gt,(st,It)=>It.element=st,st=>st==null?void 0:st.element,()=>[tt(Ye)]),_o(Ve,Gt)}),vu(()=>Au(Ji,`--primary: ${tt(vt).colors.primary??""}; --background: ${tt(vt).colors.background??""}; --text: ${tt(vt).colors.text??""};`)),_o(y,Ji),mu({getCenter:$t,setCenter:_t,getZoom:Rt,setZoom:Mi,getBounds:Jt,zoomIn:pi,zoomOut:Bt,getStyle:rr,setStyle:on,updatePopupsContentCallback:$n,updatePopups:jr,removePopups:Ir})}G_(["click"]);function Zx(y){const m=document.getElementById(y.container);if(!m)throw new Error(`Container not found: ${y.container}`);return W_(cm,{target:m,props:{options:y}})}function Vx(y){X_(y)}Vt.Map=cm,Vt.mountMap=Zx,Vt.unmountMap=Vx,Object.defineProperty(Vt,Symbol.toStringTag,{value:"Module"})});
|
|
729
|
+
${O.shaderPreludeCode.vertexSource}`,define:O.shaderDefine},defaultProjectionData:q},W=k.renderingMode?k.renderingMode:"2d";if(f.renderPass==="offscreen"){const X=k.prerender;X&&(f.setCustomLayerDefaults(),E.setColorMode(f.colorModeForRenderPass()),X.call(k,E.gl,G),E.setDirty(),f.setBaseState())}else if(f.renderPass==="translucent"){f.setCustomLayerDefaults(),E.setColorMode(f.colorModeForRenderPass()),E.setStencilMode(Ct.disabled);const X=W==="3d"?f.getDepthModeFor3D():f.getDepthModeForSublayer(0,ft.ReadOnly);E.setDepthMode(X),k.render(E.gl,G),E.setDirty(),f.setBaseState(),E.bindFramebuffer.set(null)}}(e,0,s,h))}saveTileTexture(e){const i=this._tileTextures[e.size[0]];i?i.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const i=this._tileTextures[e];return i&&i.length>0?i.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const i=this.imageManager.getPattern(e.from.toString()),s=this.imageManager.getPattern(e.to.toString());return!i||!s}useProgram(e,i,s=!1){this.cache=this.cache||{};const l=!!this.style.map.terrain,h=this.style.projection,f=e+(i?i.cacheKey:"")+`/${s?Ha:h.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(l?"/terrain":"");return this.cache[f]||(this.cache[f]=new Ns(this.context,Kr[e],i,oc[e],this._showOverdrawInspector,l,s?Kr.projectionMercator:h.shaderPreludeCode,s?In:h.shaderDefine)),this.cache[f]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ot(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:i}=this.context.gl;return this.width!==e||this.height!==i}}function wc(u,e){let i,s=!1,l=null,h=null;const f=()=>{l=null,s&&(u.apply(h,i),l=setTimeout(f,e),s=!1)};return(..._)=>(s=!0,h=this,i=_,l||f(),l)}class Tc{constructor(e){this._getCurrentHash=()=>{const i=window.location.hash.replace("#","");if(this._hashName){let s;return i.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(s=l)}),(s&&s[1]||"").split("/")}return i.split("/")},this._onHashChange=()=>{const i=this._getCurrentHash();if(!this._isValidHash(i))return!1;const s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:s,pitch:+(i[4]||0)}),!0},this._updateHashUnthrottled=()=>{const i=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,i)},this._removeHash=()=>{const i=this._getCurrentHash();if(i.length===0)return;const s=i.join("/");let l=s;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l=`${this._hashName}=${s}`);let h=window.location.hash.replace(l,"");h.startsWith("#&")?h=h.slice(0,1)+h.slice(2):h==="#"&&(h="");let f=window.location.href.replace(/(#.+)?$/,h);f=f.replace("&&","&"),window.history.replaceState(window.history.state,null,f)},this._updateHash=wc(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const i=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,l=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),h=Math.pow(10,l),f=Math.round(i.lng*h)/h,_=Math.round(i.lat*h)/h,v=this._map.getBearing(),T=this._map.getPitch();let I="";if(I+=e?`/${f}/${_}/${s}`:`${s}/${_}/${f}`,(v||T)&&(I+="/"+Math.round(10*v)/10),T&&(I+=`/${Math.round(T)}`),this._hashName){const E=this._hashName;let k=!1;const O=window.location.hash.slice(1).split("&").map(Z=>{const q=Z.split("=")[0];return q===E?(k=!0,`${q}=${I}`):Z}).filter(Z=>Z);return k||O.push(`${E}=${I}`),`#${O.join("&")}`}return`#${I}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new o.Q(+e[2],+e[1])}catch{return!1}const i=+e[0],s=+(e[3]||0),l=+(e[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&s>=-180&&s<=180&&l>=this._map.getMinPitch()&&l<=this._map.getMaxPitch()}}const hs={linearity:.3,easing:o.c9(0,0,.3,1)},Ta=o.e({deceleration:2500,maxSpeed:1400},hs),Mh=o.e({deceleration:20,maxSpeed:1400},hs),Ih=o.e({deceleration:1e3,maxSpeed:360},hs),Ch=o.e({deceleration:1e3,maxSpeed:90},hs),kh=o.e({deceleration:1e3,maxSpeed:360},hs);class Eh{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:xe.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,i=xe.now();for(;e.length>0&&i-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,roll:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:h}of this._inertiaBuffer)i.zoom+=h.zoomDelta||0,i.bearing+=h.bearingDelta||0,i.pitch+=h.pitchDelta||0,i.roll+=h.rollDelta||0,h.panDelta&&i.pan._add(h.panDelta),h.around&&(i.around=h.around),h.pinchAround&&(i.pinchAround=h.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(i.pan.mag()){const h=ps(i.pan.mag(),s,o.e({},Ta,e||{})),f=i.pan.mult(h.amount/i.pan.mag()),_=this._map.cameraHelper.handlePanInertia(f,this._map.transform);l.center=_.easingCenter,l.offset=_.easingOffset,ds(l,h)}if(i.zoom){const h=ps(i.zoom,s,Mh);l.zoom=this._map.transform.zoom+h.amount,ds(l,h)}if(i.bearing){const h=ps(i.bearing,s,Ih);l.bearing=this._map.transform.bearing+o.ae(h.amount,-179,179),ds(l,h)}if(i.pitch){const h=ps(i.pitch,s,Ch);l.pitch=this._map.transform.pitch+h.amount,ds(l,h)}if(i.roll){const h=ps(i.roll,s,kh);l.roll=this._map.transform.roll+o.ae(h.amount,-179,179),ds(l,h)}if(l.zoom||l.bearing){const h=i.pinchAround===void 0?i.around:i.pinchAround;l.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),o.e(l,{noMoveStart:!0})}}function ds(u,e){(!u.duration||u.duration<e.duration)&&(u.duration=e.duration,u.easing=e.easing)}function ps(u,e,i){const{maxSpeed:s,linearity:l,deceleration:h}=i,f=o.ae(u*l/(e/1e3),-s,s),_=Math.abs(f)/(h*l);return{easing:i.easing,duration:1e3*_,amount:f*(_/2)}}class er extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,s,l={}){s=s instanceof MouseEvent?s:new MouseEvent(e,s);const h=ie.mousePos(i.getCanvas(),s),f=i.unproject(h);super(e,o.e({point:h,lngLat:f,originalEvent:s},l)),this._defaultPrevented=!1,this.target=i}}class fs extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,s){const l=e==="touchend"?s.changedTouches:s.touches,h=ie.touchPos(i.getCanvasContainer(),l),f=h.map(v=>i.unproject(v)),_=h.reduce((v,T,I,E)=>v.add(T.div(E.length)),new o.P(0,0));super(e,{points:h,point:_,lngLats:f,lngLat:i.unproject(_),originalEvent:s}),this._defaultPrevented=!1}}class Ur extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,s){super(e,{originalEvent:s}),this._defaultPrevented=!1}}class dn{constructor(e,i){this._map=e,this._clickTolerance=i.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Ur(e.type,this._map,e))}mousedown(e,i){return this._mousedownPos=i,this._firePreventable(new er(e.type,this._map,e))}mouseup(e){this._map.fire(new er(e.type,this._map,e))}click(e,i){this._mousedownPos&&this._mousedownPos.dist(i)>=this._clickTolerance||this._map.fire(new er(e.type,this._map,e))}dblclick(e){return this._firePreventable(new er(e.type,this._map,e))}mouseover(e){this._map.fire(new er(e.type,this._map,e))}mouseout(e){this._map.fire(new er(e.type,this._map,e))}touchstart(e){return this._firePreventable(new fs(e.type,this._map,e))}touchmove(e){this._map.fire(new fs(e.type,this._map,e))}touchend(e){this._map.fire(new fs(e.type,this._map,e))}touchcancel(e){this._map.fire(new fs(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ah{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new er(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new er("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new er(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class yr{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(o.P.convert(e),this._map.terrain)}}class Pa{constructor(e,i){this._map=e,this._tr=new yr(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=i.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,i){this.isEnabled()&&e.shiftKey&&e.button===0&&(ie.disableDrag(),this._startPos=this._lastPos=i,this._active=!0)}mousemoveWindow(e,i){if(!this._active)return;const s=i;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=s,this._box||(this._box=ie.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const h=Math.min(l.x,s.x),f=Math.max(l.x,s.x),_=Math.min(l.y,s.y),v=Math.max(l.y,s.y);ie.setTransform(this._box,`translate(${h}px,${_}px)`),this._box.style.width=f-h+"px",this._box.style.height=v-_+"px"}mouseupWindow(e,i){if(!this._active||e.button!==0)return;const s=this._startPos,l=i;if(this.reset(),ie.suppressClick(),s.x!==l.x||s.y!==l.y)return this._map.fire(new o.l("boxzoomend",{originalEvent:e})),{cameraAnimation:h=>h.fitScreenCoordinates(s,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(ie.remove(this._box),this._box=null),ie.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,i){return this._map.fire(new o.l(e,{originalEvent:i}))}}function Pc(u,e){if(u.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${e.length}`);const i={};for(let s=0;s<u.length;s++)i[u[s].identifier]=e[s];return i}class Kd{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,i,s){(this.centroid||s.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),s.length===this.numTouches&&(this.centroid=function(l){const h=new o.P(0,0);for(const f of l)h._add(f);return h.div(l.length)}(i),this.touches=Pc(s,i)))}touchmove(e,i,s){if(this.aborted||!this.centroid)return;const l=Pc(s,i);for(const h in this.touches){const f=l[h];(!f||f.dist(this.touches[h])>30)&&(this.aborted=!0)}}touchend(e,i,s){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Sc{constructor(e){this.singleTap=new Kd(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,i,s){this.singleTap.touchstart(e,i,s)}touchmove(e,i,s){this.singleTap.touchmove(e,i,s)}touchend(e,i,s){const l=this.singleTap.touchend(e,i,s);if(l){const h=e.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(l)<30;if(h&&f||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Yd{constructor(e){this._tr=new yr(e),this._zoomIn=new Sc({numTouches:1,numTaps:2}),this._zoomOut=new Sc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,i,s){this._zoomIn.touchstart(e,i,s),this._zoomOut.touchstart(e,i,s)}touchmove(e,i,s){this._zoomIn.touchmove(e,i,s),this._zoomOut.touchmove(e,i,s)}touchend(e,i,s){const l=this._zoomIn.touchend(e,i,s),h=this._zoomOut.touchend(e,i,s),f=this._tr;return l?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:f.zoom+1,around:f.unproject(l)},{originalEvent:e})}):h?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:f.zoom-1,around:f.unproject(h)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ms{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const i=this._moveFunction(...e);if(i.bearingDelta||i.pitchDelta||i.rollDelta||i.around||i.panDelta)return this._active=!0,i}dragStart(e,i){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(i)?i[0]:i,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,i){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const l=Array.isArray(i)?i[0]:i;return!this._moved&&l.dist(s)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(s,l))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&ie.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Xs={0:1,2:2};class Er{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const i=ie.mouseButton(e);this._eventButton=i}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(i,s){const l=Xs[s];return i.buttons===void 0||(i.buttons&l)!==l}(e,this._eventButton)}isValidEndEvent(e){return ie.mouseButton(e)===this._eventButton}}class $e{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class zh{constructor(e=new Er({checkCorrectEvent:()=>!0}),i=new $e){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=i}_executeRelevantHandler(e,i,s){return e instanceof MouseEvent?i(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?s(e):void 0}startMove(e){this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.startMove(i),i=>this.oneFingerTouchMoveStateManager.startMove(i))}endMove(e){this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.endMove(i),i=>this.oneFingerTouchMoveStateManager.endMove(i))}isValidStartEvent(e){return this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.isValidStartEvent(i),i=>this.oneFingerTouchMoveStateManager.isValidStartEvent(i))}isValidMoveEvent(e){return this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.isValidMoveEvent(i),i=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(i))}isValidEndEvent(e){return this._executeRelevantHandler(e,i=>this.mouseMoveStateManager.isValidEndEvent(i),i=>this.oneFingerTouchMoveStateManager.isValidEndEvent(i))}}const gs=u=>{u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=e=>{e.preventDefault()}};class Rh{constructor(e,i){this._clickTolerance=e.clickTolerance||1,this._map=i,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,i,s){return this._calculateTransform(e,i,s)}touchmove(e,i,s){if(this._active){if(!this._shouldBePrevented(s.length))return e.preventDefault(),this._calculateTransform(e,i,s);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,i,s){this._calculateTransform(e,i,s),this._active&&this._shouldBePrevented(s.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,i,s){s.length>0&&(this._active=!0);const l=Pc(s,i),h=new o.P(0,0),f=new o.P(0,0);let _=0;for(const T in l){const I=l[T],E=this._touches[T];E&&(h._add(I),f._add(I.sub(E)),_++,l[T]=I)}if(this._touches=l,this._shouldBePrevented(_)||!f.mag())return;const v=f.div(_);return this._sum._add(v),this._sum.mag()<this._clickTolerance?void 0:{around:h.div(_),panDelta:v}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Sa{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,i,s){this._firstTwoTouches||s.length<2||(this._firstTwoTouches=[s[0].identifier,s[1].identifier],this._start([i[0],i[1]]))}touchmove(e,i,s){if(!this._firstTwoTouches)return;e.preventDefault();const[l,h]=this._firstTwoTouches,f=Kn(s,i,l),_=Kn(s,i,h);if(!f||!_)return;const v=this._aroundCenter?null:f.add(_).div(2);return this._move([f,_],v,e)}touchend(e,i,s){if(!this._firstTwoTouches)return;const[l,h]=this._firstTwoTouches,f=Kn(s,i,l),_=Kn(s,i,h);f&&_||(this._active&&ie.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Kn(u,e,i){for(let s=0;s<u.length;s++)if(u[s].identifier===i)return e[s]}function Mc(u,e){return Math.log(u/e)/Math.LN2}class wt extends Sa{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,i){const s=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Mc(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Mc(this._distance,s),pinchAround:i}}}function tl(u,e){return 180*u.angleWith(e)/Math.PI}class Dh extends Sa{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,i,s){const l=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:tl(this._vector,l),pinchAround:i}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const i=25/(Math.PI*this._minDiameter)*360,s=tl(e,this._startVector);return Math.abs(s)<i}}function Ks(u){return Math.abs(u.y)>Math.abs(u.x)}class Lh extends Sa{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,i,s){super.touchstart(e,i,s),this._currentTouchCount=s.length}_start(e){this._lastPoints=e,Ks(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,i,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=e[0].sub(this._lastPoints[0]),h=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,h,s.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(l.y+h.y)/2*-.5}):void 0}gestureBeginsVertically(e,i,s){if(this._valid!==void 0)return this._valid;const l=e.mag()>=2,h=i.mag()>=2;if(!l&&!h)return;if(!l||!h)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;const f=e.y>0==i.y>0;return Ks(e)&&Ks(i)&&f}}const Jd={panStep:100,bearingStep:15,pitchStep:10};class Ic{constructor(e){this._tr=new yr(e);const i=Jd;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let i=0,s=0,l=0,h=0,f=0;switch(e.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:e.shiftKey?s=-1:(e.preventDefault(),h=-1);break;case 39:e.shiftKey?s=1:(e.preventDefault(),h=1);break;case 38:e.shiftKey?l=1:(e.preventDefault(),f=-1);break;case 40:e.shiftKey?l=-1:(e.preventDefault(),f=1);break;default:return}return this._rotationDisabled&&(s=0,l=0),{cameraAnimation:_=>{const v=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:Cc,zoom:i?Math.round(v.zoom)+i*(e.shiftKey?2:1):v.zoom,bearing:v.bearing+s*this._bearingStep,pitch:v.pitch+l*this._pitchStep,offset:[-h*this._panStep,-f*this._panStep],center:v.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Cc(u){return u*(2-u)}const kc=4.000244140625;class Fh{constructor(e,i){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=e,this._tr=new yr(e),this._triggerRenderFrame=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let i=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const s=xe.now(),l=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,i!==0&&i%kc==0?this._type="wheel":i!==0&&Math.abs(i)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(l*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const i=ie.mousePos(this._map.getCanvas(),e),s=this._tr;this._aroundPoint=this._aroundCenter?s.transform.locationToScreenPoint(o.Q.convert(s.center)):i,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const _=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=_),typeof this._targetZoom=="number"&&(this._targetZoom+=_)}if(this._delta!==0){const _=this._type==="wheel"&&Math.abs(this._delta)>kc?this._wheelZoomRate:this._defaultZoomRate;let v=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&v!==0&&(v=1/v);const T=typeof this._targetZoom!="number"?e.scale:o.aI(this._targetZoom);this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,o.ab(T*v))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const i=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,s=this._startZoom,l=this._easing;let h,f=!1;if(this._type==="wheel"&&s&&l){const _=xe.now()-this._lastWheelEventTime,v=Math.min((_+5)/200,1),T=l(v);h=o.B.number(s,i,T),v<1?this._frameId||(this._frameId=!0):f=!0}else h=i,f=!0;return this._active=!0,f&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=h,{noInertia:!0,needsRenderFrame:!f,zoomDelta:h-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let i=o.cb;if(this._prevEase){const s=this._prevEase,l=(xe.now()-s.start)/s.duration,h=s.easing(l+.01)-s.easing(l),f=.27/Math.sqrt(h*h+1e-4)*.01,_=Math.sqrt(.0729-f*f);i=o.c9(f,_,.25,1)}return this._prevEase={start:xe.now(),duration:e,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ec{constructor(e,i){this._clickZoom=e,this._tapZoom=i}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Qd{constructor(e){this._tr=new yr(e),this.reset()}reset(){this._active=!1}dblclick(e,i){return e.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(i)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ep{constructor(){this._tap=new Sc({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,i,s){if(!this._swipePoint)if(this._tapTime){const l=i[0],h=e.timeStamp-this._tapTime<500,f=this._tapPoint.dist(l)<30;h&&f?s.length>0&&(this._swipePoint=l,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(e,i,s)}touchmove(e,i,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const l=i[0],h=l.y-this._swipePoint.y;return this._swipePoint=l,e.preventDefault(),this._active=!0,{zoomDelta:h/128}}}else this._tap.touchmove(e,i,s)}touchend(e,i,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{const l=this._tap.touchend(e,i,s);l&&(this._tapTime=e.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class En{constructor(e,i,s){this._el=e,this._mousePan=i,this._touchPan=s}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ti{constructor(e,i,s,l){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=i,this._mousePitch=s,this._mouseRoll=l}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Ys{constructor(e,i,s,l){this._el=e,this._touchZoom=i,this._touchRotate=s,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class il{constructor(e,i){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=i,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=ie.create("div","maplibregl-cooperative-gesture-screen",e);let i=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(i=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const s=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=i,this._container.appendChild(l);const h=document.createElement("div");h.className="maplibregl-mobile-message",h.textContent=s,this._container.appendChild(h),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(ie.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,i){this._enabled&&(this._map.fire(new o.l("cooperativegestureprevented",{gestureType:e,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Js=u=>u.zoom||u.drag||u.roll||u.pitch||u.rotate;class Bh extends o.l{}function rl(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta||u.rollDelta}class tp{constructor(e,i){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,h)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const f=l.type==="renderFrame"?void 0:l,_={needsRenderFrame:!1},v={},T={};for(const{handlerName:k,handler:O,allowed:Z}of this._handlers){if(!O.isEnabled())continue;let q;if(this._blockedByActive(T,Z,k))O.reset();else if(O[h||l.type]){if(o.cc(l,h||l.type)){const G=ie.mousePos(this._map.getCanvas(),l);q=O[h||l.type](l,G)}else if(o.cd(l,h||l.type)){const G=this._getMapTouches(l.touches),W=ie.touchPos(this._map.getCanvas(),G);q=O[h||l.type](l,W,G)}else o.ce(h||l.type)||(q=O[h||l.type](l));this.mergeHandlerResult(_,v,q,k,f),q&&q.needsRenderFrame&&this._triggerRenderFrame()}(q||O.isActive())&&(T[k]=O)}const I={};for(const k in this._previousActiveHandlers)T[k]||(I[k]=f);this._previousActiveHandlers=T,(Object.keys(I).length||rl(_))&&(this._changes.push([_,v,I]),this._triggerRenderFrame()),(Object.keys(T).length||rl(_))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:E}=_;E&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],E(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Eh(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);const s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,h,f]of this._listeners)ie.addEventListener(l,h,l===document?this.handleWindowEvent:this.handleEvent,f)}destroy(){for(const[e,i,s]of this._listeners)ie.removeEventListener(e,i,e===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(e){const i=this._map,s=i.getCanvasContainer();this._add("mapEvent",new dn(i,e));const l=i.boxZoom=new Pa(i,e);this._add("boxZoom",l),e.interactive&&e.boxZoom&&l.enable();const h=i.cooperativeGestures=new il(i,e.cooperativeGestures);this._add("cooperativeGestures",h),e.cooperativeGestures&&h.enable();const f=new Yd(i),_=new Qd(i);i.doubleClickZoom=new Ec(_,f),this._add("tapZoom",f),this._add("clickZoom",_),e.interactive&&e.doubleClickZoom&&i.doubleClickZoom.enable();const v=new ep;this._add("tapDragZoom",v);const T=i.touchPitch=new Lh(i);this._add("touchPitch",T),e.interactive&&e.touchPitch&&i.touchPitch.enable(e.touchPitch);const I=()=>i.project(i.getCenter()),E=function({enable:ee,clickTolerance:te,aroundCenter:oe=!0,minPixelCenterThreshold:re=100,rotateDegreesPerPixelMoved:me=.8},fe){const Se=new Er({checkCorrectEvent:Ie=>ie.mouseButton(Ie)===0&&Ie.ctrlKey||ie.mouseButton(Ie)===2&&!Ie.ctrlKey});return new ms({clickTolerance:te,move:(Ie,Te)=>{const je=fe();if(oe&&Math.abs(je.y-Ie.y)>re)return{bearingDelta:o.ca(new o.P(Ie.x,Te.y),Te,je)};let Be=(Te.x-Ie.x)*me;return oe&&Te.y<je.y&&(Be=-Be),{bearingDelta:Be}},moveStateManager:Se,enable:ee,assignEvents:gs})}(e,I),k=function({enable:ee,clickTolerance:te,pitchDegreesPerPixelMoved:oe=-.5}){const re=new Er({checkCorrectEvent:me=>ie.mouseButton(me)===0&&me.ctrlKey||ie.mouseButton(me)===2});return new ms({clickTolerance:te,move:(me,fe)=>({pitchDelta:(fe.y-me.y)*oe}),moveStateManager:re,enable:ee,assignEvents:gs})}(e),O=function({enable:ee,clickTolerance:te,rollDegreesPerPixelMoved:oe=.3},re){const me=new Er({checkCorrectEvent:fe=>ie.mouseButton(fe)===2&&fe.ctrlKey});return new ms({clickTolerance:te,move:(fe,Se)=>{const Ie=re();let Te=(Se.x-fe.x)*oe;return Se.y<Ie.y&&(Te=-Te),{rollDelta:Te}},moveStateManager:me,enable:ee,assignEvents:gs})}(e,I);i.dragRotate=new ti(e,E,k,O),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",k,["mouseRotate","mouseRoll"]),this._add("mouseRoll",O,["mousePitch"]),e.interactive&&e.dragRotate&&i.dragRotate.enable();const Z=function({enable:ee,clickTolerance:te}){const oe=new Er({checkCorrectEvent:re=>ie.mouseButton(re)===0&&!re.ctrlKey});return new ms({clickTolerance:te,move:(re,me)=>({around:me,panDelta:me.sub(re)}),activateOnStart:!0,moveStateManager:oe,enable:ee,assignEvents:gs})}(e),q=new Rh(e,i);i.dragPan=new En(s,Z,q),this._add("mousePan",Z),this._add("touchPan",q,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&i.dragPan.enable(e.dragPan);const G=new Dh,W=new wt;i.touchZoomRotate=new Ys(s,W,G,v),this._add("touchRotate",G,["touchPan","touchZoom"]),this._add("touchZoom",W,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&i.touchZoomRotate.enable(e.touchZoomRotate);const X=i.scrollZoom=new Fh(i,()=>this._triggerRenderFrame());this._add("scrollZoom",X,["mousePan"]),e.interactive&&e.scrollZoom&&i.scrollZoom.enable(e.scrollZoom);const Q=i.keyboard=new Ic(i);this._add("keyboard",Q),e.interactive&&e.keyboard&&i.keyboard.enable(),this._add("blockableMapEvent",new Ah(i))}_add(e,i,s){this._handlers.push({handlerName:e,handler:i,allowed:s}),this._handlersById[e]=i}stop(e){if(!this._updatingCamera){for(const{handler:i}of this._handlers)i.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Js(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,i,s){for(const l in e)if(l!==s&&(!i||i.indexOf(l)<0))return!0;return!1}_getMapTouches(e){const i=[];for(const s of e)this._el.contains(s.target)&&i.push(s);return i}mergeHandlerResult(e,i,s,l,h){if(!s)return;o.e(e,s);const f={handlerName:l,originalEvent:s.originalEvent||h};s.zoomDelta!==void 0&&(i.zoom=f),s.panDelta!==void 0&&(i.drag=f),s.rollDelta!==void 0&&(i.roll=f),s.pitchDelta!==void 0&&(i.pitch=f),s.bearingDelta!==void 0&&(i.rotate=f)}_applyChanges(){const e={},i={},s={};for(const[l,h,f]of this._changes)l.panDelta&&(e.panDelta=(e.panDelta||new o.P(0,0))._add(l.panDelta)),l.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+l.pitchDelta),l.rollDelta&&(e.rollDelta=(e.rollDelta||0)+l.rollDelta),l.around!==void 0&&(e.around=l.around),l.pinchAround!==void 0&&(e.pinchAround=l.pinchAround),l.noInertia&&(e.noInertia=l.noInertia),o.e(i,h),o.e(s,f);this._updateMapTransform(e,i,s),this._changes=[]}_updateMapTransform(e,i,s){const l=this._map,h=l._getTransformForUpdate(),f=l.terrain;if(!(rl(e)||f&&this._terrainMovement))return this._fireEvents(i,s,!0);l._stop(!0);let{panDelta:_,zoomDelta:v,bearingDelta:T,pitchDelta:I,rollDelta:E,around:k,pinchAround:O}=e;O!==void 0&&(k=O),k=k||l.transform.centerPoint,f&&!h.isPointOnMapSurface(k)&&(k=h.centerPoint);const Z={panDelta:_,zoomDelta:v,rollDelta:E,pitchDelta:I,bearingDelta:T,around:k};this._map.cameraHelper.useGlobeControls&&!h.isPointOnMapSurface(k)&&(k=h.centerPoint);const q=k.distSqr(h.centerPoint)<.01?h.center:h.screenPointToLocation(_?k.sub(_):k);f?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(Z,h),this._terrainMovement||!i.drag&&!i.zoom?i.drag&&this._terrainMovement?h.setCenter(h.screenPointToLocation(h.centerPoint.sub(_))):this._map.cameraHelper.handleMapControlsPan(Z,h,q):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(Z,h,q))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(Z,h),this._map.cameraHelper.handleMapControlsPan(Z,h,q)),l._applyUpdatedTransform(h),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(i,s,!0)}_fireEvents(e,i,s){const l=Js(this._eventsInProgress),h=Js(e),f={};for(const E in e){const{originalEvent:k}=e[E];this._eventsInProgress[E]||(f[`${E}start`]=k),this._eventsInProgress[E]=e[E]}!l&&h&&this._fireEvent("movestart",h.originalEvent);for(const E in f)this._fireEvent(E,f[E]);h&&this._fireEvent("move",h.originalEvent);for(const E in e){const{originalEvent:k}=e[E];this._fireEvent(E,k)}const _={};let v;for(const E in this._eventsInProgress){const{handlerName:k,originalEvent:O}=this._eventsInProgress[E];this._handlersById[k].isActive()||(delete this._eventsInProgress[E],v=i[k]||O,_[`${E}end`]=v)}for(const E in _)this._fireEvent(E,_[E]);const T=Js(this._eventsInProgress),I=(l||h)&&!T;if(I&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const E=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&E.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(E)}if(s&&I){this._updatingCamera=!0;const E=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),k=O=>O!==0&&-this._bearingSnap<O&&O<this._bearingSnap;!E||!E.essential&&xe.prefersReducedMotion?(this._map.fire(new o.l("moveend",{originalEvent:v})),k(this._map.getBearing())&&this._map.resetNorth()):(k(E.bearing||this._map.getBearing())&&(E.bearing=0),E.freezeElevation=!0,this._map.easeTo(E,{originalEvent:v})),this._updatingCamera=!1}}_fireEvent(e,i){this._map.fire(new o.l(e,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new Bh("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class pn extends o.E{constructor(e,i,s){super(),this._renderFrameCallback=()=>{const l=Math.min((xe.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=s.bearingSnap,this.cameraHelper=i,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,i){e.apply(this.transform),this.transform=e,this.cameraHelper=i}getCenter(){return new o.Q(this.transform.center.lng,this.transform.center.lat)}setCenter(e,i){return this.jumpTo({center:e},i)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,i){return this.jumpTo({elevation:e},i),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,i,s){return e=o.P.convert(e).mult(-1),this.panTo(this.transform.center,o.e({offset:e},i),s)}panTo(e,i,s){return this.easeTo(o.e({center:e},i),s)}getZoom(){return this.transform.zoom}setZoom(e,i){return this.jumpTo({zoom:e},i),this}zoomTo(e,i,s){return this.easeTo(o.e({zoom:e},i),s)}zoomIn(e,i){return this.zoomTo(this.getZoom()+1,e,i),this}zoomOut(e,i){return this.zoomTo(this.getZoom()-1,e,i),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,i){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new o.l("movestart",i)).fire(new o.l("move",i)).fire(new o.l("moveend",i))),this}getBearing(){return this.transform.bearing}setBearing(e,i){return this.jumpTo({bearing:e},i),this}getPadding(){return this.transform.padding}setPadding(e,i){return this.jumpTo({padding:e},i),this}rotateTo(e,i,s){return this.easeTo(o.e({bearing:e},i),s)}resetNorth(e,i){return this.rotateTo(0,o.e({duration:1e3},e),i),this}resetNorthPitch(e,i){return this.easeTo(o.e({bearing:0,pitch:0,roll:0,duration:1e3},e),i),this}snapToNorth(e,i){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,i):this}getPitch(){return this.transform.pitch}setPitch(e,i){return this.jumpTo({pitch:e},i),this}getRoll(){return this.transform.roll}setRoll(e,i){return this.jumpTo({roll:e},i),this}cameraForBounds(e,i){e=Ve.convert(e).adjustAntiMeridian();const s=i&&i.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),s,i)}_cameraForBoxAndBearing(e,i,s,l){const h={top:0,bottom:0,right:0,left:0};if(typeof(l=o.e({padding:h,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const T=l.padding;l.padding={top:T,bottom:T,right:T,left:T}}const f=o.e(h,l.padding);l.padding=f;const _=this.transform,v=new Ve(e,i);return this.cameraHelper.cameraForBoxAndBearing(l,f,v,s,_)}fitBounds(e,i,s){return this._fitInternal(this.cameraForBounds(e,i),i,s)}fitScreenCoordinates(e,i,s,l,h){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(o.P.convert(e)),this.transform.screenPointToLocation(o.P.convert(i)),s,l),l,h)}_fitInternal(e,i,s){return e?(delete(i=o.e(e,i)).padding,i.linear?this.easeTo(i,s):this.flyTo(i,s)):this}jumpTo(e,i){this.stop();const s=this._getTransformForUpdate();let l=!1,h=!1,f=!1;const _=s.zoom;this.cameraHelper.handleJumpToCenterZoom(s,e);const v=s.zoom!==_;return"elevation"in e&&s.elevation!==+e.elevation&&s.setElevation(+e.elevation),"bearing"in e&&s.bearing!==+e.bearing&&(l=!0,s.setBearing(+e.bearing)),"pitch"in e&&s.pitch!==+e.pitch&&(h=!0,s.setPitch(+e.pitch)),"roll"in e&&s.roll!==+e.roll&&(f=!0,s.setRoll(+e.roll)),e.padding==null||s.isPaddingEqual(e.padding)||s.setPadding(e.padding),this._applyUpdatedTransform(s),this.fire(new o.l("movestart",i)).fire(new o.l("move",i)),v&&this.fire(new o.l("zoomstart",i)).fire(new o.l("zoom",i)).fire(new o.l("zoomend",i)),l&&this.fire(new o.l("rotatestart",i)).fire(new o.l("rotate",i)).fire(new o.l("rotateend",i)),h&&this.fire(new o.l("pitchstart",i)).fire(new o.l("pitch",i)).fire(new o.l("pitchend",i)),f&&this.fire(new o.l("rollstart",i)).fire(new o.l("roll",i)).fire(new o.l("rollend",i)),this.fire(new o.l("moveend",i))}calculateCameraOptionsFromTo(e,i,s,l=0){const h=o.$.fromLngLat(e,i),f=o.$.fromLngLat(s,l),_=f.x-h.x,v=f.y-h.y,T=f.z-h.z,I=Math.hypot(_,v,T);if(I===0)throw new Error("Can't calculate camera options with same From and To");const E=Math.hypot(_,v),k=o.ab(this.transform.cameraToCenterDistance/I/this.transform.tileSize),O=180*Math.atan2(_,-v)/Math.PI;let Z=180*Math.acos(E/I)/Math.PI;return Z=T<0?90-Z:90+Z,{center:f.toLngLat(),elevation:l,zoom:k,pitch:Z,bearing:O}}calculateCameraOptionsFromCameraLngLatAltRotation(e,i,s,l,h){const f=this.transform.calculateCenterFromCameraLngLatAlt(e,i,s,l);return{center:f.center,elevation:f.elevation,zoom:f.zoom,bearing:s,pitch:l,roll:h}}easeTo(e,i){this._stop(!1,e.easeId),((e=o.e({offset:[0,0],duration:500,easing:o.cb},e)).animate===!1||!e.essential&&xe.prefersReducedMotion)&&(e.duration=0);const s=this._getTransformForUpdate(),l=this.getBearing(),h=s.pitch,f=s.roll,_="bearing"in e?this._normalizeBearing(e.bearing,l):l,v="pitch"in e?+e.pitch:h,T="roll"in e?this._normalizeBearing(e.roll,f):f,I="padding"in e?e.padding:s.padding,E=o.P.convert(e.offset);let k,O;e.around&&(k=o.Q.convert(e.around),O=s.locationToScreenPoint(k));const Z={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},q=this.cameraHelper.handleEaseTo(s,{bearing:_,pitch:v,roll:T,padding:I,around:k,aroundPoint:O,offsetAsPoint:E,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||l!==_,this._pitching=this._pitching||v!==h,this._rolling=this._rolling||T!==f,this._padding=!s.isPaddingEqual(I),this._zooming=this._zooming||q.isZooming,this._easeId=e.easeId,this._prepareEase(i,e.noMoveStart,Z),this.terrain&&this._prepareElevation(q.elevationCenter),this._ease(G=>{q.easeFunc(G),this.terrain&&!e.freezeElevation&&this._updateElevation(G),this._applyUpdatedTransform(s),this._fireMoveEvents(i)},G=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(i,G)},e),this}_prepareEase(e,i,s={}){this._moving=!0,i||s.moving||this.fire(new o.l("movestart",e)),this._zooming&&!s.zooming&&this.fire(new o.l("zoomstart",e)),this._rotating&&!s.rotating&&this.fire(new o.l("rotatestart",e)),this._pitching&&!s.pitching&&this.fire(new o.l("pitchstart",e)),this._rolling&&!s.rolling&&this.fire(new o.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&i!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(s-(i-(s*e+this._elevationStart))/(1-e)),this._elevationTarget=i}this.transform.setElevation(o.B.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const i=e.getCameraLngLat(),s=e.getCameraAltitude(),l=this.terrain?this.terrain.getElevationForLngLatZoom(i,e.zoom):0;if(s<l){const h=this.calculateCameraOptionsFromTo(i,l,e.center,e.elevation);return{pitch:h.pitch,zoom:h.zoom}}return{}}_applyUpdatedTransform(e){const i=[];if(i.push(l=>this._elevateCameraIfInsideTerrain(l)),this.transformCameraUpdate&&i.push(l=>this.transformCameraUpdate(l)),!i.length)return;const s=e.clone();for(const l of i){const h=s.clone(),{center:f,zoom:_,roll:v,pitch:T,bearing:I,elevation:E}=l(h);f&&h.setCenter(f),E!==void 0&&h.setElevation(E),_!==void 0&&h.setZoom(_),v!==void 0&&h.setRoll(v),T!==void 0&&h.setPitch(T),I!==void 0&&h.setBearing(I),s.apply(h)}this.transform.apply(s)}_fireMoveEvents(e){this.fire(new o.l("move",e)),this._zooming&&this.fire(new o.l("zoom",e)),this._rotating&&this.fire(new o.l("rotate",e)),this._pitching&&this.fire(new o.l("pitch",e)),this._rolling&&this.fire(new o.l("roll",e))}_afterEase(e,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;const s=this._zooming,l=this._rotating,h=this._pitching,f=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,s&&this.fire(new o.l("zoomend",e)),l&&this.fire(new o.l("rotateend",e)),h&&this.fire(new o.l("pitchend",e)),f&&this.fire(new o.l("rollend",e)),this.fire(new o.l("moveend",e))}flyTo(e,i){if(!e.essential&&xe.prefersReducedMotion){const Te=o.O(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(Te,i)}this.stop(),e=o.e({offset:[0,0],speed:1.2,curve:1.42,easing:o.cb},e);const s=this._getTransformForUpdate(),l=s.bearing,h=s.pitch,f=s.roll,_=s.padding,v="bearing"in e?this._normalizeBearing(e.bearing,l):l,T="pitch"in e?+e.pitch:h,I="roll"in e?this._normalizeBearing(e.roll,f):f,E="padding"in e?e.padding:s.padding,k=o.P.convert(e.offset);let O=s.centerPoint.add(k);const Z=s.screenPointToLocation(O),q=this.cameraHelper.handleFlyTo(s,{bearing:v,pitch:T,roll:I,padding:E,locationAtOffset:Z,offsetAsPoint:k,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let G=e.curve;const W=Math.max(s.width,s.height),X=W/q.scaleOfZoom,Q=q.pixelPathLength;typeof q.scaleOfMinZoom=="number"&&(G=Math.sqrt(W/q.scaleOfMinZoom/Q*2));const ee=G*G;function te(Te){const je=(X*X-W*W+(Te?-1:1)*ee*ee*Q*Q)/(2*(Te?X:W)*ee*Q);return Math.log(Math.sqrt(je*je+1)-je)}function oe(Te){return(Math.exp(Te)-Math.exp(-Te))/2}function re(Te){return(Math.exp(Te)+Math.exp(-Te))/2}const me=te(!1);let fe=function(Te){return re(me)/re(me+G*Te)},Se=function(Te){return W*((re(me)*(oe(je=me+G*Te)/re(je))-oe(me))/ee)/Q;var je},Ie=(te(!0)-me)/G;if(Math.abs(Q)<2e-6||!isFinite(Ie)){if(Math.abs(W-X)<1e-6)return this.easeTo(e,i);const Te=X<W?-1:1;Ie=Math.abs(Math.log(X/W))/G,Se=()=>0,fe=je=>Math.exp(Te*G*je)}return e.duration="duration"in e?+e.duration:1e3*Ie/("screenSpeed"in e?+e.screenSpeed/G:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=l!==v,this._pitching=T!==h,this._rolling=I!==f,this._padding=!s.isPaddingEqual(E),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(q.targetCenter),this._ease(Te=>{const je=Te*Ie,Be=1/fe(je),Ce=Se(je);this._rotating&&s.setBearing(o.B.number(l,v,Te)),this._pitching&&s.setPitch(o.B.number(h,T,Te)),this._rolling&&s.setRoll(o.B.number(f,I,Te)),this._padding&&(s.interpolatePadding(_,E,Te),O=s.centerPoint.add(k)),q.easeFunc(Te,Be,Ce,O),this.terrain&&!e.freezeElevation&&this._updateElevation(Te),this._applyUpdatedTransform(s),this._fireMoveEvents(i)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,i){var s;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,i)}return e||(s=this.handlers)===null||s===void 0||s.stop(!1),this}_ease(e,i,s){s.animate===!1||s.duration===0?(e(1),i()):(this._easeStart=xe.now(),this._easeOptions=s,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,i){e=o.aL(e,-180,180);const s=Math.abs(e-i);return Math.abs(e-360-i)<s&&(e-=360),Math.abs(e+360-i)<s&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(o.Q.convert(e),this.transform.tileZoom):null}}const Qs={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Je{constructor(e=Qs){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=i=>{!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"&&i.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=ie.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ie.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ie.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){ie.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,i){const s=this._map._getUIString(`AttributionControl.${i}`);e.title=s,e.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const i=this._map.style.sourceCaches;for(const l in i){const h=i[l];if(h.used||h.usedForTerrain){const f=h.getSource();f.attribution&&e.indexOf(f.attribution)<0&&e.push(f.attribution)}}e=e.filter(l=>String(l).trim()),e.sort((l,h)=>l.length-h.length),e=e.filter((l,h)=>{for(let f=h+1;f<e.length;f++)if(e[f].indexOf(l)>=0)return!1;return!0});const s=e.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,e.length?(this._innerContainer.innerHTML=ie.sanitize(s),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class nt{constructor(e={}){this._updateCompact=()=>{const i=this._container.children;if(i.length){const s=i[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=ie.create("div","maplibregl-ctrl");const i=ie.create("a","maplibregl-ctrl-logo");return i.target="_blank",i.rel="noopener nofollow",i.href="https://maplibre.org/",i.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),i.setAttribute("rel","noopener nofollow"),this._container.appendChild(i),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){ie.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class nl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const i=++this._id;return this._queue.push({callback:e,id:i,cancelled:!1}),i}remove(e){const i=this._currentlyRunning,s=i?this._queue.concat(i):this._queue;for(const l of s)if(l.id===e)return void(l.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const i=this._currentlyRunning=this._queue;this._queue=[];for(const s of i)if(!s.cancelled&&(s.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ac=o.aD([{name:"a_pos3d",type:"Int16",components:3}]);class zc extends o.E{constructor(e){super(),this._lastTilesetChange=xe.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,i){this.sourceCache.update(e,i),this._renderableTilesKeys=[];const s={};for(const l of he(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))s[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.terrainRttPosMatrix32f=new Float64Array(16),o.bO(l.terrainRttPosMatrix32f,0,o.Z,o.Z,0,0,1),this._tiles[l.key]=new ln(l,this.tileSize),this._lastTilesetChange=xe.now());for(const l in this._tiles)s[l]||delete this._tiles[l]}freeRtt(e){for(const i in this._tiles){const s=this._tiles[i];(!e||s.tileID.equals(e)||s.tileID.isChildOf(e)||e.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,i){return i?this._getTerrainCoordsForTileRanges(e,i):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){const i={};for(const s of this._renderableTilesKeys){const l=this._tiles[s].tileID,h=e.clone(),f=o.b2();if(l.canonical.equals(e.canonical))o.bO(f,0,o.Z,o.Z,0,0,1);else if(l.canonical.isChildOf(e.canonical)){const _=l.canonical.z-e.canonical.z,v=l.canonical.x-(l.canonical.x>>_<<_),T=l.canonical.y-(l.canonical.y>>_<<_),I=o.Z>>_;o.bO(f,0,I,I,0,0,1),o.L(f,f,[-v*I,-T*I,0])}else{if(!e.canonical.isChildOf(l.canonical))continue;{const _=e.canonical.z-l.canonical.z,v=e.canonical.x-(e.canonical.x>>_<<_),T=e.canonical.y-(e.canonical.y>>_<<_),I=o.Z>>_;o.bO(f,0,o.Z,o.Z,0,0,1),o.L(f,f,[v*I,T*I,0]),o.M(f,f,[1/2**_,1/2**_,0])}}h.terrainRttPosMatrix32f=new Float32Array(f),i[s]=h}return i}_getTerrainCoordsForTileRanges(e,i){const s={};for(const l of this._renderableTilesKeys){const h=this._tiles[l].tileID;if(!this._isWithinTileRanges(h,i))continue;const f=e.clone(),_=o.b2();if(h.canonical.z===e.canonical.z){const v=e.canonical.x-h.canonical.x,T=e.canonical.y-h.canonical.y;o.bO(_,0,o.Z,o.Z,0,0,1),o.L(_,_,[v*o.Z,T*o.Z,0])}else if(h.canonical.z>e.canonical.z){const v=h.canonical.z-e.canonical.z,T=h.canonical.x-(h.canonical.x>>v<<v),I=h.canonical.y-(h.canonical.y>>v<<v),E=e.canonical.x-(h.canonical.x>>v),k=e.canonical.y-(h.canonical.y>>v),O=o.Z>>v;o.bO(_,0,O,O,0,0,1),o.L(_,_,[-T*O+E*o.Z,-I*O+k*o.Z,0])}else{const v=e.canonical.z-h.canonical.z,T=e.canonical.x-(e.canonical.x>>v<<v),I=e.canonical.y-(e.canonical.y>>v<<v),E=(e.canonical.x>>v)-h.canonical.x,k=(e.canonical.y>>v)-h.canonical.y,O=o.Z<<v;o.bO(_,0,O,O,0,0,1),o.L(_,_,[T*o.Z+E*O,I*o.Z+k*O,0])}f.terrainRttPosMatrix32f=new Float32Array(_),s[l]=f}return s}getSourceTile(e,i){const s=this.sourceCache._source;let l=e.overscaledZ-this.deltaZoom;if(l>s.maxzoom&&(l=s.maxzoom),l<s.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(l).key);let h=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!h||!h.dem)&&i)for(;l>=s.minzoom&&(!h||!h.dem);)h=this.sourceCache.getTileByID(e.scaledTo(l--).key);return h}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,i){return i[e.canonical.z]&&e.canonical.x>=i[e.canonical.z].minTileX&&e.canonical.x<=i[e.canonical.z].maxTileX&&e.canonical.y>=i[e.canonical.z].minTileY&&e.canonical.y<=i[e.canonical.z].maxTileY}}class xr{constructor(e,i,s){this._meshCache={},this.painter=e,this.sourceCache=new zc(i),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,i,s,l=o.Z){var h;if(!(i>=0&&i<l&&s>=0&&s<l))return 0;const f=this.getTerrainData(e),_=(h=f.tile)===null||h===void 0?void 0:h.dem;if(!_)return 0;const v=o.cf([],[i/l*o.Z,s/l*o.Z],f.u_terrain_matrix),T=[v[0]*_.dim,v[1]*_.dim],I=Math.floor(T[0]),E=Math.floor(T[1]),k=T[0]-I,O=T[1]-E;return _.get(I,E)*(1-k)*(1-O)+_.get(I+1,E)*k*(1-O)+_.get(I,E+1)*(1-k)*O+_.get(I+1,E+1)*k*O}getElevationForLngLatZoom(e,i){if(!o.cg(i,e.wrap()))return 0;const{tileID:s,mercatorX:l,mercatorY:h}=this._getOverscaledTileIDFromLngLatZoom(e,i);return this.getElevation(s,l%o.Z,h%o.Z,o.Z)}getElevation(e,i,s,l=o.Z){return this.getDEMElevation(e,i,s,l)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const l=this.painter.context,h=new o.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ot(l,h,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ot(l,new o.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.at([])}const i=this.sourceCache.getSourceTile(e,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const l=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new Ot(l,i.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),i.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}const s=i&&i+i.tileID.key+e.key;if(s&&!this._demMatrixCache[s]){const l=this.sourceCache.sourceCache._source.maxzoom;let h=e.canonical.z-i.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=l?h=e.canonical.z-l:o.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const f=e.canonical.x-(e.canonical.x>>h<<h),_=e.canonical.y-(e.canonical.y>>h<<h),v=o.ch(new Float64Array(16),[1/(o.Z<<h),1/(o.Z<<h),0]);o.L(v,v,[f*o.Z,_*o.Z,0]),this._demMatrixCache[e.key]={matrix:v,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:s?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(e){const i=this.painter,s=i.width/devicePixelRatio,l=i.height/devicePixelRatio;return!this._fbo||this._fbo.width===s&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Ot(i.context,{width:s,height:l,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Ot(i.context,{width:s,height:l,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=i.context.createFramebuffer(s,l,!0,!1),this._fbo.depthAttachment.set(i.context.createRenderbuffer(i.context.gl.DEPTH_COMPONENT16,s,l))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let h=0,f=0;h<this._coordsTextureSize;h++)for(let _=0;_<this._coordsTextureSize;_++,f+=4)i[f+0]=255&_,i[f+1]=255&h,i[f+2]=_>>8<<4|h>>8,i[f+3]=0;const s=new o.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),l=new Ot(e,s,e.gl.RGBA,{premultiply:!1});return l.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const i=new Uint8Array(4),s=this.painter.context,l=s.gl,h=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),f=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),_=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(h,_-f-1,1,1,l.RGBA,l.UNSIGNED_BYTE,i),s.bindFramebuffer.set(null);const v=i[0]+(i[2]>>4<<8),T=i[1]+((15&i[2])<<8),I=this.coordsIndex[255-i[3]],E=I&&this.sourceCache.getTileByID(I);if(!E)return null;const k=this._coordsTextureSize,O=(1<<E.tileID.canonical.z)*k;return new o.$((E.tileID.canonical.x*k+v)/O+E.tileID.wrap,(E.tileID.canonical.y*k+T)/O,this.getElevation(E.tileID,v,T,k))}depthAtPoint(e){const i=new Uint8Array(4),s=this.painter.context,l=s.gl;return s.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,i),s.bindFramebuffer.set(null),(i[0]/16777216+i[1]/65536+i[2]/256+i[3])/256}getTerrainMesh(e){var i;const s=((i=this.painter.style.projection)===null||i===void 0?void 0:i.transitionState)>0,l=s&&e.canonical.y===0,h=s&&e.canonical.y===(1<<e.canonical.z)-1,f=`m_${l?"n":""}_${h?"s":""}`;if(this._meshCache[f])return this._meshCache[f];const _=this.painter.context,v=new o.ci,T=new o.aH,I=this.meshSize,E=o.Z/I,k=I*I;for(let re=0;re<=I;re++)for(let me=0;me<=I;me++)v.emplaceBack(me*E,re*E,0);for(let re=0;re<k;re+=I+1)for(let me=0;me<I;me++)T.emplaceBack(me+re,I+me+re+1,I+me+re+2),T.emplaceBack(me+re,I+me+re+2,me+re+1);const O=v.length,Z=O+(I+1),q=(I+1)*I,G=l?o.b9:0,W=l?0:1,X=h?o.ba:o.Z,Q=h?0:1;for(let re=0;re<=I;re++)v.emplaceBack(re*E,G,W);for(let re=0;re<=I;re++)v.emplaceBack(re*E,X,Q);for(let re=0;re<I;re++)T.emplaceBack(q+re,Z+re,Z+re+1),T.emplaceBack(q+re,Z+re+1,q+re+1),T.emplaceBack(0+re,O+re+1,O+re),T.emplaceBack(0+re,0+re+1,O+re+1);const ee=v.length,te=ee+2*(I+1);for(const re of[0,1])for(let me=0;me<=I;me++)for(const fe of[0,1])v.emplaceBack(re*o.Z,me*E,fe);for(let re=0;re<2*I;re+=2)T.emplaceBack(ee+re,ee+re+1,ee+re+3),T.emplaceBack(ee+re,ee+re+3,ee+re+2),T.emplaceBack(te+re,te+re+3,te+re+1),T.emplaceBack(te+re,te+re+2,te+re+3);const oe=new ma(_.createVertexBuffer(v,Ac.members),_.createIndexBuffer(T),o.aG.simpleSegment(0,0,v.length,T.length));return this._meshCache[f]=oe,oe}getMeshFrameDelta(e){return 2*Math.PI*o.br/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,i){var s;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(e,i);return(s=this.getMinMaxElevation(l).minElevation)!==null&&s!==void 0?s:0}getMinMaxElevation(e){const i=this.getTerrainData(e).tile,s={minElevation:null,maxElevation:null};return i&&i.dem&&(s.minElevation=i.dem.min*this.exaggeration,s.maxElevation=i.dem.max*this.exaggeration),s}_getOverscaledTileIDFromLngLatZoom(e,i){const s=o.$.fromLngLat(e.wrap()),l=(1<<i)*o.Z,h=s.x*l,f=s.y*l,_=Math.floor(h/o.Z),v=Math.floor(f/o.Z);return{tileID:new o.Y(i,0,i,_,v),mercatorX:h,mercatorY:f}}}class Oh{constructor(e,i,s){this._context=e,this._size=i,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const i=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new Ot(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),i.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),i.colorAttachment.set(s.texture),{id:e,fbo:i,texture:s,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(i=>e.id!==i),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const i of this._recentlyUsed)if(!this._objects[i].inUse)return this._objects[i];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const cr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ip{constructor(e,i){this.painter=e,this.terrain=i,this.pool=new Oh(e.context,30,i.sourceCache.tileSize*i.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,i){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(s=>!e._layers[s].isHidden(i)),this._coordsAscending={};for(const s in e.sourceCaches){this._coordsAscending[s]={};const l=e.sourceCaches[s].getVisibleCoordinates(),h=e.sourceCaches[s].getSource(),f=h instanceof st?h.terrainTileRanges:null;for(const _ of l){const v=this.terrain.sourceCache.getTerrainCoords(_,f);for(const T in v)this._coordsAscending[s][T]||(this._coordsAscending[s][T]=[]),this._coordsAscending[s][T].push(v[T])}}this._coordsAscendingStr={};for(const s of e._order){const l=e._layers[s],h=l.source;if(cr[l.type]&&!this._coordsAscendingStr[h]){this._coordsAscendingStr[h]={};for(const f in this._coordsAscending[h])this._coordsAscendingStr[h][f]=this._coordsAscending[h][f].map(_=>_.key).sort().join()}}for(const s of this._renderableTiles)for(const l in this._coordsAscendingStr){const h=this._coordsAscendingStr[l][s.tileID.key];h&&h!==s.rttCoords[l]&&(s.rtt=[])}}renderLayer(e,i){if(e.isHidden(this.painter.transform.zoom))return!1;const s=Object.assign(Object.assign({},i),{isRenderingToTexture:!0}),l=e.type,h=this.painter,f=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(cr[l]&&(this._prevType&&cr[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(e.id),!f))return!0;if(cr[this._prevType]||cr[l]&&f){this._prevType=l;const _=this._stacks.length-1,v=this._stacks[_]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(el(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[_]){const E=this.pool.getObjectForId(T.rtt[_].id);if(E.stamp===T.rtt[_].stamp){this.pool.useObject(E);continue}}const I=this.pool.getOrCreateFreeObject();this.pool.useObject(I),this.pool.stampObject(I),T.rtt[_]={id:I.id,stamp:I.stamp},h.context.bindFramebuffer.set(I.fbo.framebuffer),h.context.clear({color:o.b7.transparent,stencil:0}),h.currentStencilSource=void 0;for(let E=0;E<v.length;E++){const k=h.style._layers[v[E]],O=k.source?this._coordsAscending[k.source][T.tileID.key]:[T.tileID];h.context.viewport.set([0,0,I.fbo.width,I.fbo.height]),h._renderTileClippingMasks(k,O,!0),h.renderLayer(h,h.style.sourceCaches[k.source],k,O,s),k.source&&(T.rttCoords[k.source]=this._coordsAscendingStr[k.source][T.tileID.key])}}return el(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects(),cr[l]}return!1}}const eo={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},gi=le,Ti={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Qs,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:o.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},jh={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class to{constructor(e,i,s=!1){this.mousedown=h=>{this.startMove(h,ie.mousePos(this.element,h)),ie.addEventListener(window,"mousemove",this.mousemove),ie.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=h=>{this.move(h,ie.mousePos(this.element,h))},this.mouseup=h=>{this._rotatePitchHanlder.dragEnd(h),this.offTemp()},this.touchstart=h=>{h.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ie.touchPos(this.element,h.targetTouches)[0],this.startMove(h,this._startPos),ie.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),ie.addEventListener(window,"touchend",this.touchend))},this.touchmove=h=>{h.targetTouches.length!==1?this.reset():(this._lastPos=ie.touchPos(this.element,h.targetTouches)[0],this.move(h,this._lastPos))},this.touchend=h=>{h.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHanlder.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;const l=new zh;this._rotatePitchHanlder=new ms({clickTolerance:3,move:(h,f)=>{const _=i.getBoundingClientRect(),v=new o.P((_.bottom-_.top)/2,(_.right-_.left)/2);return{bearingDelta:o.ca(new o.P(h.x,f.y),f,v),pitchDelta:s?-.5*(f.y-h.y):void 0}},moveStateManager:l,enable:!0,assignEvents:()=>{}}),this.map=e,ie.addEventListener(i,"mousedown",this.mousedown),ie.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),ie.addEventListener(i,"touchcancel",this.reset)}startMove(e,i){this._rotatePitchHanlder.dragStart(e,i),ie.disableDrag()}move(e,i){const s=this.map,{bearingDelta:l,pitchDelta:h}=this._rotatePitchHanlder.dragMove(e,i)||{};l&&s.setBearing(s.getBearing()+l),h&&s.setPitch(s.getPitch()+h)}off(){const e=this.element;ie.removeEventListener(e,"mousedown",this.mousedown),ie.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),ie.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ie.removeEventListener(window,"touchend",this.touchend),ie.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){ie.enableDrag(),ie.removeEventListener(window,"mousemove",this.mousemove),ie.removeEventListener(window,"mouseup",this.mouseup),ie.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ie.removeEventListener(window,"touchend",this.touchend)}}let fn;function al(u,e,i){const s=new o.Q(u.lng,u.lat);if(u=new o.Q(u.lng,u.lat),e){const l=new o.Q(u.lng-360,u.lat),h=new o.Q(u.lng+360,u.lat),f=i.locationToScreenPoint(u).distSqr(e);i.locationToScreenPoint(l).distSqr(e)<f?u=l:i.locationToScreenPoint(h).distSqr(e)<f&&(u=h)}for(;Math.abs(u.lng-i.center.lng)>180;){const l=i.locationToScreenPoint(u);if(l.x>=0&&l.y>=0&&l.x<=i.width&&l.y<=i.height)break;u.lng>i.center.lng?u.lng-=360:u.lng+=360}return u.lng!==s.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(u))?u:s}const io={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function sl(u,e,i){const s=u.classList;for(const l in io)s.remove(`maplibregl-${i}-anchor-${l}`);s.add(`maplibregl-${i}-anchor-${e}`)}class Ma extends o.E{constructor(e){if(super(),this._onKeyPress=i=>{const s=i.code,l=i.charCode||i.keyCode;s!=="Space"&&s!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=i=>{const s=i.originalEvent.target,l=this._element;this._popup&&(s===l||l.contains(s))&&this.togglePopup()},this._update=i=>{var s;if(!this._map)return;const l=this._map.loaded()&&!this._map.isMoving();((i==null?void 0:i.type)==="terrain"||(i==null?void 0:i.type)==="render"&&!l)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?al(this._lngLat,this._flatPos,this._map.transform):(s=this._lngLat)===null||s===void 0?void 0:s.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let h="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?h=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let f="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?f="rotateX(0deg)":this._pitchAlignment==="map"&&(f=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||i&&i.type!=="moveend"||(this._pos=this._pos.round()),ie.setTransform(this._element,`${io[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${f} ${h}`),xe.frameAsync(new AbortController).then(()=>{this._updateOpacity(i&&i.type==="moveend")}).catch(()=>{})},this._onMove=i=>{if(!this._isDragging){const s=this._clickTolerance||this._map._clickTolerance;this._isDragging=i.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=i.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.l("dragstart"))),this.fire(new o.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.l("dragend")),this._state="inactive"},this._addDragHandler=i=>{this._element.contains(i.originalEvent.target)&&(i.preventDefault(),this._positionDelta=i.point.sub(this._pos).add(this._offset),this._pointerdownPos=i.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=o.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=ie.create("div");const i=ie.createNS("http://www.w3.org/2000/svg","svg"),s=41,l=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${s}px`),i.setAttributeNS(null,"width",`${l}px`),i.setAttributeNS(null,"viewBox",`0 0 ${l} ${s}`);const h=ie.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"stroke","none"),h.setAttributeNS(null,"stroke-width","1"),h.setAttributeNS(null,"fill","none"),h.setAttributeNS(null,"fill-rule","evenodd");const f=ie.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill-rule","nonzero");const _=ie.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const v=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const W of v){const X=ie.createNS("http://www.w3.org/2000/svg","ellipse");X.setAttributeNS(null,"opacity","0.04"),X.setAttributeNS(null,"cx","10.5"),X.setAttributeNS(null,"cy","5.80029008"),X.setAttributeNS(null,"rx",W.rx),X.setAttributeNS(null,"ry",W.ry),_.appendChild(X)}const T=ie.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill",this._color);const I=ie.createNS("http://www.w3.org/2000/svg","path");I.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),T.appendChild(I);const E=ie.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"opacity","0.25"),E.setAttributeNS(null,"fill","#000000");const k=ie.createNS("http://www.w3.org/2000/svg","path");k.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),E.appendChild(k);const O=ie.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(6.0, 7.0)"),O.setAttributeNS(null,"fill","#FFFFFF");const Z=ie.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(8.0, 8.0)");const q=ie.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#000000"),q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962");const G=ie.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#FFFFFF"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962"),Z.appendChild(q),Z.appendChild(G),f.appendChild(_),f.appendChild(T),f.appendChild(E),f.appendChild(O),f.appendChild(Z),i.appendChild(f),i.setAttributeNS(null,"height",s*this._scale+"px"),i.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(i),this._offset=o.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",i=>{i.preventDefault()}),this._element.addEventListener("mousedown",i=>{i.preventDefault()}),sl(this._element,this._anchor,"marker"),e&&e.className)for(const i of e.className.split(" "))this._element.classList.add(i);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),ie.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=o.Q.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const l=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var i,s;if(!(!((i=this._map)===null||i===void 0)&&i.terrain)){const E=this._map.transform.isLocationOccluded(this._lngLat)?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==E&&(this._element.style.opacity=E))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const l=this._map,h=l.terrain.depthAtPoint(this._pos),f=l.terrain.getElevationForLngLatZoom(this._lngLat,l.transform.tileZoom);if(l.transform.lngLatToCameraDepth(this._lngLat,f)-h<.006)return void(this._element.style.opacity=this._opacity);const _=-this._offset.y/l.transform.pixelsPerMeter,v=Math.sin(l.getPitch()*Math.PI/180)*_,T=l.terrain.depthAtPoint(new o.P(this._pos.x,this._pos.y-this._offset.y)),I=l.transform.lngLatToCameraDepth(this._lngLat,f+v)-T>.006;!((s=this._popup)===null||s===void 0)&&s.isOpen()&&I&&this._popup.remove(),this._element.style.opacity=I?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=o.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,i){return(this._opacity===void 0||e===void 0&&i===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),i!==void 0&&(this._opacityWhenCovered=i),this._map&&this._updateOpacity(!0),this}}const Rc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let _s=0,Ia=!1;const Dc={maxWidth:100,unit:"metric"};function ol(u,e,i){const s=i&&i.maxWidth||100,l=u._container.clientHeight/2,h=u._container.clientWidth/2,f=u.unproject([h-s/2,l]),_=u.unproject([h+s/2,l]),v=Math.round(u.project(_).x-u.project(f).x),T=Math.min(s,v,u._container.clientWidth),I=f.distanceTo(_);if(i&&i.unit==="imperial"){const E=3.2808*I;E>5280?Ca(e,T,E/5280,u._getUIString("ScaleControl.Miles")):Ca(e,T,E,u._getUIString("ScaleControl.Feet"))}else i&&i.unit==="nautical"?Ca(e,T,I/1852,u._getUIString("ScaleControl.NauticalMiles")):I>=1e3?Ca(e,T,I/1e3,u._getUIString("ScaleControl.Kilometers")):Ca(e,T,I,u._getUIString("ScaleControl.Meters"))}function Ca(u,e,i,s){const l=function(h){const f=Math.pow(10,`${Math.floor(h)}`.length-1);let _=h/f;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:function(v){const T=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*T)/T}(_),f*_}(i);u.style.width=e*(l/i)+"px",u.innerHTML=`${l} ${s}`}const Lc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Fc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ro(u){if(u){if(typeof u=="number"){const e=Math.round(Math.abs(u)/Math.SQRT2);return{center:new o.P(0,0),top:new o.P(0,u),"top-left":new o.P(e,e),"top-right":new o.P(-e,e),bottom:new o.P(0,-u),"bottom-left":new o.P(e,-e),"bottom-right":new o.P(-e,-e),left:new o.P(u,0),right:new o.P(-u,0)}}if(u instanceof o.P||Array.isArray(u)){const e=o.P.convert(u);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:o.P.convert(u.center||[0,0]),top:o.P.convert(u.top||[0,0]),"top-left":o.P.convert(u["top-left"]||[0,0]),"top-right":o.P.convert(u["top-right"]||[0,0]),bottom:o.P.convert(u.bottom||[0,0]),"bottom-left":o.P.convert(u["bottom-left"]||[0,0]),"bottom-right":o.P.convert(u["bottom-right"]||[0,0]),left:o.P.convert(u.left||[0,0]),right:o.P.convert(u.right||[0,0])}}return ro(new o.P(0,0))}const Bc=le;S.AJAXError=o.cm,S.Event=o.l,S.Evented=o.E,S.LngLat=o.Q,S.MercatorCoordinate=o.$,S.Point=o.P,S.addProtocol=o.cn,S.config=o.a,S.removeProtocol=o.co,S.AttributionControl=Je,S.BoxZoomHandler=Pa,S.CanvasSource=qt,S.CooperativeGesturesHandler=il,S.DoubleClickZoomHandler=Ec,S.DragPanHandler=En,S.DragRotateHandler=ti,S.EdgeInsets=oi,S.FullscreenControl=class extends o.E{constructor(u={}){super(),this._onFullscreenChange=()=>{var e;let i=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=i==null?void 0:i.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)i=i.shadowRoot.fullscreenElement;i===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:o.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){ie.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=ie.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);ie.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new o.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new o.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},S.GeoJSONSource=Pt,S.GeolocateControl=class extends o.E{constructor(u){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new o.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new o.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{const i=new o.Q(e.coords.longitude,e.coords.latitude),s=e.coords.accuracy,l=this._map.getBearing(),h=o.e({bearing:l},this.options.fitBoundsOptions),f=Ve.fromLngLat(i,s);this._map.fitBounds(f,h,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const i=new o.Q(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Ia)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new o.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=ie.create("button","maplibregl-ctrl-geolocate",this._container),ie.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){o.w("Geolocation support is not available so the GeolocateControl will be disabled.");const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{const i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ie.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ma({element:this._dotElement}),this._circleElement=ie.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ma({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",i=>{i.geolocateSource||this._watchState!=="ACTIVE_LOCK"||i.originalEvent&&i.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new o.l("trackuserlocationend")),this.fire(new o.l("userlocationlostfocus")))})}},this.options=o.e({},Rc,u)}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return o._(this,arguments,void 0,function*(e=!1){if(fn!==void 0&&!e)return fn;if(window.navigator.permissions===void 0)return fn=!!window.navigator.geolocation,fn;try{fn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{fn=!!window.navigator.geolocation}return fn})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),ie.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,_s=0,Ia=!1}_isOutOfMapMaxBounds(u){const e=this._map.getMaxBounds(),i=u.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),e=u.getSouthEast(),i=u.getNorthEast(),s=e.distanceTo(i),l=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return o.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new o.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":_s--,Ia=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new o.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.l("trackuserlocationstart")),this.fire(new o.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),_s++,_s>1?(u={maximumAge:6e5,timeout:0},Ia=!0):(u=this.options.positionOptions,Ia=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},S.GlobeControl=class{constructor(){this._toggleProjection=()=>{var u;const e=(u=this._map.getProjection())===null||u===void 0?void 0:u.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var u;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((u=this._map.getProjection())===null||u===void 0?void 0:u.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=ie.create("button","maplibregl-ctrl-globe",this._container),ie.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){ie.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},S.Hash=Tc,S.ImageSource=st,S.KeyboardHandler=Ic,S.LngLatBounds=Ve,S.LogoControl=nt,S.Map=class extends pn{constructor(u){var e,i;o.cj.mark(o.ck.create);const s=Object.assign(Object.assign(Object.assign({},Ti),u),{canvasContextAttributes:Object.assign(Object.assign({},Ti.canvasContextAttributes),u.canvasContextAttributes)});if(s.minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const l=new li,h=new _r;if(s.minZoom!==void 0&&l.setMinZoom(s.minZoom),s.maxZoom!==void 0&&l.setMaxZoom(s.maxZoom),s.minPitch!==void 0&&l.setMinPitch(s.minPitch),s.maxPitch!==void 0&&l.setMaxPitch(s.maxPitch),s.renderWorldCopies!==void 0&&l.setRenderWorldCopies(s.renderWorldCopies),super(l,h,{bearingSnap:s.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new nl,this._controls=[],this._mapId=o.a4(),this._contextLost=_=>{_.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new o.l("webglcontextlost",{originalEvent:_}))},this._contextRestored=_=>{this._setupPainter(),this.resize(),this._update(),this.fire(new o.l("webglcontextrestored",{originalEvent:_}))},this._onMapScroll=_=>{if(_.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._maxTileCacheZoomLevels=s.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},s.canvasContextAttributes),this._trackResize=s.trackResize===!0,this._bearingSnap=s.bearingSnap,this._centerClampedToGround=s.centerClampedToGround,this._refreshExpiredTiles=s.refreshExpiredTiles===!0,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions===!0,this._collectResourceTiming=s.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},eo),s.locale),this._clickTolerance=s.clickTolerance,this._overridePixelRatio=s.pixelRatio,this._maxCanvasSize=s.maxCanvasSize,this.transformCameraUpdate=s.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=s.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=Jt.addThrottleControl(()=>this.isMoving()),this._requestManager=new pi(s.transformRequest),typeof s.container=="string"){if(this._container=document.getElementById(s.container),!this._container)throw new Error(`Container '${s.container}' not found.`)}else{if(!(s.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let _=!1;const v=wc(T=>{this._trackResize&&!this._removed&&(this.resize(T),this.redraw())},50);this._resizeObserver=new ResizeObserver(T=>{_?v(T):_=!0}),this._resizeObserver.observe(this._container)}this.handlers=new tp(this,s),this._hash=s.hash&&new Tc(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,elevation:s.elevation,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,roll:s.roll}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,o.e({},s.fitBoundsOptions,{duration:0}))));const f=typeof s.style=="string"||((i=(e=s.style)===null||e===void 0?void 0:e.projection)===null||i===void 0?void 0:i.type)!=="globe";this.resize(null,f),this._localIdeographFontFamily=s.localIdeographFontFamily,this._validateStyle=s.validateStyle,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Je(typeof s.attributionControl=="boolean"?void 0:s.attributionControl)),s.maplibreLogo&&this.addControl(new nt,s.logoPosition),this.on("style.load",()=>{if(f||this._resizeTransform(),this.transform.unmodified){const _=o.O(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(_)}}),this.on("data",_=>{this._update(_.dataType==="style"),this.fire(new o.l(`${_.dataType}data`,_))}),this.on("dataloading",_=>{this.fire(new o.l(`${_.dataType}dataloading`,_))}),this.on("dataabort",_=>{this.fire(new o.l("sourcedataabort",_))})}_getMapId(){return this._mapId}addControl(u,e){if(e===void 0&&(e=u.getDefaultPosition?u.getDefaultPosition():"top-right"),!u||!u.onAdd)return this.fire(new o.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const i=u.onAdd(this);this._controls.push(u);const s=this._controlPositions[e];return e.indexOf("bottom")!==-1?s.insertBefore(i,s.firstChild):s.appendChild(i),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new o.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(u);return e>-1&&this._controls.splice(e,1),u.onRemove(this),this}hasControl(u){return this._controls.indexOf(u)>-1}calculateCameraOptionsFromTo(u,e,i,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,e,i,s)}resize(u,e=!0){const[i,s]=this._containerDimensions(),l=this._getClampedPixelRatio(i,s);if(this._resizeCanvas(i,s,l),this.painter.resize(i,s,l),this.painter.overLimit()){const f=this.painter.context.gl;this._maxCanvasSize=[f.drawingBufferWidth,f.drawingBufferHeight];const _=this._getClampedPixelRatio(i,s);this._resizeCanvas(i,s,_),this.painter.resize(i,s,_)}this._resizeTransform(e);const h=!this._moving;return h&&(this.stop(),this.fire(new o.l("movestart",u)).fire(new o.l("move",u))),this.fire(new o.l("resize",u)),h&&this.fire(new o.l("moveend",u)),this}_resizeTransform(u=!0){var e;const[i,s]=this._containerDimensions();this.transform.resize(i,s,u),(e=this._requestedCameraState)===null||e===void 0||e.resize(i,s,u)}_getClampedPixelRatio(u,e){const{0:i,1:s}=this._maxCanvasSize,l=this.getPixelRatio(),h=u*l,f=e*l;return Math.min(h>i?i/h:1,f>s?s/f:1)*l}getPixelRatio(){var u;return(u=this._overridePixelRatio)!==null&&u!==void 0?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(Ve.convert(u)),this._update()}setMinZoom(u){if((u=u??-2)>=-2&&u<=this.transform.maxZoom)return this.transform.setMinZoom(u),this._update(),this.getZoom()<u&&this.setZoom(u),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(u){if((u=u??22)>=this.transform.minZoom)return this.transform.setMaxZoom(u),this._update(),this.getZoom()>u&&this.setZoom(u),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(u){if((u=u??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(u>=0&&u<=this.transform.maxPitch)return this.transform.setMinPitch(u),this._update(),this.getPitch()<u&&this.setPitch(u),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(u){if((u=u??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(u>=this.transform.minPitch)return this.transform.setMaxPitch(u),this._update(),this.getPitch()>u&&this.setPitch(u),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.setRenderWorldCopies(u),this._update()}project(u){return this.transform.locationToScreenPoint(o.Q.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.screenPointToLocation(o.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||((u=this.handlers)===null||u===void 0?void 0:u.isMoving())}isZooming(){var u;return this._zooming||((u=this.handlers)===null||u===void 0?void 0:u.isZooming())}isRotating(){var u;return this._rotating||((u=this.handlers)===null||u===void 0?void 0:u.isRotating())}_createDelegatedListener(u,e,i){if(u==="mouseenter"||u==="mouseover"){let s=!1;return{layers:e,listener:i,delegates:{mousemove:h=>{const f=e.filter(v=>this.getLayer(v)),_=f.length!==0?this.queryRenderedFeatures(h.point,{layers:f}):[];_.length?s||(s=!0,i.call(this,new er(u,this,h.originalEvent,{features:_}))):s=!1},mouseout:()=>{s=!1}}}}if(u==="mouseleave"||u==="mouseout"){let s=!1;return{layers:e,listener:i,delegates:{mousemove:f=>{const _=e.filter(v=>this.getLayer(v));(_.length!==0?this.queryRenderedFeatures(f.point,{layers:_}):[]).length?s=!0:s&&(s=!1,i.call(this,new er(u,this,f.originalEvent)))},mouseout:f=>{s&&(s=!1,i.call(this,new er(u,this,f.originalEvent)))}}}}{const s=l=>{const h=e.filter(_=>this.getLayer(_)),f=h.length!==0?this.queryRenderedFeatures(l.point,{layers:h}):[];f.length&&(l.features=f,i.call(this,l),delete l.features)};return{layers:e,listener:i,delegates:{[u]:s}}}}_saveDelegatedListener(u,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(e)}_removeDelegatedListener(u,e,i){if(!this._delegatedListeners||!this._delegatedListeners[u])return;const s=this._delegatedListeners[u];for(let l=0;l<s.length;l++){const h=s[l];if(h.listener===i&&h.layers.length===e.length&&h.layers.every(f=>e.includes(f))){for(const f in h.delegates)this.off(f,h.delegates[f]);return void s.splice(l,1)}}}on(u,e,i){if(i===void 0)return super.on(u,e);const s=typeof e=="string"?[e]:e,l=this._createDelegatedListener(u,s,i);this._saveDelegatedListener(u,l);for(const h in l.delegates)this.on(h,l.delegates[h]);return{unsubscribe:()=>{this._removeDelegatedListener(u,s,i)}}}once(u,e,i){if(i===void 0)return super.once(u,e);const s=typeof e=="string"?[e]:e,l=this._createDelegatedListener(u,s,i);for(const h in l.delegates){const f=l.delegates[h];l.delegates[h]=(..._)=>{this._removeDelegatedListener(u,s,i),f(..._)}}this._saveDelegatedListener(u,l);for(const h in l.delegates)this.once(h,l.delegates[h]);return this}off(u,e,i){return i===void 0?super.off(u,e):(this._removeDelegatedListener(u,typeof e=="string"?[e]:e,i),this)}queryRenderedFeatures(u,e){if(!this.style)return[];let i;const s=u instanceof o.P||Array.isArray(u),l=s?u:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(s?{}:u)||{},l instanceof o.P||typeof l[0]=="number")i=[o.P.convert(l)];else{const h=o.P.convert(l[0]),f=o.P.convert(l[1]);i=[h,new o.P(f.x,h.y),f,new o.P(h.x,f.y),h]}return this.style.queryRenderedFeatures(i,e,this.transform)}querySourceFeatures(u,e){return this.style.querySourceFeatures(u,e)}setStyle(u,e){return(e=o.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&u?(this._diffStyle(u,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(u,e))}setTransformRequest(u){return this._requestManager.setTransformRequest(u),this}_getUIString(u){const e=this._locale[u];if(e==null)throw new Error(`Missing UI string '${u}'`);return e}_updateStyle(u,e){var i,s;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(u,e));const l=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new ts(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof u=="string"?this.style.loadURL(u,e,l):this.style.loadJSON(u,e,l),this):((s=(i=this.style)===null||i===void 0?void 0:i.projection)===null||s===void 0||s.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ts(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,e){if(typeof u=="string"){const i=this._requestManager.transformRequest(u,"Style");o.j(i,new AbortController).then(s=>{this._updateDiff(s.data,e)}).catch(s=>{s&&this.fire(new o.k(s))})}else typeof u=="object"&&this._updateDiff(u,e)}_updateDiff(u,e){try{this.style.setState(u,e)&&this._update(!0)}catch(i){o.w(`Unable to perform style diff: ${i.message||i.error||i}. Rebuilding the style from scratch.`),this._updateStyle(u,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.w("There is no style added to the map.")}addSource(u,e){return this._lazyInitEmptyStyle(),this.style.addSource(u,e),this._update(!0)}isSourceLoaded(u){const e=this.style&&this.style.sourceCaches[u];if(e!==void 0)return e.loaded();this.fire(new o.k(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const e=this.style.sourceCaches[u.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);this.terrain===null&&e.reload();for(const i in this.style._layers){const s=this.style._layers[i];s.type==="hillshade"&&s.source===u.source&&o.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new xr(this.painter,e,u),this.painter.renderToTexture=new ip(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=i=>{var s;i.dataType==="style"?this.terrain.sourceCache.freeRtt():i.dataType==="source"&&i.tile&&(i.sourceId!==u.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((s=i.source)===null||s===void 0?void 0:s.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(i.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new o.l("terrain",{terrain:u})),this}getTerrain(){var u,e;return(e=(u=this.terrain)===null||u===void 0?void 0:u.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const e in u){const i=u[e]._tiles;for(const s in i){const l=i[s];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,e,i={}){const{pixelRatio:s=1,sdf:l=!1,stretchX:h,stretchY:f,content:_,textFitWidth:v,textFitHeight:T}=i;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||o.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new o.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:I,height:E,data:k}=e,O=e;return this.style.addImage(u,{data:new o.R({width:I,height:E},new Uint8Array(k)),pixelRatio:s,stretchX:h,stretchY:f,content:_,textFitWidth:v,textFitHeight:T,sdf:l,version:0,userImage:O}),O.onAdd&&O.onAdd(this,u),this}}{const{width:I,height:E,data:k}=xe.getImageData(e);this.style.addImage(u,{data:new o.R({width:I,height:E},k),pixelRatio:s,stretchX:h,stretchY:f,content:_,textFitWidth:v,textFitHeight:T,sdf:l,version:0})}}updateImage(u,e){const i=this.style.getImage(u);if(!i)return this.fire(new o.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=e instanceof HTMLImageElement||o.b(e)?xe.getImageData(e):e,{width:l,height:h,data:f}=s;if(l===void 0||h===void 0)return this.fire(new o.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==i.data.width||h!==i.data.height)return this.fire(new o.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const _=!(e instanceof HTMLImageElement||o.b(e));return i.data.replace(f,_),this.style.updateImage(u,i),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new o.k(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u){return Jt.getImage(this._requestManager.transformRequest(u,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(u,e){return this._lazyInitEmptyStyle(),this.style.addLayer(u,e),this._update(!0)}moveLayer(u,e){return this.style.moveLayer(u,e),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,e,i){return this.style.setLayerZoomRange(u,e,i),this._update(!0)}setFilter(u,e,i={}){return this.style.setFilter(u,e,i),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,e,i,s={}){return this.style.setPaintProperty(u,e,i,s),this._update(!0)}getPaintProperty(u,e){return this.style.getPaintProperty(u,e)}setLayoutProperty(u,e,i,s={}){return this.style.setLayoutProperty(u,e,i,s),this._update(!0)}getLayoutProperty(u,e){return this.style.getLayoutProperty(u,e)}setGlyphs(u,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,e,i,s=>{s||this._update(!0)}),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,e,i=>{i||this._update(!0)}),this}setLight(u,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(u,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(u,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(u,e){return this.style.setFeatureState(u,e),this._update()}removeFeatureState(u,e){return this.style.removeFeatureState(u,e),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,e=0;return this._container&&(u=this._container.clientWidth||400,e=this._container.clientHeight||300),[u,e]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const e=this._canvasContainer=ie.create("div","maplibregl-canvas-container",u);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=ie.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const i=this._containerDimensions(),s=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],s);const l=this._controlContainer=ie.create("div","maplibregl-control-container",u),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(f=>{h[f]=ie.create("div",`maplibregl-ctrl-${f} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(u,e,i){this._canvas.width=Math.floor(i*u),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const u=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{e={requestedAttributes:u},s&&(e.statusMessage=s.statusMessage,e.type=s.type)},{once:!0});let i=null;if(i=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,u):this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u),!i){const s="Failed to initialize WebGL";throw e?(e.message=s,new Error(JSON.stringify(e))):new Error(s)}this.painter=new Sh(i,this.transform),De.testSupport(i)}migrateProjection(u,e){super.migrateProjection(u,e),this.painter.transform=u,this.fire(new o.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){var e,i,s,l,h;const f=this._idleTriggered?this._fadeDuration:0,_=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let v=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const E=this.transform.zoom,k=xe.now();this.style.zoomHistory.update(E,k);const O=new o.C(E,{now:k,fadeDuration:f,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Z=O.crossFadingFactor();Z===1&&Z===this._crossFadingFactor||(v=!0,this._crossFadingFactor=Z),this.style.update(O)}const T=((i=this.style.projection)===null||i===void 0?void 0:i.transitionState)>0!==_;(s=this.style.projection)===null||s===void 0||s.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((l=this.style.projection)===null||l===void 0?void 0:l.transitionState,(h=this.style.projection)===null||h===void 0?void 0:h.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||T)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,f,this._crossSourceCollisions,T),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:f,showPadding:this.showPadding}),this.fire(new o.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.cj.mark(o.ck.load),this.fire(new o.l("load"))),this.style&&(this.style.hasTransitions()||v)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const I=this._sourcesDirty||this._styleDirty||this._placementDirty;return I||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.l("idle")),!this._loaded||this._fullyLoaded||I||(this._fullyLoaded=!0,o.cj.mark(o.ck.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const i of this._controls)i.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Jt.removeThrottleControl(this._imageQueueHandle),(u=this._resizeObserver)===null||u===void 0||u.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ie.remove(this._canvasContainer),ie.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),o.cj.clearMetrics(),this._removed=!0,this.fire(new o.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,xe.frame(this._frameRequest,u=>{o.cj.frame(u),this._frameRequest=null;try{this._render(u)}catch(e){if(!o.cl(e)&&!function(i){return i.message===vh}(e))throw e}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return gi}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(u){return this._lazyInitEmptyStyle(),this.style.setProjection(u),this._update(!0)}},S.MapMouseEvent=er,S.MapTouchEvent=fs,S.MapWheelEvent=Ur,S.Marker=Ma,S.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const e=this._map.getZoom(),i=e===this._map.getMaxZoom(),s=e===this._map.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,i)=>{const s=this._map._getUIString(`NavigationControl.${i}`);e.title=s,e.setAttribute("aria-label",s)},this.options=o.e({},jh,u),this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),ie.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),ie.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=ie.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new to(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ie.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(u,e){const i=ie.create("button",u,this._container);return i.type="button",i.addEventListener("click",e),i}},S.Popup=class extends o.E{constructor(u){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:void 0)},this.remove=()=>(this._content&&ie.remove(this._content),this._container&&(ie.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new o.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var i;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=ie.create("div","maplibregl-popup",this._map.getContainer()),this._tip=ie.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const _ of this.options.className.split(" "))this._container.classList.add(_);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?al(this._lngLat,this._flatPos,this._map.transform):(i=this._lngLat)===null||i===void 0?void 0:i.wrap(),this._trackPointer&&!e)return;const s=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let l=this.options.anchor;const h=ro(this.options.offset);if(!l){const _=this._container.offsetWidth,v=this._container.offsetHeight;let T;T=s.y+h.bottom.y<v?["top"]:s.y>this._map.transform.height-v?["bottom"]:[],s.x<_/2?T.push("left"):s.x>this._map.transform.width-_/2&&T.push("right"),l=T.length===0?"bottom":T.join("-")}let f=s.add(h[l]);this.options.subpixelPositioning||(f=f.round()),ie.setTransform(this._container,`${io[l]} translate(${f.x}px,${f.y}px)`),sl(this._container,l,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=o.e(Object.create(Lc),u)}addTo(u){return this._map&&this.remove(),this._map=u,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new o.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=o.Q.convert(u),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const e=document.createDocumentFragment(),i=document.createElement("body");let s;for(i.innerHTML=u;s=i.firstChild,s;)e.appendChild(s);return this.setDOMContent(e)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=ie.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){return this._container&&this._container.classList.add(u),this}removeClassName(u){return this._container&&this._container.classList.remove(u),this}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}setSubpixelPositioning(u){this.options.subpixelPositioning=u}_createCloseButton(){this.options.closeButton&&(this._closeButton=ie.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(Fc);u&&u.focus()}},S.RasterDEMTileSource=bi,S.RasterTileSource=Gt,S.ScaleControl=class{constructor(u){this._onMove=()=>{ol(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,ol(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Dc),u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ie.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},S.ScrollZoomHandler=Fh,S.Style=ts,S.TerrainControl=class{constructor(u){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=u}onAdd(u){return this._map=u,this._container=ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=ie.create("button","maplibregl-ctrl-terrain",this._container),ie.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ie.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},S.TwoFingersTouchPitchHandler=Lh,S.TwoFingersTouchRotateHandler=Dh,S.TwoFingersTouchZoomHandler=wt,S.TwoFingersTouchZoomRotateHandler=Ys,S.VectorTileSource=Zt,S.VideoSource=It,S.addSourceType=(u,e)=>o._(void 0,void 0,void 0,function*(){if(fi(u))throw new Error(`A source type called "${u}" already exists.`);((i,s)=>{qi[i]=s})(u,e)}),S.clearPrewarmedResources=function(){const u=Ji;u&&(u.isPreloaded()&&u.numActive()===1?(u.release($n),Ji=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},S.createTileMesh=Ao,S.getMaxParallelImageRequests=function(){return o.a.MAX_PARALLEL_IMAGE_REQUESTS},S.getRTLTextPluginStatus=function(){return Xr().getRTLTextPluginStatus()},S.getVersion=function(){return Bc},S.getWorkerCount=function(){return jr.workerCount},S.getWorkerUrl=function(){return o.a.WORKER_URL},S.importScriptInWorkers=function(u){return kr().broadcast("IS",u)},S.prewarm=function(){Tn().acquire($n)},S.setMaxParallelImageRequests=function(u){o.a.MAX_PARALLEL_IMAGE_REQUESTS=u},S.setRTLTextPlugin=function(u,e){return Xr().setRTLTextPlugin(u,e)},S.setWorkerCount=function(u){jr.workerCount=u},S.setWorkerUrl=function(u){o.a.WORKER_URL=u}});var D=b;return D})}(zu)),zu.exports}var Sy=Py();const Sd=wy(Sy);class Wf{constructor(m,b,C,A,D){Ts(this,"bounds1");Ts(this,"bounds2");Ts(this,"getBounds",(m,b,C,A)=>new Sd.LngLatBounds([m,b],[C,A]));Ts(this,"contains",(m,b)=>this.bounds1.contains([b,m])||this.bounds2.contains([b,m]));const S=m.unproject([b,C]),o=m.unproject([A,D]);if(S.lng<-180){this.bounds1=this.getBounds(-180,S.lat,o.lng,o.lat),this.bounds2=this.getBounds(S.wrap().lng,S.lat,180,o.lat);return}if(o.lng>180){this.bounds1=this.getBounds(S.lng,S.lat,180,o.lat),this.bounds2=this.getBounds(-180,S.lat,o.wrap().lng,o.lat);return}this.bounds1=this.getBounds(S.lng,S.lat,o.lng,o.lat),this.bounds2=this.getBounds(0,0,0,0)}}const My={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(120, 120, 120, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(128, 128, 128, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(56, 56, 56, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(153, 153, 153, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(104, 104, 104, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(56, 56, 56, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(136, 136, 136, 1)","fill-outline-color":"rgba(102, 102, 102, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(50, 50, 50, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(52, 52, 52, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(88, 88, 88, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20],"line-color":"rgba(102, 102, 102, 1)"}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23],"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(51, 51, 51, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(51, 51, 51, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(255, 255, 255, 1)","text-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]},Iy={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(220, 220, 220, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(228, 228, 228, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(156, 156, 156, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(253, 253, 253, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(204, 204, 204, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(156, 156, 156, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(236, 236, 236, 1)","fill-outline-color":"rgba(202, 202, 202, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(185, 185, 185)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(150, 150, 150, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(152, 152, 152, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(188, 188, 188)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(185, 185, 185)","line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23]}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":2}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(151, 151, 151, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(151, 151, 151, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1.5}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(0, 0, 0, 1)","text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]};var Nt;(function(y){y.assertEqual=A=>A;function m(A){}y.assertIs=m;function b(A){throw new Error}y.assertNever=b,y.arrayToEnum=A=>{const D={};for(const S of A)D[S]=S;return D},y.getValidEnumValues=A=>{const D=y.objectKeys(A).filter(o=>typeof A[A[o]]!="number"),S={};for(const o of D)S[o]=A[o];return y.objectValues(S)},y.objectValues=A=>y.objectKeys(A).map(function(D){return A[D]}),y.objectKeys=typeof Object.keys=="function"?A=>Object.keys(A):A=>{const D=[];for(const S in A)Object.prototype.hasOwnProperty.call(A,S)&&D.push(S);return D},y.find=(A,D)=>{for(const S of A)if(D(S))return S},y.isInteger=typeof Number.isInteger=="function"?A=>Number.isInteger(A):A=>typeof A=="number"&&isFinite(A)&&Math.floor(A)===A;function C(A,D=" | "){return A.map(S=>typeof S=="string"?`'${S}'`:S).join(D)}y.joinValues=C,y.jsonStringifyReplacer=(A,D)=>typeof D=="bigint"?D.toString():D})(Nt||(Nt={}));var Md;(function(y){y.mergeShapes=(m,b)=>({...m,...b})})(Md||(Md={}));const Ke=Nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ua=y=>{switch(typeof y){case"undefined":return Ke.undefined;case"string":return Ke.string;case"number":return isNaN(y)?Ke.nan:Ke.number;case"boolean":return Ke.boolean;case"function":return Ke.function;case"bigint":return Ke.bigint;case"symbol":return Ke.symbol;case"object":return Array.isArray(y)?Ke.array:y===null?Ke.null:y.then&&typeof y.then=="function"&&y.catch&&typeof y.catch=="function"?Ke.promise:typeof Map<"u"&&y instanceof Map?Ke.map:typeof Set<"u"&&y instanceof Set?Ke.set:typeof Date<"u"&&y instanceof Date?Ke.date:Ke.object;default:return Ke.unknown}},Oe=Nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Cy=y=>JSON.stringify(y,null,2).replace(/"([^"]+)":/g,"$1:");class qr extends Error{get errors(){return this.issues}constructor(m){super(),this.issues=[],this.addIssue=C=>{this.issues=[...this.issues,C]},this.addIssues=(C=[])=>{this.issues=[...this.issues,...C]};const b=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,b):this.__proto__=b,this.name="ZodError",this.issues=m}format(m){const b=m||function(D){return D.message},C={_errors:[]},A=D=>{for(const S of D.issues)if(S.code==="invalid_union")S.unionErrors.map(A);else if(S.code==="invalid_return_type")A(S.returnTypeError);else if(S.code==="invalid_arguments")A(S.argumentsError);else if(S.path.length===0)C._errors.push(b(S));else{let o=C,le=0;for(;le<S.path.length;){const ue=S.path[le];le===S.path.length-1?(o[ue]=o[ue]||{_errors:[]},o[ue]._errors.push(b(S))):o[ue]=o[ue]||{_errors:[]},o=o[ue],le++}}};return A(this),C}static assert(m){if(!(m instanceof qr))throw new Error(`Not a ZodError: ${m}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Nt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(m=b=>b.message){const b={},C=[];for(const A of this.issues)A.path.length>0?(b[A.path[0]]=b[A.path[0]]||[],b[A.path[0]].push(m(A))):C.push(m(A));return{formErrors:C,fieldErrors:b}}get formErrors(){return this.flatten()}}qr.create=y=>new qr(y);const xo=(y,m)=>{let b;switch(y.code){case Oe.invalid_type:y.received===Ke.undefined?b="Required":b=`Expected ${y.expected}, received ${y.received}`;break;case Oe.invalid_literal:b=`Invalid literal value, expected ${JSON.stringify(y.expected,Nt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:b=`Unrecognized key(s) in object: ${Nt.joinValues(y.keys,", ")}`;break;case Oe.invalid_union:b="Invalid input";break;case Oe.invalid_union_discriminator:b=`Invalid discriminator value. Expected ${Nt.joinValues(y.options)}`;break;case Oe.invalid_enum_value:b=`Invalid enum value. Expected ${Nt.joinValues(y.options)}, received '${y.received}'`;break;case Oe.invalid_arguments:b="Invalid function arguments";break;case Oe.invalid_return_type:b="Invalid function return type";break;case Oe.invalid_date:b="Invalid date";break;case Oe.invalid_string:typeof y.validation=="object"?"includes"in y.validation?(b=`Invalid input: must include "${y.validation.includes}"`,typeof y.validation.position=="number"&&(b=`${b} at one or more positions greater than or equal to ${y.validation.position}`)):"startsWith"in y.validation?b=`Invalid input: must start with "${y.validation.startsWith}"`:"endsWith"in y.validation?b=`Invalid input: must end with "${y.validation.endsWith}"`:Nt.assertNever(y.validation):y.validation!=="regex"?b=`Invalid ${y.validation}`:b="Invalid";break;case Oe.too_small:y.type==="array"?b=`Array must contain ${y.exact?"exactly":y.inclusive?"at least":"more than"} ${y.minimum} element(s)`:y.type==="string"?b=`String must contain ${y.exact?"exactly":y.inclusive?"at least":"over"} ${y.minimum} character(s)`:y.type==="number"?b=`Number must be ${y.exact?"exactly equal to ":y.inclusive?"greater than or equal to ":"greater than "}${y.minimum}`:y.type==="date"?b=`Date must be ${y.exact?"exactly equal to ":y.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(y.minimum))}`:b="Invalid input";break;case Oe.too_big:y.type==="array"?b=`Array must contain ${y.exact?"exactly":y.inclusive?"at most":"less than"} ${y.maximum} element(s)`:y.type==="string"?b=`String must contain ${y.exact?"exactly":y.inclusive?"at most":"under"} ${y.maximum} character(s)`:y.type==="number"?b=`Number must be ${y.exact?"exactly":y.inclusive?"less than or equal to":"less than"} ${y.maximum}`:y.type==="bigint"?b=`BigInt must be ${y.exact?"exactly":y.inclusive?"less than or equal to":"less than"} ${y.maximum}`:y.type==="date"?b=`Date must be ${y.exact?"exactly":y.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(y.maximum))}`:b="Invalid input";break;case Oe.custom:b="Invalid input";break;case Oe.invalid_intersection_types:b="Intersection results could not be merged";break;case Oe.not_multiple_of:b=`Number must be a multiple of ${y.multipleOf}`;break;case Oe.not_finite:b="Number must be finite";break;default:b=m.defaultError,Nt.assertNever(y)}return{message:b}};let Hf=xo;function ky(y){Hf=y}function Ru(){return Hf}const Du=y=>{const{data:m,path:b,errorMaps:C,issueData:A}=y,D=[...b,...A.path||[]],S={...A,path:D};if(A.message!==void 0)return{...A,path:D,message:A.message};let o="";const le=C.filter(ue=>!!ue).slice().reverse();for(const ue of le)o=ue(S,{data:m,defaultError:o}).message;return{...A,path:D,message:o}},Ey=[];function qe(y,m){const b=Ru(),C=Du({issueData:m,data:y.data,path:y.path,errorMaps:[y.common.contextualErrorMap,y.schemaErrorMap,b,b===xo?void 0:xo].filter(A=>!!A)});y.common.issues.push(C)}class hr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(m,b){const C=[];for(const A of b){if(A.status==="aborted")return dt;A.status==="dirty"&&m.dirty(),C.push(A.value)}return{status:m.value,value:C}}static async mergeObjectAsync(m,b){const C=[];for(const A of b){const D=await A.key,S=await A.value;C.push({key:D,value:S})}return hr.mergeObjectSync(m,C)}static mergeObjectSync(m,b){const C={};for(const A of b){const{key:D,value:S}=A;if(D.status==="aborted"||S.status==="aborted")return dt;D.status==="dirty"&&m.dirty(),S.status==="dirty"&&m.dirty(),D.value!=="__proto__"&&(typeof S.value<"u"||A.alwaysSet)&&(C[D.value]=S.value)}return{status:m.value,value:C}}}const dt=Object.freeze({status:"aborted"}),vo=y=>({status:"dirty",value:y}),Sr=y=>({status:"valid",value:y}),Id=y=>y.status==="aborted",Cd=y=>y.status==="dirty",Ms=y=>y.status==="valid",El=y=>typeof Promise<"u"&&y instanceof Promise;function Lu(y,m,b,C){if(typeof m=="function"?y!==m||!0:!m.has(y))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m.get(y)}function Xf(y,m,b,C,A){if(typeof m=="function"?y!==m||!0:!m.has(y))throw new TypeError("Cannot write private member to an object whose class did not declare it");return m.set(y,b),b}typeof SuppressedError=="function"&&SuppressedError;var rt;(function(y){y.errToObj=m=>typeof m=="string"?{message:m}:m||{},y.toString=m=>typeof m=="string"?m:m==null?void 0:m.message})(rt||(rt={}));var Al,zl;class Zn{constructor(m,b,C,A){this._cachedPath=[],this.parent=m,this.data=b,this._path=C,this._key=A}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Kf=(y,m)=>{if(Ms(m))return{success:!0,data:m.value};if(!y.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const b=new qr(y.common.issues);return this._error=b,this._error}}};function xt(y){if(!y)return{};const{errorMap:m,invalid_type_error:b,required_error:C,description:A}=y;if(m&&(b||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return m?{errorMap:m,description:A}:{errorMap:(S,o)=>{var le,ue;const{message:_e}=y;return S.code==="invalid_enum_value"?{message:_e??o.defaultError}:typeof o.data>"u"?{message:(le=_e??C)!==null&&le!==void 0?le:o.defaultError}:S.code!=="invalid_type"?{message:o.defaultError}:{message:(ue=_e??b)!==null&&ue!==void 0?ue:o.defaultError}},description:A}}class Mt{get description(){return this._def.description}_getType(m){return ua(m.data)}_getOrReturnCtx(m,b){return b||{common:m.parent.common,data:m.data,parsedType:ua(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}_processInputParams(m){return{status:new hr,ctx:{common:m.parent.common,data:m.data,parsedType:ua(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}}_parseSync(m){const b=this._parse(m);if(El(b))throw new Error("Synchronous parse encountered promise.");return b}_parseAsync(m){const b=this._parse(m);return Promise.resolve(b)}parse(m,b){const C=this.safeParse(m,b);if(C.success)return C.data;throw C.error}safeParse(m,b){var C;const A={common:{issues:[],async:(C=b==null?void 0:b.async)!==null&&C!==void 0?C:!1,contextualErrorMap:b==null?void 0:b.errorMap},path:(b==null?void 0:b.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:ua(m)},D=this._parseSync({data:m,path:A.path,parent:A});return Kf(A,D)}"~validate"(m){var b,C;const A={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:ua(m)};if(!this["~standard"].async)try{const D=this._parseSync({data:m,path:[],parent:A});return Ms(D)?{value:D.value}:{issues:A.common.issues}}catch(D){!((C=(b=D==null?void 0:D.message)===null||b===void 0?void 0:b.toLowerCase())===null||C===void 0)&&C.includes("encountered")&&(this["~standard"].async=!0),A.common={issues:[],async:!0}}return this._parseAsync({data:m,path:[],parent:A}).then(D=>Ms(D)?{value:D.value}:{issues:A.common.issues})}async parseAsync(m,b){const C=await this.safeParseAsync(m,b);if(C.success)return C.data;throw C.error}async safeParseAsync(m,b){const C={common:{issues:[],contextualErrorMap:b==null?void 0:b.errorMap,async:!0},path:(b==null?void 0:b.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:ua(m)},A=this._parse({data:m,path:C.path,parent:C}),D=await(El(A)?A:Promise.resolve(A));return Kf(C,D)}refine(m,b){const C=A=>typeof b=="string"||typeof b>"u"?{message:b}:typeof b=="function"?b(A):b;return this._refinement((A,D)=>{const S=m(A),o=()=>D.addIssue({code:Oe.custom,...C(A)});return typeof Promise<"u"&&S instanceof Promise?S.then(le=>le?!0:(o(),!1)):S?!0:(o(),!1)})}refinement(m,b){return this._refinement((C,A)=>m(C)?!0:(A.addIssue(typeof b=="function"?b(C,A):b),!1))}_refinement(m){return new bn({schema:this,typeName:ut.ZodEffects,effect:{type:"refinement",refinement:m}})}superRefine(m){return this._refinement(m)}constructor(m){this.spa=this.safeParseAsync,this._def=m,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:b=>this["~validate"](b)}}optional(){return Un.create(this,this._def)}nullable(){return Za.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vn.create(this)}promise(){return Po.create(this,this._def)}or(m){return Fl.create([this,m],this._def)}and(m){return Bl.create(this,m,this._def)}transform(m){return new bn({...xt(this._def),schema:this,typeName:ut.ZodEffects,effect:{type:"transform",transform:m}})}default(m){const b=typeof m=="function"?m:()=>m;return new Vl({...xt(this._def),innerType:this,defaultValue:b,typeName:ut.ZodDefault})}brand(){return new Ad({typeName:ut.ZodBranded,type:this,...xt(this._def)})}catch(m){const b=typeof m=="function"?m:()=>m;return new Ul({...xt(this._def),innerType:this,catchValue:b,typeName:ut.ZodCatch})}describe(m){const b=this.constructor;return new b({...this._def,description:m})}pipe(m){return $l.create(this,m)}readonly(){return Gl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ay=/^c[^\s-]{8,}$/i,zy=/^[0-9a-z]+$/,Ry=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Dy=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ly=/^[a-z0-9_-]{21}$/i,Fy=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,By=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Oy=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kd;const Ny=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Vy=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Uy=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$y=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Gy=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qy=new RegExp(`^${Yf}$`);function Jf(y){let m="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return y.precision?m=`${m}\\.\\d{${y.precision}}`:y.precision==null&&(m=`${m}(\\.\\d+)?`),m}function Wy(y){return new RegExp(`^${Jf(y)}$`)}function Qf(y){let m=`${Yf}T${Jf(y)}`;const b=[];return b.push(y.local?"Z?":"Z"),y.offset&&b.push("([+-]\\d{2}:?\\d{2})"),m=`${m}(${b.join("|")})`,new RegExp(`^${m}$`)}function Hy(y,m){return!!((m==="v4"||!m)&&Ny.test(y)||(m==="v6"||!m)&&Vy.test(y))}function Xy(y,m){if(!Fy.test(y))return!1;try{const[b]=y.split("."),C=b.replace(/-/g,"+").replace(/_/g,"/").padEnd(b.length+(4-b.length%4)%4,"="),A=JSON.parse(atob(C));return!(typeof A!="object"||A===null||!A.typ||!A.alg||m&&A.alg!==m)}catch{return!1}}function Ky(y,m){return!!((m==="v4"||!m)&&Zy.test(y)||(m==="v6"||!m)&&Uy.test(y))}class xn extends Mt{_parse(m){if(this._def.coerce&&(m.data=String(m.data)),this._getType(m)!==Ke.string){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_type,expected:Ke.string,received:D.parsedType}),dt}const C=new hr;let A;for(const D of this._def.checks)if(D.kind==="min")m.data.length<D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_small,minimum:D.value,type:"string",inclusive:!0,exact:!1,message:D.message}),C.dirty());else if(D.kind==="max")m.data.length>D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_big,maximum:D.value,type:"string",inclusive:!0,exact:!1,message:D.message}),C.dirty());else if(D.kind==="length"){const S=m.data.length>D.value,o=m.data.length<D.value;(S||o)&&(A=this._getOrReturnCtx(m,A),S?qe(A,{code:Oe.too_big,maximum:D.value,type:"string",inclusive:!0,exact:!0,message:D.message}):o&&qe(A,{code:Oe.too_small,minimum:D.value,type:"string",inclusive:!0,exact:!0,message:D.message}),C.dirty())}else if(D.kind==="email")Oy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"email",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="emoji")kd||(kd=new RegExp(jy,"u")),kd.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"emoji",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="uuid")Dy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"uuid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="nanoid")Ly.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"nanoid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="cuid")Ay.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"cuid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="cuid2")zy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"cuid2",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="ulid")Ry.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"ulid",code:Oe.invalid_string,message:D.message}),C.dirty());else if(D.kind==="url")try{new URL(m.data)}catch{A=this._getOrReturnCtx(m,A),qe(A,{validation:"url",code:Oe.invalid_string,message:D.message}),C.dirty()}else D.kind==="regex"?(D.regex.lastIndex=0,D.regex.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"regex",code:Oe.invalid_string,message:D.message}),C.dirty())):D.kind==="trim"?m.data=m.data.trim():D.kind==="includes"?m.data.includes(D.value,D.position)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:{includes:D.value,position:D.position},message:D.message}),C.dirty()):D.kind==="toLowerCase"?m.data=m.data.toLowerCase():D.kind==="toUpperCase"?m.data=m.data.toUpperCase():D.kind==="startsWith"?m.data.startsWith(D.value)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:{startsWith:D.value},message:D.message}),C.dirty()):D.kind==="endsWith"?m.data.endsWith(D.value)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:{endsWith:D.value},message:D.message}),C.dirty()):D.kind==="datetime"?Qf(D).test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:"datetime",message:D.message}),C.dirty()):D.kind==="date"?qy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:"date",message:D.message}),C.dirty()):D.kind==="time"?Wy(D).test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.invalid_string,validation:"time",message:D.message}),C.dirty()):D.kind==="duration"?By.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"duration",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="ip"?Hy(m.data,D.version)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"ip",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="jwt"?Xy(m.data,D.alg)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"jwt",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="cidr"?Ky(m.data,D.version)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"cidr",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="base64"?$y.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"base64",code:Oe.invalid_string,message:D.message}),C.dirty()):D.kind==="base64url"?Gy.test(m.data)||(A=this._getOrReturnCtx(m,A),qe(A,{validation:"base64url",code:Oe.invalid_string,message:D.message}),C.dirty()):Nt.assertNever(D);return{status:C.value,value:m.data}}_regex(m,b,C){return this.refinement(A=>m.test(A),{validation:b,code:Oe.invalid_string,...rt.errToObj(C)})}_addCheck(m){return new xn({...this._def,checks:[...this._def.checks,m]})}email(m){return this._addCheck({kind:"email",...rt.errToObj(m)})}url(m){return this._addCheck({kind:"url",...rt.errToObj(m)})}emoji(m){return this._addCheck({kind:"emoji",...rt.errToObj(m)})}uuid(m){return this._addCheck({kind:"uuid",...rt.errToObj(m)})}nanoid(m){return this._addCheck({kind:"nanoid",...rt.errToObj(m)})}cuid(m){return this._addCheck({kind:"cuid",...rt.errToObj(m)})}cuid2(m){return this._addCheck({kind:"cuid2",...rt.errToObj(m)})}ulid(m){return this._addCheck({kind:"ulid",...rt.errToObj(m)})}base64(m){return this._addCheck({kind:"base64",...rt.errToObj(m)})}base64url(m){return this._addCheck({kind:"base64url",...rt.errToObj(m)})}jwt(m){return this._addCheck({kind:"jwt",...rt.errToObj(m)})}ip(m){return this._addCheck({kind:"ip",...rt.errToObj(m)})}cidr(m){return this._addCheck({kind:"cidr",...rt.errToObj(m)})}datetime(m){var b,C;return typeof m=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:m}):this._addCheck({kind:"datetime",precision:typeof(m==null?void 0:m.precision)>"u"?null:m==null?void 0:m.precision,offset:(b=m==null?void 0:m.offset)!==null&&b!==void 0?b:!1,local:(C=m==null?void 0:m.local)!==null&&C!==void 0?C:!1,...rt.errToObj(m==null?void 0:m.message)})}date(m){return this._addCheck({kind:"date",message:m})}time(m){return typeof m=="string"?this._addCheck({kind:"time",precision:null,message:m}):this._addCheck({kind:"time",precision:typeof(m==null?void 0:m.precision)>"u"?null:m==null?void 0:m.precision,...rt.errToObj(m==null?void 0:m.message)})}duration(m){return this._addCheck({kind:"duration",...rt.errToObj(m)})}regex(m,b){return this._addCheck({kind:"regex",regex:m,...rt.errToObj(b)})}includes(m,b){return this._addCheck({kind:"includes",value:m,position:b==null?void 0:b.position,...rt.errToObj(b==null?void 0:b.message)})}startsWith(m,b){return this._addCheck({kind:"startsWith",value:m,...rt.errToObj(b)})}endsWith(m,b){return this._addCheck({kind:"endsWith",value:m,...rt.errToObj(b)})}min(m,b){return this._addCheck({kind:"min",value:m,...rt.errToObj(b)})}max(m,b){return this._addCheck({kind:"max",value:m,...rt.errToObj(b)})}length(m,b){return this._addCheck({kind:"length",value:m,...rt.errToObj(b)})}nonempty(m){return this.min(1,rt.errToObj(m))}trim(){return new xn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(m=>m.kind==="datetime")}get isDate(){return!!this._def.checks.find(m=>m.kind==="date")}get isTime(){return!!this._def.checks.find(m=>m.kind==="time")}get isDuration(){return!!this._def.checks.find(m=>m.kind==="duration")}get isEmail(){return!!this._def.checks.find(m=>m.kind==="email")}get isURL(){return!!this._def.checks.find(m=>m.kind==="url")}get isEmoji(){return!!this._def.checks.find(m=>m.kind==="emoji")}get isUUID(){return!!this._def.checks.find(m=>m.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(m=>m.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(m=>m.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(m=>m.kind==="cuid2")}get isULID(){return!!this._def.checks.find(m=>m.kind==="ulid")}get isIP(){return!!this._def.checks.find(m=>m.kind==="ip")}get isCIDR(){return!!this._def.checks.find(m=>m.kind==="cidr")}get isBase64(){return!!this._def.checks.find(m=>m.kind==="base64")}get isBase64url(){return!!this._def.checks.find(m=>m.kind==="base64url")}get minLength(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m}get maxLength(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m}}xn.create=y=>{var m;return new xn({checks:[],typeName:ut.ZodString,coerce:(m=y==null?void 0:y.coerce)!==null&&m!==void 0?m:!1,...xt(y)})};function Yy(y,m){const b=(y.toString().split(".")[1]||"").length,C=(m.toString().split(".")[1]||"").length,A=b>C?b:C,D=parseInt(y.toFixed(A).replace(".","")),S=parseInt(m.toFixed(A).replace(".",""));return D%S/Math.pow(10,A)}class Oa extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(m){if(this._def.coerce&&(m.data=Number(m.data)),this._getType(m)!==Ke.number){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_type,expected:Ke.number,received:D.parsedType}),dt}let C;const A=new hr;for(const D of this._def.checks)D.kind==="int"?Nt.isInteger(m.data)||(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.invalid_type,expected:"integer",received:"float",message:D.message}),A.dirty()):D.kind==="min"?(D.inclusive?m.data<D.value:m.data<=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_small,minimum:D.value,type:"number",inclusive:D.inclusive,exact:!1,message:D.message}),A.dirty()):D.kind==="max"?(D.inclusive?m.data>D.value:m.data>=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_big,maximum:D.value,type:"number",inclusive:D.inclusive,exact:!1,message:D.message}),A.dirty()):D.kind==="multipleOf"?Yy(m.data,D.value)!==0&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.not_multiple_of,multipleOf:D.value,message:D.message}),A.dirty()):D.kind==="finite"?Number.isFinite(m.data)||(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.not_finite,message:D.message}),A.dirty()):Nt.assertNever(D);return{status:A.value,value:m.data}}gte(m,b){return this.setLimit("min",m,!0,rt.toString(b))}gt(m,b){return this.setLimit("min",m,!1,rt.toString(b))}lte(m,b){return this.setLimit("max",m,!0,rt.toString(b))}lt(m,b){return this.setLimit("max",m,!1,rt.toString(b))}setLimit(m,b,C,A){return new Oa({...this._def,checks:[...this._def.checks,{kind:m,value:b,inclusive:C,message:rt.toString(A)}]})}_addCheck(m){return new Oa({...this._def,checks:[...this._def.checks,m]})}int(m){return this._addCheck({kind:"int",message:rt.toString(m)})}positive(m){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rt.toString(m)})}negative(m){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rt.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rt.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rt.toString(m)})}multipleOf(m,b){return this._addCheck({kind:"multipleOf",value:m,message:rt.toString(b)})}finite(m){return this._addCheck({kind:"finite",message:rt.toString(m)})}safe(m){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rt.toString(m)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rt.toString(m)})}get minValue(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m}get maxValue(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m}get isInt(){return!!this._def.checks.find(m=>m.kind==="int"||m.kind==="multipleOf"&&Nt.isInteger(m.value))}get isFinite(){let m=null,b=null;for(const C of this._def.checks){if(C.kind==="finite"||C.kind==="int"||C.kind==="multipleOf")return!0;C.kind==="min"?(b===null||C.value>b)&&(b=C.value):C.kind==="max"&&(m===null||C.value<m)&&(m=C.value)}return Number.isFinite(b)&&Number.isFinite(m)}}Oa.create=y=>new Oa({checks:[],typeName:ut.ZodNumber,coerce:(y==null?void 0:y.coerce)||!1,...xt(y)});class ja extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(m){if(this._def.coerce)try{m.data=BigInt(m.data)}catch{return this._getInvalidInput(m)}if(this._getType(m)!==Ke.bigint)return this._getInvalidInput(m);let C;const A=new hr;for(const D of this._def.checks)D.kind==="min"?(D.inclusive?m.data<D.value:m.data<=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_small,type:"bigint",minimum:D.value,inclusive:D.inclusive,message:D.message}),A.dirty()):D.kind==="max"?(D.inclusive?m.data>D.value:m.data>=D.value)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.too_big,type:"bigint",maximum:D.value,inclusive:D.inclusive,message:D.message}),A.dirty()):D.kind==="multipleOf"?m.data%D.value!==BigInt(0)&&(C=this._getOrReturnCtx(m,C),qe(C,{code:Oe.not_multiple_of,multipleOf:D.value,message:D.message}),A.dirty()):Nt.assertNever(D);return{status:A.value,value:m.data}}_getInvalidInput(m){const b=this._getOrReturnCtx(m);return qe(b,{code:Oe.invalid_type,expected:Ke.bigint,received:b.parsedType}),dt}gte(m,b){return this.setLimit("min",m,!0,rt.toString(b))}gt(m,b){return this.setLimit("min",m,!1,rt.toString(b))}lte(m,b){return this.setLimit("max",m,!0,rt.toString(b))}lt(m,b){return this.setLimit("max",m,!1,rt.toString(b))}setLimit(m,b,C,A){return new ja({...this._def,checks:[...this._def.checks,{kind:m,value:b,inclusive:C,message:rt.toString(A)}]})}_addCheck(m){return new ja({...this._def,checks:[...this._def.checks,m]})}positive(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rt.toString(m)})}negative(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rt.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rt.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rt.toString(m)})}multipleOf(m,b){return this._addCheck({kind:"multipleOf",value:m,message:rt.toString(b)})}get minValue(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m}get maxValue(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m}}ja.create=y=>{var m;return new ja({checks:[],typeName:ut.ZodBigInt,coerce:(m=y==null?void 0:y.coerce)!==null&&m!==void 0?m:!1,...xt(y)})};class Rl extends Mt{_parse(m){if(this._def.coerce&&(m.data=!!m.data),this._getType(m)!==Ke.boolean){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.boolean,received:C.parsedType}),dt}return Sr(m.data)}}Rl.create=y=>new Rl({typeName:ut.ZodBoolean,coerce:(y==null?void 0:y.coerce)||!1,...xt(y)});class Is extends Mt{_parse(m){if(this._def.coerce&&(m.data=new Date(m.data)),this._getType(m)!==Ke.date){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_type,expected:Ke.date,received:D.parsedType}),dt}if(isNaN(m.data.getTime())){const D=this._getOrReturnCtx(m);return qe(D,{code:Oe.invalid_date}),dt}const C=new hr;let A;for(const D of this._def.checks)D.kind==="min"?m.data.getTime()<D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_small,message:D.message,inclusive:!0,exact:!1,minimum:D.value,type:"date"}),C.dirty()):D.kind==="max"?m.data.getTime()>D.value&&(A=this._getOrReturnCtx(m,A),qe(A,{code:Oe.too_big,message:D.message,inclusive:!0,exact:!1,maximum:D.value,type:"date"}),C.dirty()):Nt.assertNever(D);return{status:C.value,value:new Date(m.data.getTime())}}_addCheck(m){return new Is({...this._def,checks:[...this._def.checks,m]})}min(m,b){return this._addCheck({kind:"min",value:m.getTime(),message:rt.toString(b)})}max(m,b){return this._addCheck({kind:"max",value:m.getTime(),message:rt.toString(b)})}get minDate(){let m=null;for(const b of this._def.checks)b.kind==="min"&&(m===null||b.value>m)&&(m=b.value);return m!=null?new Date(m):null}get maxDate(){let m=null;for(const b of this._def.checks)b.kind==="max"&&(m===null||b.value<m)&&(m=b.value);return m!=null?new Date(m):null}}Is.create=y=>new Is({checks:[],coerce:(y==null?void 0:y.coerce)||!1,typeName:ut.ZodDate,...xt(y)});class Fu extends Mt{_parse(m){if(this._getType(m)!==Ke.symbol){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.symbol,received:C.parsedType}),dt}return Sr(m.data)}}Fu.create=y=>new Fu({typeName:ut.ZodSymbol,...xt(y)});class Dl extends Mt{_parse(m){if(this._getType(m)!==Ke.undefined){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.undefined,received:C.parsedType}),dt}return Sr(m.data)}}Dl.create=y=>new Dl({typeName:ut.ZodUndefined,...xt(y)});class Ll extends Mt{_parse(m){if(this._getType(m)!==Ke.null){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.null,received:C.parsedType}),dt}return Sr(m.data)}}Ll.create=y=>new Ll({typeName:ut.ZodNull,...xt(y)});class bo extends Mt{constructor(){super(...arguments),this._any=!0}_parse(m){return Sr(m.data)}}bo.create=y=>new bo({typeName:ut.ZodAny,...xt(y)});class Cs extends Mt{constructor(){super(...arguments),this._unknown=!0}_parse(m){return Sr(m.data)}}Cs.create=y=>new Cs({typeName:ut.ZodUnknown,...xt(y)});class ha extends Mt{_parse(m){const b=this._getOrReturnCtx(m);return qe(b,{code:Oe.invalid_type,expected:Ke.never,received:b.parsedType}),dt}}ha.create=y=>new ha({typeName:ut.ZodNever,...xt(y)});class Bu extends Mt{_parse(m){if(this._getType(m)!==Ke.undefined){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.void,received:C.parsedType}),dt}return Sr(m.data)}}Bu.create=y=>new Bu({typeName:ut.ZodVoid,...xt(y)});class vn extends Mt{_parse(m){const{ctx:b,status:C}=this._processInputParams(m),A=this._def;if(b.parsedType!==Ke.array)return qe(b,{code:Oe.invalid_type,expected:Ke.array,received:b.parsedType}),dt;if(A.exactLength!==null){const S=b.data.length>A.exactLength.value,o=b.data.length<A.exactLength.value;(S||o)&&(qe(b,{code:S?Oe.too_big:Oe.too_small,minimum:o?A.exactLength.value:void 0,maximum:S?A.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:A.exactLength.message}),C.dirty())}if(A.minLength!==null&&b.data.length<A.minLength.value&&(qe(b,{code:Oe.too_small,minimum:A.minLength.value,type:"array",inclusive:!0,exact:!1,message:A.minLength.message}),C.dirty()),A.maxLength!==null&&b.data.length>A.maxLength.value&&(qe(b,{code:Oe.too_big,maximum:A.maxLength.value,type:"array",inclusive:!0,exact:!1,message:A.maxLength.message}),C.dirty()),b.common.async)return Promise.all([...b.data].map((S,o)=>A.type._parseAsync(new Zn(b,S,b.path,o)))).then(S=>hr.mergeArray(C,S));const D=[...b.data].map((S,o)=>A.type._parseSync(new Zn(b,S,b.path,o)));return hr.mergeArray(C,D)}get element(){return this._def.type}min(m,b){return new vn({...this._def,minLength:{value:m,message:rt.toString(b)}})}max(m,b){return new vn({...this._def,maxLength:{value:m,message:rt.toString(b)}})}length(m,b){return new vn({...this._def,exactLength:{value:m,message:rt.toString(b)}})}nonempty(m){return this.min(1,m)}}vn.create=(y,m)=>new vn({type:y,minLength:null,maxLength:null,exactLength:null,typeName:ut.ZodArray,...xt(m)});function wo(y){if(y instanceof Si){const m={};for(const b in y.shape){const C=y.shape[b];m[b]=Un.create(wo(C))}return new Si({...y._def,shape:()=>m})}else return y instanceof vn?new vn({...y._def,type:wo(y.element)}):y instanceof Un?Un.create(wo(y.unwrap())):y instanceof Za?Za.create(wo(y.unwrap())):y instanceof Vn?Vn.create(y.items.map(m=>wo(m))):y}class Si extends Mt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const m=this._def.shape(),b=Nt.objectKeys(m);return this._cached={shape:m,keys:b}}_parse(m){if(this._getType(m)!==Ke.object){const ue=this._getOrReturnCtx(m);return qe(ue,{code:Oe.invalid_type,expected:Ke.object,received:ue.parsedType}),dt}const{status:C,ctx:A}=this._processInputParams(m),{shape:D,keys:S}=this._getCached(),o=[];if(!(this._def.catchall instanceof ha&&this._def.unknownKeys==="strip"))for(const ue in A.data)S.includes(ue)||o.push(ue);const le=[];for(const ue of S){const _e=D[ue],Re=A.data[ue];le.push({key:{status:"valid",value:ue},value:_e._parse(new Zn(A,Re,A.path,ue)),alwaysSet:ue in A.data})}if(this._def.catchall instanceof ha){const ue=this._def.unknownKeys;if(ue==="passthrough")for(const _e of o)le.push({key:{status:"valid",value:_e},value:{status:"valid",value:A.data[_e]}});else if(ue==="strict")o.length>0&&(qe(A,{code:Oe.unrecognized_keys,keys:o}),C.dirty());else if(ue!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const ue=this._def.catchall;for(const _e of o){const Re=A.data[_e];le.push({key:{status:"valid",value:_e},value:ue._parse(new Zn(A,Re,A.path,_e)),alwaysSet:_e in A.data})}}return A.common.async?Promise.resolve().then(async()=>{const ue=[];for(const _e of le){const Re=await _e.key,xe=await _e.value;ue.push({key:Re,value:xe,alwaysSet:_e.alwaysSet})}return ue}).then(ue=>hr.mergeObjectSync(C,ue)):hr.mergeObjectSync(C,le)}get shape(){return this._def.shape()}strict(m){return rt.errToObj,new Si({...this._def,unknownKeys:"strict",...m!==void 0?{errorMap:(b,C)=>{var A,D,S,o;const le=(S=(D=(A=this._def).errorMap)===null||D===void 0?void 0:D.call(A,b,C).message)!==null&&S!==void 0?S:C.defaultError;return b.code==="unrecognized_keys"?{message:(o=rt.errToObj(m).message)!==null&&o!==void 0?o:le}:{message:le}}}:{}})}strip(){return new Si({...this._def,unknownKeys:"strip"})}passthrough(){return new Si({...this._def,unknownKeys:"passthrough"})}extend(m){return new Si({...this._def,shape:()=>({...this._def.shape(),...m})})}merge(m){return new Si({unknownKeys:m._def.unknownKeys,catchall:m._def.catchall,shape:()=>({...this._def.shape(),...m._def.shape()}),typeName:ut.ZodObject})}setKey(m,b){return this.augment({[m]:b})}catchall(m){return new Si({...this._def,catchall:m})}pick(m){const b={};return Nt.objectKeys(m).forEach(C=>{m[C]&&this.shape[C]&&(b[C]=this.shape[C])}),new Si({...this._def,shape:()=>b})}omit(m){const b={};return Nt.objectKeys(this.shape).forEach(C=>{m[C]||(b[C]=this.shape[C])}),new Si({...this._def,shape:()=>b})}deepPartial(){return wo(this)}partial(m){const b={};return Nt.objectKeys(this.shape).forEach(C=>{const A=this.shape[C];m&&!m[C]?b[C]=A:b[C]=A.optional()}),new Si({...this._def,shape:()=>b})}required(m){const b={};return Nt.objectKeys(this.shape).forEach(C=>{if(m&&!m[C])b[C]=this.shape[C];else{let D=this.shape[C];for(;D instanceof Un;)D=D._def.innerType;b[C]=D}}),new Si({...this._def,shape:()=>b})}keyof(){return em(Nt.objectKeys(this.shape))}}Si.create=(y,m)=>new Si({shape:()=>y,unknownKeys:"strip",catchall:ha.create(),typeName:ut.ZodObject,...xt(m)}),Si.strictCreate=(y,m)=>new Si({shape:()=>y,unknownKeys:"strict",catchall:ha.create(),typeName:ut.ZodObject,...xt(m)}),Si.lazycreate=(y,m)=>new Si({shape:y,unknownKeys:"strip",catchall:ha.create(),typeName:ut.ZodObject,...xt(m)});class Fl extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m),C=this._def.options;function A(D){for(const o of D)if(o.result.status==="valid")return o.result;for(const o of D)if(o.result.status==="dirty")return b.common.issues.push(...o.ctx.common.issues),o.result;const S=D.map(o=>new qr(o.ctx.common.issues));return qe(b,{code:Oe.invalid_union,unionErrors:S}),dt}if(b.common.async)return Promise.all(C.map(async D=>{const S={...b,common:{...b.common,issues:[]},parent:null};return{result:await D._parseAsync({data:b.data,path:b.path,parent:S}),ctx:S}})).then(A);{let D;const S=[];for(const le of C){const ue={...b,common:{...b.common,issues:[]},parent:null},_e=le._parseSync({data:b.data,path:b.path,parent:ue});if(_e.status==="valid")return _e;_e.status==="dirty"&&!D&&(D={result:_e,ctx:ue}),ue.common.issues.length&&S.push(ue.common.issues)}if(D)return b.common.issues.push(...D.ctx.common.issues),D.result;const o=S.map(le=>new qr(le));return qe(b,{code:Oe.invalid_union,unionErrors:o}),dt}}get options(){return this._def.options}}Fl.create=(y,m)=>new Fl({options:y,typeName:ut.ZodUnion,...xt(m)});const da=y=>y instanceof jl?da(y.schema):y instanceof bn?da(y.innerType()):y instanceof Nl?[y.value]:y instanceof Na?y.options:y instanceof Zl?Nt.objectValues(y.enum):y instanceof Vl?da(y._def.innerType):y instanceof Dl?[void 0]:y instanceof Ll?[null]:y instanceof Un?[void 0,...da(y.unwrap())]:y instanceof Za?[null,...da(y.unwrap())]:y instanceof Ad||y instanceof Gl?da(y.unwrap()):y instanceof Ul?da(y._def.innerType):[];class Ou extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m);if(b.parsedType!==Ke.object)return qe(b,{code:Oe.invalid_type,expected:Ke.object,received:b.parsedType}),dt;const C=this.discriminator,A=b.data[C],D=this.optionsMap.get(A);return D?b.common.async?D._parseAsync({data:b.data,path:b.path,parent:b}):D._parseSync({data:b.data,path:b.path,parent:b}):(qe(b,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[C]}),dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(m,b,C){const A=new Map;for(const D of b){const S=da(D.shape[m]);if(!S.length)throw new Error(`A discriminator value for key \`${m}\` could not be extracted from all schema options`);for(const o of S){if(A.has(o))throw new Error(`Discriminator property ${String(m)} has duplicate value ${String(o)}`);A.set(o,D)}}return new Ou({typeName:ut.ZodDiscriminatedUnion,discriminator:m,options:b,optionsMap:A,...xt(C)})}}function Ed(y,m){const b=ua(y),C=ua(m);if(y===m)return{valid:!0,data:y};if(b===Ke.object&&C===Ke.object){const A=Nt.objectKeys(m),D=Nt.objectKeys(y).filter(o=>A.indexOf(o)!==-1),S={...y,...m};for(const o of D){const le=Ed(y[o],m[o]);if(!le.valid)return{valid:!1};S[o]=le.data}return{valid:!0,data:S}}else if(b===Ke.array&&C===Ke.array){if(y.length!==m.length)return{valid:!1};const A=[];for(let D=0;D<y.length;D++){const S=y[D],o=m[D],le=Ed(S,o);if(!le.valid)return{valid:!1};A.push(le.data)}return{valid:!0,data:A}}else return b===Ke.date&&C===Ke.date&&+y==+m?{valid:!0,data:y}:{valid:!1}}class Bl extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m),A=(D,S)=>{if(Id(D)||Id(S))return dt;const o=Ed(D.value,S.value);return o.valid?((Cd(D)||Cd(S))&&b.dirty(),{status:b.value,value:o.data}):(qe(C,{code:Oe.invalid_intersection_types}),dt)};return C.common.async?Promise.all([this._def.left._parseAsync({data:C.data,path:C.path,parent:C}),this._def.right._parseAsync({data:C.data,path:C.path,parent:C})]).then(([D,S])=>A(D,S)):A(this._def.left._parseSync({data:C.data,path:C.path,parent:C}),this._def.right._parseSync({data:C.data,path:C.path,parent:C}))}}Bl.create=(y,m,b)=>new Bl({left:y,right:m,typeName:ut.ZodIntersection,...xt(b)});class Vn extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.array)return qe(C,{code:Oe.invalid_type,expected:Ke.array,received:C.parsedType}),dt;if(C.data.length<this._def.items.length)return qe(C,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dt;!this._def.rest&&C.data.length>this._def.items.length&&(qe(C,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b.dirty());const D=[...C.data].map((S,o)=>{const le=this._def.items[o]||this._def.rest;return le?le._parse(new Zn(C,S,C.path,o)):null}).filter(S=>!!S);return C.common.async?Promise.all(D).then(S=>hr.mergeArray(b,S)):hr.mergeArray(b,D)}get items(){return this._def.items}rest(m){return new Vn({...this._def,rest:m})}}Vn.create=(y,m)=>{if(!Array.isArray(y))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vn({items:y,typeName:ut.ZodTuple,rest:null,...xt(m)})};class Ol extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.object)return qe(C,{code:Oe.invalid_type,expected:Ke.object,received:C.parsedType}),dt;const A=[],D=this._def.keyType,S=this._def.valueType;for(const o in C.data)A.push({key:D._parse(new Zn(C,o,C.path,o)),value:S._parse(new Zn(C,C.data[o],C.path,o)),alwaysSet:o in C.data});return C.common.async?hr.mergeObjectAsync(b,A):hr.mergeObjectSync(b,A)}get element(){return this._def.valueType}static create(m,b,C){return b instanceof Mt?new Ol({keyType:m,valueType:b,typeName:ut.ZodRecord,...xt(C)}):new Ol({keyType:xn.create(),valueType:m,typeName:ut.ZodRecord,...xt(b)})}}class ju extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.map)return qe(C,{code:Oe.invalid_type,expected:Ke.map,received:C.parsedType}),dt;const A=this._def.keyType,D=this._def.valueType,S=[...C.data.entries()].map(([o,le],ue)=>({key:A._parse(new Zn(C,o,C.path,[ue,"key"])),value:D._parse(new Zn(C,le,C.path,[ue,"value"]))}));if(C.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const le of S){const ue=await le.key,_e=await le.value;if(ue.status==="aborted"||_e.status==="aborted")return dt;(ue.status==="dirty"||_e.status==="dirty")&&b.dirty(),o.set(ue.value,_e.value)}return{status:b.value,value:o}})}else{const o=new Map;for(const le of S){const ue=le.key,_e=le.value;if(ue.status==="aborted"||_e.status==="aborted")return dt;(ue.status==="dirty"||_e.status==="dirty")&&b.dirty(),o.set(ue.value,_e.value)}return{status:b.value,value:o}}}}ju.create=(y,m,b)=>new ju({valueType:m,keyType:y,typeName:ut.ZodMap,...xt(b)});class ks extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.parsedType!==Ke.set)return qe(C,{code:Oe.invalid_type,expected:Ke.set,received:C.parsedType}),dt;const A=this._def;A.minSize!==null&&C.data.size<A.minSize.value&&(qe(C,{code:Oe.too_small,minimum:A.minSize.value,type:"set",inclusive:!0,exact:!1,message:A.minSize.message}),b.dirty()),A.maxSize!==null&&C.data.size>A.maxSize.value&&(qe(C,{code:Oe.too_big,maximum:A.maxSize.value,type:"set",inclusive:!0,exact:!1,message:A.maxSize.message}),b.dirty());const D=this._def.valueType;function S(le){const ue=new Set;for(const _e of le){if(_e.status==="aborted")return dt;_e.status==="dirty"&&b.dirty(),ue.add(_e.value)}return{status:b.value,value:ue}}const o=[...C.data.values()].map((le,ue)=>D._parse(new Zn(C,le,C.path,ue)));return C.common.async?Promise.all(o).then(le=>S(le)):S(o)}min(m,b){return new ks({...this._def,minSize:{value:m,message:rt.toString(b)}})}max(m,b){return new ks({...this._def,maxSize:{value:m,message:rt.toString(b)}})}size(m,b){return this.min(m,b).max(m,b)}nonempty(m){return this.min(1,m)}}ks.create=(y,m)=>new ks({valueType:y,minSize:null,maxSize:null,typeName:ut.ZodSet,...xt(m)});class To extends Mt{constructor(){super(...arguments),this.validate=this.implement}_parse(m){const{ctx:b}=this._processInputParams(m);if(b.parsedType!==Ke.function)return qe(b,{code:Oe.invalid_type,expected:Ke.function,received:b.parsedType}),dt;function C(o,le){return Du({data:o,path:b.path,errorMaps:[b.common.contextualErrorMap,b.schemaErrorMap,Ru(),xo].filter(ue=>!!ue),issueData:{code:Oe.invalid_arguments,argumentsError:le}})}function A(o,le){return Du({data:o,path:b.path,errorMaps:[b.common.contextualErrorMap,b.schemaErrorMap,Ru(),xo].filter(ue=>!!ue),issueData:{code:Oe.invalid_return_type,returnTypeError:le}})}const D={errorMap:b.common.contextualErrorMap},S=b.data;if(this._def.returns instanceof Po){const o=this;return Sr(async function(...le){const ue=new qr([]),_e=await o._def.args.parseAsync(le,D).catch(ie=>{throw ue.addIssue(C(le,ie)),ue}),Re=await Reflect.apply(S,this,_e);return await o._def.returns._def.type.parseAsync(Re,D).catch(ie=>{throw ue.addIssue(A(Re,ie)),ue})})}else{const o=this;return Sr(function(...le){const ue=o._def.args.safeParse(le,D);if(!ue.success)throw new qr([C(le,ue.error)]);const _e=Reflect.apply(S,this,ue.data),Re=o._def.returns.safeParse(_e,D);if(!Re.success)throw new qr([A(_e,Re.error)]);return Re.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...m){return new To({...this._def,args:Vn.create(m).rest(Cs.create())})}returns(m){return new To({...this._def,returns:m})}implement(m){return this.parse(m)}strictImplement(m){return this.parse(m)}static create(m,b,C){return new To({args:m||Vn.create([]).rest(Cs.create()),returns:b||Cs.create(),typeName:ut.ZodFunction,...xt(C)})}}class jl extends Mt{get schema(){return this._def.getter()}_parse(m){const{ctx:b}=this._processInputParams(m);return this._def.getter()._parse({data:b.data,path:b.path,parent:b})}}jl.create=(y,m)=>new jl({getter:y,typeName:ut.ZodLazy,...xt(m)});class Nl extends Mt{_parse(m){if(m.data!==this._def.value){const b=this._getOrReturnCtx(m);return qe(b,{received:b.data,code:Oe.invalid_literal,expected:this._def.value}),dt}return{status:"valid",value:m.data}}get value(){return this._def.value}}Nl.create=(y,m)=>new Nl({value:y,typeName:ut.ZodLiteral,...xt(m)});function em(y,m){return new Na({values:y,typeName:ut.ZodEnum,...xt(m)})}class Na extends Mt{constructor(){super(...arguments),Al.set(this,void 0)}_parse(m){if(typeof m.data!="string"){const b=this._getOrReturnCtx(m),C=this._def.values;return qe(b,{expected:Nt.joinValues(C),received:b.parsedType,code:Oe.invalid_type}),dt}if(Lu(this,Al)||Xf(this,Al,new Set(this._def.values)),!Lu(this,Al).has(m.data)){const b=this._getOrReturnCtx(m),C=this._def.values;return qe(b,{received:b.data,code:Oe.invalid_enum_value,options:C}),dt}return Sr(m.data)}get options(){return this._def.values}get enum(){const m={};for(const b of this._def.values)m[b]=b;return m}get Values(){const m={};for(const b of this._def.values)m[b]=b;return m}get Enum(){const m={};for(const b of this._def.values)m[b]=b;return m}extract(m,b=this._def){return Na.create(m,{...this._def,...b})}exclude(m,b=this._def){return Na.create(this.options.filter(C=>!m.includes(C)),{...this._def,...b})}}Al=new WeakMap,Na.create=em;class Zl extends Mt{constructor(){super(...arguments),zl.set(this,void 0)}_parse(m){const b=Nt.getValidEnumValues(this._def.values),C=this._getOrReturnCtx(m);if(C.parsedType!==Ke.string&&C.parsedType!==Ke.number){const A=Nt.objectValues(b);return qe(C,{expected:Nt.joinValues(A),received:C.parsedType,code:Oe.invalid_type}),dt}if(Lu(this,zl)||Xf(this,zl,new Set(Nt.getValidEnumValues(this._def.values))),!Lu(this,zl).has(m.data)){const A=Nt.objectValues(b);return qe(C,{received:C.data,code:Oe.invalid_enum_value,options:A}),dt}return Sr(m.data)}get enum(){return this._def.values}}zl=new WeakMap,Zl.create=(y,m)=>new Zl({values:y,typeName:ut.ZodNativeEnum,...xt(m)});class Po extends Mt{unwrap(){return this._def.type}_parse(m){const{ctx:b}=this._processInputParams(m);if(b.parsedType!==Ke.promise&&b.common.async===!1)return qe(b,{code:Oe.invalid_type,expected:Ke.promise,received:b.parsedType}),dt;const C=b.parsedType===Ke.promise?b.data:Promise.resolve(b.data);return Sr(C.then(A=>this._def.type.parseAsync(A,{path:b.path,errorMap:b.common.contextualErrorMap})))}}Po.create=(y,m)=>new Po({type:y,typeName:ut.ZodPromise,...xt(m)});class bn extends Mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ut.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(m){const{status:b,ctx:C}=this._processInputParams(m),A=this._def.effect||null,D={addIssue:S=>{qe(C,S),S.fatal?b.abort():b.dirty()},get path(){return C.path}};if(D.addIssue=D.addIssue.bind(D),A.type==="preprocess"){const S=A.transform(C.data,D);if(C.common.async)return Promise.resolve(S).then(async o=>{if(b.value==="aborted")return dt;const le=await this._def.schema._parseAsync({data:o,path:C.path,parent:C});return le.status==="aborted"?dt:le.status==="dirty"||b.value==="dirty"?vo(le.value):le});{if(b.value==="aborted")return dt;const o=this._def.schema._parseSync({data:S,path:C.path,parent:C});return o.status==="aborted"?dt:o.status==="dirty"||b.value==="dirty"?vo(o.value):o}}if(A.type==="refinement"){const S=o=>{const le=A.refinement(o,D);if(C.common.async)return Promise.resolve(le);if(le instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(C.common.async===!1){const o=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});return o.status==="aborted"?dt:(o.status==="dirty"&&b.dirty(),S(o.value),{status:b.value,value:o.value})}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(o=>o.status==="aborted"?dt:(o.status==="dirty"&&b.dirty(),S(o.value).then(()=>({status:b.value,value:o.value}))))}if(A.type==="transform")if(C.common.async===!1){const S=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});if(!Ms(S))return S;const o=A.transform(S.value,D);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:b.value,value:o}}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(S=>Ms(S)?Promise.resolve(A.transform(S.value,D)).then(o=>({status:b.value,value:o})):S);Nt.assertNever(A)}}bn.create=(y,m,b)=>new bn({schema:y,typeName:ut.ZodEffects,effect:m,...xt(b)}),bn.createWithPreprocess=(y,m,b)=>new bn({schema:m,effect:{type:"preprocess",transform:y},typeName:ut.ZodEffects,...xt(b)});class Un extends Mt{_parse(m){return this._getType(m)===Ke.undefined?Sr(void 0):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}}Un.create=(y,m)=>new Un({innerType:y,typeName:ut.ZodOptional,...xt(m)});class Za extends Mt{_parse(m){return this._getType(m)===Ke.null?Sr(null):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}}Za.create=(y,m)=>new Za({innerType:y,typeName:ut.ZodNullable,...xt(m)});class Vl extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m);let C=b.data;return b.parsedType===Ke.undefined&&(C=this._def.defaultValue()),this._def.innerType._parse({data:C,path:b.path,parent:b})}removeDefault(){return this._def.innerType}}Vl.create=(y,m)=>new Vl({innerType:y,typeName:ut.ZodDefault,defaultValue:typeof m.default=="function"?m.default:()=>m.default,...xt(m)});class Ul extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m),C={...b,common:{...b.common,issues:[]}},A=this._def.innerType._parse({data:C.data,path:C.path,parent:{...C}});return El(A)?A.then(D=>({status:"valid",value:D.status==="valid"?D.value:this._def.catchValue({get error(){return new qr(C.common.issues)},input:C.data})})):{status:"valid",value:A.status==="valid"?A.value:this._def.catchValue({get error(){return new qr(C.common.issues)},input:C.data})}}removeCatch(){return this._def.innerType}}Ul.create=(y,m)=>new Ul({innerType:y,typeName:ut.ZodCatch,catchValue:typeof m.catch=="function"?m.catch:()=>m.catch,...xt(m)});class Nu extends Mt{_parse(m){if(this._getType(m)!==Ke.nan){const C=this._getOrReturnCtx(m);return qe(C,{code:Oe.invalid_type,expected:Ke.nan,received:C.parsedType}),dt}return{status:"valid",value:m.data}}}Nu.create=y=>new Nu({typeName:ut.ZodNaN,...xt(y)});const Jy=Symbol("zod_brand");class Ad extends Mt{_parse(m){const{ctx:b}=this._processInputParams(m),C=b.data;return this._def.type._parse({data:C,path:b.path,parent:b})}unwrap(){return this._def.type}}class $l extends Mt{_parse(m){const{status:b,ctx:C}=this._processInputParams(m);if(C.common.async)return(async()=>{const D=await this._def.in._parseAsync({data:C.data,path:C.path,parent:C});return D.status==="aborted"?dt:D.status==="dirty"?(b.dirty(),vo(D.value)):this._def.out._parseAsync({data:D.value,path:C.path,parent:C})})();{const A=this._def.in._parseSync({data:C.data,path:C.path,parent:C});return A.status==="aborted"?dt:A.status==="dirty"?(b.dirty(),{status:"dirty",value:A.value}):this._def.out._parseSync({data:A.value,path:C.path,parent:C})}}static create(m,b){return new $l({in:m,out:b,typeName:ut.ZodPipeline})}}class Gl extends Mt{_parse(m){const b=this._def.innerType._parse(m),C=A=>(Ms(A)&&(A.value=Object.freeze(A.value)),A);return El(b)?b.then(A=>C(A)):C(b)}unwrap(){return this._def.innerType}}Gl.create=(y,m)=>new Gl({innerType:y,typeName:ut.ZodReadonly,...xt(m)});function tm(y,m){const b=typeof y=="function"?y(m):typeof y=="string"?{message:y}:y;return typeof b=="string"?{message:b}:b}function im(y,m={},b){return y?bo.create().superRefine((C,A)=>{var D,S;const o=y(C);if(o instanceof Promise)return o.then(le=>{var ue,_e;if(!le){const Re=tm(m,C),xe=(_e=(ue=Re.fatal)!==null&&ue!==void 0?ue:b)!==null&&_e!==void 0?_e:!0;A.addIssue({code:"custom",...Re,fatal:xe})}});if(!o){const le=tm(m,C),ue=(S=(D=le.fatal)!==null&&D!==void 0?D:b)!==null&&S!==void 0?S:!0;A.addIssue({code:"custom",...le,fatal:ue})}}):bo.create()}const Qy={object:Si.lazycreate};var ut;(function(y){y.ZodString="ZodString",y.ZodNumber="ZodNumber",y.ZodNaN="ZodNaN",y.ZodBigInt="ZodBigInt",y.ZodBoolean="ZodBoolean",y.ZodDate="ZodDate",y.ZodSymbol="ZodSymbol",y.ZodUndefined="ZodUndefined",y.ZodNull="ZodNull",y.ZodAny="ZodAny",y.ZodUnknown="ZodUnknown",y.ZodNever="ZodNever",y.ZodVoid="ZodVoid",y.ZodArray="ZodArray",y.ZodObject="ZodObject",y.ZodUnion="ZodUnion",y.ZodDiscriminatedUnion="ZodDiscriminatedUnion",y.ZodIntersection="ZodIntersection",y.ZodTuple="ZodTuple",y.ZodRecord="ZodRecord",y.ZodMap="ZodMap",y.ZodSet="ZodSet",y.ZodFunction="ZodFunction",y.ZodLazy="ZodLazy",y.ZodLiteral="ZodLiteral",y.ZodEnum="ZodEnum",y.ZodEffects="ZodEffects",y.ZodNativeEnum="ZodNativeEnum",y.ZodOptional="ZodOptional",y.ZodNullable="ZodNullable",y.ZodDefault="ZodDefault",y.ZodCatch="ZodCatch",y.ZodPromise="ZodPromise",y.ZodBranded="ZodBranded",y.ZodPipeline="ZodPipeline",y.ZodReadonly="ZodReadonly"})(ut||(ut={}));const ex=(y,m={message:`Input not instance of ${y.name}`})=>im(b=>b instanceof y,m),rm=xn.create,nm=Oa.create,tx=Nu.create,ix=ja.create,am=Rl.create,rx=Is.create,nx=Fu.create,ax=Dl.create,sx=Ll.create,ox=bo.create,lx=Cs.create,cx=ha.create,ux=Bu.create,hx=vn.create,dx=Si.create,px=Si.strictCreate,fx=Fl.create,mx=Ou.create,gx=Bl.create,_x=Vn.create,yx=Ol.create,xx=ju.create,vx=ks.create,bx=To.create,wx=jl.create,Tx=Nl.create,Px=Na.create,Sx=Zl.create,Mx=Po.create,sm=bn.create,Ix=Un.create,Cx=Za.create,kx=bn.createWithPreprocess,Ex=$l.create;var ct=Object.freeze({__proto__:null,defaultErrorMap:xo,setErrorMap:ky,getErrorMap:Ru,makeIssue:Du,EMPTY_PATH:Ey,addIssueToContext:qe,ParseStatus:hr,INVALID:dt,DIRTY:vo,OK:Sr,isAborted:Id,isDirty:Cd,isValid:Ms,isAsync:El,get util(){return Nt},get objectUtil(){return Md},ZodParsedType:Ke,getParsedType:ua,ZodType:Mt,datetimeRegex:Qf,ZodString:xn,ZodNumber:Oa,ZodBigInt:ja,ZodBoolean:Rl,ZodDate:Is,ZodSymbol:Fu,ZodUndefined:Dl,ZodNull:Ll,ZodAny:bo,ZodUnknown:Cs,ZodNever:ha,ZodVoid:Bu,ZodArray:vn,ZodObject:Si,ZodUnion:Fl,ZodDiscriminatedUnion:Ou,ZodIntersection:Bl,ZodTuple:Vn,ZodRecord:Ol,ZodMap:ju,ZodSet:ks,ZodFunction:To,ZodLazy:jl,ZodLiteral:Nl,ZodEnum:Na,ZodNativeEnum:Zl,ZodPromise:Po,ZodEffects:bn,ZodTransformer:bn,ZodOptional:Un,ZodNullable:Za,ZodDefault:Vl,ZodCatch:Ul,ZodNaN:Nu,BRAND:Jy,ZodBranded:Ad,ZodPipeline:$l,ZodReadonly:Gl,custom:im,Schema:Mt,ZodSchema:Mt,late:Qy,get ZodFirstPartyTypeKind(){return ut},coerce:{string:y=>xn.create({...y,coerce:!0}),number:y=>Oa.create({...y,coerce:!0}),boolean:y=>Rl.create({...y,coerce:!0}),bigint:y=>ja.create({...y,coerce:!0}),date:y=>Is.create({...y,coerce:!0})},any:ox,array:hx,bigint:ix,boolean:am,date:rx,discriminatedUnion:mx,effect:sm,enum:Px,function:bx,instanceof:ex,intersection:gx,lazy:wx,literal:Tx,map:xx,nan:tx,nativeEnum:Sx,never:cx,null:sx,nullable:Cx,number:nm,object:dx,oboolean:()=>am().optional(),onumber:()=>nm().optional(),optional:Ix,ostring:()=>rm().optional(),pipeline:Ex,preprocess:kx,promise:Mx,record:yx,set:vx,strictObject:px,string:rm,symbol:nx,transformer:sm,tuple:_x,undefined:ax,union:fx,unknown:lx,void:ux,NEVER:dt,ZodIssueCode:Oe,quotelessJson:Cy,ZodError:qr});const om=ct.object({lat:ct.number(),lng:ct.number()}),Ax=ct.object({sw:om,ne:om}),zx=ct.object({name:ct.literal("dark").or(ct.literal("light")),url:ct.string().optional(),colors:ct.object({primary:ct.string().max(64),background:ct.string().max(64),text:ct.string().max(64)})}),Rx=ct.object({container:ct.string(),position:ct.object({center:ct.object({lat:ct.number(),lng:ct.number()}),zoom:ct.number()}),style:zx,events:ct.object({onMapIdle:ct.function().returns(ct.void()).optional(),onMapMove:ct.function().args(ct.object({lat:ct.number(),lng:ct.number(),zoom:ct.number()})).returns(ct.void()).optional(),onMapClick:ct.function().returns(ct.void()).optional(),onPopupClick:ct.function().args(ct.string()).returns(ct.void()).optional(),onLoadingStart:ct.function().returns(ct.void()).optional(),onLoadingEnd:ct.function().returns(ct.void()).optional()}).optional()}),Dx=ct.object({id:ct.string(),rank:ct.number(),lat:ct.number(),lng:ct.number(),width:ct.number(),height:ct.number()}),lm=ct.array(Dx);ct.function().args(Ax).returns(ct.promise(lm));const Lx=ct.function().args(ct.string()).returns(ct.promise(ct.any()));var Fx=(y,m,b)=>m(tt(b).marker.id),Bx=go('<div class="popup svelte-1s5t15y"></div>'),Ox=go("<!> <!>",1),jx=go('<div class="marker"><!></div>'),Nx=go('<div class="container svelte-1s5t15y"><div class="map svelte-1s5t15y"></div> <div class="markers svelte-1s5t15y"></div></div>');function cm(y,m){var Cr,kr,Di,Hr,vi,si,ar;fu(m,!0);let b,C,A=0,D=Pi(!1);Nf(()=>{Rx.parse(m.options),S(),o()});function S(){const Ve=m.options.position;b=new Sd.Map({style:Ot(m.options.style),center:{lat:Ve.center.lat,lng:Ve.center.lng},zoom:Ve.zoom,minZoom:De(),maxZoom:$f,container:C,pitchWithRotate:!1,attributionControl:{compact:!1}})}function o(){b.on("load",le),b.on("move",ue),b.on("idle",_e),b.on("click",Re),b.dragRotate.disable(),b.keyboard.disable(),b.touchZoomRotate.disableRotation(),b.touchPitch.disable()}function le(){ai(D,!0)}function ue(){var Ve;if((Ve=m.options.events)!=null&&Ve.onMapMove){const Ye=b.getCenter(),Zt=b.getZoom();m.options.events.onMapMove({lat:Ye.lat,lng:Ye.lng,zoom:Zt})}}function _e(){var Ve,Ye;(Ye=(Ve=m.options.events)==null?void 0:Ve.onMapIdle)==null||Ye.call(null)}function Re(Ve){var Ye,Zt;(Zt=(Ye=m.options.events)==null?void 0:Ye.onMapClick)==null||Zt.call(null)}function xe(Ve){var Ye,Zt;(Zt=(Ye=m.options.events)==null?void 0:Ye.onPopupClick)==null||Zt.call(null,Ve)}function ie(){gt(De())}function De(){const Ye=Math.ceil(Math.log2(A/Uf));return Math.max(dy,Ye)}function gt(Ve){b==null||b.setMinZoom(Ve)}function $t(){const Ve=b==null?void 0:b.getCenter();return Ve?{lat:Ve.lat,lng:Ve.lng}:{lat:m.options.position.center.lat,lng:m.options.position.center.lng}}function _t(Ve){b==null||b.setCenter(Ve)}function Rt(){return(b==null?void 0:b.getZoom())??m.options.position.zoom}function Mi(Ve){b==null||b.setZoom(Ve)}function Jt(){const Ve=b==null?void 0:b.getBounds();if(Ve)return{sw:{lat:Ve.getSouthWest().lat,lng:Ve.getSouthWest().lng},ne:{lat:Ve.getNorthEast().lat,lng:Ve.getNorthEast().lng}}}function pi(){b==null||b.zoomIn()}function Bt(){b==null||b.zoomOut()}let vt=Pi(la(m.options.style));fo(()=>{tt(D)&&b.setStyle(Ot(tt(vt)),{diff:!0})});function Ot(Ve){if(Ve.url)return Ve.url;switch(Ve.name){case"light":return Iy;case"dark":return My}}function rr(){return g_(tt(vt))}function on(Ve){ai(vt,Ve,!0),b.setStyle(Ot(tt(vt)),{diff:!0})}class Mr{constructor(Ye){Ts(this,"marker");Ts(this,"libreMarker");wr(this,Cr,Pi());wr(this,kr,Pi(!1));wr(this,Di,Pi());wr(this,Hr,Pi());wr(this,vi,Pi(!1));wr(this,si,Pi());wr(this,ar,Pi());this.marker=Ye,this.libreMarker=void 0,this.element=void 0,this.rendered=!1,this.content=void 0,this.contentLoading=!1,this.component=void 0,this.circle=void 0}get element(){return tt(Ft(this,Cr))}set element(Ye){ai(Ft(this,Cr),Ye,!0)}get rendered(){return tt(Ft(this,kr))}set rendered(Ye){ai(Ft(this,kr),Ye,!0)}get popup(){return tt(Ft(this,Di))}set popup(Ye){ai(Ft(this,Di),Ye,!0)}get content(){return tt(Ft(this,Hr))}set content(Ye){ai(Ft(this,Hr),Ye,!0)}get contentLoading(){return tt(Ft(this,vi))}set contentLoading(Ye){ai(Ft(this,vi),Ye,!0)}get component(){return tt(Ft(this,si))}set component(Ye){ai(Ft(this,si),Ye,!0)}get circle(){return tt(Ft(this,ar))}set circle(Ye){ai(Ft(this,ar),Ye,!0)}getAngle(Ye){let Zt=this.marker.angs,Gt=Zt[0],bi=0;for(;Gt[0]<Ye&&(bi++,bi!=Zt.length);)Gt=Zt[bi];return Gt[1]}getDistance(Ye){return(this.marker.zet-Ye)/Gf}updateZIndex(){var Gt;const Ye=(Gt=this.libreMarker)==null?void 0:Gt.getElement();if(!Ye)throw new Error("Failed to update zIndex");const Zt=Math.round(($f-this.marker.zet)*py);Ye.style.zIndex=Zt.toString()}}Cr=new WeakMap,kr=new WeakMap,Di=new WeakMap,Hr=new WeakMap,vi=new WeakMap,si=new WeakMap,ar=new WeakMap;let yt,ui,At=la(new Array),nr=la(new Map),Tt=new Array,dr;Nf(()=>{const Ve=()=>{Or(),yt=window.setTimeout(Ve,25)};return Ve(),()=>{clearInterval(yt),clearInterval(ui)}});function Or(){if(tt(D)==!1||At.length==0||dr==null)return;const Ve=b.getZoom();if(!Ve)return;const Ye=new Array,Zt=Uf,Gt=new Wf(b,-512,window.innerHeight+Zt,window.innerWidth+Zt,-512),bi=new Wf(b,0,window.innerHeight,window.innerWidth,0);for(let Pt=0;Pt<At.length;Pt++){const st=At[Pt],It=st.marker,qt=st.libreMarker;if(qt){if(It.zet<=Ve&&Gt.contains(It.lat,It.lng)){qt._map!=b&&qt.addTo(b),Ye.push(st);continue}if(It.zet<=Ve+Gf&&bi.contains(It.lat,It.lng)){qt._map!=b&&qt.addTo(b),Ye.push(st);continue}qt._map!=null&&qt.remove()}}for(let Pt=0;Pt<Ye.length;Pt++){const st=Ye[Pt],It=st.marker;st.rendered||(st.rendered=!0);const qt=st.component,qi=st.circle;if(!qi||!qt)continue;It.zet<=Ve+fy?qt.setDisplayed(!0):qt.setDisplayed(!1),It.zet<=Ve?(qi.setCollapsed(!0),qt.setCollapsed(!1),qt.setAngle(st.getAngle(Ve))):(qt.setCollapsed(!0),qi==null||qi.setCollapsed(!1),qi==null||qi.setDistance(st.getDistance(Ve)));const fi=st.popup;if(!fi)continue;st.content==null&&st.contentLoading==!1&&(st.contentLoading=!0,dr(It.id).then(fr=>{st.content=fr,st.contentLoading=!1}));const sr=st.content;if(!sr)continue;fi.firstElementChild==null&&fi.appendChild(sr)}}async function Wr(Ve){var bi;const Ye=new Map(Ve.map(Pt=>[Pt.id,new Mr(Pt)])),Zt=new Array,Gt=Array.from(At);for(const Pt of Gt)Ye.has(Pt.marker.id)==!1&&((bi=Pt.libreMarker)==null||bi.remove(),nr.delete(Pt.marker.id),At.splice(At.indexOf(Pt),1));for(const Pt of Ve){const st=nr.get(Pt.id);if(st)st.marker=Pt,st.updateZIndex();else{const It=new Mr(Pt);nr.set(Pt.id,It),At.push(It),Zt.push(It)}}await O_();for(const Pt of Zt){const st=Pt.marker,It=Pt.element;if(!It)throw new Error("Failed to render marker element.");const qt=new Sd.Marker({element:It});qt.setLngLat([st.lng,st.lat]),Pt.libreMarker=qt,Pt.updateZIndex()}}function wn(){var Ve;for(let Ye=0;Ye<At.length;Ye++)(Ve=At[Ye].libreMarker)==null||Ve.remove();At.length=0,nr.clear()}function $n(Ve){if(!Lx.safeParse(Ve).success)throw new Error("Invalid popup content callback");dr=Ve}async function jr(Ve){var Zt,Gt,bi,Pt;if(dr==null)throw new Error("Popup content callback not set");if(!(await lm.safeParseAsync(Ve)).success)throw new Error("Invalid popups");try{(Gt=(Zt=m.options.events)==null?void 0:Zt.onLoadingStart)==null||Gt.call(null);for(const st of Ve){const It=Tt.findIndex(qt=>qt.id==st.id);It==-1?Tt.push(st):Tt[It]=st}await Wr(await vy(Tt))}finally{(Pt=(bi=m.options.events)==null?void 0:bi.onLoadingEnd)==null||Pt.call(null)}}function Ir(){wn()}var Ji=Nx();$_("resize",hd,ie);var Ei=Pl(Ji);Ba(Ei,Ve=>C=Ve,()=>C);var Tn=dd(Ei,2);return J_(Tn,21,()=>At,Ve=>Ve.marker.id,(Ve,Ye,Zt)=>{var Gt=jx(),bi=Pl(Gt);{var Pt=st=>{var It=Ox(),qt=T_(It);Ba(xy(qt,{}),(fi,sr)=>sr.circle=fi,fi=>fi==null?void 0:fi.circle,()=>[tt(Ye)]);var qi=dd(qt,2);Ba(_y(qi,{children:(fi,sr)=>{var pr=Bx();pr.__click=[Fx,xe,Ye],Ba(pr,(fr,Xr)=>Xr.popup=fr,fr=>fr==null?void 0:fr.popup,()=>[tt(Ye)]),vu(()=>Au(pr,`width: ${tt(Ye).marker.width??""}px; height: ${tt(Ye).marker.height??""}px;`)),_o(fi,pr)},$$slots:{default:!0}}),(fi,sr)=>sr.component=fi,fi=>fi==null?void 0:fi.component,()=>[tt(Ye)]),_o(st,It)};K_(bi,st=>{tt(Ye).rendered&&st(Pt)})}Ba(Gt,(st,It)=>It.element=st,st=>st==null?void 0:st.element,()=>[tt(Ye)]),_o(Ve,Gt)}),vu(()=>Au(Ji,`--primary: ${tt(vt).colors.primary??""}; --background: ${tt(vt).colors.background??""}; --text: ${tt(vt).colors.text??""};`)),_o(y,Ji),mu({getCenter:$t,setCenter:_t,getZoom:Rt,setZoom:Mi,getBounds:Jt,zoomIn:pi,zoomOut:Bt,getStyle:rr,setStyle:on,updatePopupsContentCallback:$n,updatePopups:jr,removePopups:Ir})}G_(["click"]);function Zx(y){const m=document.getElementById(y.container);if(!m)throw new Error(`Container not found: ${y.container}`);return W_(cm,{target:m,props:{options:y}})}function Vx(y){X_(y)}Vt.Map=cm,Vt.mountMap=Zx,Vt.unmountMap=Vx,Object.defineProperty(Vt,Symbol.toStringTag,{value:"Module"})});
|