From 774cf561b77d808e8ebc837920c7511cb8a23752 Mon Sep 17 00:00:00 2001 From: webprofusion-chrisc Date: Fri, 25 Aug 2023 16:47:04 +0800 Subject: [PATCH] Update --- index.html | 2 +- main.4d54e5fa71416a11.js | 1 + main.819383d819882ebf.js | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 main.4d54e5fa71416a11.js delete mode 100644 main.819383d819882ebf.js diff --git a/index.html b/index.html index b517b75a..b2d722d5 100644 --- a/index.html +++ b/index.html @@ -37,6 +37,6 @@ - + \ No newline at end of file diff --git a/main.4d54e5fa71416a11.js b/main.4d54e5fa71416a11.js new file mode 100644 index 00000000..d20ac49e --- /dev/null +++ b/main.4d54e5fa71416a11.js @@ -0,0 +1 @@ +(self.webpackChunkapp=self.webpackChunkapp||[]).push([[179],{6091:(Nn,yt,k)=>{"use strict";k.d(yt,{Ar:()=>_e,N0:()=>Ne});var x=k(2029),h=k(6814),y=k(7398),s=k(1631),J=k(4911),ie=k(2096),Y=k(9862);const E=new x.OlP("JWT_OPTIONS");let Ne=(()=>{class ee{constructor(oe=null){this.tokenGetter=oe&&oe.tokenGetter||function(){}}urlBase64Decode(oe){let Be=oe.replace(/-/g,"+").replace(/_/g,"/");switch(Be.length%4){case 0:break;case 2:Be+="==";break;case 3:Be+="=";break;default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(Be)}b64decode(oe){let Ie="";if((oe=String(oe).replace(/=+$/,"")).length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let Ue,et,Ee=0,le=0;et=oe.charAt(le++);~et&&(Ue=Ee%4?64*Ue+et:et,Ee++%4)?Ie+=String.fromCharCode(255&Ue>>(-2*Ee&6)):0)et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(et);return Ie}b64DecodeUnicode(oe){return decodeURIComponent(Array.prototype.map.call(this.b64decode(oe),Be=>"%"+("00"+Be.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(oe=this.tokenGetter()){return oe instanceof Promise?oe.then(Be=>this._decodeToken(Be)):this._decodeToken(oe)}_decodeToken(oe){if(!oe||""===oe)return null;const Be=oe.split(".");if(3!==Be.length)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");const Ie=this.urlBase64Decode(Be[1]);if(!Ie)throw new Error("Cannot decode the token.");return JSON.parse(Ie)}getTokenExpirationDate(oe=this.tokenGetter()){return oe instanceof Promise?oe.then(Be=>this._getTokenExpirationDate(Be)):this._getTokenExpirationDate(oe)}_getTokenExpirationDate(oe){let Be;if(Be=this.decodeToken(oe),!Be||!Be.hasOwnProperty("exp"))return null;const Ie=new Date(0);return Ie.setUTCSeconds(Be.exp),Ie}isTokenExpired(oe=this.tokenGetter(),Be){return oe instanceof Promise?oe.then(Ie=>this._isTokenExpired(Ie,Be)):this._isTokenExpired(oe,Be)}_isTokenExpired(oe,Be){if(!oe||""===oe)return!0;const Ie=this.getTokenExpirationDate(oe);return Be=Be||0,null!==Ie&&!(Ie.valueOf()>(new Date).valueOf()+1e3*Be)}getAuthScheme(oe,Be){return"function"==typeof oe?oe(Be):oe}}return ee.\u0275fac=function(oe){return new(oe||ee)(x.LFG(E))},ee.\u0275prov=x.Yz7({token:ee,factory:ee.\u0275fac}),ee})();const me=ee=>ee instanceof Promise?(0,J.P)(()=>ee):(0,ie.of)(ee);let he=(()=>{class ee{constructor(oe,Be,Ie){this.jwtHelper=Be,this.document=Ie,this.standardPorts=["80","443"],this.tokenGetter=oe.tokenGetter,this.headerName=oe.headerName||"Authorization",this.authScheme=oe.authScheme||""===oe.authScheme?oe.authScheme:"Bearer ",this.allowedDomains=oe.allowedDomains||[],this.disallowedRoutes=oe.disallowedRoutes||[],this.throwNoTokenError=oe.throwNoTokenError||!1,this.skipWhenExpired=oe.skipWhenExpired}isAllowedDomain(oe){const Be=new URL(oe.url,this.document.location.origin);if(Be.host===this.document.location.host)return!0;const Ie=`${Be.hostname}${Be.port&&!this.standardPorts.includes(Be.port)?":"+Be.port:""}`;return this.allowedDomains.findIndex(Ee=>"string"==typeof Ee?Ee===Ie:Ee instanceof RegExp&&Ee.test(Ie))>-1}isDisallowedRoute(oe){const Be=new URL(oe.url,this.document.location.origin);return this.disallowedRoutes.findIndex(Ie=>{if("string"==typeof Ie){const Ee=new URL(Ie,this.document.location.origin);return Ee.hostname===Be.hostname&&Ee.pathname===Be.pathname}return Ie instanceof RegExp&&Ie.test(oe.url)})>-1}handleInterception(oe,Be,Ie){const Ee=this.jwtHelper.getAuthScheme(this.authScheme,Be);if(!oe&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let Ue=(0,ie.of)(!1);return this.skipWhenExpired&&(Ue=oe?me(this.jwtHelper.isTokenExpired(oe)):(0,ie.of)(!0)),oe?Ue.pipe((0,y.U)(et=>et&&this.skipWhenExpired?Be.clone():Be.clone({setHeaders:{[this.headerName]:`${Ee}${oe}`}})),(0,s.z)(et=>Ie.handle(et))):Ie.handle(Be)}intercept(oe,Be){if(!this.isAllowedDomain(oe)||this.isDisallowedRoute(oe))return Be.handle(oe);const Ie=this.tokenGetter(oe);return me(Ie).pipe((0,s.z)(Ee=>this.handleInterception(Ee,oe,Be)))}}return ee.\u0275fac=function(oe){return new(oe||ee)(x.LFG(E),x.LFG(Ne),x.LFG(h.K0))},ee.\u0275prov=x.Yz7({token:ee,factory:ee.\u0275fac}),ee})(),_e=(()=>{class ee{constructor(oe){if(oe)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(oe){return{ngModule:ee,providers:[{provide:Y.TP,useClass:he,multi:!0},oe.jwtOptionsProvider||{provide:E,useValue:oe.config},Ne]}}}return ee.\u0275fac=function(oe){return new(oe||ee)(x.LFG(ee,12))},ee.\u0275mod=x.oAB({type:ee}),ee.\u0275inj=x.cJS({}),ee})()},2726:(Nn,yt,k)=>{"use strict";k.d(yt,{Uw:()=>Ie,fo:()=>ae});var x=k(5861);typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"&&global;var E=function(Pe){return Pe.Unimplemented="UNIMPLEMENTED",Pe.Unavailable="UNAVAILABLE",Pe}(E||{});class Ne extends Error{constructor(Ae,Ye,_t){super(Ae),this.message=Ae,this.code=Ye,this.data=_t}}const he=Pe=>{var Ae,Ye,_t,hn,qt;const Ht=Pe.CapacitorCustomPlatform||null,De=Pe.Capacitor||{},Je=De.Plugins=De.Plugins||{},Re=Pe.CapacitorPlatforms,St=(null===(Ae=Re?.currentPlatform)||void 0===Ae?void 0:Ae.getPlatform)||(()=>null!==Ht?Ht.name:(Pe=>{var Ae,Ye;return Pe?.androidBridge?"android":null!==(Ye=null===(Ae=Pe?.webkit)||void 0===Ae?void 0:Ae.messageHandlers)&&void 0!==Ye&&Ye.bridge?"ios":"web"})(Pe)),Rt=(null===(Ye=Re?.currentPlatform)||void 0===Ye?void 0:Ye.isNativePlatform)||(()=>"web"!==St()),Gt=(null===(_t=Re?.currentPlatform)||void 0===_t?void 0:_t.isPluginAvailable)||(Ut=>{const ii=Ot.get(Ut);return!(!ii?.platforms.has(St())&&!Jt(Ut))}),Jt=(null===(hn=Re?.currentPlatform)||void 0===hn?void 0:hn.getPluginHeader)||(Ut=>{var ii;return null===(ii=De.PluginHeaders)||void 0===ii?void 0:ii.find(gn=>gn.name===Ut)}),Ot=new Map,Yt=(null===(qt=Re?.currentPlatform)||void 0===qt?void 0:qt.registerPlugin)||((Ut,ii={})=>{const gn=Ot.get(Ut);if(gn)return console.warn(`Capacitor plugin "${Ut}" already registered. Cannot register plugins twice.`),gn.proxy;const Ft=St(),Jn=Jt(Ut);let Wt;const wt=function(){var Fi=(0,x.Z)(function*(){return!Wt&&Ft in ii?Wt=Wt="function"==typeof ii[Ft]?yield ii[Ft]():ii[Ft]:null!==Ht&&!Wt&&"web"in ii&&(Wt=Wt="function"==typeof ii.web?yield ii.web():ii.web),Wt});return function(){return Fi.apply(this,arguments)}}(),ln=Fi=>{let Cn;const Mn=(...qn)=>{const yn=wt().then(_n=>{const Hi=((Fi,Cn)=>{var Mn,qn;if(!Jn){if(Fi)return null===(qn=Fi[Cn])||void 0===qn?void 0:qn.bind(Fi);throw new Ne(`"${Ut}" plugin is not implemented on ${Ft}`,E.Unimplemented)}{const yn=Jn?.methods.find(_n=>Cn===_n.name);if(yn)return"promise"===yn.rtype?_n=>De.nativePromise(Ut,Cn.toString(),_n):(_n,Hi)=>De.nativeCallback(Ut,Cn.toString(),_n,Hi);if(Fi)return null===(Mn=Fi[Cn])||void 0===Mn?void 0:Mn.bind(Fi)}})(_n,Fi);if(Hi){const nt=Hi(...qn);return Cn=nt?.remove,nt}throw new Ne(`"${Ut}.${Fi}()" is not implemented on ${Ft}`,E.Unimplemented)});return"addListener"===Fi&&(yn.remove=(0,x.Z)(function*(){return Cn()})),yn};return Mn.toString=()=>`${Fi.toString()}() { [capacitor code] }`,Object.defineProperty(Mn,"name",{value:Fi,writable:!1,configurable:!1}),Mn},ni=ln("addListener"),er=ln("removeListener"),lr=(Fi,Cn)=>{const Mn=ni({eventName:Fi},Cn),qn=function(){var _n=(0,x.Z)(function*(){const Hi=yield Mn;er({eventName:Fi,callbackId:Hi},Cn)});return function(){return _n.apply(this,arguments)}}(),yn=new Promise(_n=>Mn.then(()=>_n({remove:qn})));return yn.remove=(0,x.Z)(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield qn()}),yn},mi=new Proxy({},{get(Fi,Cn){switch(Cn){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return Jn?lr:ni;case"removeListener":return er;default:return ln(Cn)}}});return Je[Ut]=mi,Ot.set(Ut,{name:Ut,proxy:mi,platforms:new Set([...Object.keys(ii),...Jn?[Ft]:[]])}),mi});return De.convertFileSrc||(De.convertFileSrc=Ut=>Ut),De.getPlatform=St,De.handleError=Ut=>Pe.console.error(Ut),De.isNativePlatform=Rt,De.isPluginAvailable=Gt,De.pluginMethodNoop=(Ut,ii,gn)=>Promise.reject(`${gn} does not have an implementation of "${ii}".`),De.registerPlugin=Yt,De.Exception=Ne,De.DEBUG=!!De.DEBUG,De.isLoggingEnabled=!!De.isLoggingEnabled,De.platform=De.getPlatform(),De.isNative=De.isNativePlatform(),De},ee=(Pe=>Pe.Capacitor=he(Pe))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),ae=ee.registerPlugin;class Ie{constructor(Ae){this.listeners={},this.windowListeners={},Ae&&(console.warn(`Capacitor WebPlugin "${Ae.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=Ae)}addListener(Ae,Ye){var _t=this;this.listeners[Ae]||(this.listeners[Ae]=[]),this.listeners[Ae].push(Ye);const qt=this.windowListeners[Ae];qt&&!qt.registered&&this.addWindowListener(qt);const Ht=function(){var Je=(0,x.Z)(function*(){return _t.removeListener(Ae,Ye)});return function(){return Je.apply(this,arguments)}}(),De=Promise.resolve({remove:Ht});return Object.defineProperty(De,"remove",{value:(Je=(0,x.Z)(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Ht()}),function(){return Je.apply(this,arguments)})}),De;var Je}removeAllListeners(){var Ae=this;return(0,x.Z)(function*(){Ae.listeners={};for(const Ye in Ae.windowListeners)Ae.removeWindowListener(Ae.windowListeners[Ye]);Ae.windowListeners={}})()}notifyListeners(Ae,Ye){const _t=this.listeners[Ae];_t&&_t.forEach(hn=>hn(Ye))}hasListeners(Ae){return!!this.listeners[Ae].length}registerWindowListener(Ae,Ye){this.windowListeners[Ye]={registered:!1,windowEventName:Ae,pluginEventName:Ye,handler:_t=>{this.notifyListeners(Ye,_t)}}}unimplemented(Ae="not implemented"){return new ee.Exception(Ae,E.Unimplemented)}unavailable(Ae="not available"){return new ee.Exception(Ae,E.Unavailable)}removeListener(Ae,Ye){var _t=this;return(0,x.Z)(function*(){const hn=_t.listeners[Ae];if(!hn)return;const qt=hn.indexOf(Ye);_t.listeners[Ae].splice(qt,1),_t.listeners[Ae].length||_t.removeWindowListener(_t.windowListeners[Ae])})()}addWindowListener(Ae){window.addEventListener(Ae.windowEventName,Ae.handler),Ae.registered=!0}removeWindowListener(Ae){Ae&&(window.removeEventListener(Ae.windowEventName,Ae.handler),Ae.registered=!1)}}const Ue=Pe=>encodeURIComponent(Pe).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),et=Pe=>Pe.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class le extends Ie{getCookies(){return(0,x.Z)(function*(){const Ae=document.cookie,Ye={};return Ae.split(";").forEach(_t=>{if(_t.length<=0)return;let[hn,qt]=_t.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");hn=et(hn).trim(),qt=et(qt).trim(),Ye[hn]=qt}),Ye})()}setCookie(Ae){return(0,x.Z)(function*(){try{const Ye=Ue(Ae.key),_t=Ue(Ae.value),hn=`; expires=${(Ae.expires||"").replace("expires=","")}`,qt=(Ae.path||"/").replace("path=",""),Ht=null!=Ae.url&&Ae.url.length>0?`domain=${Ae.url}`:"";document.cookie=`${Ye}=${_t||""}${hn}; path=${qt}; ${Ht};`}catch(Ye){return Promise.reject(Ye)}})()}deleteCookie(Ae){return(0,x.Z)(function*(){try{document.cookie=`${Ae.key}=; Max-Age=0`}catch(Ye){return Promise.reject(Ye)}})()}clearCookies(){return(0,x.Z)(function*(){try{const Ae=document.cookie.split(";")||[];for(const Ye of Ae)document.cookie=Ye.replace(/^ +/,"").replace(/=.*/,`=;expires=${(new Date).toUTCString()};path=/`)}catch(Ae){return Promise.reject(Ae)}})()}clearAllCookies(){var Ae=this;return(0,x.Z)(function*(){try{yield Ae.clearCookies()}catch(Ye){return Promise.reject(Ye)}})()}}ae("CapacitorCookies",{web:()=>new le});const ct=function(){var Pe=(0,x.Z)(function*(Ae){return new Promise((Ye,_t)=>{const hn=new FileReader;hn.onload=()=>{const qt=hn.result;Ye(qt.indexOf(",")>=0?qt.split(",")[1]:qt)},hn.onerror=qt=>_t(qt),hn.readAsDataURL(Ae)})});return function(Ye){return Pe.apply(this,arguments)}}();class gt extends Ie{request(Ae){return(0,x.Z)(function*(){const Ye=((Pe,Ae={})=>{const Ye=Object.assign({method:Pe.method||"GET",headers:Pe.headers},Ae),hn=((Pe={})=>{const Ae=Object.keys(Pe);return Object.keys(Pe).map(hn=>hn.toLocaleLowerCase()).reduce((hn,qt,Ht)=>(hn[qt]=Pe[Ae[Ht]],hn),{})})(Pe.headers)["content-type"]||"";if("string"==typeof Pe.data)Ye.body=Pe.data;else if(hn.includes("application/x-www-form-urlencoded")){const qt=new URLSearchParams;for(const[Ht,De]of Object.entries(Pe.data||{}))qt.set(Ht,De);Ye.body=qt.toString()}else if(hn.includes("multipart/form-data")){const qt=new FormData;if(Pe.data instanceof FormData)Pe.data.forEach((De,Je)=>{qt.append(Je,De)});else for(const De of Object.keys(Pe.data))qt.append(De,Pe.data[De]);Ye.body=qt;const Ht=new Headers(Ye.headers);Ht.delete("content-type"),Ye.headers=Ht}else(hn.includes("application/json")||"object"==typeof Pe.data)&&(Ye.body=JSON.stringify(Pe.data));return Ye})(Ae,Ae.webFetchExtra),_t=((Pe,Ae=!0)=>Pe?Object.entries(Pe).reduce((_t,hn)=>{const[qt,Ht]=hn;let De,Je;return Array.isArray(Ht)?(Je="",Ht.forEach(Re=>{De=Ae?encodeURIComponent(Re):Re,Je+=`${qt}=${De}&`}),Je.slice(0,-1)):(De=Ae?encodeURIComponent(Ht):Ht,Je=`${qt}=${De}`),`${_t}&${Je}`},"").substr(1):null)(Ae.params,Ae.shouldEncodeUrlParams),hn=_t?`${Ae.url}?${_t}`:Ae.url,qt=yield fetch(hn,Ye),Ht=qt.headers.get("content-type")||"";let Je,Re,{responseType:De="text"}=qt.ok?Ae:{};switch(Ht.includes("application/json")&&(De="json"),De){case"arraybuffer":case"blob":Re=yield qt.blob(),Je=yield ct(Re);break;case"json":Je=yield qt.json();break;default:Je=yield qt.text()}const Fe={};return qt.headers.forEach((St,Ce)=>{Fe[Ce]=St}),{data:Je,headers:Fe,status:qt.status,url:qt.url}})()}get(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"GET"}))})()}post(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"POST"}))})()}put(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"PUT"}))})()}patch(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"PATCH"}))})()}delete(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"DELETE"}))})()}}ae("CapacitorHttp",{web:()=>new gt})},1774:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>Be});var x=k(6225),h=k(839);let y;const J=Ie=>Ie.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ie=Ie=>(void 0===y&&(y=void 0===Ie.style.animationName&&void 0!==Ie.style.webkitAnimationName?"-webkit-":""),y),Y=(Ie,Ee,Ue)=>{const et=Ee.startsWith("animation")?ie(Ie):"";Ie.style.setProperty(et+Ee,Ue)},E=(Ie,Ee)=>{const Ue=Ee.startsWith("animation")?ie(Ie):"";Ie.style.removeProperty(Ue+Ee)},he=[],oe=(Ie=[],Ee)=>{if(void 0!==Ee){const Ue=Array.isArray(Ee)?Ee:[Ee];return[...Ie,...Ue]}return Ie},Be=Ie=>{let Ee,Ue,et,le,ue,ct,Te,De,Je,Re,Fe,Qt,Gt,ht=[],Le=[],ye=[],gt=!1,Pe={},Ae=[],Ye=[],_t={},hn=0,qt=!1,Ht=!1,St=!0,Ce=!1,Rt=!0,Zt=!1;const Jt=Ie,kt=[],dt=[],Ot=[],pt=[],Yt=[],Ut=[],ii=[],gn=[],Ft=[],Jn=[],Wt="function"==typeof AnimationEffect||void 0!==x.w&&"function"==typeof x.w.AnimationEffect,wt="function"==typeof Element&&"function"==typeof Element.prototype.animate&&Wt,ln=()=>Jn,Fi=(fe,je)=>((je?.oneTimeCallback?dt:kt).push({c:fe,o:je}),Gt),Mn=()=>{if(wt)Jn.forEach(fe=>{fe.cancel()}),Jn.length=0;else{const fe=Ot.slice();(0,h.r)(()=>{fe.forEach(je=>{E(je,"animation-name"),E(je,"animation-duration"),E(je,"animation-timing-function"),E(je,"animation-iteration-count"),E(je,"animation-delay"),E(je,"animation-play-state"),E(je,"animation-fill-mode"),E(je,"animation-direction")})})}},qn=()=>{Yt.forEach(fe=>{fe?.parentNode&&fe.parentNode.removeChild(fe)}),Yt.length=0},Xt=()=>void 0!==ue?ue:Te?Te.getFill():"both",Sn=()=>void 0!==Je?Je:void 0!==ct?ct:Te?Te.getDirection():"normal",zn=()=>qt?"linear":void 0!==et?et:Te?Te.getEasing():"linear",pe=()=>Ht?0:void 0!==Re?Re:void 0!==Ue?Ue:Te?Te.getDuration():0,ze=()=>void 0!==le?le:Te?Te.getIterations():1,xe=()=>void 0!==Fe?Fe:void 0!==Ee?Ee:Te?Te.getDelay():0,ti=()=>{0!==hn&&(hn--,0===hn&&((()=>{yr(),gn.forEach(Vt=>Vt()),Ft.forEach(Vt=>Vt());const fe=St?1:0,je=Ae,lt=Ye,an=_t;Ot.forEach(Vt=>{const vn=Vt.classList;je.forEach(Dn=>vn.add(Dn)),lt.forEach(Dn=>vn.remove(Dn));for(const Dn in an)an.hasOwnProperty(Dn)&&Y(Vt,Dn,an[Dn])}),kt.forEach(Vt=>Vt.c(fe,Gt)),dt.forEach(Vt=>Vt.c(fe,Gt)),dt.length=0,Rt=!0,St&&(Ce=!0),St=!0})(),Te&&Te.animationFinish()))},gi=(fe=!0)=>{qn();const je=(Ie=>(Ie.forEach(Ee=>{for(const Ue in Ee)if(Ee.hasOwnProperty(Ue)){const et=Ee[Ue];if("easing"===Ue)Ee["animation-timing-function"]=et,delete Ee[Ue];else{const le=J(Ue);le!==Ue&&(Ee[le]=et,delete Ee[Ue])}}}),Ie))(ht);Ot.forEach(lt=>{if(je.length>0){const an=((Ie=[])=>Ie.map(Ee=>{const Ue=Ee.offset,et=[];for(const le in Ee)Ee.hasOwnProperty(le)&&"offset"!==le&&et.push(`${le}: ${Ee[le]};`);return`${100*Ue}% { ${et.join(" ")} }`}).join(" "))(je);Qt=void 0!==Ie?Ie:(Ie=>{let Ee=he.indexOf(Ie);return Ee<0&&(Ee=he.push(Ie)-1),`ion-animation-${Ee}`})(an);const Vt=((Ie,Ee,Ue)=>{var et;const le=(Ie=>{const Ee=void 0!==Ie.getRootNode?Ie.getRootNode():Ie;return Ee.head||Ee})(Ue),ue=ie(Ue),ct=le.querySelector("#"+Ie);if(ct)return ct;const ht=(null!==(et=Ue.ownerDocument)&&void 0!==et?et:document).createElement("style");return ht.id=Ie,ht.textContent=`@${ue}keyframes ${Ie} { ${Ee} } @${ue}keyframes ${Ie}-alt { ${Ee} }`,le.appendChild(ht),ht})(Qt,an,lt);Yt.push(Vt),Y(lt,"animation-duration",`${pe()}ms`),Y(lt,"animation-timing-function",zn()),Y(lt,"animation-delay",`${xe()}ms`),Y(lt,"animation-fill-mode",Xt()),Y(lt,"animation-direction",Sn());const vn=ze()===1/0?"infinite":ze().toString();Y(lt,"animation-iteration-count",vn),Y(lt,"animation-play-state","paused"),fe&&Y(lt,"animation-name",`${Vt.id}-alt`),(0,h.r)(()=>{Y(lt,"animation-name",Vt.id||null)})}})},Li=(fe=!0)=>{(()=>{Ut.forEach(an=>an()),ii.forEach(an=>an());const fe=Le,je=ye,lt=Pe;Ot.forEach(an=>{const Vt=an.classList;fe.forEach(vn=>Vt.add(vn)),je.forEach(vn=>Vt.remove(vn));for(const vn in lt)lt.hasOwnProperty(vn)&&Y(an,vn,lt[vn])})})(),ht.length>0&&(wt?(Ot.forEach(fe=>{const je=fe.animate(ht,{id:Jt,delay:xe(),duration:pe(),easing:zn(),iterations:ze(),fill:Xt(),direction:Sn()});je.pause(),Jn.push(je)}),Jn.length>0&&(Jn[0].onfinish=()=>{ti()})):gi(fe)),gt=!0},bi=fe=>{if(fe=Math.min(Math.max(fe,0),.9999),wt)Jn.forEach(je=>{je.currentTime=je.effect.getComputedTiming().delay+pe()*fe,je.pause()});else{const je=`-${pe()*fe}ms`;Ot.forEach(lt=>{ht.length>0&&(Y(lt,"animation-delay",je),Y(lt,"animation-play-state","paused"))})}},ir=fe=>{Jn.forEach(je=>{je.effect.updateTiming({delay:xe(),duration:pe(),easing:zn(),iterations:ze(),fill:Xt(),direction:Sn()})}),void 0!==fe&&bi(fe)},Dr=(fe=!0,je)=>{(0,h.r)(()=>{Ot.forEach(lt=>{Y(lt,"animation-name",Qt||null),Y(lt,"animation-duration",`${pe()}ms`),Y(lt,"animation-timing-function",zn()),Y(lt,"animation-delay",void 0!==je?`-${je*pe()}ms`:`${xe()}ms`),Y(lt,"animation-fill-mode",Xt()||null),Y(lt,"animation-direction",Sn()||null);const an=ze()===1/0?"infinite":ze().toString();Y(lt,"animation-iteration-count",an),fe&&Y(lt,"animation-name",`${Qt}-alt`),(0,h.r)(()=>{Y(lt,"animation-name",Qt||null)})})})},vi=(fe=!1,je=!0,lt)=>(fe&&pt.forEach(an=>{an.update(fe,je,lt)}),wt?ir(lt):Dr(je,lt),Gt),Kt=()=>{gt&&(wt?Jn.forEach(fe=>{fe.pause()}):Ot.forEach(fe=>{Y(fe,"animation-play-state","paused")}),Zt=!0)},rr=()=>{De=void 0,ti()},yr=()=>{De&&clearTimeout(De)},to=fe=>new Promise(je=>{fe?.sync&&(Ht=!0,Fi(()=>Ht=!1,{oneTimeCallback:!0})),gt||Li(),Ce&&(wt?(bi(0),ir()):Dr(),Ce=!1),Rt&&(hn=pt.length+1,Rt=!1),Fi(()=>je(),{oneTimeCallback:!0}),pt.forEach(lt=>{lt.play()}),wt?(Jn.forEach(fe=>{fe.play()}),(0===ht.length||0===Ot.length)&&ti()):(()=>{if(yr(),(0,h.r)(()=>{Ot.forEach(fe=>{ht.length>0&&Y(fe,"animation-play-state","running")})}),0===ht.length||0===Ot.length)ti();else{const fe=xe()||0,je=pe()||0,lt=ze()||1;isFinite(lt)&&(De=setTimeout(rr,fe+je*lt+100)),((Ie,Ee)=>{let Ue;const et={passive:!0},ue=ct=>{Ie===ct.target&&(Ue&&Ue(),yr(),(0,h.r)(()=>{Ot.forEach(fe=>{E(fe,"animation-duration"),E(fe,"animation-delay"),E(fe,"animation-play-state")}),(0,h.r)(ti)}))};Ie&&(Ie.addEventListener("webkitAnimationEnd",ue,et),Ie.addEventListener("animationend",ue,et),Ue=()=>{Ie.removeEventListener("webkitAnimationEnd",ue,et),Ie.removeEventListener("animationend",ue,et)})})(Ot[0])}})(),Zt=!1}),Ei=(fe,je)=>{const lt=ht[0];return void 0===lt||void 0!==lt.offset&&0!==lt.offset?ht=[{offset:0,[fe]:je},...ht]:lt[fe]=je,Gt};return Gt={parentAnimation:Te,elements:Ot,childAnimations:pt,id:Jt,animationFinish:ti,from:Ei,to:(fe,je)=>{const lt=ht[ht.length-1];return void 0===lt||void 0!==lt.offset&&1!==lt.offset?ht=[...ht,{offset:1,[fe]:je}]:lt[fe]=je,Gt},fromTo:(fe,je,lt)=>Ei(fe,je).to(fe,lt),parent:fe=>(Te=fe,Gt),play:to,pause:()=>(pt.forEach(fe=>{fe.pause()}),Kt(),Gt),stop:()=>{pt.forEach(fe=>{fe.stop()}),gt&&(Mn(),gt=!1),qt=!1,Ht=!1,Rt=!0,Je=void 0,Re=void 0,Fe=void 0,hn=0,Ce=!1,St=!0,Zt=!1},destroy:fe=>(pt.forEach(je=>{je.destroy(fe)}),(fe=>{Mn(),fe&&qn()})(fe),Ot.length=0,pt.length=0,ht.length=0,kt.length=0,dt.length=0,gt=!1,Rt=!0,Gt),keyframes:fe=>{const je=ht!==fe;return ht=fe,je&&(fe=>{wt?ln().forEach(je=>{if(je.effect.setKeyframes)je.effect.setKeyframes(fe);else{const lt=new KeyframeEffect(je.effect.target,fe,je.effect.getTiming());je.effect=lt}}):gi()})(ht),Gt},addAnimation:fe=>{if(null!=fe)if(Array.isArray(fe))for(const je of fe)je.parent(Gt),pt.push(je);else fe.parent(Gt),pt.push(fe);return Gt},addElement:fe=>{if(null!=fe)if(1===fe.nodeType)Ot.push(fe);else if(fe.length>=0)for(let je=0;je(ue=fe,vi(!0),Gt),direction:fe=>(ct=fe,vi(!0),Gt),iterations:fe=>(le=fe,vi(!0),Gt),duration:fe=>(!wt&&0===fe&&(fe=1),Ue=fe,vi(!0),Gt),easing:fe=>(et=fe,vi(!0),Gt),delay:fe=>(Ee=fe,vi(!0),Gt),getWebAnimations:ln,getKeyframes:()=>ht,getFill:Xt,getDirection:Sn,getDelay:xe,getIterations:ze,getEasing:zn,getDuration:pe,afterAddRead:fe=>(gn.push(fe),Gt),afterAddWrite:fe=>(Ft.push(fe),Gt),afterClearStyles:(fe=[])=>{for(const je of fe)_t[je]="";return Gt},afterStyles:(fe={})=>(_t=fe,Gt),afterRemoveClass:fe=>(Ye=oe(Ye,fe),Gt),afterAddClass:fe=>(Ae=oe(Ae,fe),Gt),beforeAddRead:fe=>(Ut.push(fe),Gt),beforeAddWrite:fe=>(ii.push(fe),Gt),beforeClearStyles:(fe=[])=>{for(const je of fe)Pe[je]="";return Gt},beforeStyles:(fe={})=>(Pe=fe,Gt),beforeRemoveClass:fe=>(ye=oe(ye,fe),Gt),beforeAddClass:fe=>(Le=oe(Le,fe),Gt),onFinish:Fi,isRunning:()=>0!==hn&&!Zt,progressStart:(fe=!1,je)=>(pt.forEach(lt=>{lt.progressStart(fe,je)}),Kt(),qt=fe,gt||Li(),vi(!1,!0,je),Gt),progressStep:fe=>(pt.forEach(je=>{je.progressStep(fe)}),bi(fe),Gt),progressEnd:(fe,je,lt)=>(qt=!1,pt.forEach(an=>{an.progressEnd(fe,je,lt)}),void 0!==lt&&(Re=lt),Ce=!1,St=!0,0===fe?(Je="reverse"===Sn()?"normal":"reverse","reverse"===Je&&(St=!1),wt?(vi(),bi(1-je)):(Fe=(1-je)*pe()*-1,vi(!1,!1))):1===fe&&(wt?(vi(),bi(je)):(Fe=je*pe()*-1,vi(!1,!1))),void 0!==fe&&(Fi(()=>{Re=void 0,Je=void 0,Fe=void 0},{oneTimeCallback:!0}),Te||to()),Gt)}}},3365:(Nn,yt,k)=>{"use strict";k.d(yt,{E:()=>me,a:()=>x,s:()=>E});const x=he=>{try{if(he instanceof Y)return he.value;if(!s()||"string"!=typeof he||""===he)return he;if(he.includes("onload="))return"";const _e=document.createDocumentFragment(),ee=document.createElement("div");_e.appendChild(ee),ee.innerHTML=he,ie.forEach(Ie=>{const Ee=_e.querySelectorAll(Ie);for(let Ue=Ee.length-1;Ue>=0;Ue--){const et=Ee[Ue];et.parentNode?et.parentNode.removeChild(et):_e.removeChild(et);const le=y(et);for(let ue=0;ue{if(he.nodeType&&1!==he.nodeType)return;if(typeof NamedNodeMap<"u"&&!(he.attributes instanceof NamedNodeMap))return void he.remove();for(let ee=he.attributes.length-1;ee>=0;ee--){const ae=he.attributes.item(ee),oe=ae.name;if(!J.includes(oe.toLowerCase())){he.removeAttribute(oe);continue}const Be=ae.value,Ie=he[oe];(null!=Be&&Be.toLowerCase().includes("javascript:")||null!=Ie&&Ie.toLowerCase().includes("javascript:"))&&he.removeAttribute(oe)}const _e=y(he);for(let ee=0;ee<_e.length;ee++)h(_e[ee])},y=he=>null!=he.children?he.children:he.childNodes,s=()=>{var he;const _e=window,ee=null===(he=_e?.Ionic)||void 0===he?void 0:he.config;return!ee||(ee.get?ee.get("sanitizerEnabled",!0):!0===ee.sanitizerEnabled||void 0===ee.sanitizerEnabled)},J=["class","id","href","src","name","slot"],ie=["script","style","iframe","meta","link","object","embed"];class Y{constructor(_e){this.value=_e}}const E=he=>{const _e=window,ee=_e.Ionic;if(!ee||!ee.config||"Object"===ee.config.constructor.name)return _e.Ionic=_e.Ionic||{},_e.Ionic.config=Object.assign(Object.assign({},_e.Ionic.config),he),_e.Ionic.config},me=!1},1042:(Nn,yt,k)=>{"use strict";k.d(yt,{C:()=>J,a:()=>y,d:()=>s});var x=k(5861),h=k(839);const y=function(){var ie=(0,x.Z)(function*(Y,E,Ne,me,he,_e){var ee;if(Y)return Y.attachViewToDom(E,Ne,he,me);if(!(_e||"string"==typeof Ne||Ne instanceof HTMLElement))throw new Error("framework delegate is missing");const ae="string"==typeof Ne?null===(ee=E.ownerDocument)||void 0===ee?void 0:ee.createElement(Ne):Ne;return me&&me.forEach(oe=>ae.classList.add(oe)),he&&Object.assign(ae,he),E.appendChild(ae),yield new Promise(oe=>(0,h.c)(ae,oe)),ae});return function(E,Ne,me,he,_e,ee){return ie.apply(this,arguments)}}(),s=(ie,Y)=>{if(Y){if(ie)return ie.removeViewFromDom(Y.parentElement,Y);Y.remove()}return Promise.resolve()},J=()=>{let ie,Y;return{attachViewToDom:function(){var me=(0,x.Z)(function*(he,_e,ee={},ae=[]){var oe,Be;if(ie=he,_e){const Ee="string"==typeof _e?null===(oe=ie.ownerDocument)||void 0===oe?void 0:oe.createElement(_e):_e;ae.forEach(Ue=>Ee.classList.add(Ue)),Object.assign(Ee,ee),ie.appendChild(Ee),yield new Promise(Ue=>(0,h.c)(Ee,Ue))}else if(ie.children.length>0&&("ION-MODAL"===ie.tagName||"ION-POPOVER"===ie.tagName)&&!ie.children[0].classList.contains("ion-delegate-host")){const Ue=null===(Be=ie.ownerDocument)||void 0===Be?void 0:Be.createElement("div");Ue.classList.add("ion-delegate-host"),ae.forEach(et=>Ue.classList.add(et)),Ue.append(...ie.children),ie.appendChild(Ue)}const Ie=document.querySelector("ion-app")||document.body;return Y=document.createComment("ionic teleport"),ie.parentNode.insertBefore(Y,ie),Ie.appendChild(ie),ie});return function(_e,ee){return me.apply(this,arguments)}}(),removeViewFromDom:()=>(ie&&Y&&(Y.parentNode.insertBefore(ie,Y),Y.remove()),Promise.resolve())}}},619:(Nn,yt,k)=>{"use strict";k.d(yt,{G:()=>J});class h{constructor(Y,E,Ne,me,he){this.id=E,this.name=Ne,this.disableScroll=he,this.priority=1e6*me+E,this.ctrl=Y}canStart(){return!!this.ctrl&&this.ctrl.canStart(this.name)}start(){return!!this.ctrl&&this.ctrl.start(this.name,this.id,this.priority)}capture(){if(!this.ctrl)return!1;const Y=this.ctrl.capture(this.name,this.id,this.priority);return Y&&this.disableScroll&&this.ctrl.disableScroll(this.id),Y}release(){this.ctrl&&(this.ctrl.release(this.id),this.disableScroll&&this.ctrl.enableScroll(this.id))}destroy(){this.release(),this.ctrl=void 0}}class y{constructor(Y,E,Ne,me){this.id=E,this.disable=Ne,this.disableScroll=me,this.ctrl=Y}block(){if(this.ctrl){if(this.disable)for(const Y of this.disable)this.ctrl.disableGesture(Y,this.id);this.disableScroll&&this.ctrl.disableScroll(this.id)}}unblock(){if(this.ctrl){if(this.disable)for(const Y of this.disable)this.ctrl.enableGesture(Y,this.id);this.disableScroll&&this.ctrl.enableScroll(this.id)}}destroy(){this.unblock(),this.ctrl=void 0}}const s="backdrop-no-scroll",J=new class x{constructor(){this.gestureId=0,this.requestedStart=new Map,this.disabledGestures=new Map,this.disabledScroll=new Set}createGesture(Y){var E;return new h(this,this.newID(),Y.name,null!==(E=Y.priority)&&void 0!==E?E:0,!!Y.disableScroll)}createBlocker(Y={}){return new y(this,this.newID(),Y.disable,!!Y.disableScroll)}start(Y,E,Ne){return this.canStart(Y)?(this.requestedStart.set(E,Ne),!0):(this.requestedStart.delete(E),!1)}capture(Y,E,Ne){if(!this.start(Y,E,Ne))return!1;const me=this.requestedStart;let he=-1e4;if(me.forEach(_e=>{he=Math.max(he,_e)}),he===Ne){this.capturedId=E,me.clear();const _e=new CustomEvent("ionGestureCaptured",{detail:{gestureName:Y}});return document.dispatchEvent(_e),!0}return me.delete(E),!1}release(Y){this.requestedStart.delete(Y),this.capturedId===Y&&(this.capturedId=void 0)}disableGesture(Y,E){let Ne=this.disabledGestures.get(Y);void 0===Ne&&(Ne=new Set,this.disabledGestures.set(Y,Ne)),Ne.add(E)}enableGesture(Y,E){const Ne=this.disabledGestures.get(Y);void 0!==Ne&&Ne.delete(E)}disableScroll(Y){this.disabledScroll.add(Y),1===this.disabledScroll.size&&document.body.classList.add(s)}enableScroll(Y){this.disabledScroll.delete(Y),0===this.disabledScroll.size&&document.body.classList.remove(s)}canStart(Y){return!(void 0!==this.capturedId||this.isDisabled(Y))}isCaptured(){return void 0!==this.capturedId}isScrollDisabled(){return this.disabledScroll.size>0}isDisabled(Y){const E=this.disabledGestures.get(Y);return!!(E&&E.size>0)}newID(){return this.gestureId++,this.gestureId}}},2124:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{MENU_BACK_BUTTON_PRIORITY:()=>J,OVERLAY_BACK_BUTTON_PRIORITY:()=>s,blockHardwareBackButton:()=>h,startHardwareBackButton:()=>y});var x=k(5861);const h=()=>{document.addEventListener("backbutton",()=>{})},y=()=>{const ie=document;let Y=!1;ie.addEventListener("backbutton",()=>{if(Y)return;let E=0,Ne=[];const me=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register(ee,ae){Ne.push({priority:ee,handler:ae,id:E++})}}});ie.dispatchEvent(me);const he=function(){var ee=(0,x.Z)(function*(ae){try{if(ae?.handler){const oe=ae.handler(_e);null!=oe&&(yield oe)}}catch(oe){console.error(oe)}});return function(oe){return ee.apply(this,arguments)}}(),_e=()=>{if(Ne.length>0){let ee={priority:Number.MIN_SAFE_INTEGER,handler:()=>{},id:-1};Ne.forEach(ae=>{ae.priority>=ee.priority&&(ee=ae)}),Y=!0,Ne=Ne.filter(ae=>ae.id!==ee.id),he(ee).then(()=>Y=!1)}};_e()})},s=100,J=99},839:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>E,b:()=>Ne,c:()=>y,d:()=>Be,e:()=>oe,f:()=>ae,g:()=>me,h:()=>ee,i:()=>Y,j:()=>ue,k:()=>J,l:()=>Ie,m:()=>s,n:()=>_e,o:()=>Ee,p:()=>le,q:()=>ct,r:()=>he,s:()=>ht,t:()=>x,u:()=>Ue,v:()=>et});const x=(Le,ye=0)=>new Promise(gt=>{h(Le,ye,gt)}),h=(Le,ye=0,gt)=>{let Te,Pe;const Ae={passive:!0},_t=()=>{Te&&Te()},hn=qt=>{(void 0===qt||Le===qt.target)&&(_t(),gt(qt))};return Le&&(Le.addEventListener("webkitTransitionEnd",hn,Ae),Le.addEventListener("transitionend",hn,Ae),Pe=setTimeout(hn,ye+500),Te=()=>{Pe&&(clearTimeout(Pe),Pe=void 0),Le.removeEventListener("webkitTransitionEnd",hn,Ae),Le.removeEventListener("transitionend",hn,Ae)}),_t},y=(Le,ye)=>{Le.componentOnReady?Le.componentOnReady().then(gt=>ye(gt)):he(()=>ye(Le))},s=Le=>void 0!==Le.componentOnReady,J=(Le,ye=[])=>{const gt={};return ye.forEach(Te=>{Le.hasAttribute(Te)&&(null!==Le.getAttribute(Te)&&(gt[Te]=Le.getAttribute(Te)),Le.removeAttribute(Te))}),gt},ie=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],Y=(Le,ye)=>{let gt=ie;return ye&&ye.length>0&&(gt=gt.filter(Te=>!ye.includes(Te))),J(Le,gt)},E=(Le,ye,gt,Te)=>{var Pe;if(typeof window<"u"){const Ae=window,Ye=null===(Pe=Ae?.Ionic)||void 0===Pe?void 0:Pe.config;if(Ye){const _t=Ye.get("_ael");if(_t)return _t(Le,ye,gt,Te);if(Ye._ael)return Ye._ael(Le,ye,gt,Te)}}return Le.addEventListener(ye,gt,Te)},Ne=(Le,ye,gt,Te)=>{var Pe;if(typeof window<"u"){const Ae=window,Ye=null===(Pe=Ae?.Ionic)||void 0===Pe?void 0:Pe.config;if(Ye){const _t=Ye.get("_rel");if(_t)return _t(Le,ye,gt,Te);if(Ye._rel)return Ye._rel(Le,ye,gt,Te)}}return Le.removeEventListener(ye,gt,Te)},me=(Le,ye=Le)=>Le.shadowRoot||ye,he=Le=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(Le):"function"==typeof requestAnimationFrame?requestAnimationFrame(Le):setTimeout(Le),_e=Le=>!!Le.shadowRoot&&!!Le.attachShadow,ee=Le=>{const ye=Le.closest("ion-item");return ye?ye.querySelector("ion-label"):null},ae=Le=>{if(Le.focus(),Le.classList.contains("ion-focusable")){const ye=Le.closest("ion-app");ye&&ye.setFocus([Le])}},oe=(Le,ye)=>{let gt;const Te=Le.getAttribute("aria-labelledby"),Pe=Le.id;let Ae=null!==Te&&""!==Te.trim()?Te:ye+"-lbl",Ye=null!==Te&&""!==Te.trim()?document.getElementById(Te):ee(Le);return Ye?(null===Te&&(Ye.id=Ae),gt=Ye.textContent,Ye.setAttribute("aria-hidden","true")):""!==Pe.trim()&&(Ye=document.querySelector(`label[for="${Pe}"]`),Ye&&(""!==Ye.id?Ae=Ye.id:Ye.id=Ae=`${Pe}-lbl`,gt=Ye.textContent)),{label:Ye,labelId:Ae,labelText:gt}},Be=(Le,ye,gt,Te,Pe)=>{if(Le||_e(ye)){let Ae=ye.querySelector("input.aux-input");Ae||(Ae=ye.ownerDocument.createElement("input"),Ae.type="hidden",Ae.classList.add("aux-input"),ye.appendChild(Ae)),Ae.disabled=Pe,Ae.name=gt,Ae.value=Te||""}},Ie=(Le,ye,gt)=>Math.max(Le,Math.min(ye,gt)),Ee=(Le,ye)=>{if(!Le){const gt="ASSERT: "+ye;throw console.error(gt),new Error(gt)}},Ue=Le=>Le.timeStamp||Date.now(),et=Le=>{if(Le){const ye=Le.changedTouches;if(ye&&ye.length>0){const gt=ye[0];return{x:gt.clientX,y:gt.clientY}}if(void 0!==Le.pageX)return{x:Le.pageX,y:Le.pageY}}return{x:0,y:0}},le=Le=>{const ye="rtl"===document.dir;switch(Le){case"start":return ye;case"end":return!ye;default:throw new Error(`"${Le}" is not a valid value for [side]. Use "start" or "end" instead.`)}},ue=(Le,ye)=>{const gt=Le._original||Le;return{_original:Le,emit:ct(gt.emit.bind(gt),ye)}},ct=(Le,ye=0)=>{let gt;return(...Te)=>{clearTimeout(gt),gt=setTimeout(Le,ye,...Te)}},ht=(Le,ye)=>{if(Le??(Le={}),ye??(ye={}),Le===ye)return!0;const gt=Object.keys(Le);if(gt.length!==Object.keys(ye).length)return!1;for(const Te of gt)if(!(Te in ye)||Le[Te]!==ye[Te])return!1;return!0}},6710:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>h,b:()=>y,p:()=>x});const x=(s,...J)=>console.warn(`[Ionic Warning]: ${s}`,...J),h=(s,...J)=>console.error(`[Ionic Error]: ${s}`,...J),y=(s,...J)=>console.error(`<${s.tagName.toLowerCase()}> must be used inside ${J.join(" or ")}.`)},1651:(Nn,yt,k)=>{"use strict";k.d(yt,{L:()=>s,a:()=>J,b:()=>ie,c:()=>Y,d:()=>E,e:()=>Le,g:()=>Te,l:()=>ct,s:()=>ye,t:()=>he,w:()=>ht});var x=k(5861),h=k(1688),y=k(839);const s="ionViewWillEnter",J="ionViewDidEnter",ie="ionViewWillLeave",Y="ionViewDidLeave",E="ionViewWillUnload",he=Pe=>new Promise((Ae,Ye)=>{(0,h.w)(()=>{_e(Pe),ee(Pe).then(_t=>{_t.animation&&_t.animation.destroy(),ae(Pe),Ae(_t)},_t=>{ae(Pe),Ye(_t)})})}),_e=Pe=>{const Ae=Pe.enteringEl,Ye=Pe.leavingEl;gt(Ae,Ye,Pe.direction),Pe.showGoBack?Ae.classList.add("can-go-back"):Ae.classList.remove("can-go-back"),ye(Ae,!1),Ae.style.setProperty("pointer-events","none"),Ye&&(ye(Ye,!1),Ye.style.setProperty("pointer-events","none"))},ee=function(){var Pe=(0,x.Z)(function*(Ae){const Ye=yield oe(Ae);return Ye&&h.B.isBrowser?Be(Ye,Ae):Ie(Ae)});return function(Ye){return Pe.apply(this,arguments)}}(),ae=Pe=>{const Ae=Pe.enteringEl,Ye=Pe.leavingEl;Ae.classList.remove("ion-page-invisible"),Ae.style.removeProperty("pointer-events"),void 0!==Ye&&(Ye.classList.remove("ion-page-invisible"),Ye.style.removeProperty("pointer-events"))},oe=function(){var Pe=(0,x.Z)(function*(Ae){return Ae.leavingEl&&Ae.animated&&0!==Ae.duration?Ae.animationBuilder?Ae.animationBuilder:"ios"===Ae.mode?(yield Promise.resolve().then(k.bind(k,2650))).iosTransitionAnimation:(yield Promise.resolve().then(k.bind(k,1904))).mdTransitionAnimation:void 0});return function(Ye){return Pe.apply(this,arguments)}}(),Be=function(){var Pe=(0,x.Z)(function*(Ae,Ye){yield Ee(Ye,!0);const _t=Ae(Ye.baseEl,Ye);le(Ye.enteringEl,Ye.leavingEl);const hn=yield et(_t,Ye);return Ye.progressCallback&&Ye.progressCallback(void 0),hn&&ue(Ye.enteringEl,Ye.leavingEl),{hasCompleted:hn,animation:_t}});return function(Ye,_t){return Pe.apply(this,arguments)}}(),Ie=function(){var Pe=(0,x.Z)(function*(Ae){const Ye=Ae.enteringEl,_t=Ae.leavingEl;return yield Ee(Ae,!1),le(Ye,_t),ue(Ye,_t),{hasCompleted:!0}});return function(Ye){return Pe.apply(this,arguments)}}(),Ee=function(){var Pe=(0,x.Z)(function*(Ae,Ye){(void 0!==Ae.deepWait?Ae.deepWait:Ye)&&(yield Promise.all([Le(Ae.enteringEl),Le(Ae.leavingEl)])),yield Ue(Ae.viewIsReady,Ae.enteringEl)});return function(Ye,_t){return Pe.apply(this,arguments)}}(),Ue=function(){var Pe=(0,x.Z)(function*(Ae,Ye){Ae&&(yield Ae(Ye))});return function(Ye,_t){return Pe.apply(this,arguments)}}(),et=(Pe,Ae)=>{const Ye=Ae.progressCallback,_t=new Promise(hn=>{Pe.onFinish(qt=>hn(1===qt))});return Ye?(Pe.progressStart(!0),Ye(Pe)):Pe.play(),_t},le=(Pe,Ae)=>{ct(Ae,ie),ct(Pe,s)},ue=(Pe,Ae)=>{ct(Pe,J),ct(Ae,Y)},ct=(Pe,Ae)=>{if(Pe){const Ye=new CustomEvent(Ae,{bubbles:!1,cancelable:!1});Pe.dispatchEvent(Ye)}},ht=()=>new Promise(Pe=>(0,y.r)(()=>(0,y.r)(()=>Pe()))),Le=function(){var Pe=(0,x.Z)(function*(Ae){const Ye=Ae;if(Ye){if(null!=Ye.componentOnReady){if(null!=(yield Ye.componentOnReady()))return}else if(null!=Ye.__registerHost)return void(yield new Promise(hn=>(0,y.r)(hn)));yield Promise.all(Array.from(Ye.children).map(Le))}});return function(Ye){return Pe.apply(this,arguments)}}(),ye=(Pe,Ae)=>{Ae?(Pe.setAttribute("aria-hidden","true"),Pe.classList.add("ion-page-hidden")):(Pe.hidden=!1,Pe.removeAttribute("aria-hidden"),Pe.classList.remove("ion-page-hidden"))},gt=(Pe,Ae,Ye)=>{void 0!==Pe&&(Pe.style.zIndex="back"===Ye?"99":"101"),void 0!==Ae&&(Ae.style.zIndex="100")},Te=Pe=>Pe.classList.contains("ion-page")?Pe:Pe.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||Pe},6225:(Nn,yt,k)=>{"use strict";k.d(yt,{d:()=>h,w:()=>x});const x=typeof window<"u"?window:void 0,h=typeof document<"u"?document:void 0},1688:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>he,H:()=>_t,a:()=>Kt,b:()=>wi,c:()=>Ce,d:()=>Zt,e:()=>Ei,f:()=>Gt,g:()=>Rt,h:()=>Ae,i:()=>Et,j:()=>_e,r:()=>ti,w:()=>Si});var x=k(5861);let y,s,J,ie=!1,Y=!1,E=!1,Ne=!1,me=!1;const he={isDev:!1,isBrowser:!0,isServer:!1,isTesting:!1},_e=we=>{const fe=new URL(we,Bi.$resourcesUrl$);return fe.origin!==Ar.location.origin?fe.href:fe.pathname},Ue="s-id",et="sty-id",ct="http://www.w3.org/1999/xlink",ht={},Te=we=>"object"==(we=typeof we)||"function"===we;function Pe(we){var fe,je,lt;return null!==(lt=null===(je=null===(fe=we.head)||void 0===fe?void 0:fe.querySelector('meta[name="csp-nonce"]'))||void 0===je?void 0:je.getAttribute("content"))&&void 0!==lt?lt:void 0}const Ae=(we,fe,...je)=>{let lt=null,an=null,Vt=null,vn=!1,Dn=!1;const In=[],Fn=Ai=>{for(let Ni=0;NiAi[Ni]).join(" "))}}if("function"==typeof we)return we(null===fe?{}:fe,In,qt);const di=Ye(we,null);return di.$attrs$=fe,In.length>0&&(di.$children$=In),di.$key$=an,di.$name$=Vt,di},Ye=(we,fe)=>({$flags$:0,$tag$:we,$text$:fe,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null}),_t={},qt={forEach:(we,fe)=>we.map(Ht).forEach(fe),map:(we,fe)=>we.map(Ht).map(fe).map(De)},Ht=we=>({vattrs:we.$attrs$,vchildren:we.$children$,vkey:we.$key$,vname:we.$name$,vtag:we.$tag$,vtext:we.$text$}),De=we=>{if("function"==typeof we.vtag){const je=Object.assign({},we.vattrs);return we.vkey&&(je.key=we.vkey),we.vname&&(je.name=we.vname),Ae(we.vtag,je,...we.vchildren||[])}const fe=Ye(we.vtag,we.vtext);return fe.$attrs$=we.vattrs,fe.$children$=we.vchildren,fe.$key$=we.vkey,fe.$name$=we.vname,fe},Re=(we,fe,je,lt,an,Vt,vn)=>{let Dn,In,Fn,di;if(1===Vt.nodeType){for(Dn=Vt.getAttribute("c-id"),Dn&&(In=Dn.split("."),(In[0]===vn||"0"===In[0])&&(Fn={$flags$:0,$hostId$:In[0],$nodeId$:In[1],$depth$:In[2],$index$:In[3],$tag$:Vt.tagName.toLowerCase(),$elm$:Vt,$attrs$:null,$children$:null,$key$:null,$name$:null,$text$:null},fe.push(Fn),Vt.removeAttribute("c-id"),we.$children$||(we.$children$=[]),we.$children$[Fn.$index$]=Fn,we=Fn,lt&&"0"===Fn.$depth$&&(lt[Fn.$index$]=Fn.$elm$))),di=Vt.childNodes.length-1;di>=0;di--)Re(we,fe,je,lt,an,Vt.childNodes[di],vn);if(Vt.shadowRoot)for(di=Vt.shadowRoot.childNodes.length-1;di>=0;di--)Re(we,fe,je,lt,an,Vt.shadowRoot.childNodes[di],vn)}else if(8===Vt.nodeType)In=Vt.nodeValue.split("."),(In[1]===vn||"0"===In[1])&&(Dn=In[0],Fn={$flags$:0,$hostId$:In[1],$nodeId$:In[2],$depth$:In[3],$index$:In[4],$elm$:Vt,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},"t"===Dn?(Fn.$elm$=Vt.nextSibling,Fn.$elm$&&3===Fn.$elm$.nodeType&&(Fn.$text$=Fn.$elm$.textContent,fe.push(Fn),Vt.remove(),we.$children$||(we.$children$=[]),we.$children$[Fn.$index$]=Fn,lt&&"0"===Fn.$depth$&&(lt[Fn.$index$]=Fn.$elm$))):Fn.$hostId$===vn&&("s"===Dn?(Fn.$tag$="slot",Vt["s-sn"]=In[5]?Fn.$name$=In[5]:"",Vt["s-sr"]=!0,lt&&(Fn.$elm$=qi.createElement(Fn.$tag$),Fn.$name$&&Fn.$elm$.setAttribute("name",Fn.$name$),Vt.parentNode.insertBefore(Fn.$elm$,Vt),Vt.remove(),"0"===Fn.$depth$&&(lt[Fn.$index$]=Fn.$elm$)),je.push(Fn),we.$children$||(we.$children$=[]),we.$children$[Fn.$index$]=Fn):"r"===Dn&&(lt?Vt.remove():(an["s-cr"]=Vt,Vt["s-cn"]=!0))));else if(we&&"style"===we.$tag$){const Ai=Ye(null,Vt.textContent);Ai.$elm$=Vt,Ai.$index$="0",we.$children$=[Ai]}},Fe=(we,fe)=>{if(1===we.nodeType){let je=0;for(;jevi.push(we),Rt=we=>En(we).$modeName$,Gt=we=>En(we).$hostElement$,Zt=(we,fe,je)=>{const lt=Gt(we);return{emit:an=>Jt(lt,fe,{bubbles:!!(4&je),composed:!!(2&je),cancelable:!!(1&je),detail:an})}},Jt=(we,fe,je)=>{const lt=Bi.ce(fe,je);return we.dispatchEvent(lt),lt},kt=new WeakMap,dt=(we,fe,je)=>{let lt=Dr.get(we);yr&&je?(lt=lt||new CSSStyleSheet,"string"==typeof lt?lt=fe:lt.replaceSync(fe)):lt=fe,Dr.set(we,lt)},Ot=(we,fe,je)=>{var lt;const an=Yt(fe,je),Vt=Dr.get(an);if(we=11===we.nodeType?we:qi,Vt)if("string"==typeof Vt){let Dn,vn=kt.get(we=we.head||we);if(vn||kt.set(we,vn=new Set),!vn.has(an)){if(we.host&&(Dn=we.querySelector(`[${et}="${an}"]`)))Dn.innerHTML=Vt;else{Dn=qi.createElement("style"),Dn.innerHTML=Vt;const In=null!==(lt=Bi.$nonce$)&&void 0!==lt?lt:Pe(qi);null!=In&&Dn.setAttribute("nonce",In),we.insertBefore(Dn,we.querySelector("link"))}vn&&vn.add(an)}}else we.adoptedStyleSheets.includes(Vt)||(we.adoptedStyleSheets=[...we.adoptedStyleSheets,Vt]);return an},Yt=(we,fe)=>"sc-"+(fe&&32&we.$flags$?we.$tagName$+"-"+fe:we.$tagName$),Ut=we=>we.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),ii=(we,fe,je,lt,an,Vt)=>{if(je!==lt){let vn=_i(we,fe),Dn=fe.toLowerCase();if("class"===fe){const In=we.classList,Fn=Ft(je),di=Ft(lt);In.remove(...Fn.filter(Ai=>Ai&&!di.includes(Ai))),In.add(...di.filter(Ai=>Ai&&!Fn.includes(Ai)))}else if("style"===fe){for(const In in je)(!lt||null==lt[In])&&(In.includes("-")?we.style.removeProperty(In):we.style[In]="");for(const In in lt)(!je||lt[In]!==je[In])&&(In.includes("-")?we.style.setProperty(In,lt[In]):we.style[In]=lt[In])}else if("key"!==fe)if("ref"===fe)lt&<(we);else if(vn||"o"!==fe[0]||"n"!==fe[1]){const In=Te(lt);if((vn||In&&null!==lt)&&!an)try{if(we.tagName.includes("-"))we[fe]=lt;else{const di=lt??"";"list"===fe?vn=!1:(null==je||we[fe]!=di)&&(we[fe]=di)}}catch{}let Fn=!1;Dn!==(Dn=Dn.replace(/^xlink\:?/,""))&&(fe=Dn,Fn=!0),null==lt||!1===lt?(!1!==lt||""===we.getAttribute(fe))&&(Fn?we.removeAttributeNS(ct,fe):we.removeAttribute(fe)):(!vn||4&Vt||an)&&!In&&(lt=!0===lt?"":lt,Fn?we.setAttributeNS(ct,fe,lt):we.setAttribute(fe,lt))}else fe="-"===fe[2]?fe.slice(3):_i(Ar,Dn)?Dn.slice(2):Dn[2]+fe.slice(3),je&&Bi.rel(we,fe,je,!1),lt&&Bi.ael(we,fe,lt,!1)}},gn=/\s/,Ft=we=>we?we.split(gn):[],Jn=(we,fe,je,lt)=>{const an=11===fe.$elm$.nodeType&&fe.$elm$.host?fe.$elm$.host:fe.$elm$,Vt=we&&we.$attrs$||ht,vn=fe.$attrs$||ht;for(lt in Vt)lt in vn||ii(an,lt,Vt[lt],void 0,je,fe.$flags$);for(lt in vn)ii(an,lt,Vt[lt],vn[lt],je,fe.$flags$)},Wt=(we,fe,je,lt)=>{const an=fe.$children$[je];let vn,Dn,In,Vt=0;if(ie||(E=!0,"slot"===an.$tag$&&(y&<.classList.add(y+"-s"),an.$flags$|=an.$children$?2:1)),null!==an.$text$)vn=an.$elm$=qi.createTextNode(an.$text$);else if(1&an.$flags$)vn=an.$elm$=qi.createTextNode("");else{if(Ne||(Ne="svg"===an.$tag$),vn=an.$elm$=qi.createElementNS(Ne?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&an.$flags$?"slot-fb":an.$tag$),Ne&&"foreignObject"===an.$tag$&&(Ne=!1),Jn(null,an,Ne),(we=>null!=we)(y)&&vn["s-si"]!==y&&vn.classList.add(vn["s-si"]=y),an.$children$)for(Vt=0;Vt{Bi.$flags$|=1;const je=we.childNodes;for(let lt=je.length-1;lt>=0;lt--){const an=je[lt];an["s-hn"]!==J&&an["s-ol"]&&(mi(an).insertBefore(an,lr(an)),an["s-ol"].remove(),an["s-ol"]=void 0,E=!0),fe&&wt(an,fe)}Bi.$flags$&=-2},vt=(we,fe,je,lt,an,Vt)=>{let Dn,vn=we["s-cr"]&&we["s-cr"].parentNode||we;for(vn.shadowRoot&&vn.tagName===J&&(vn=vn.shadowRoot);an<=Vt;++an)lt[an]&&(Dn=Wt(null,je,an,we),Dn&&(lt[an].$elm$=Dn,vn.insertBefore(Dn,lr(fe))))},ln=(we,fe,je)=>{for(let lt=fe;lt<=je;++lt){const an=we[lt];if(an){const Vt=an.$elm$;_n(an),Vt&&(Y=!0,Vt["s-ol"]?Vt["s-ol"].remove():wt(Vt,!0),Vt.remove())}}},er=(we,fe)=>we.$tag$===fe.$tag$&&("slot"===we.$tag$?we.$name$===fe.$name$:we.$key$===fe.$key$),lr=we=>we&&we["s-ol"]||we,mi=we=>(we["s-ol"]?we["s-ol"]:we).parentNode,Fi=(we,fe)=>{const je=fe.$elm$=we.$elm$,lt=we.$children$,an=fe.$children$,Vt=fe.$tag$,vn=fe.$text$;let Dn;null===vn?(Ne="svg"===Vt||"foreignObject"!==Vt&&Ne,"slot"===Vt||Jn(we,fe,Ne),null!==lt&&null!==an?((we,fe,je,lt)=>{let go,Nr,an=0,Vt=0,vn=0,Dn=0,In=fe.length-1,Fn=fe[0],di=fe[In],Ai=lt.length-1,Ni=lt[0],vr=lt[Ai];for(;an<=In&&Vt<=Ai;)if(null==Fn)Fn=fe[++an];else if(null==di)di=fe[--In];else if(null==Ni)Ni=lt[++Vt];else if(null==vr)vr=lt[--Ai];else if(er(Fn,Ni))Fi(Fn,Ni),Fn=fe[++an],Ni=lt[++Vt];else if(er(di,vr))Fi(di,vr),di=fe[--In],vr=lt[--Ai];else if(er(Fn,vr))("slot"===Fn.$tag$||"slot"===vr.$tag$)&&wt(Fn.$elm$.parentNode,!1),Fi(Fn,vr),we.insertBefore(Fn.$elm$,di.$elm$.nextSibling),Fn=fe[++an],vr=lt[--Ai];else if(er(di,Ni))("slot"===Fn.$tag$||"slot"===vr.$tag$)&&wt(di.$elm$.parentNode,!1),Fi(di,Ni),we.insertBefore(di.$elm$,Fn.$elm$),di=fe[--In],Ni=lt[++Vt];else{for(vn=-1,Dn=an;Dn<=In;++Dn)if(fe[Dn]&&null!==fe[Dn].$key$&&fe[Dn].$key$===Ni.$key$){vn=Dn;break}vn>=0?(Nr=fe[vn],Nr.$tag$!==Ni.$tag$?go=Wt(fe&&fe[Vt],je,vn,we):(Fi(Nr,Ni),fe[vn]=void 0,go=Nr.$elm$),Ni=lt[++Vt]):(go=Wt(fe&&fe[Vt],je,Vt,we),Ni=lt[++Vt]),go&&mi(Fn.$elm$).insertBefore(go,lr(Fn.$elm$))}an>In?vt(we,null==lt[Ai+1]?null:lt[Ai+1].$elm$,je,lt,Vt,Ai):Vt>Ai&&ln(fe,an,In)})(je,lt,fe,an):null!==an?(null!==we.$text$&&(je.textContent=""),vt(je,null,fe,an,0,an.length-1)):null!==lt&&ln(lt,0,lt.length-1),Ne&&"svg"===Vt&&(Ne=!1)):(Dn=je["s-cr"])?Dn.parentNode.textContent=vn:we.$text$!==vn&&(je.data=vn)},Cn=we=>{const fe=we.childNodes;let je,lt,an,Vt,vn,Dn;for(lt=0,an=fe.length;lt{let fe,je,lt,an,Vt,vn,Dn=0;const In=we.childNodes,Fn=In.length;for(;Dn=0;vn--)je=lt[vn],!je["s-cn"]&&!je["s-nr"]&&je["s-hn"]!==fe["s-hn"]&&(yn(je,an)?(Vt=Mn.find(di=>di.$nodeToRelocate$===je),Y=!0,je["s-sn"]=je["s-sn"]||an,Vt?Vt.$slotRefNode$=fe:Mn.push({$slotRefNode$:fe,$nodeToRelocate$:je}),je["s-sr"]&&Mn.map(di=>{yn(di.$nodeToRelocate$,je["s-sn"])&&(Vt=Mn.find(Ai=>Ai.$nodeToRelocate$===je),Vt&&!di.$slotRefNode$&&(di.$slotRefNode$=Vt.$slotRefNode$))})):Mn.some(di=>di.$nodeToRelocate$===je)||Mn.push({$nodeToRelocate$:je}));1===fe.nodeType&&qn(fe)}},yn=(we,fe)=>1===we.nodeType?null===we.getAttribute("slot")&&""===fe||we.getAttribute("slot")===fe:we["s-sn"]===fe||""===fe,_n=we=>{we.$attrs$&&we.$attrs$.ref&&we.$attrs$.ref(null),we.$children$&&we.$children$.map(_n)},nt=(we,fe)=>{fe&&!we.$onRenderResolve$&&fe["s-p"]&&fe["s-p"].push(new Promise(je=>we.$onRenderResolve$=je))},ge=(we,fe)=>{if(we.$flags$|=16,!(4&we.$flags$))return nt(we,we.$ancestorComponent$),Si(()=>ve(we,fe));we.$flags$|=512},ve=(we,fe)=>{const lt=we.$lazyInstance$;let an;return fe&&(we.$flags$|=256,we.$queuedListeners$&&(we.$queuedListeners$.map(([Vt,vn])=>Sn(lt,Vt,vn)),we.$queuedListeners$=void 0),an=Sn(lt,"componentWillLoad")),an=Xe(an,()=>Sn(lt,"componentWillRender")),Xe(an,()=>Ct(we,lt,fe))},Xe=(we,fe)=>ft(we)?we.then(fe):fe(),ft=we=>we instanceof Promise||we&&we.then&&"function"==typeof we.then,Ct=function(){var we=(0,x.Z)(function*(fe,je,lt){var an;const Vt=fe.$hostElement$,Dn=Vt["s-rc"];lt&&(we=>{const fe=we.$cmpMeta$,je=we.$hostElement$,lt=fe.$flags$,Vt=Ot(je.shadowRoot?je.shadowRoot:je.getRootNode(),fe,we.$modeName$);10<&&(je["s-sc"]=Vt,je.classList.add(Vt+"-h"),2<&&je.classList.add(Vt+"-s"))})(fe);Bt(fe,je,Vt,lt),Dn&&(Dn.map(Fn=>Fn()),Vt["s-rc"]=void 0);{const Fn=null!==(an=Vt["s-p"])&&void 0!==an?an:[],di=()=>jt(fe);0===Fn.length?di():(Promise.all(Fn).then(di),fe.$flags$|=4,Fn.length=0)}});return function(je,lt,an){return we.apply(this,arguments)}}(),Bt=(we,fe,je,lt)=>{try{fe=fe.render&&fe.render(),we.$flags$&=-17,we.$flags$|=2,((we,fe,je=!1)=>{const lt=we.$hostElement$,an=we.$cmpMeta$,Vt=we.$vnode$||Ye(null,null),vn=(we=>we&&we.$tag$===_t)(fe)?fe:Ae(null,null,fe);if(J=lt.tagName,an.$attrsToReflect$&&(vn.$attrs$=vn.$attrs$||{},an.$attrsToReflect$.map(([Dn,In])=>vn.$attrs$[In]=lt[Dn])),je&&vn.$attrs$)for(const Dn of Object.keys(vn.$attrs$))lt.hasAttribute(Dn)&&!["key","ref","style","class"].includes(Dn)&&(vn.$attrs$[Dn]=lt[Dn]);if(vn.$tag$=null,vn.$flags$|=4,we.$vnode$=vn,vn.$elm$=Vt.$elm$=lt.shadowRoot||lt,y=lt["s-sc"],s=lt["s-cr"],ie=0!=(1&an.$flags$),Y=!1,Fi(Vt,vn),Bi.$flags$|=1,E){qn(vn.$elm$);let Dn,In,Fn,di,Ai,Ni,vr=0;for(;vr{const je=we.$hostElement$,an=we.$lazyInstance$,Vt=we.$ancestorComponent$;Sn(an,"componentDidRender"),64&we.$flags$?Sn(an,"componentDidUpdate"):(we.$flags$|=64,zn(je),Sn(an,"componentDidLoad"),we.$onReadyResolve$(je),Vt||Xt()),we.$onInstanceResolve$(je),we.$onRenderResolve$&&(we.$onRenderResolve$(),we.$onRenderResolve$=void 0),512&we.$flags$&&Xn(()=>ge(we,!1)),we.$flags$&=-517},Et=we=>{{const fe=En(we),je=fe.$hostElement$.isConnected;return je&&2==(18&fe.$flags$)&&ge(fe,!1),je}},Xt=we=>{zn(qi.documentElement),Xn(()=>Jt(Ar,"appload",{detail:{namespace:"ionic"}}))},Sn=(we,fe,je)=>{if(we&&we[fe])try{return we[fe](je)}catch(lt){Li(lt)}},zn=we=>we.classList.add("hydrated"),xe=(we,fe,je)=>{if(fe.$members$){we.watchers&&(fe.$watchers$=we.watchers);const lt=Object.entries(fe.$members$),an=we.prototype;if(lt.map(([Vt,[vn]])=>{31&vn||2&je&&32&vn?Object.defineProperty(an,Vt,{get(){return((we,fe)=>En(this).$instanceValues$.get(fe))(0,Vt)},set(Dn){((we,fe,je,lt)=>{const an=En(we),Vt=an.$hostElement$,vn=an.$instanceValues$.get(fe),Dn=an.$flags$,In=an.$lazyInstance$;je=((we,fe)=>null==we||Te(we)?we:4&fe?"false"!==we&&(""===we||!!we):2&fe?parseFloat(we):1&fe?String(we):we)(je,lt.$members$[fe][0]);const Fn=Number.isNaN(vn)&&Number.isNaN(je);if((!(8&Dn)||void 0===vn)&&je!==vn&&!Fn&&(an.$instanceValues$.set(fe,je),In)){if(lt.$watchers$&&128&Dn){const Ai=lt.$watchers$[fe];Ai&&Ai.map(Ni=>{try{In[Ni](je,vn,fe)}catch(vr){Li(vr,Vt)}})}2==(18&Dn)&&ge(an,!1)}})(this,Vt,Dn,fe)},configurable:!0,enumerable:!0}):1&je&&64&vn&&Object.defineProperty(an,Vt,{value(...Dn){const In=En(this);return In.$onInstancePromise$.then(()=>In.$lazyInstance$[Vt](...Dn))}})}),1&je){const Vt=new Map;an.attributeChangedCallback=function(vn,Dn,In){Bi.jmp(()=>{const Fn=Vt.get(vn);if(this.hasOwnProperty(Fn))In=this[Fn],delete this[Fn];else if(an.hasOwnProperty(Fn)&&"number"==typeof this[Fn]&&this[Fn]==In)return;this[Fn]=(null!==In||"boolean"!=typeof this[Fn])&&In})},we.observedAttributes=lt.filter(([vn,Dn])=>15&Dn[0]).map(([vn,Dn])=>{const In=Dn[1]||vn;return Vt.set(In,vn),512&Dn[0]&&fe.$attrsToReflect$.push([vn,In]),In})}}return we},be=function(){var we=(0,x.Z)(function*(fe,je,lt,an,Vt){if(!(32&je.$flags$)){je.$flags$|=32;{if((Vt=ir(lt)).then){const Fn=()=>{};Vt=yield Vt,Fn()}Vt.isProxied||(lt.$watchers$=Vt.watchers,xe(Vt,lt,2),Vt.isProxied=!0);const In=()=>{};je.$flags$|=8;try{new Vt(je)}catch(Fn){Li(Fn)}je.$flags$&=-9,je.$flags$|=128,In(),Ze(je.$lazyInstance$)}if(Vt.style){let In=Vt.style;"string"!=typeof In&&(In=In[je.$modeName$=(we=>vi.map(fe=>fe(we)).find(fe=>!!fe))(fe)]);const Fn=Yt(lt,je.$modeName$);if(!Dr.has(Fn)){const di=()=>{};dt(Fn,In,!!(1<.$flags$)),di()}}}const vn=je.$ancestorComponent$,Dn=()=>ge(je,!0);vn&&vn["s-rc"]?vn["s-rc"].push(Dn):Dn()});return function(je,lt,an,Vt,vn){return we.apply(this,arguments)}}(),Ze=we=>{Sn(we,"connectedCallback")},bn=we=>{const fe=we["s-cr"]=qi.createComment("");fe["s-cn"]=!0,we.insertBefore(fe,we.firstChild)},Kn=we=>{Sn(we,"disconnectedCallback")},Ci=function(){var we=(0,x.Z)(function*(fe){if(!(1&Bi.$flags$)){const je=En(fe);je.$rmListeners$&&(je.$rmListeners$.map(lt=>lt()),je.$rmListeners$=void 0),je?.$lazyInstance$?Kn(je.$lazyInstance$):je?.$onReadyPromise$&&je.$onReadyPromise$.then(()=>Kn(je.$lazyInstance$))}});return function(je){return we.apply(this,arguments)}}(),wi=(we,fe={})=>{var je;const an=[],Vt=fe.exclude||[],vn=Ar.customElements,Dn=qi.head,In=Dn.querySelector("meta[charset]"),Fn=qi.createElement("style"),di=[],Ai=qi.querySelectorAll(`[${et}]`);let Ni,vr=!0,go=0;for(Object.assign(Bi,fe),Bi.$resourcesUrl$=new URL(fe.resourcesUrl||"./",qi.baseURI).href,Bi.$flags$|=2;go{Nr[1].map(co=>{const uo={$flags$:co[0],$tagName$:co[1],$members$:co[2],$listeners$:co[3]};uo.$members$=co[2],uo.$listeners$=co[3],uo.$attrsToReflect$=[],uo.$watchers$={};const Jr=uo.$tagName$,kr=class extends HTMLElement{constructor(To){super(To),gi(To=this,uo),1&uo.$flags$&&To.attachShadow({mode:"open",delegatesFocus:!!(16&uo.$flags$)})}connectedCallback(){Ni&&(clearTimeout(Ni),Ni=null),vr?di.push(this):Bi.jmp(()=>(we=>{if(!(1&Bi.$flags$)){const fe=En(we),je=fe.$cmpMeta$,lt=()=>{};if(1&fe.$flags$)cr(we,fe,je.$listeners$),fe?.$lazyInstance$?Ze(fe.$lazyInstance$):fe?.$onReadyPromise$&&fe.$onReadyPromise$.then(()=>Ze(fe.$lazyInstance$));else{let an;if(fe.$flags$|=1,an=we.getAttribute(Ue),an){if(1&je.$flags$){const Vt=Ot(we.shadowRoot,je,we.getAttribute("s-mode"));we.classList.remove(Vt+"-h",Vt+"-s")}((we,fe,je,lt)=>{const Vt=we.shadowRoot,vn=[],In=Vt?[]:null,Fn=lt.$vnode$=Ye(fe,null);Bi.$orgLocNodes$||Fe(qi.body,Bi.$orgLocNodes$=new Map),we[Ue]=je,we.removeAttribute(Ue),Re(Fn,vn,[],In,we,we,je),vn.map(di=>{const Ai=di.$hostId$+"."+di.$nodeId$,Ni=Bi.$orgLocNodes$.get(Ai),vr=di.$elm$;Ni&&Wi&&""===Ni["s-en"]&&Ni.parentNode.insertBefore(vr,Ni.nextSibling),Vt||(vr["s-hn"]=fe,Ni&&(vr["s-ol"]=Ni,vr["s-ol"]["s-nr"]=vr)),Bi.$orgLocNodes$.delete(Ai)}),Vt&&In.map(di=>{di&&Vt.appendChild(di)})})(we,je.$tagName$,an,fe)}an||12&je.$flags$&&bn(we);{let Vt=we;for(;Vt=Vt.parentNode||Vt.host;)if(1===Vt.nodeType&&Vt.hasAttribute("s-id")&&Vt["s-p"]||Vt["s-p"]){nt(fe,fe.$ancestorComponent$=Vt);break}}je.$members$&&Object.entries(je.$members$).map(([Vt,[vn]])=>{if(31&vn&&we.hasOwnProperty(Vt)){const Dn=we[Vt];delete we[Vt],we[Vt]=Dn}}),be(we,fe,je)}lt()}})(this))}disconnectedCallback(){Bi.jmp(()=>Ci(this))}componentOnReady(){return En(this).$onReadyPromise$}};uo.$lazyBundleId$=Nr[0],!Vt.includes(Jr)&&!vn.get(Jr)&&(an.push(Jr),vn.define(Jr,xe(kr,uo,1)))})});{Fn.innerHTML=an+"{visibility:hidden}.hydrated{visibility:inherit}",Fn.setAttribute("data-styles","");const Nr=null!==(je=Bi.$nonce$)&&void 0!==je?je:Pe(qi);null!=Nr&&Fn.setAttribute("nonce",Nr),Dn.insertBefore(Fn,In?In.nextSibling:Dn.firstChild)}vr=!1,di.length?di.map(Nr=>Nr.connectedCallback()):Bi.jmp(()=>Ni=setTimeout(Xt,30))},cr=(we,fe,je,lt)=>{je&&je.map(([an,Vt,vn])=>{const Dn=Lt(we,an),In=Ui(fe,vn),Fn=st(an);Bi.ael(Dn,Vt,In,Fn),(fe.$rmListeners$=fe.$rmListeners$||[]).push(()=>Bi.rel(Dn,Vt,In,Fn))})},Ui=(we,fe)=>je=>{try{256&we.$flags$?we.$lazyInstance$[fe](je):(we.$queuedListeners$=we.$queuedListeners$||[]).push([fe,je])}catch(lt){Li(lt)}},Lt=(we,fe)=>4&fe?qi:8&fe?Ar:16&fe?qi.body:we,st=we=>0!=(2&we),mn=new WeakMap,En=we=>mn.get(we),ti=(we,fe)=>mn.set(fe.$lazyInstance$=we,fe),gi=(we,fe)=>{const je={$flags$:0,$hostElement$:we,$cmpMeta$:fe,$instanceValues$:new Map};return je.$onInstancePromise$=new Promise(lt=>je.$onInstanceResolve$=lt),je.$onReadyPromise$=new Promise(lt=>je.$onReadyResolve$=lt),we["s-p"]=[],we["s-rc"]=[],cr(we,je,fe.$listeners$),mn.set(we,je)},_i=(we,fe)=>fe in we,Li=(we,fe)=>(0,console.error)(we,fe),bi=new Map,ir=(we,fe,je)=>{const lt=we.$tagName$.replace(/-/g,"_"),an=we.$lazyBundleId$,Vt=bi.get(an);return Vt?Vt[lt]:k(863)(`./${an}.entry.js`).then(vn=>(bi.set(an,vn),vn[lt]),Li)},Dr=new Map,vi=[],Ar=typeof window<"u"?window:{},qi=Ar.document||{head:{}},Bi={$flags$:0,$resourcesUrl$:"",jmp:we=>we(),raf:we=>requestAnimationFrame(we),ael:(we,fe,je,lt)=>we.addEventListener(fe,je,lt),rel:(we,fe,je,lt)=>we.removeEventListener(fe,je,lt),ce:(we,fe)=>new CustomEvent(we,fe)},Kt=we=>{Object.assign(Bi,we)},Wi=!0,yr=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch{}return!1})(),xr=[],Sr=[],Go=(we,fe)=>je=>{we.push(je),me||(me=!0,fe&&4&Bi.$flags$?Xn(to):Bi.raf(to))},Eo=we=>{for(let fe=0;fe{Eo(xr),Eo(Sr),(me=xr.length>0)&&Bi.raf(to)},Xn=we=>Promise.resolve(void 0).then(we),Ei=Go(xr,!1),Si=Go(Sr,!0)},5662:(Nn,yt,k)=>{"use strict";k.d(yt,{m:()=>he});var x=k(5861),h=k(2124),y=k(839),s=k(2085),J=k(1774);const ie=_e=>(0,J.c)().duration(_e?400:300),Y=_e=>{let ee,ae;const oe=_e.width+8,Be=(0,J.c)(),Ie=(0,J.c)();_e.isEndSide?(ee=oe+"px",ae="0px"):(ee=-oe+"px",ae="0px"),Be.addElement(_e.menuInnerEl).fromTo("transform",`translateX(${ee})`,`translateX(${ae})`);const Ue="ios"===(0,s.b)(_e),et=Ue?.2:.25;return Ie.addElement(_e.backdropEl).fromTo("opacity",.01,et),ie(Ue).addAnimation([Be,Ie])},E=_e=>{let ee,ae;const oe=(0,s.b)(_e),Be=_e.width;_e.isEndSide?(ee=-Be+"px",ae=Be+"px"):(ee=Be+"px",ae=-Be+"px");const Ie=(0,J.c)().addElement(_e.menuInnerEl).fromTo("transform",`translateX(${ae})`,"translateX(0px)"),Ee=(0,J.c)().addElement(_e.contentEl).fromTo("transform","translateX(0px)",`translateX(${ee})`),Ue=(0,J.c)().addElement(_e.backdropEl).fromTo("opacity",.01,.32);return ie("ios"===oe).addAnimation([Ie,Ee,Ue])},Ne=_e=>{const ee=(0,s.b)(_e),ae=_e.width*(_e.isEndSide?-1:1)+"px",oe=(0,J.c)().addElement(_e.contentEl).fromTo("transform","translateX(0px)",`translateX(${ae})`);return ie("ios"===ee).addAnimation(oe)},he=(()=>{const _e=new Map,ee=[],ae=function(){var De=(0,x.Z)(function*(Je){const Re=yield le(Je);return!!Re&&Re.open()});return function(Re){return De.apply(this,arguments)}}(),oe=function(){var De=(0,x.Z)(function*(Je){const Re=yield void 0!==Je?le(Je):ue();return void 0!==Re&&Re.close()});return function(Re){return De.apply(this,arguments)}}(),Be=function(){var De=(0,x.Z)(function*(Je){const Re=yield le(Je);return!!Re&&Re.toggle()});return function(Re){return De.apply(this,arguments)}}(),Ie=function(){var De=(0,x.Z)(function*(Je,Re){const Fe=yield le(Re);return Fe&&(Fe.disabled=!Je),Fe});return function(Re,Fe){return De.apply(this,arguments)}}(),Ee=function(){var De=(0,x.Z)(function*(Je,Re){const Fe=yield le(Re);return Fe&&(Fe.swipeGesture=Je),Fe});return function(Re,Fe){return De.apply(this,arguments)}}(),Ue=function(){var De=(0,x.Z)(function*(Je){if(null!=Je){const Re=yield le(Je);return void 0!==Re&&Re.isOpen()}return void 0!==(yield ue())});return function(Re){return De.apply(this,arguments)}}(),et=function(){var De=(0,x.Z)(function*(Je){const Re=yield le(Je);return!!Re&&!Re.disabled});return function(Re){return De.apply(this,arguments)}}(),le=function(){var De=(0,x.Z)(function*(Je){return yield Ht(),"start"===Je||"end"===Je?qt(St=>St.side===Je&&!St.disabled)||qt(St=>St.side===Je):null!=Je?qt(Fe=>Fe.menuId===Je):qt(Fe=>!Fe.disabled)||(ee.length>0?ee[0].el:void 0)});return function(Re){return De.apply(this,arguments)}}(),ue=function(){var De=(0,x.Z)(function*(){return yield Ht(),Ye()});return function(){return De.apply(this,arguments)}}(),ct=function(){var De=(0,x.Z)(function*(){return yield Ht(),_t()});return function(){return De.apply(this,arguments)}}(),ht=function(){var De=(0,x.Z)(function*(){return yield Ht(),hn()});return function(){return De.apply(this,arguments)}}(),Le=(De,Je)=>{_e.set(De,Je)},Te=De=>{const Je=De.side;ee.filter(Re=>Re.side===Je&&Re!==De).forEach(Re=>Re.disabled=!0)},Pe=function(){var De=(0,x.Z)(function*(Je,Re,Fe){if(hn())return!1;if(Re){const St=yield ue();St&&Je.el!==St&&(yield St.setOpen(!1,!1))}return Je._setOpen(Re,Fe)});return function(Re,Fe,St){return De.apply(this,arguments)}}(),Ye=()=>qt(De=>De._isOpen),_t=()=>ee.map(De=>De.el),hn=()=>ee.some(De=>De.isAnimating),qt=De=>{const Je=ee.find(De);if(void 0!==Je)return Je.el},Ht=()=>Promise.all(Array.from(document.querySelectorAll("ion-menu")).map(De=>new Promise(Je=>(0,y.c)(De,Je))));return Le("reveal",Ne),Le("push",E),Le("overlay",Y),typeof document<"u"&&document.addEventListener("ionBackButton",De=>{const Je=Ye();Je&&De.detail.register(h.MENU_BACK_BUTTON_PRIORITY,()=>Je.close())}),{registerAnimation:Le,get:le,getMenus:ct,getOpen:ue,isEnabled:et,swipeGesture:Ee,isAnimating:ht,isOpen:Ue,enable:Ie,toggle:Be,close:oe,open:ae,_getOpenSync:Ye,_createAnimation:(De,Je)=>{const Re=_e.get(De);if(!Re)throw new Error("animation not registered");return Re(Je)},_register:De=>{ee.indexOf(De)<0&&(De.disabled||Te(De),ee.push(De))},_unregister:De=>{const Je=ee.indexOf(De);Je>-1&&ee.splice(Je,1)},_setOpen:Pe,_setActiveMenu:Te}})()},9203:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{GESTURE_CONTROLLER:()=>x.G,createGesture:()=>Ne});var x=k(619);const h=(ee,ae,oe,Be)=>{const Ie=y(ee)?{capture:!!Be.capture,passive:!!Be.passive}:!!Be.capture;let Ee,Ue;return ee.__zone_symbol__addEventListener?(Ee="__zone_symbol__addEventListener",Ue="__zone_symbol__removeEventListener"):(Ee="addEventListener",Ue="removeEventListener"),ee[Ee](ae,oe,Ie),()=>{ee[Ue](ae,oe,Ie)}},y=ee=>{if(void 0===s)try{const ae=Object.defineProperty({},"passive",{get:()=>{s=!0}});ee.addEventListener("optsTest",()=>{},ae)}catch{s=!1}return!!s};let s;const Y=ee=>ee instanceof Document?ee:ee.ownerDocument,Ne=ee=>{let ae=!1,oe=!1,Be=!0,Ie=!1;const Ee=Object.assign({disableScroll:!1,direction:"x",gesturePriority:0,passive:!0,maxAngle:40,threshold:10},ee),Ue=Ee.canStart,et=Ee.onWillStart,le=Ee.onStart,ue=Ee.onEnd,ct=Ee.notCaptured,ht=Ee.onMove,Le=Ee.threshold,ye=Ee.passive,gt=Ee.blurOnStart,Te={type:"pan",startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,event:void 0,data:void 0},Pe=((ee,ae,oe)=>{const Be=oe*(Math.PI/180),Ie="x"===ee,Ee=Math.cos(Be),Ue=ae*ae;let et=0,le=0,ue=!1,ct=0;return{start(ht,Le){et=ht,le=Le,ct=0,ue=!0},detect(ht,Le){if(!ue)return!1;const ye=ht-et,gt=Le-le,Te=ye*ye+gt*gt;if(TeEe?1:Ae<-Ee?-1:0,ue=!1,!0},isGesture:()=>0!==ct,getDirection:()=>ct}})(Ee.direction,Ee.threshold,Ee.maxAngle),Ae=x.G.createGesture({name:ee.gestureName,priority:ee.gesturePriority,disableScroll:ee.disableScroll}),hn=()=>{ae&&(Ie=!1,ht&&ht(Te))},qt=()=>!!Ae.capture()&&(ae=!0,Be=!1,Te.startX=Te.currentX,Te.startY=Te.currentY,Te.startTime=Te.currentTime,et?et(Te).then(De):De(),!0),De=()=>{gt&&(()=>{if(typeof document<"u"){const Ce=document.activeElement;Ce?.blur&&Ce.blur()}})(),le&&le(Te),Be=!0},Je=()=>{ae=!1,oe=!1,Ie=!1,Be=!0,Ae.release()},Re=Ce=>{const Rt=ae,Qt=Be;if(Je(),Qt){if(me(Te,Ce),Rt)return void(ue&&ue(Te));ct&&ct(Te)}},Fe=((ee,ae,oe,Be,Ie)=>{let Ee,Ue,et,le,ue,ct,ht,Le=0;const ye=Ht=>{Le=Date.now()+2e3,ae(Ht)&&(!Ue&&oe&&(Ue=h(ee,"touchmove",oe,Ie)),et||(et=h(Ht.target,"touchend",Te,Ie)),le||(le=h(Ht.target,"touchcancel",Te,Ie)))},gt=Ht=>{Le>Date.now()||ae(Ht)&&(!ct&&oe&&(ct=h(Y(ee),"mousemove",oe,Ie)),ht||(ht=h(Y(ee),"mouseup",Pe,Ie)))},Te=Ht=>{Ae(),Be&&Be(Ht)},Pe=Ht=>{Ye(),Be&&Be(Ht)},Ae=()=>{Ue&&Ue(),et&&et(),le&&le(),Ue=et=le=void 0},Ye=()=>{ct&&ct(),ht&&ht(),ct=ht=void 0},_t=()=>{Ae(),Ye()},hn=(Ht=!0)=>{Ht?(Ee||(Ee=h(ee,"touchstart",ye,Ie)),ue||(ue=h(ee,"mousedown",gt,Ie))):(Ee&&Ee(),ue&&ue(),Ee=ue=void 0,_t())};return{enable:hn,stop:_t,destroy:()=>{hn(!1),Be=oe=ae=void 0}}})(Ee.el,Ce=>{const Rt=_e(Ce);return!(oe||!Be||(he(Ce,Te),Te.startX=Te.currentX,Te.startY=Te.currentY,Te.startTime=Te.currentTime=Rt,Te.velocityX=Te.velocityY=Te.deltaX=Te.deltaY=0,Te.event=Ce,Ue&&!1===Ue(Te))||(Ae.release(),!Ae.start()))&&(oe=!0,0===Le?qt():(Pe.start(Te.startX,Te.startY),!0))},Ce=>{ae?!Ie&&Be&&(Ie=!0,me(Te,Ce),requestAnimationFrame(hn)):(me(Te,Ce),Pe.detect(Te.currentX,Te.currentY)&&(!Pe.isGesture()||!qt())&&St())},Re,{capture:!1,passive:ye}),St=()=>{Je(),Fe.stop(),ct&&ct(Te)};return{enable(Ce=!0){Ce||(ae&&Re(void 0),Je()),Fe.enable(Ce)},destroy(){Ae.destroy(),Fe.destroy()}}},me=(ee,ae)=>{if(!ae)return;const oe=ee.currentX,Be=ee.currentY,Ie=ee.currentTime;he(ae,ee);const Ee=ee.currentX,Ue=ee.currentY,le=(ee.currentTime=_e(ae))-Ie;if(le>0&&le<100){const ct=(Ue-Be)/le;ee.velocityX=(Ee-oe)/le*.7+.3*ee.velocityX,ee.velocityY=.7*ct+.3*ee.velocityY}ee.deltaX=Ee-ee.startX,ee.deltaY=Ue-ee.startY,ee.event=ae},he=(ee,ae)=>{let oe=0,Be=0;if(ee){const Ie=ee.changedTouches;if(Ie&&Ie.length>0){const Ee=Ie[0];oe=Ee.clientX,Be=Ee.clientY}else void 0!==ee.pageX&&(oe=ee.pageX,Be=ee.pageY)}ae.currentX=oe,ae.currentY=Be},_e=ee=>ee.timeStamp||Date.now()},2085:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>he,b:()=>hn,c:()=>y,g:()=>me,i:()=>qt});var x=k(1688);class h{constructor(){this.m=new Map}reset(De){this.m=new Map(Object.entries(De))}get(De,Je){const Re=this.m.get(De);return void 0!==Re?Re:Je}getBoolean(De,Je=!1){const Re=this.m.get(De);return void 0===Re?Je:"string"==typeof Re?"true"===Re:!!Re}getNumber(De,Je){const Re=parseFloat(this.m.get(De));return isNaN(Re)?void 0!==Je?Je:NaN:Re}set(De,Je){this.m.set(De,Je)}}const y=new h,E="ionic:",Ne="ionic-persist-config",me=Ht=>_e(Ht),he=(Ht,De)=>("string"==typeof Ht&&(De=Ht,Ht=void 0),me(Ht).includes(De)),_e=(Ht=window)=>{if(typeof Ht>"u")return[];Ht.Ionic=Ht.Ionic||{};let De=Ht.Ionic.platforms;return null==De&&(De=Ht.Ionic.platforms=ee(Ht),De.forEach(Je=>Ht.document.documentElement.classList.add(`plt-${Je}`))),De},ee=Ht=>{const De=y.get("platform");return Object.keys(Ye).filter(Je=>{const Re=De?.[Je];return"function"==typeof Re?Re(Ht):Ye[Je](Ht)})},oe=Ht=>!!(Pe(Ht,/iPad/i)||Pe(Ht,/Macintosh/i)&&ue(Ht)),Ee=Ht=>Pe(Ht,/android|sink/i),ue=Ht=>Ae(Ht,"(any-pointer:coarse)"),ht=Ht=>Le(Ht)||ye(Ht),Le=Ht=>!!(Ht.cordova||Ht.phonegap||Ht.PhoneGap),ye=Ht=>{const De=Ht.Capacitor;return!!De?.isNative},Pe=(Ht,De)=>De.test(Ht.navigator.userAgent),Ae=(Ht,De)=>{var Je;return null===(Je=Ht.matchMedia)||void 0===Je?void 0:Je.call(Ht,De).matches},Ye={ipad:oe,iphone:Ht=>Pe(Ht,/iPhone/i),ios:Ht=>Pe(Ht,/iPhone|iPod/i)||oe(Ht),android:Ee,phablet:Ht=>{const De=Ht.innerWidth,Je=Ht.innerHeight,Re=Math.min(De,Je),Fe=Math.max(De,Je);return Re>390&&Re<520&&Fe>620&&Fe<800},tablet:Ht=>{const De=Ht.innerWidth,Je=Ht.innerHeight,Re=Math.min(De,Je),Fe=Math.max(De,Je);return oe(Ht)||(Ht=>Ee(Ht)&&!Pe(Ht,/mobile/i))(Ht)||Re>460&&Re<820&&Fe>780&&Fe<1400},cordova:Le,capacitor:ye,electron:Ht=>Pe(Ht,/electron/i),pwa:Ht=>{var De;return!!(null!==(De=Ht.matchMedia)&&void 0!==De&&De.call(Ht,"(display-mode: standalone)").matches||Ht.navigator.standalone)},mobile:ue,mobileweb:Ht=>ue(Ht)&&!ht(Ht),desktop:Ht=>!ue(Ht),hybrid:ht};let _t;const hn=Ht=>Ht&&(0,x.g)(Ht)||_t,qt=(Ht={})=>{if(typeof window>"u")return;const De=window.document,Je=window,Re=Je.Ionic=Je.Ionic||{},Fe={};Ht._ael&&(Fe.ael=Ht._ael),Ht._rel&&(Fe.rel=Ht._rel),Ht._ce&&(Fe.ce=Ht._ce),(0,x.a)(Fe);const St=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(Ht=>{try{const De=Ht.sessionStorage.getItem(Ne);return null!==De?JSON.parse(De):{}}catch{return{}}})(Je)),{persistConfig:!1}),Re.config),(Ht=>{const De={};return Ht.location.search.slice(1).split("&").map(Je=>Je.split("=")).map(([Je,Re])=>[decodeURIComponent(Je),decodeURIComponent(Re)]).filter(([Je])=>((Ht,De)=>Ht.substr(0,De.length)===De)(Je,E)).map(([Je,Re])=>[Je.slice(6),Re]).forEach(([Je,Re])=>{De[Je]=Re}),De})(Je)),Ht);y.reset(St),y.getBoolean("persistConfig")&&((Ht,De)=>{try{Ht.sessionStorage.setItem(Ne,JSON.stringify(De))}catch{return}})(Je,St),_e(Je),Re.config=y,Re.mode=_t=y.get("mode",De.documentElement.getAttribute("mode")||(he(Je,"ios")?"ios":"md")),y.set("mode",_t),De.documentElement.setAttribute("mode",_t),De.documentElement.classList.add(_t),y.getBoolean("_testing")&&y.set("animated",!1);const Ce=Qt=>{var Gt;return null===(Gt=Qt.tagName)||void 0===Gt?void 0:Gt.startsWith("ION-")},Rt=Qt=>["ios","md"].includes(Qt);(0,x.c)(Qt=>{for(;Qt;){const Gt=Qt.mode||Qt.getAttribute("mode");if(Gt){if(Rt(Gt))return Gt;Ce(Qt)&&console.warn('Invalid ionic mode: "'+Gt+'", expected: "ios" or "md"')}Qt=Qt.parentElement}return _t})}},2650:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{iosTransitionAnimation:()=>ee,shadow:()=>Y});var x=k(1774),h=k(1651);k(6225),k(1688);const ie=ae=>document.querySelector(`${ae}.ion-cloned-element`),Y=ae=>ae.shadowRoot||ae,E=ae=>{const oe="ION-TABS"===ae.tagName?ae:ae.querySelector("ion-tabs"),Be="ion-content ion-header:not(.header-collapse-condense-inactive) ion-title.title-large";if(null!=oe){const Ie=oe.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");return null!=Ie?Ie.querySelector(Be):null}return ae.querySelector(Be)},Ne=(ae,oe)=>{const Be="ION-TABS"===ae.tagName?ae:ae.querySelector("ion-tabs");let Ie=[];if(null!=Be){const Ee=Be.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");null!=Ee&&(Ie=Ee.querySelectorAll("ion-buttons"))}else Ie=ae.querySelectorAll("ion-buttons");for(const Ee of Ie){const Ue=Ee.closest("ion-header"),et=Ue&&!Ue.classList.contains("header-collapse-condense-inactive"),le=Ee.querySelector("ion-back-button"),ue=Ee.classList.contains("buttons-collapse");if(null!==le&&("start"===Ee.slot||""===Ee.slot)&&(ue&&et&&oe||!ue))return le}return null},he=(ae,oe,Be,Ie,Ee,Ue)=>{const et=oe?`calc(100% - ${Ue.right+4}px)`:Ue.left-4+"px",le=oe?"7px":"-7px",ue=oe?"-4px":"4px",ct=oe?"-4px":"4px",ht=oe?"right":"left",Le=oe?"left":"right",Te=Be?[{offset:0,opacity:1,transform:`translate3d(${ue}, ${Ue.top-46}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${le}, ${Ee.top-40}px, 0) scale(2.1)`}]:[{offset:0,opacity:0,transform:`translate3d(${le}, ${Ee.top-40}px, 0) scale(2.1)`},{offset:1,opacity:1,transform:`translate3d(${ue}, ${Ue.top-46}px, 0) scale(1)`}],Ye=Be?[{offset:0,opacity:1,transform:`translate3d(${ct}, ${Ue.top-46}px, 0) scale(1)`},{offset:.2,opacity:0,transform:`translate3d(${ct}, ${Ue.top-41}px, 0) scale(0.6)`},{offset:1,opacity:0,transform:`translate3d(${ct}, ${Ue.top-41}px, 0) scale(0.6)`}]:[{offset:0,opacity:0,transform:`translate3d(${ct}, ${Ue.top-41}px, 0) scale(0.6)`},{offset:1,opacity:1,transform:`translate3d(${ct}, ${Ue.top-46}px, 0) scale(1)`}],_t=(0,x.c)(),hn=(0,x.c)(),qt=ie("ion-back-button"),Ht=Y(qt).querySelector(".button-text"),De=Y(qt).querySelector("ion-icon");qt.text=Ie.text,qt.mode=Ie.mode,qt.icon=Ie.icon,qt.color=Ie.color,qt.disabled=Ie.disabled,qt.style.setProperty("display","block"),qt.style.setProperty("position","fixed"),hn.addElement(De),_t.addElement(Ht),_t.beforeStyles({"transform-origin":`${ht} center`}).beforeAddWrite(()=>{Ie.style.setProperty("display","none"),qt.style.setProperty(ht,et)}).afterAddWrite(()=>{Ie.style.setProperty("display",""),qt.style.setProperty("display","none"),qt.style.removeProperty(ht)}).keyframes(Te),hn.beforeStyles({"transform-origin":`${Le} center`}).keyframes(Ye),ae.addAnimation([_t,hn])},_e=(ae,oe,Be,Ie,Ee,Ue)=>{const et=oe?`calc(100% - ${Ee.right}px)`:`${Ee.left}px`,le=oe?"-18px":"18px",ue=oe?"right":"left",Le=Be?[{offset:0,opacity:0,transform:`translate3d(${le}, ${Ue.top-4}px, 0) scale(0.49)`},{offset:.1,opacity:0},{offset:1,opacity:1,transform:`translate3d(0, ${Ee.top-2}px, 0) scale(1)`}]:[{offset:0,opacity:.99,transform:`translate3d(0, ${Ee.top-2}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${le}, ${Ue.top-4}px, 0) scale(0.5)`}],ye=ie("ion-title"),gt=(0,x.c)();ye.innerText=Ie.innerText,ye.size=Ie.size,ye.color=Ie.color,gt.addElement(ye),gt.beforeStyles({"transform-origin":`${ue} center`,height:"46px",display:"",position:"relative",[ue]:et}).beforeAddWrite(()=>{Ie.style.setProperty("display","none")}).afterAddWrite(()=>{Ie.style.setProperty("display",""),ye.style.setProperty("display","none")}).keyframes(Le),ae.addAnimation(gt)},ee=(ae,oe)=>{var Be;try{const Ie="cubic-bezier(0.32,0.72,0,1)",Ee="opacity",Ue="transform",et="0%",ue="rtl"===ae.ownerDocument.dir,ct=ue?"-99.5%":"99.5%",ht=ue?"33%":"-33%",Le=oe.enteringEl,ye=oe.leavingEl,gt="back"===oe.direction,Te=Le.querySelector(":scope > ion-content"),Pe=Le.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *"),Ae=Le.querySelectorAll(":scope > ion-header > ion-toolbar"),Ye=(0,x.c)(),_t=(0,x.c)();if(Ye.addElement(Le).duration((null!==(Be=oe.duration)&&void 0!==Be?Be:0)||540).easing(oe.easing||Ie).fill("both").beforeRemoveClass("ion-page-invisible"),ye&&null!=ae){const De=(0,x.c)();De.addElement(ae),Ye.addAnimation(De)}if(Te||0!==Ae.length||0!==Pe.length?(_t.addElement(Te),_t.addElement(Pe)):_t.addElement(Le.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),Ye.addAnimation(_t),gt?_t.beforeClearStyles([Ee]).fromTo("transform",`translateX(${ht})`,`translateX(${et})`).fromTo(Ee,.8,1):_t.beforeClearStyles([Ee]).fromTo("transform",`translateX(${ct})`,`translateX(${et})`),Te){const De=Y(Te).querySelector(".transition-effect");if(De){const Je=De.querySelector(".transition-cover"),Re=De.querySelector(".transition-shadow"),Fe=(0,x.c)(),St=(0,x.c)(),Ce=(0,x.c)();Fe.addElement(De).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),St.addElement(Je).beforeClearStyles([Ee]).fromTo(Ee,0,.1),Ce.addElement(Re).beforeClearStyles([Ee]).fromTo(Ee,.03,.7),Fe.addAnimation([St,Ce]),_t.addAnimation([Fe])}}const hn=Le.querySelector("ion-header.header-collapse-condense"),{forward:qt,backward:Ht}=((ae,oe,Be,Ie,Ee)=>{const Ue=Ne(Ie,Be),et=E(Ee),le=E(Ie),ue=Ne(Ee,Be),ct=null!==Ue&&null!==et&&!Be,ht=null!==le&&null!==ue&&Be;if(ct){const Le=et.getBoundingClientRect(),ye=Ue.getBoundingClientRect();_e(ae,oe,Be,et,Le,ye),he(ae,oe,Be,Ue,Le,ye)}else if(ht){const Le=le.getBoundingClientRect(),ye=ue.getBoundingClientRect();_e(ae,oe,Be,le,Le,ye),he(ae,oe,Be,ue,Le,ye)}return{forward:ct,backward:ht}})(Ye,ue,gt,Le,ye);if(Ae.forEach(De=>{const Je=(0,x.c)();Je.addElement(De),Ye.addAnimation(Je);const Re=(0,x.c)();Re.addElement(De.querySelector("ion-title"));const Fe=(0,x.c)(),St=Array.from(De.querySelectorAll("ion-buttons,[menuToggle]")),Ce=De.closest("ion-header"),Rt=Ce?.classList.contains("header-collapse-condense-inactive");let Qt;Qt=St.filter(gt?dt=>{const Ot=dt.classList.contains("buttons-collapse");return Ot&&!Rt||!Ot}:dt=>!dt.classList.contains("buttons-collapse")),Fe.addElement(Qt);const Gt=(0,x.c)();Gt.addElement(De.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])"));const Zt=(0,x.c)();Zt.addElement(Y(De).querySelector(".toolbar-background"));const Jt=(0,x.c)(),kt=De.querySelector("ion-back-button");if(kt&&Jt.addElement(kt),Je.addAnimation([Re,Fe,Gt,Zt,Jt]),Fe.fromTo(Ee,.01,1),Gt.fromTo(Ee,.01,1),gt)Rt||Re.fromTo("transform",`translateX(${ht})`,`translateX(${et})`).fromTo(Ee,.01,1),Gt.fromTo("transform",`translateX(${ht})`,`translateX(${et})`),Jt.fromTo(Ee,.01,1);else if(hn||Re.fromTo("transform",`translateX(${ct})`,`translateX(${et})`).fromTo(Ee,.01,1),Gt.fromTo("transform",`translateX(${ct})`,`translateX(${et})`),Zt.beforeClearStyles([Ee,"transform"]),Ce?.translucent?Zt.fromTo("transform",ue?"translateX(-100%)":"translateX(100%)","translateX(0px)"):Zt.fromTo(Ee,.01,"var(--opacity)"),qt||Jt.fromTo(Ee,.01,1),kt&&!qt){const Ot=(0,x.c)();Ot.addElement(Y(kt).querySelector(".button-text")).fromTo("transform",ue?"translateX(-100px)":"translateX(100px)","translateX(0px)"),Je.addAnimation(Ot)}}),ye){const De=(0,x.c)(),Je=ye.querySelector(":scope > ion-content"),Re=ye.querySelectorAll(":scope > ion-header > ion-toolbar"),Fe=ye.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *");if(Je||0!==Re.length||0!==Fe.length?(De.addElement(Je),De.addElement(Fe)):De.addElement(ye.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),Ye.addAnimation(De),gt){De.beforeClearStyles([Ee]).fromTo("transform",`translateX(${et})`,ue?"translateX(-100%)":"translateX(100%)");const St=(0,h.g)(ye);Ye.afterAddWrite(()=>{"normal"===Ye.getDirection()&&St.style.setProperty("display","none")})}else De.fromTo("transform",`translateX(${et})`,`translateX(${ht})`).fromTo(Ee,1,.8);if(Je){const St=Y(Je).querySelector(".transition-effect");if(St){const Ce=St.querySelector(".transition-cover"),Rt=St.querySelector(".transition-shadow"),Qt=(0,x.c)(),Gt=(0,x.c)(),Zt=(0,x.c)();Qt.addElement(St).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),Gt.addElement(Ce).beforeClearStyles([Ee]).fromTo(Ee,.1,0),Zt.addElement(Rt).beforeClearStyles([Ee]).fromTo(Ee,.7,.03),Qt.addAnimation([Gt,Zt]),De.addAnimation([Qt])}}Re.forEach(St=>{const Ce=(0,x.c)();Ce.addElement(St);const Rt=(0,x.c)();Rt.addElement(St.querySelector("ion-title"));const Qt=(0,x.c)(),Gt=St.querySelectorAll("ion-buttons,[menuToggle]"),Zt=St.closest("ion-header"),Jt=Zt?.classList.contains("header-collapse-condense-inactive"),kt=Array.from(Gt).filter(ii=>{const gn=ii.classList.contains("buttons-collapse");return gn&&!Jt||!gn});Qt.addElement(kt);const dt=(0,x.c)(),Ot=St.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])");Ot.length>0&&dt.addElement(Ot);const pt=(0,x.c)();pt.addElement(Y(St).querySelector(".toolbar-background"));const Yt=(0,x.c)(),Ut=St.querySelector("ion-back-button");if(Ut&&Yt.addElement(Ut),Ce.addAnimation([Rt,Qt,dt,Yt,pt]),Ye.addAnimation(Ce),Yt.fromTo(Ee,.99,0),Qt.fromTo(Ee,.99,0),dt.fromTo(Ee,.99,0),gt){if(Jt||Rt.fromTo("transform",`translateX(${et})`,ue?"translateX(-100%)":"translateX(100%)").fromTo(Ee,.99,0),dt.fromTo("transform",`translateX(${et})`,ue?"translateX(-100%)":"translateX(100%)"),pt.beforeClearStyles([Ee,"transform"]),Zt?.translucent?pt.fromTo("transform","translateX(0px)",ue?"translateX(-100%)":"translateX(100%)"):pt.fromTo(Ee,"var(--opacity)",0),Ut&&!Ht){const gn=(0,x.c)();gn.addElement(Y(Ut).querySelector(".button-text")).fromTo("transform",`translateX(${et})`,`translateX(${(ue?-124:124)+"px"})`),Ce.addAnimation(gn)}}else Jt||Rt.fromTo("transform",`translateX(${et})`,`translateX(${ht})`).fromTo(Ee,.99,0).afterClearStyles([Ue,Ee]),dt.fromTo("transform",`translateX(${et})`,`translateX(${ht})`).afterClearStyles([Ue,Ee]),Yt.afterClearStyles([Ee]),Rt.afterClearStyles([Ee]),Qt.afterClearStyles([Ee])})}return Ye}catch(Ie){throw Ie}}},1904:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{mdTransitionAnimation:()=>J});var x=k(1774),h=k(1651);k(6225),k(1688);const J=(ie,Y)=>{var E,Ne,me;const ee="back"===Y.direction,oe=Y.leavingEl,Be=(0,h.g)(Y.enteringEl),Ie=Be.querySelector("ion-toolbar"),Ee=(0,x.c)();if(Ee.addElement(Be).fill("both").beforeRemoveClass("ion-page-invisible"),ee?Ee.duration((null!==(E=Y.duration)&&void 0!==E?E:0)||200).easing("cubic-bezier(0.47,0,0.745,0.715)"):Ee.duration((null!==(Ne=Y.duration)&&void 0!==Ne?Ne:0)||280).easing("cubic-bezier(0.36,0.66,0.04,1)").fromTo("transform","translateY(40px)","translateY(0px)").fromTo("opacity",.01,1),Ie){const Ue=(0,x.c)();Ue.addElement(Ie),Ee.addAnimation(Ue)}if(oe&&ee){Ee.duration((null!==(me=Y.duration)&&void 0!==me?me:0)||200).easing("cubic-bezier(0.47,0,0.745,0.715)");const Ue=(0,x.c)();Ue.addElement((0,h.g)(oe)).onFinish(et=>{1===et&&Ue.elements.length>0&&Ue.elements[0].style.setProperty("display","none")}).fromTo("transform","translateY(0px)","translateY(40px)").fromTo("opacity",1,0),Ee.addAnimation(Ue)}return Ee}},4988:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>Ce,G:()=>Rt,a:()=>he,b:()=>_e,c:()=>Be,d:()=>Qt,e:()=>Gt,f:()=>Ye,g:()=>hn,h:()=>De,i:()=>Re,j:()=>Ee,k:()=>Ue,l:()=>ee,m:()=>ae,n:()=>Ne,o:()=>ue,q:()=>Pe,s:()=>St,t:()=>Ie});var x=k(5861),h=k(2085),y=k(1042),s=k(2124),J=k(839),ie=k(6710);let Y=0,E=0;const Ne=new WeakMap,me=Zt=>({create:Jt=>et(Zt,Jt),dismiss:(Jt,kt,dt)=>gt(document,Jt,kt,Zt,dt),getTop:()=>(0,x.Z)(function*(){return Pe(document,Zt)})()}),he=me("ion-alert"),_e=me("ion-action-sheet"),ee=me("ion-loading"),ae=me("ion-modal"),Be=me("ion-popover"),Ie=me("ion-toast"),Ee=Zt=>{typeof document<"u"&&ye(document);const Jt=Y++;Zt.overlayIndex=Jt},Ue=Zt=>(Zt.hasAttribute("id")||(Zt.id="ion-overlay-"+ ++E),Zt.id),et=(Zt,Jt)=>typeof window<"u"&&typeof window.customElements<"u"?window.customElements.whenDefined(Zt).then(()=>{const kt=document.createElement(Zt);return kt.classList.add("overlay-hidden"),Object.assign(kt,Object.assign(Object.assign({},Jt),{hasController:!0})),qt(document).appendChild(kt),new Promise(dt=>(0,J.c)(kt,dt))}):Promise.resolve(),le='[tabindex]:not([tabindex^="-"]):not([hidden]):not([disabled]), input:not([type=hidden]):not([tabindex^="-"]):not([hidden]):not([disabled]), textarea:not([tabindex^="-"]):not([hidden]):not([disabled]), button:not([tabindex^="-"]):not([hidden]):not([disabled]), select:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable[disabled="false"]:not([tabindex^="-"]):not([hidden])',ue=(Zt,Jt)=>{let kt=Zt.querySelector(le);const dt=kt?.shadowRoot;dt&&(kt=dt.querySelector(le)||kt),kt?(0,J.f)(kt):Jt.focus()},ht=(Zt,Jt)=>{const kt=Array.from(Zt.querySelectorAll(le));let dt=kt.length>0?kt[kt.length-1]:null;const Ot=dt?.shadowRoot;Ot&&(dt=Ot.querySelector(le)||dt),dt?dt.focus():Jt.focus()},ye=Zt=>{0===Y&&(Y=1,Zt.addEventListener("focus",Jt=>{((Zt,Jt)=>{const kt=Pe(Jt,"ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover"),dt=Zt.target;kt&&dt&&!kt.classList.contains("ion-disable-focus-trap")&&(kt.shadowRoot?(()=>{if(kt.contains(dt))kt.lastFocus=dt;else{const Yt=kt.lastFocus;ue(kt,kt),Yt===Jt.activeElement&&ht(kt,kt),kt.lastFocus=Jt.activeElement}})():(()=>{if(kt===dt)kt.lastFocus=void 0;else{const Yt=(0,J.g)(kt);if(!Yt.contains(dt))return;const Ut=Yt.querySelector(".ion-overlay-wrapper");if(!Ut)return;if(Ut.contains(dt)||dt===Yt.querySelector("ion-backdrop"))kt.lastFocus=dt;else{const ii=kt.lastFocus;ue(Ut,kt),ii===Jt.activeElement&&ht(Ut,kt),kt.lastFocus=Jt.activeElement}}})())})(Jt,Zt)},!0),Zt.addEventListener("ionBackButton",Jt=>{const kt=Pe(Zt);kt?.backdropDismiss&&Jt.detail.register(s.OVERLAY_BACK_BUTTON_PRIORITY,()=>kt.dismiss(void 0,Ce))}),Zt.addEventListener("keydown",Jt=>{if("Escape"===Jt.key){const kt=Pe(Zt);kt?.backdropDismiss&&kt.dismiss(void 0,Ce)}}))},gt=(Zt,Jt,kt,dt,Ot)=>{const pt=Pe(Zt,dt,Ot);return pt?pt.dismiss(Jt,kt):Promise.reject("overlay does not exist")},Pe=(Zt,Jt,kt)=>{const dt=((Zt,Jt)=>(void 0===Jt&&(Jt="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(Zt.querySelectorAll(Jt)).filter(kt=>kt.overlayIndex>0)))(Zt,Jt).filter(Ot=>!(Zt=>Zt.classList.contains("overlay-hidden"))(Ot));return void 0===kt?dt[dt.length-1]:dt.find(Ot=>Ot.id===kt)},Ae=(Zt=!1)=>{const kt=qt(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");kt&&(Zt?kt.setAttribute("aria-hidden","true"):kt.removeAttribute("aria-hidden"))},Ye=function(){var Zt=(0,x.Z)(function*(Jt,kt,dt,Ot,pt){var Yt,Ut;if(Jt.presented)return;Ae(!0),Jt.presented=!0,Jt.willPresent.emit(),null===(Yt=Jt.willPresentShorthand)||void 0===Yt||Yt.emit();const ii=(0,h.b)(Jt),gn=Jt.enterAnimation?Jt.enterAnimation:h.c.get(kt,"ios"===ii?dt:Ot);(yield Ht(Jt,gn,Jt.el,pt))&&(Jt.didPresent.emit(),null===(Ut=Jt.didPresentShorthand)||void 0===Ut||Ut.emit()),"ION-TOAST"!==Jt.el.tagName&&_t(Jt.el),Jt.keyboardClose&&(null===document.activeElement||!Jt.el.contains(document.activeElement))&&Jt.el.focus()});return function(kt,dt,Ot,pt,Yt){return Zt.apply(this,arguments)}}(),_t=function(){var Zt=(0,x.Z)(function*(Jt){let kt=document.activeElement;if(!kt)return;const dt=kt?.shadowRoot;dt&&(kt=dt.querySelector(le)||kt),yield Jt.onDidDismiss(),kt.focus()});return function(kt){return Zt.apply(this,arguments)}}(),hn=function(){var Zt=(0,x.Z)(function*(Jt,kt,dt,Ot,pt,Yt,Ut){var ii,gn;if(!Jt.presented)return!1;Ae(!1),Jt.presented=!1;try{Jt.el.style.setProperty("pointer-events","none"),Jt.willDismiss.emit({data:kt,role:dt}),null===(ii=Jt.willDismissShorthand)||void 0===ii||ii.emit({data:kt,role:dt});const Ft=(0,h.b)(Jt),Jn=Jt.leaveAnimation?Jt.leaveAnimation:h.c.get(Ot,"ios"===Ft?pt:Yt);dt!==Rt&&(yield Ht(Jt,Jn,Jt.el,Ut)),Jt.didDismiss.emit({data:kt,role:dt}),null===(gn=Jt.didDismissShorthand)||void 0===gn||gn.emit({data:kt,role:dt}),Ne.delete(Jt),Jt.el.classList.add("overlay-hidden"),Jt.el.style.removeProperty("pointer-events"),void 0!==Jt.el.lastFocus&&(Jt.el.lastFocus=void 0)}catch(Ft){console.error(Ft)}return Jt.el.remove(),!0});return function(kt,dt,Ot,pt,Yt,Ut,ii){return Zt.apply(this,arguments)}}(),qt=Zt=>Zt.querySelector("ion-app")||Zt.body,Ht=function(){var Zt=(0,x.Z)(function*(Jt,kt,dt,Ot){dt.classList.remove("overlay-hidden");const Yt=kt(Jt.el,Ot);(!Jt.animated||!h.c.getBoolean("animated",!0))&&Yt.duration(0),Jt.keyboardClose&&Yt.beforeAddWrite(()=>{const ii=dt.ownerDocument.activeElement;ii?.matches("input,ion-input, ion-textarea")&&ii.blur()});const Ut=Ne.get(Jt)||[];return Ne.set(Jt,[...Ut,Yt]),yield Yt.play(),!0});return function(kt,dt,Ot,pt){return Zt.apply(this,arguments)}}(),De=(Zt,Jt)=>{let kt;const dt=new Promise(Ot=>kt=Ot);return Je(Zt,Jt,Ot=>{kt(Ot.detail)}),dt},Je=(Zt,Jt,kt)=>{const dt=Ot=>{(0,J.b)(Zt,Jt,dt),kt(Ot)};(0,J.a)(Zt,Jt,dt)},Re=Zt=>"cancel"===Zt||Zt===Ce,Fe=Zt=>Zt(),St=(Zt,Jt)=>{if("function"==typeof Zt)return h.c.get("_zoneGate",Fe)(()=>{try{return Zt(Jt)}catch(dt){throw dt}})},Ce="backdrop",Rt="gesture",Qt=Zt=>{let kt,Jt=!1;const dt=(0,y.C)(),Ot=(Ut=!1)=>{if(kt&&!Ut)return{delegate:kt,inline:Jt};const{el:ii,hasController:gn,delegate:Ft}=Zt;return Jt=null!==ii.parentNode&&!gn,kt=Jt?Ft||dt:Ft,{inline:Jt,delegate:kt}};return{attachViewToDom:function(){var Ut=(0,x.Z)(function*(ii){const{delegate:gn}=Ot(!0);if(gn)return yield gn.attachViewToDom(Zt.el,ii);const{hasController:Ft}=Zt;if(Ft&&void 0!==ii)throw new Error("framework delegate is missing");return null});return function(gn){return Ut.apply(this,arguments)}}(),removeViewFromDom:()=>{const{delegate:Ut}=Ot();Ut&&void 0!==Zt.el&&Ut.removeViewFromDom(Zt.el.parentElement,Zt.el)}}},Gt=()=>{let Zt;const Jt=()=>{Zt&&(Zt(),Zt=void 0)};return{addClickListener:(dt,Ot)=>{Jt();const pt=void 0!==Ot?document.getElementById(Ot):null;pt?Zt=((Ut,ii)=>{const gn=()=>{ii.present()};return Ut.addEventListener("click",gn),()=>{Ut.removeEventListener("click",gn)}})(pt,dt):(0,ie.p)(`A trigger element with the ID "${Ot}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on an overlay component.`,dt)},removeClickListener:Jt}}},1163:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>ee});var x=k(1180),h=k(2029),y=k(866),s=k(6814),J=k(9843);function ie(ae,oe){if(1&ae&&(h.TgZ(0,"ion-badge",7),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.Quantity," x")}}function Y(ae,oe){if(1&ae&&(h.TgZ(0,"strong"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.PowerKW," kW ")}}function E(ae,oe){if(1&ae&&(h.TgZ(0,"div"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",null==Be.CurrentType?null:Be.CurrentType.Title," ")}}function Ne(ae,oe){if(1&ae&&(h.TgZ(0,"span"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.Amps,"A ")}}function me(ae,oe){if(1&ae&&(h.TgZ(0,"span"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.Voltage,"V ")}}function he(ae,oe){if(1&ae){const Be=h.EpF();h.TgZ(0,"ion-col")(1,"ion-button",8),h.NdJ("click",function(){h.CHM(Be);const Ee=h.oxw().$implicit,Ue=h.oxw();return h.KtG(Ue.editConnection(Ee))}),h._UZ(2,"ion-icon",9),h.qZA(),h._UZ(3,"br"),h.TgZ(4,"ion-button",10),h.NdJ("click",function(){h.CHM(Be);const Ee=h.oxw().$implicit,Ue=h.oxw();return h.KtG(Ue.deleteConnection(Ee))}),h._UZ(5,"ion-icon",11),h.qZA()()}}function _e(ae,oe){if(1&ae&&(h.TgZ(0,"ion-row")(1,"ion-col")(2,"ion-row")(3,"ion-col",1),h._UZ(4,"img",2),h.YNc(5,ie,2,1,"ion-badge",3),h.TgZ(6,"div",4),h._uU(7),h.qZA()(),h.TgZ(8,"ion-col")(9,"ion-row")(10,"ion-col")(11,"ion-note")(12,"div")(13,"strong",5),h._uU(14),h.qZA()(),h.YNc(15,Y,2,1,"strong",6),h.YNc(16,E,2,1,"div",6),h.qZA(),h.TgZ(17,"ion-note"),h.YNc(18,Ne,2,1,"span",6),h.YNc(19,me,2,1,"span",6),h.qZA()()(),h.TgZ(20,"ion-row")(21,"ion-col",4),h._uU(22),h.qZA(),h.TgZ(23,"ion-col",4),h._uU(24),h.qZA()()(),h.YNc(25,he,6,0,"ion-col",6),h.qZA()()()),2&ae){const Be=oe.$implicit,Ie=h.oxw();h.xp6(4),h.Q6J("src",Ie.getConnectorTypeIcon(Be.ConnectionTypeID),h.LSH),h.xp6(1),h.Q6J("ngIf",Be.Quantity),h.xp6(2),h.Oqu(null==Be.StatusType?null:Be.StatusType.Title),h.xp6(6),h.s9C("title",null==Be.ConnectionType?null:Be.ConnectionType.FormalName),h.xp6(1),h.hij("",null==Be.ConnectionType?null:Be.ConnectionType.Title," "),h.xp6(1),h.Q6J("ngIf",Be.PowerKW),h.xp6(1),h.Q6J("ngIf",Be.CurrentTypeID),h.xp6(2),h.Q6J("ngIf",Be.Amps),h.xp6(1),h.Q6J("ngIf",Be.Voltage),h.xp6(3),h.Oqu(Be.Reference),h.xp6(2),h.Oqu(Be.Comments),h.xp6(1),h.Q6J("ngIf",Ie.enableEdit)}}let ee=(()=>{var ae;class oe{constructor(){(0,x.Z)(this,"item",void 0),(0,x.Z)(this,"enableEdit",!1),(0,x.Z)(this,"onEdit",new h.vpe),(0,x.Z)(this,"onDelete",new h.vpe)}ngOnInit(){}editConnection(Ie){this.onEdit.emit(Ie)}deleteConnection(Ie){this.onDelete.emit(Ie)}getConnectorTypeIcon(Ie){return y.c.getIconForConnector(Ie)}}return ae=oe,(0,x.Z)(oe,"\u0275fac",function(Ie){return new(Ie||ae)}),(0,x.Z)(oe,"\u0275cmp",h.Xpm({type:ae,selectors:[["app-equipment-details"]],inputs:{item:"item",enableEdit:"enableEdit"},outputs:{onEdit:"onEdit",onDelete:"onDelete"},decls:2,vars:1,consts:[[4,"ngFor","ngForOf"],["size","3"],[2,"max-width","64px",3,"src"],["color","primary",4,"ngIf"],[1,"info"],[3,"title"],[4,"ngIf"],["color","primary"],["size","small","color","secondary",3,"click"],["name","create","slot","icon-only"],["size","small","color","danger",3,"click"],["name","trash","slot","icon-only"]],template:function(Ie,Ee){1&Ie&&(h.TgZ(0,"ion-grid"),h.YNc(1,_e,26,12,"ion-row",0),h.qZA()),2&Ie&&(h.xp6(1),h.Q6J("ngForOf",Ee.item.Connections))},dependencies:[s.sg,s.O5,J.yp,J.YG,J.wI,J.jY,J.gu,J.uN,J.Nd]})),oe})()},6086:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>Ie});var x=k(5861),h=k(1180),y=k(2029),s=k(9159),J=k(6814),ie=k(9843),Y=k(6223);function E(Ee,Ue){if(1&Ee&&(y.TgZ(0,"ion-select-option",5),y._uU(1),y.qZA()),2&Ee){const et=Ue.$implicit;y.Q6J("value",et.ID),y.xp6(1),y.Oqu(et.Title)}}function Ne(Ee,Ue){1&Ee&&(y.TgZ(0,"ion-select-option",6),y._uU(1,"Other..."),y.qZA())}function me(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-item")(1,"ion-label",1),y._uU(2,"Network Operator"),y.qZA(),y.TgZ(3,"ion-select",2),y.NdJ("ngModelChange",function(ue){y.CHM(et);const ct=y.oxw();return y.KtG(ct.operatorId=ue)})("ionChange",function(){y.CHM(et);const ue=y.oxw();return y.KtG(ue.onOperatorChange())}),y.YNc(4,E,2,2,"ion-select-option",3),y.YNc(5,Ne,2,0,"ion-select-option",4),y.qZA()()}if(2&Ee){const et=y.oxw();y.xp6(3),y.Q6J("ngModel",et.operatorId),y.xp6(1),y.Q6J("ngForOf",et.operators),y.xp6(1),y.Q6J("ngIf",et.useFilteredOperators)}}function he(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-item")(1,"ion-searchbar",7),y.NdJ("ionCancel",function(){y.CHM(et);const ue=y.oxw();return y.KtG(ue.cancelOperatorLookup())})("ngModelChange",function(ue){y.CHM(et);const ct=y.oxw();return y.KtG(ct.operatorSearchKeyword=ue)})("ionInput",function(ue){y.CHM(et);const ct=y.oxw();return y.KtG(ct.searchOperators(ue))}),y.qZA()()}if(2&Ee){const et=y.oxw();y.xp6(1),y.Q6J("ngModel",et.operatorSearchKeyword)}}function _e(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-item",9),y.NdJ("click",function(){const ct=y.CHM(et).$implicit,ht=y.oxw(2);return y.KtG(ht.onOperatorChange(ct))}),y.TgZ(1,"ion-avatar",10),y._UZ(2,"ion-icon",11),y.qZA(),y.TgZ(3,"ion-label")(4,"p"),y._uU(5),y.qZA(),y.TgZ(6,"p"),y._uU(7),y.qZA()()()}if(2&Ee){const et=Ue.$implicit;y.xp6(5),y.Oqu(et.Title),y.xp6(2),y.Oqu(et.WebsiteURL)}}function ee(Ee,Ue){if(1&Ee&&(y.ynx(0),y.TgZ(1,"ion-list"),y.YNc(2,_e,8,2,"ion-item",8),y.qZA(),y.BQk()),2&Ee){const et=y.oxw();y.xp6(2),y.Q6J("ngForOf",et.operatorSearchResults)}}function ae(Ee,Ue){if(1&Ee){const et=y.EpF();y.ynx(0),y.TgZ(1,"ion-item")(2,"ion-avatar",10),y._UZ(3,"ion-icon",12),y.qZA(),y.TgZ(4,"ion-label")(5,"p"),y._uU(6),y.qZA(),y.TgZ(7,"p"),y._uU(8),y.qZA(),y.TgZ(9,"ion-button",9),y.NdJ("click",function(){y.CHM(et);const ue=y.oxw();return y.KtG(ue.selectedOperator=null)}),y._uU(10,"Change"),y.qZA()()(),y.BQk()}if(2&Ee){const et=y.oxw();y.xp6(6),y.Oqu(et.selectedOperator.Title),y.xp6(2),y.Oqu(et.selectedOperator.WebsiteURL)}}function oe(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-chip")(1,"ion-label"),y._uU(2),y.qZA(),y.TgZ(3,"ion-icon",14),y.NdJ("click",function(){const ct=y.CHM(et).$implicit,ht=y.oxw(2);return y.KtG(ht.removeOperator(ct))}),y.qZA()()}if(2&Ee){const et=Ue.$implicit,le=y.oxw(2);y.xp6(2),y.Oqu(le.getOperatorInfo(et).Title)}}function Be(Ee,Ue){if(1&Ee&&(y.ynx(0),y.YNc(1,oe,4,1,"ion-chip",13),y.BQk()),2&Ee){const et=y.oxw();y.xp6(1),y.Q6J("ngForOf",et.operatorList)}}let Ie=(()=>{var Ee;class Ue{get operators(){return this.referenceDataManager.getNetworkOperators(this.useFilteredOperators)}constructor(le,ue){(0,h.Z)(this,"referenceDataManager",void 0),(0,h.Z)(this,"changeDetector",void 0),(0,h.Z)(this,"operatorId",null),(0,h.Z)(this,"operatorList",null),(0,h.Z)(this,"mode","single"),(0,h.Z)(this,"useFilteredOperators",null),(0,h.Z)(this,"operatorChanged",new y.vpe),(0,h.Z)(this,"operatorRemoved",new y.vpe),(0,h.Z)(this,"operatorCache",[]),(0,h.Z)(this,"operatorSearchResults",[]),(0,h.Z)(this,"operatorSearchKeyword",""),(0,h.Z)(this,"selectedOperator",null),this.referenceDataManager=le,this.changeDetector=ue}ngOnInit(){this.operatorCache=this.referenceDataManager.getNetworkOperators(!1),null!=this.operatorId&&(this.selectedOperator=this.operatorCache.find(le=>le.ID==this.operatorId))}searchOperators(){this.operatorSearchResults=[],0!=this.operatorSearchKeyword.length&&(this.operatorSearchResults=this.operatorCache?this.operatorCache.filter(le=>le.Title.toLowerCase().startsWith(this.operatorSearchKeyword.toLowerCase())||le.Title.toLowerCase().startsWith("("+this.operatorSearchKeyword.toLowerCase())).slice(0,10):[])}getOperatorInfo(le){if(this.operatorCache)return this.operatorCache.find(ue=>ue.ID==le)}onOperatorChange(le=null){var ue=this;return(0,x.Z)(function*(){null==le&&ue.operatorId&&(le=ue.operatorCache.find(ct=>ct.ID==ue.operatorId)),null!=le&&(ue.operatorSearchResults=[],ue.selectedOperator=le,ue.operatorId=le.ID),ue.operatorId?(ue.operatorChanged.emit(ue.selectedOperator),"single"!=ue.mode&&(ue.selectedOperator=null,ue.operatorSearchKeyword="")):ue.useFilteredOperators=!1})()}removeOperator(le){var ue=this;return(0,x.Z)(function*(){ue.operatorId=null,ue.operatorRemoved.emit(le)})()}cancelOperatorLookup(){this.selectedOperator=null}}return Ee=Ue,(0,h.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(y.Y36(s.W),y.Y36(y.sBO))}),(0,h.Z)(Ue,"\u0275cmp",y.Xpm({type:Ee,selectors:[["app-operator-lookup"]],inputs:{operatorId:"operatorId",operatorList:"operatorList",mode:"mode",useFilteredOperators:"useFilteredOperators"},outputs:{operatorChanged:"operatorChanged",operatorRemoved:"operatorRemoved"},decls:5,vars:5,consts:[[4,"ngIf"],["position","floating"],[3,"ngModel","ngModelChange","ionChange"],[3,"value",4,"ngFor","ngForOf"],["value","",4,"ngIf"],[3,"value"],["value",""],["placeholder","Search network operators","showCancelButton","focus","autocomplete","on",3,"ngModel","ionCancel","ngModelChange","ionInput"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["item-left",""],["name","card"],["name","locate"],[4,"ngFor","ngForOf"],["name","close-circle",3,"click"]],template:function(le,ue){1&le&&(y.YNc(0,me,6,3,"ion-item",0),y.YNc(1,he,2,1,"ion-item",0),y.YNc(2,ee,3,1,"ng-container",0),y.YNc(3,ae,11,2,"ng-container",0),y.YNc(4,Be,2,1,"ng-container",0)),2&le&&(y.Q6J("ngIf",ue.useFilteredOperators&&!ue.selectedOperator),y.xp6(1),y.Q6J("ngIf",!ue.useFilteredOperators&&!ue.selectedOperator),y.xp6(1),y.Q6J("ngIf",ue.operatorSearchResults.length>0),y.xp6(1),y.Q6J("ngIf",null!=ue.selectedOperator),y.xp6(1),y.Q6J("ngIf",(null==ue.operatorList?null:ue.operatorList.length)>0))},dependencies:[J.sg,J.O5,ie.BJ,ie.YG,ie.hM,ie.gu,ie.Ie,ie.Q$,ie.q_,ie.VI,ie.t9,ie.n0,ie.QI,ie.j9,Y.JJ,Y.On]})),Ue})()},5460:(Nn,yt,k)=>{"use strict";k.d(yt,{v:()=>ee});var x=k(5861),h=k(1180),y=k(9127),s=k(2029),J=k(9903),ie=k(9843),Y=k(9862),E=k(5957),Ne=k(6814);function me(ae,oe){1&ae&&(s.TgZ(0,"div"),s._UZ(1,"ion-spinner"),s.qZA())}function he(ae,oe){if(1&ae){const Be=s.EpF();s.TgZ(0,"ion-item",5),s.NdJ("click",function(){const Ue=s.CHM(Be).$implicit,et=s.oxw(2);return s.KtG(et.placeSelected(Ue))}),s.TgZ(1,"ion-avatar",6),s._UZ(2,"ion-icon",7),s.qZA(),s.TgZ(3,"ion-label")(4,"p"),s._uU(5),s.qZA()()()}if(2&ae){const Be=oe.$implicit;s.xp6(5),s.Oqu(Be.Address)}}function _e(ae,oe){if(1&ae&&(s.TgZ(0,"div",1),s.YNc(1,me,2,0,"div",2),s.TgZ(2,"ion-list"),s.YNc(3,he,6,1,"ion-item",3),s.TgZ(4,"ion-item")(5,"p",4),s._uU(6),s.qZA()()()()),2&ae){const Be=s.oxw();s.xp6(1),s.Q6J("ngIf",Be.searchInProgress),s.xp6(2),s.Q6J("ngForOf",Be.placeList),s.xp6(3),s.hij(" ",Be.placeAttribution," ")}}let ee=(()=>{var ae;class oe{constructor(Ie,Ee,Ue,et,le){(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"changeDetector",void 0),(0,h.Z)(this,"platform",void 0),(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"placeSearchType",void 0),(0,h.Z)(this,"placeList",void 0),(0,h.Z)(this,"searchInProgress",!1),(0,h.Z)(this,"searchKeyword",void 0),(0,h.Z)(this,"placeSearchFocused",void 0),(0,h.Z)(this,"placeSearchActive",!1),(0,h.Z)(this,"placeAttribution",""),(0,h.Z)(this,"selectedPlace",void 0),(0,h.Z)(this,"placeChanged",new s.vpe),(0,h.Z)(this,"mapService",void 0),this.logging=Ie,this.changeDetector=Ee,this.platform=Ue,this.http=et,this.events=le,this.searchKeyword="",this.searchInProgress=!1,this.mapService=new J.k(le,Ie,et)}ngOnInit(){var Ie=this;return(0,x.Z)(function*(){yield Ie.platform.ready(),Ie.mapService.initAPI()})()}onSearchFocus(){this.placeSearchFocused=!0}onSearchBlur(){this.placeSearchFocused=!1}onSearchCancel(){}getPlacesAutoComplete(Ie,Ee){var Ue=this;return(0,x.Z)(function*(){Ue.placeSearchType=Ee;let et=Ie.target.value;if(et&&et.length>3){Ue.logging.log("Starting place lookup for:"+et),Ue.placeSearchActive=!0,Ue.searchInProgress=!0,Ue.searchInProgress=!1,Ue.placeSearchActive=!0;try{Ue.placeList=yield Ue.mapService.placeSearch(et),Ue.placeList&&Ue.placeList.length>0&&(Ue.placeAttribution=Ue.placeList[0].Attribution)}catch{}Ue.searchInProgress=!1,Ue.placeSearchActive=!0}else Ue.searchInProgress=!1,Ue.placeSearchActive=!1})()}placeSelected(Ie){this.logging.log("Looking up place details:"+Ie.Title+"::"+Ie.ReferenceID),this.selectedPlace=Ie,this.placeChanged.emit(Ie),this.placeSearchActive=!1}}return ae=oe,(0,h.Z)(oe,"\u0275fac",function(Ie){return new(Ie||ae)(s.Y36(y.z),s.Y36(s.sBO),s.Y36(ie.t4),s.Y36(Y.eN),s.Y36(E.z))}),(0,h.Z)(oe,"\u0275cmp",s.Xpm({type:ae,selectors:[["place-search"]],inputs:{searchKeyword:"searchKeyword"},outputs:{selectedPlace:"selectedPlace",placeChanged:"placeChanged"},decls:1,vars:1,consts:[["class","place-search",4,"ngIf"],[1,"place-search"],[4,"ngIf"],[3,"click",4,"ngFor","ngForOf"],[1,"place-attribution"],[3,"click"],["item-left",""],["name","locate"]],template:function(Ie,Ee){1&Ie&&s.YNc(0,_e,7,3,"div",0),2&Ie&&s.Q6J("ngIf",Ee.placeSearchActive)},dependencies:[Ne.sg,Ne.O5,ie.BJ,ie.gu,ie.Ie,ie.Q$,ie.q_,ie.PQ],styles:[".place-search[_ngcontent-%COMP%]{position:absolute;z-index:1000}.place-attribution[_ngcontent-%COMP%]{font-size:9px;color:#dcdcdc;max-width:100%}"]})),oe})()},8696:(Nn,yt,k)=>{"use strict";k.d(yt,{o:()=>Ne});var x=k(1180),h=k(2029),y=k(866),s=k(6814),J=k(9843);function ie(me,he){if(1&me){const _e=h.EpF();h.TgZ(0,"ion-button",5),h.NdJ("click",function(){h.CHM(_e);const ae=h.oxw().$implicit,oe=h.oxw();return h.KtG(oe.onCopyCommand(ae))}),h._uU(1,"Copy"),h.qZA()}}function Y(me,he){if(1&me){const _e=h.EpF();h.TgZ(0,"ion-button",5),h.NdJ("click",function(){h.CHM(_e);const ae=h.oxw().$implicit,oe=h.oxw();return h.KtG(oe.onEditCommand(ae))}),h._uU(1,"Edit"),h.qZA()}}function E(me,he){if(1&me&&(h.TgZ(0,"ion-item",1)(1,"ion-grid")(2,"ion-row")(3,"ion-col"),h._uU(4),h.qZA()(),h.TgZ(5,"ion-row")(6,"ion-col",2)(7,"p"),h._UZ(8,"img",3),h.qZA(),h.TgZ(9,"ion-note"),h._uU(10),h.qZA(),h.YNc(11,ie,2,0,"ion-button",4),h.YNc(12,Y,2,0,"ion-button",4),h.qZA(),h.TgZ(13,"ion-col")(14,"ion-row")(15,"ion-col")(16,"p"),h._uU(17),h.qZA(),h.TgZ(18,"ion-note"),h._uU(19),h.qZA()()(),h.TgZ(20,"ion-row")(21,"ion-col"),h._uU(22),h.qZA(),h.TgZ(23,"ion-col"),h._uU(24),h.qZA()()()()()()),2&me){const _e=he.$implicit,ee=h.oxw();h.xp6(4),h.hij(" ",_e.AddressInfo.Title," "),h.xp6(4),h.Q6J("src",ee.getIconForPOI(_e),h.LSH),h.xp6(2),h.hij(" ",ee.getFormattedDistance(_e)," "),h.xp6(1),h.Q6J("ngIf",ee.enableCopyOption),h.xp6(1),h.Q6J("ngIf",ee.enableEditOption),h.xp6(5),h.hij(" ",ee.getFormattedAddress(_e)," "),h.xp6(2),h.hij(" ",ee.getFormattedConnectorList(_e)," "),h.xp6(3),h.hij(" ",null==_e.UsageType?null:_e.UsageType.Title," "),h.xp6(2),h.hij(" ",null==_e.OperatorInfo?null:_e.OperatorInfo.Title," ")}}let Ne=(()=>{var me;class he{constructor(){(0,x.Z)(this,"enableCopyOption",!1),(0,x.Z)(this,"enableEditOption",!1),(0,x.Z)(this,"poiList",[]),(0,x.Z)(this,"onCopy",new h.vpe),(0,x.Z)(this,"onEdit",new h.vpe)}ngOnInit(){}onCopyCommand(ee){this.onCopy.emit(ee)}onEditCommand(ee){this.onEdit.emit(ee)}getFormattedAddress(ee){let ae="";return ae+=ee.AddressInfo.Title!=ee.AddressInfo.AddressLine1?ee.AddressInfo.Title:ee.AddressInfo.Town,ae}getFormattedConnectorList(ee){if(!ee.Connections)return;let ae=[];for(let oe of ee.Connections)null!=oe.ConnectionType&&(ae.find(Be=>Be==oe.ConnectionType.Title)||ae.push(oe.ConnectionType.Title));return ae.join(", ")}getIconForPOI(ee){return y.c.getIconForPOI(ee)}getFormattedDistance(ee){return y.c.getFormattedDistance(ee)}}return me=he,(0,x.Z)(he,"\u0275fac",function(ee){return new(ee||me)}),(0,x.Z)(he,"\u0275cmp",h.Xpm({type:me,selectors:[["app-poi-list"]],inputs:{enableCopyOption:"enableCopyOption",enableEditOption:"enableEditOption",poiList:"poiList"},outputs:{onCopy:"onCopy",onEdit:"onEdit"},decls:2,vars:1,consts:[["style","max-width:400px;",4,"ngFor","ngForOf"],[2,"max-width","400px"],["size","3"],[2,"width","24px",3,"src"],["size","small",3,"click",4,"ngIf"],["size","small",3,"click"]],template:function(ee,ae){1&ee&&(h.TgZ(0,"ion-list"),h.YNc(1,E,25,9,"ion-item",0),h.qZA()),2&ee&&(h.xp6(1),h.Q6J("ngForOf",ae.poiList))},dependencies:[s.sg,s.O5,J.YG,J.wI,J.jY,J.Ie,J.q_,J.uN,J.Nd]})),he})()},5086:(Nn,yt,k)=>{"use strict";k.d(yt,{e:()=>Y});var x=k(1180),h=k(6814),y=k(9843),s=k(6223),J=k(3999),ie=k(2029);let Y=(()=>{var E;class Ne{}return E=Ne,(0,x.Z)(Ne,"\u0275fac",function(he){return new(he||E)}),(0,x.Z)(Ne,"\u0275mod",ie.oAB({type:E})),(0,x.Z)(Ne,"\u0275inj",ie.cJS({providers:[h.JJ],imports:[h.ez,y.Pc,s.u5,J.aw]})),Ne})()},7777:(Nn,yt,k)=>{"use strict";k.d(yt,{X:()=>y});var x=k(1180),h=k(553);class y{constructor(){(0,x.Z)(this,"baseURL",void 0),(0,x.Z)(this,"loginProviderRedirectBaseURL",void 0),(0,x.Z)(this,"loginProviderRedirectURL",void 0),(0,x.Z)(this,"enableLiveMapQuerying",void 0),(0,x.Z)(this,"googleMapsAPIKey",void 0),(0,x.Z)(this,"enableStaticMaps",void 0),this.baseURL="https://map.openchargemap.io",this.loginProviderRedirectBaseURL="https://openchargemap.org/site/loginprovider/?_mode=silent&_forceLogin=true&_redirectURL=",this.loginProviderRedirectURL=this.loginProviderRedirectBaseURL+this.baseURL,this.enableLiveMapQuerying=!0,this.googleMapsAPIKey=h.N.googleMapsKey,this.enableStaticMaps=h.N.enableStaticMaps}}},866:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>y});var x=k(1180),h=k(553);let y=(()=>{class s{static isFeatureEnabled(ie){return!!h.N.enabledFeatures.find(Y=>Y===ie)}static getClientHeight(){const ie=document.body,Y=document.documentElement;return Math.max(ie.scrollHeight,ie.offsetHeight,Y.clientHeight,Y.scrollHeight,Y.offsetHeight)}static getClientWidth(){const ie=document.body,Y=document.documentElement;return Math.max(ie.scrollWidth,ie.offsetWidth,Y.clientWidth,Y.scrollWidth,Y.offsetWidth)}static getMaxLevelOfPOI(ie){let Y=0;if(null!=ie.Connections)for(let E=0;EY&&(Y=ie.Connections[E].Level.ID);return 4===Y&&(Y=2),Y>4&&(Y=3),Y}static getIconForPOI(ie){let E="assets/images/icons/map/level"+s.getMaxLevelOfPOI(ie);return null!=ie.UsageType&&ie.UsageType.Title.indexOf("Private")>-1?E+="_private":E+=null!=ie.StatusType&&!0!==ie.StatusType.IsOperational?"_nonoperational":"_operational",E+="_icon.png",E}static getColorForPOI(ie){const Y=s.getMaxLevelOfPOI(ie);let E="#c0c0c0";return null!=ie.UsageType&&ie.UsageType.Title.indexOf("Private")>-1?E="#FF0000":null!=ie.StatusType&&!0!==ie.StatusType.IsOperational?E="#a0a0a0":2==Y?E="#72EB0D":3==Y&&(E="#EB800D"),E}static getIconForConnector(ie){let Y="assets/images/icons/connectors/";return Y+=1===ie?"Type1_J1772.svg":2===ie?"Chademo_type4.svg":25===ie?"Type2_socket.svg":32===ie?"Type1_CCS.svg":33===ie?"Type2_CCS.svg":1036===ie?"Type2_tethered.svg":26===ie?"Type3c.svg":28===ie?"schuko.svg":"Unknown.svg",Y}static getFormattedDistance(ie){return ie&&ie.AddressInfo&&ie.AddressInfo.Distance?ie.AddressInfo.Distance.toFixed(1)+" "+(1===ie.AddressInfo.DistanceUnit?"km":"miles"):""}static fixJSONDate(ie){if(null==ie)return null;if(0==ie.indexOf("/")){let E=/Date\(([^)]+)\)/.exec(ie);ie=new Date(parseFloat(E[1]))}else ie=new Date(ie);return ie}static formatMapLinkFromPosition(ie,Y,E,Ne,me){return'Map ('+Math.ceil(Ne)+" "+me+")"}static formatSystemWebLink(ie,Y){return""+Y+""}static formatMapLink(ie,Y,E){return E?device&&"WinCE"==device.platform?this.formatSystemWebLink("maps:"+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude,Y):device&&"iOS"===device.platform?this.formatSystemWebLink("https://maps.apple.com/?q="+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude,Y):this.formatSystemWebLink("https://maps.google.com/maps?q="+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude,Y):''+Y+""}static formatURL(ie,Y=null){return null==ie||""==ie?"":(-1==ie.indexOf("http")&&(ie="https://"+ie),''+(Y??ie)+"")}static formatString(ie){return null==ie?"":ie.toString()}static formatTextField(ie,Y=null,E=!1,Ne=!1,me=null){if(null==ie||""==ie||null==ie)return"";let he=(null!=Y?""+Y+": ":"")+(E?"
":"")+ie.toString().replace("\n","
")+"
";return 1==Ne&&(he="

"+he+"

"),he}static formatEmailAddress(ie){return null!=ie&&null!=ie&&""!=ie?" '+ie+"
":""}static formatPhone(ie,Y=null){return null!=ie&&null!=ie&&""!=ie?(null==Y?Y=" ":Y+=": ",Y+''+ie+"
"):""}static formatPOIDetails(ie,Y){let Ne=new Date;null==Y&&(Y=!1);let me=this.formatPOIAddress(ie,!1),he="";he+=this.formatPhone(ie.AddressInfo.ContactTelephone1),he+=this.formatPhone(ie.AddressInfo.ContactTelephone2),he+=this.formatEmailAddress(ie.AddressInfo.ContactEmail);let _e="";if(null!=ie.AddressInfo.Distance){let Ee="https://maps.google.com/maps?saddr=&daddr="+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude;_e+="Distance: "+ie.AddressInfo.Distance.toFixed(1)+" "+(2==ie.AddressInfo.DistanceUnit?"Miles":"KM")+"",_e+="

"+this.formatSystemWebLink(Ee,"Get Directions")+"

"}if(null!=ie.AddressInfo.RelatedURL&&""!=ie.AddressInfo.RelatedURL){let Ee=ie.AddressInfo.RelatedURL;Ee=Ee.replace(/.*?:\/\//g,""),Ee.length>40&&(Ee=Ee.substr(0,40)+".."),he+=" "+this.formatSystemWebLink(ie.AddressInfo.RelatedURL,""+Ee+"")}he+="

";const ee=this.formatTextField(ie.GeneralComments,null,!1,!0)+this.formatTextField(ie.AddressInfo.AccessComments,"Access",!0,!0,"details.accessComments");let ae="";null!=ie.NumberOfPoints&&(ae+=this.formatTextField(ie.NumberOfPoints,"Bays",!1,!0,"details.numberOfPoints")),null!=ie.UsageType&&(ae+=this.formatTextField(ie.UsageType.Title,"Usage",!1,!0,"details.usageType")),null!=ie.UsageCost&&(ae+=this.formatTextField(ie.UsageCost,"Usage Cost",!1,!0,"details.usageCost")),null!=ie.OperatorInfo&&1!=ie.OperatorInfo.ID&&(ae+=this.formatTextField(ie.OperatorInfo.Title,"Operator",!1,!0,"details.operatorTitle"),null!=ie.OperatorInfo.WebsiteURL&&(ae+=this.formatTextField(this.formatURL(ie.OperatorInfo.WebsiteURL),"Operator Website",!0,!0,"details.operatorWebsite")));let oe="";if(null!=ie.StatusType&&(oe+=this.formatTextField(ie.StatusType.Title,"Status",!1,!0,"details.operationalStatus"),null!=ie.DateLastStatusUpdate&&(oe+=this.formatTextField(Math.round((Ne-this.fixJSONDate(ie.DateLastStatusUpdate))/864e5)+" days ago","Last Updated",!1,!0,"details.lastUpdated"))),null!=ie.Connections&&ie.Connections.length>0){oe+="",oe+="";for(let Ee=0;Ee"}oe+="
ConnectionPower LevelStatus
"+(null!=Ue.ConnectionType?Ue.ConnectionType.Title:"")+""+(null!=Ue.Level?""+Ue.Level.Title+"
":"")+(null!=Ue.Amps?this.formatString(Ue.Amps)+"A/ ":"")+(null!=Ue.Voltage?this.formatString(Ue.Voltage)+"V/ ":"")+(null!=Ue.PowerKW?this.formatString(Ue.PowerKW)+"kW
":"")+(null!=Ue.CurrentType?Ue.CurrentType.Title:"")+"
"+(null!=Ue.Quantity?this.formatString(Ue.Quantity):"1")+" Present
"+(null!=Ue.StatusType?Ue.StatusType.Title:"-")+"
"}let Be="";return Be+=this.formatTextField("OCM-"+ie.ID+"","OpenChargeMap Ref",!1,!0,"details.refNumber"),null!=ie.DataProvider&&(Be+=this.formatTextField(ie.DataProvider.Title,"Data Provider",!1,!0,"details.dataProviderTitle"),null!=ie.DataProvider.WebsiteURL&&(Be+=this.formatTextField(this.formatURL(ie.DataProvider.WebsiteURL),"Website",!1,!0,"details.dataProviderWebsite")),Be+=this.formatTextField(ie.AddressInfo.Latitude,"Latitude",!1,!0,null),Be+=this.formatTextField(ie.AddressInfo.Longitude,"Longitude",!1,!0,null)),{address:me,drivingInfo:_e,contactInfo:he,additionalInfo:ee+ae+oe,advancedInfo:Be}}static debounce(ie,Y,E){let Ne;return function(){let me=this,he=arguments,ee=E&&!Ne;clearTimeout(Ne),Ne=setTimeout(function(){Ne=null,E||ie.apply(me,he)},Y),ee&&ie.apply(me,he)}}static getRandomInt(ie){return Math.floor(Math.random()*Math.floor(ie))}}return(0,x.Z)(s,"formatPOIAddress",function(J,ie=!0){let Y="";return Y=ie?""+this.formatTextField(J.AddressInfo.AddressLine1)+this.formatTextField(J.AddressInfo.AddressLine2)+this.formatTextField(J.AddressInfo.Town)+this.formatTextField(J.AddressInfo.StateOrProvince)+this.formatTextField(J.AddressInfo.Postcode)+(null!=J.AddressInfo.Country?this.formatTextField(J.AddressInfo.Country.Title):""):this.formatStringArray([J.AddressInfo.AddressLine1,J.AddressInfo.AddressLine2,J.AddressInfo.Town,J.AddressInfo.StateOrProvince,J.AddressInfo.Postcode,null!=J.AddressInfo.Country?J.AddressInfo.Country.Title:""]),Y}),(0,x.Z)(s,"formatStringArray",function(J,ie=", "){if(null==J)return"";let Y="";for(let E=0;E{"use strict";k.d(yt,{Qp:()=>s.Qp,wC:()=>ie.wC,jR:()=>ie.jR,fw:()=>s.fw,vw:()=>s.vw,be:()=>E.b,nS:()=>J,Nm:()=>Y.N,aX:()=>h,qO:()=>y,kA:()=>s.kA});var x=k(1180);class h{constructor(me,he){(0,x.Z)(this,"ID",void 0),(0,x.Z)(this,"SubmissionType",void 0),(0,x.Z)(this,"Data",void 0),(0,x.Z)(this,"Attempts",void 0),(0,x.Z)(this,"DateQueued",void 0),(0,x.Z)(this,"IsSubmitted",void 0),(0,x.Z)(this,"IsInProgress",void 0),(0,x.Z)(this,"IsCancelled",void 0),(0,x.Z)(this,"IsFailure",void 0),(0,x.Z)(this,"FailureReason",void 0),this.SubmissionType=me,this.Data=he,this.DateQueued=new Date,this.IsSubmitted=!1,this.IsInProgress=!1,this.IsCancelled=!1,this.IsFailure=!1,this.Attempts=0,this.ID=new Date+"_"+100*Math.random()}}var y=function(Ne){return Ne[Ne.POI=0]="POI",Ne[Ne.Comment=1]="Comment",Ne[Ne.Media=2]="Media",Ne}(y||{}),s=k(7430);class J{constructor(){(0,x.Z)(this,"Location",void 0),(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"Address",void 0),(0,x.Z)(this,"Type",void 0),(0,x.Z)(this,"ReferenceID",void 0),(0,x.Z)(this,"Attribution",void 0),(0,x.Z)(this,"AddressInfo",void 0)}}var ie=k(3052),Y=k(4783),E=k(4677)},3052:(Nn,yt,k)=>{"use strict";k.d(yt,{LL:()=>s,jR:()=>y,wC:()=>h});var x=k(1180);class h{constructor(ie=null,Y=null){(0,x.Z)(this,"altitudeAccuracy",void 0),(0,x.Z)(this,"longitude",void 0),(0,x.Z)(this,"latitude",void 0),(0,x.Z)(this,"speed",void 0),(0,x.Z)(this,"heading",void 0),(0,x.Z)(this,"altitude",void 0),(0,x.Z)(this,"accuracy",void 0),this.latitude=ie,this.longitude=Y}}class y{constructor(ie=null,Y=null){(0,x.Z)(this,"coords",void 0),(0,x.Z)(this,"timestamp",void 0),(0,x.Z)(this,"attribution",void 0),this.coords=new h,this.coords.latitude=ie,this.coords.longitude=Y}static fromPosition(ie){return new y(ie.coords.latitude,ie.coords.longitude)}}class s{constructor(ie,Y){(0,x.Z)(this,"northEast",void 0),(0,x.Z)(this,"southWest",void 0),this.northEast=ie,this.southWest=Y}}},7430:(Nn,yt,k)=>{"use strict";k.d(yt,{Qp:()=>s,fw:()=>Y,JJ:()=>Ne,eN:()=>E,vw:()=>ie,kA:()=>J});var x=k(1180);class h{constructor(he,_e){(0,x.Z)(this,"itemType",void 0),(0,x.Z)(this,"itemId",void 0),(0,x.Z)(this,"version",void 0),(0,x.Z)(this,"schemaVersion",void 0),(0,x.Z)(this,"syncTimeStamp",void 0),this.itemType=he,this.itemId=h.getNewItemId(),this.version=1,this.schemaVersion=_e,this.syncTimeStamp=h.getNewSyncTimeStamp()}static getNewSyncTimeStamp(){return Date.now().toString()}static getNewItemId(){return"_syncitem_"+Date.now().toString()}}class y{constructor(he,_e){(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"Notes",void 0),(0,x.Z)(this,"_sync",void 0),this._sync=new h(he,_e)}}class s extends y{constructor(...he){super(...he),(0,x.Z)(this,"PoiID",void 0),(0,x.Z)(this,"Type",void 0),(0,x.Z)(this,"Poi",void 0),(0,x.Z)(this,"Photos",void 0)}}class J extends y{constructor(){super("waypoint",1),(0,x.Z)(this,"Stage",void 0),(0,x.Z)(this,"Position",void 0),(0,x.Z)(this,"PoiIDs",void 0),(0,x.Z)(this,"PoiList",void 0)}}class ie extends y{constructor(){super("journey_stage",1),(0,x.Z)(this,"WayPoints",void 0),this.WayPoints=[]}}class Y extends y{constructor(){super("journey",1),(0,x.Z)(this,"ID",void 0),(0,x.Z)(this,"Stages",void 0),this.ID=""+Date.now(),this.Stages=[]}}class E{constructor(){(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"DistanceKM",void 0),(0,x.Z)(this,"DurationMinutes",void 0),(0,x.Z)(this,"StartElevation",void 0),(0,x.Z)(this,"EndElevation",void 0),(0,x.Z)(this,"EnergyConsumptionkWh",void 0)}}class Ne{constructor(){(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"JourneyRouteLegs",void 0),(0,x.Z)(this,"TotalDistanceKM",void 0),(0,x.Z)(this,"TotalDurationMinutes",void 0),(0,x.Z)(this,"TotalEnergykWh",void 0)}}},4677:(Nn,yt,k)=>{"use strict";k.d(yt,{b:()=>h});var x=k(1180);class h{constructor(){(0,x.Z)(this,"poiIdList",null),(0,x.Z)(this,"countryCode",null),(0,x.Z)(this,"latitude",null),(0,x.Z)(this,"longitude",null),(0,x.Z)(this,"locationTitle",null),(0,x.Z)(this,"distance",null),(0,x.Z)(this,"distanceUnit",null),(0,x.Z)(this,"connectionTypeIdList",null),(0,x.Z)(this,"operatorIdList",null),(0,x.Z)(this,"levelIdList",null),(0,x.Z)(this,"countryIdList",null),(0,x.Z)(this,"usageTypeIdList",null),(0,x.Z)(this,"statusTypeIdList",null),(0,x.Z)(this,"minPowerKW",null),(0,x.Z)(this,"maxPowerKW",null),(0,x.Z)(this,"submissionStatusTypeIdList",null),(0,x.Z)(this,"maxResults",500),(0,x.Z)(this,"additionalParams",null),(0,x.Z)(this,"includeComments",!1),(0,x.Z)(this,"compact",!0),(0,x.Z)(this,"enableCaching",!0),(0,x.Z)(this,"levelOfDetail",1),(0,x.Z)(this,"polyline",null),(0,x.Z)(this,"boundingbox",null)}}},4783:(Nn,yt,k)=>{"use strict";k.d(yt,{N:()=>y,U:()=>h});var x=k(1180);const h=1e3;class y{constructor(){(0,x.Z)(this,"OperatorList",void 0),(0,x.Z)(this,"ConnectionTypeList",void 0),(0,x.Z)(this,"CountryList",void 0),(0,x.Z)(this,"UsageTypeList",void 0),(0,x.Z)(this,"StatusTypeList",void 0),(0,x.Z)(this,"MinPowerKW",void 0),(0,x.Z)(this,"MaxPowerKW",void 0),(0,x.Z)(this,"UseDistanceInKM",void 0),(0,x.Z)(this,"HasActiveFilters",void 0),(0,x.Z)(this,"LastSearchPosition",void 0),(0,x.Z)(this,"StartSearchPosition",void 0),(0,x.Z)(this,"StartViewPoiId",void 0),(0,x.Z)(this,"Language",void 0),(0,x.Z)(this,"FilterOptionsByCountryId",void 0),(0,x.Z)(this,"MapType",void 0),(0,x.Z)(this,"EnableAdvancedEditorFeatures",void 0),(0,x.Z)(this,"EnablePOIPendingApproval",void 0),(0,x.Z)(this,"MaxResults",void 0),this.OperatorList=[],this.ConnectionTypeList=[],this.CountryList=[],this.UsageTypeList=[],this.StatusTypeList=[],this.MaxPowerKW=null,this.MinPowerKW=null,this.HasActiveFilters=!1,this.FilterOptionsByCountryId=null,this.UseDistanceInKM=!0,this.MapType="ROADMAP",this.EnableAdvancedEditorFeatures=!1,this.EnablePOIPendingApproval=!1,this.MaxResults=500}LoadSettings(){}SaveSettings(){}ClearActiveFilters(){this.OperatorList=[],this.ConnectionTypeList=[],this.CountryList=[],this.UsageTypeList=[],this.StatusTypeList=[],this.MinPowerKW=null,this.MaxPowerKW=null}CheckForActiveFilters(){return this.HasActiveFilters=this.OperatorList.length>0||this.ConnectionTypeList.length>0||this.CountryList.length>0||this.UsageTypeList.length>0||this.StatusTypeList.length>0||this.MinPowerKW>0||this.MaxPowerKW>0||null!=this.MaxPowerKW&&this.MaxPowerKW{"use strict";k.r(yt),k.d(yt,{AboutPageModule:()=>he});var x=k(1180),h=k(6814),y=k(6223),s=k(9843),J=k(6800),ie=k(9236),Y=k(2029);const E=[{path:"",component:ie.t}];let Ne=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[J.Bz.forChild(E),J.Bz]})),ee})();var me=k(3999);let he=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[h.ez,y.u5,s.Pc,me.aw,Ne]})),ee})()},9236:(Nn,yt,k)=>{"use strict";k.d(yt,{t:()=>ie});var x=k(1180),h=k(553),y=k(2029),s=k(9843),J=k(3999);let ie=(()=>{var Y;class E{constructor(me){(0,x.Z)(this,"modalController",void 0),this.modalController=me}get appVersion(){return h.N.version}get apiUrl(){return h.N.apiBase}ngOnInit(){}close(){this.modalController.dismiss()}}return Y=E,(0,x.Z)(E,"\u0275fac",function(me){return new(me||Y)(y.Y36(s.IN))}),(0,x.Z)(E,"\u0275cmp",y.Xpm({type:Y,selectors:[["app-about"]],decls:46,vars:5,consts:[[1,"ion-padding"],["size","2"],["src","assets/images/icons/branding/AppIcon_128x128.png"],["href","https://openchargemap.org","target","_blank"],["href","https://community.openchargemap.org","target","_blank"],["href","https://webprofusion.com","target","_blank"],["href","https://openchargemap.org/site/about/datasharing","target","_blank"],["slot","end"],[3,"click"],["name","close","slot","start"]],template:function(me,he){1&me&&(y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),y._uU(3),y.ALo(4,"translate"),y.qZA()()(),y.TgZ(5,"ion-content",0)(6,"ion-grid")(7,"ion-row")(8,"ion-col",1),y._UZ(9,"img",2),y.qZA(),y.TgZ(10,"ion-col")(11,"h1"),y._uU(12,"Open Charge Map"),y.qZA()()()(),y.TgZ(13,"p")(14,"strong"),y._uU(15,"Open Charge Map is the worlds largest Open Data registry of electric vehicle charging locations."),y.qZA(),y._uU(16," By adding and editing the information within Open Charge Map you are improving the data for an unlimited amount of other apps and services which can use the data for free. "),y.qZA(),y.TgZ(17,"p")(18,"a",3),y._uU(19,"openchargemap.org"),y.qZA()(),y.TgZ(20,"p"),y._uU(21,"Join our community discussions: "),y.TgZ(22,"a",4),y._uU(23,"community.openchargemap.org"),y.qZA()(),y.TgZ(24,"p"),y._uU(25,"Software development and service hosting by "),y.TgZ(26,"a",5),y._uU(27,"webprofusion.com"),y.qZA()(),y.TgZ(28,"p"),y._uU(29,"Our service is run by volunteers, our data is largely crowdsourced by you. Some data is imported from public Open Data sources."),y.qZA(),y.TgZ(30,"p"),y._uU(31,"Network operators can "),y.TgZ(32,"a",6),y._uU(33,"provide us with an OCPI data feed"),y.qZA(),y._uU(34," to freely promote their network and ensure information accuracy. "),y.qZA(),y.TgZ(35,"ion-note")(36,"p"),y._uU(37),y.qZA(),y.TgZ(38,"p"),y._uU(39),y.qZA()()(),y.TgZ(40,"ion-footer")(41,"ion-toolbar")(42,"ion-buttons",7)(43,"ion-button",8),y.NdJ("click",function(){return he.close()}),y._UZ(44,"ion-icon",9),y._uU(45," Close "),y.qZA()()()()),2&me&&(y.xp6(3),y.hij("",y.lcZ(4,3,"ocm.general.about")," Open Charge Map"),y.xp6(34),y.hij("App Version: ",he.appVersion,""),y.xp6(2),y.hij("API: ",he.apiUrl,""))},dependencies:[s.YG,s.Sm,s.wI,s.W2,s.fr,s.jY,s.Gu,s.gu,s.uN,s.Nd,s.wd,s.sr,J.X$]})),E})()},9192:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{JourneysModule:()=>me});var x=k(1180),h=k(4292),y=k(5086),s=k(3999),J=k(6814),ie=k(6223),Y=k(9843),E=k(6800),Ne=k(2029);let me=(()=>{var he;class _e{}return he=_e,(0,x.Z)(_e,"\u0275fac",function(ae){return new(ae||he)}),(0,x.Z)(_e,"\u0275mod",Ne.oAB({type:he})),(0,x.Z)(_e,"\u0275inj",Ne.cJS({imports:[J.ez,ie.u5,Y.Pc,s.aw,y.e,E.Bz.forChild([{path:"",component:h.g}])]})),_e})()},4292:(Nn,yt,k)=>{"use strict";k.d(yt,{g:()=>le});var x=k(1180),h=k(989),y=k(439),s=k(6470),J=k(7518),ie=k(9723),Y=k(2029),E=k(9843),Ne=k(6814);function me(ue,ct){1&ue&&(Y.TgZ(0,"p"),Y._uU(1," You have no journeys yet. Start by browsing to a charging location, then add it as Favourite to start a new Journey. "),Y.qZA())}function he(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.AddressLine1,"")}}function _e(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.AddressLine2,"")}}function ee(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.Town,"")}}function ae(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.StateOrProvince,"")}}function oe(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.Postcode,"")}}function Be(ue,ct){if(1&ue){const ht=Y.EpF();Y.TgZ(0,"div")(1,"div",18),Y.NdJ("click",function(){Y.CHM(ht);const ye=Y.oxw().$implicit,gt=Y.oxw(4);return Y.KtG(gt.viewPOIDetails(ye.Poi))}),Y.YNc(2,he,2,1,"p",4),Y.YNc(3,_e,2,1,"p",4),Y.YNc(4,ee,2,1,"p",4),Y.YNc(5,ae,2,1,"p",4),Y.YNc(6,oe,2,1,"p",4),Y.qZA(),Y.TgZ(7,"ion-button",19),Y.NdJ("click",function(){Y.CHM(ht);const ye=Y.oxw().$implicit,gt=Y.oxw(4);return Y.KtG(gt.launchNavigation(ye.Poi))}),Y._UZ(8,"ion-icon",20),Y._uU(9," Navigate "),Y.qZA()()}if(2&ue){const ht=Y.oxw().$implicit;Y.xp6(2),Y.Q6J("ngIf",ht.Poi.AddressInfo.AddressLine1),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.AddressLine2),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.Town),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.StateOrProvince),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.Postcode)}}function Ie(ue,ct){if(1&ue&&(Y.TgZ(0,"div",17),Y.YNc(1,Be,10,5,"div",4),Y.qZA()),2&ue){const ht=ct.$implicit;Y.xp6(1),Y.Q6J("ngIf",ht.Poi)}}function Ee(ue,ct){if(1&ue&&(Y.TgZ(0,"ion-item")(1,"h2"),Y._uU(2),Y.qZA(),Y.TgZ(3,"ion-thumbnail",0),Y._UZ(4,"ion-icon",15),Y.qZA(),Y.TgZ(5,"p"),Y._uU(6),Y.qZA(),Y.YNc(7,Ie,2,1,"div",16),Y.qZA()),2&ue){const ht=ct.$implicit;Y.xp6(2),Y.Oqu(ht.Title),Y.xp6(4),Y.Oqu(ht.Notes),Y.xp6(1),Y.Q6J("ngForOf",ht.PoiList)}}function Ue(ue,ct){if(1&ue&&(Y.TgZ(0,"ion-list")(1,"ion-list-header",11),Y._uU(2),Y._UZ(3,"ion-icon",12),Y._uU(4," -- "),Y._UZ(5,"ion-icon",13),Y._uU(6," -- "),Y._UZ(7,"ion-icon",14),Y._uU(8," -- "),Y.qZA(),Y.YNc(9,Ee,8,3,"ion-item",5),Y.qZA()),2&ue){const ht=ct.$implicit;Y.xp6(2),Y.hij(" ",ht.Title," "),Y.xp6(7),Y.Q6J("ngForOf",ht.WayPoints)}}function et(ue,ct){if(1&ue){const ht=Y.EpF();Y.TgZ(0,"ion-card")(1,"ion-card-content")(2,"ion-toolbar",8)(3,"ion-title"),Y._uU(4),Y.qZA(),Y.TgZ(5,"ion-buttons",9)(6,"ion-button",1),Y.NdJ("click",function(){const gt=Y.CHM(ht).$implicit,Te=Y.oxw();return Y.KtG(Te.deleteJourney(gt.ID))}),Y._UZ(7,"ion-icon",10),Y.qZA()()(),Y.TgZ(8,"p"),Y._uU(9),Y.qZA(),Y.YNc(10,Ue,10,2,"ion-list",5),Y.qZA()()}if(2&ue){const ht=ct.$implicit;Y.xp6(4),Y.hij(" ",ht.Title,""),Y.xp6(5),Y.Oqu(ht.Notes),Y.xp6(1),Y.Q6J("ngForOf",ht.Stages)}}let le=(()=>{var ue;class ct{constructor(Le,ye,gt,Te,Pe){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"api",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"alertController",void 0),this.appManager=Le,this.journeyManager=ye,this.api=gt,this.modalController=Te,this.alertController=Pe}dismiss(){this.modalController.dismiss()}discoverImages(){this.journeyManager.journeys.forEach(Le=>{Le.Stages.forEach(ye=>{ye.WayPoints.forEach(gt=>{null!=gt.PoiList&>.PoiList.forEach(Te=>{Te.Poi&&this.api.getPanoramioLocationPhotos(new J.wC(Te.Poi.AddressInfo.Latitude,Te.Poi.AddressInfo.Longitude)).then(Pe=>{Te.Photos=Pe})})})})})}getJson(Le){return JSON.stringify(Le,null,4)}viewPOIDetails(Le){this.modalController.create({component:ie.H,componentProps:{item:Le}}).then(ye=>ye.present())}get staticMapSize(){return"60x60"}getStaticMapURL(Le){return"https://maps.googleapis.com/maps/api/staticmap?center="+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude+"&zoom=13&scale=2&size="+this.staticMapSize+"&maptype=roadmap&format=jpg&visual_refresh=true&markers=size:small%7Ccolor:0xff0000%7Clabel:%7C"+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude}deleteJourney(Le){this.alertController.create({header:"Delete this Journey?",message:"Are you sure you want to delete this Journey?",buttons:[{text:"No",handler:()=>{}},{text:"Delete",handler:()=>{this.journeyManager.deleteJourney(Le)}}]}).then(ye=>ye.present())}launchNavigation(Le){let ye="https://maps.google.com/?q="+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude;this.appManager.platform.is("ios")&&(ye="https://maps.apple.com?q="+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude),window.open(ye,"_system")}}return ue=ct,(0,x.Z)(ct,"\u0275fac",function(Le){return new(Le||ue)(Y.Y36(s.c),Y.Y36(h.i),Y.Y36(y.l),Y.Y36(E.IN),Y.Y36(E.Br))}),(0,x.Z)(ct,"\u0275cmp",Y.Xpm({type:ue,selectors:[["ng-component"]],decls:18,vars:2,consts:[["slot","start"],[3,"click"],[1,"journeys-page"],[1,"ion-padding"],[4,"ngIf"],[4,"ngFor","ngForOf"],["slot","end"],["name","close","slot","start"],["primary",""],["slot","primary"],["name","close","slot","icon-only"],[2,"font-size","1.5rem"],["name","car"],["name","time"],["name","flash"],["name","caret-down",2,"font-size","4rem"],["style","text-align:right;width:100%;",4,"ngFor","ngForOf"],[2,"text-align","right","width","100%"],["tappable","",3,"click"],["clear","","item-right","",3,"click"],["name","navigate","slot","start"]],template:function(Le,ye){1&Le&&(Y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-buttons",0)(3,"ion-back-button",1),Y.NdJ("click",function(){return ye.dismiss()}),Y.qZA()(),Y.TgZ(4,"ion-title"),Y._uU(5," Journeys "),Y.qZA()()(),Y.TgZ(6,"ion-content",2)(7,"div",3)(8,"p"),Y._uU(9," You can create and plan journeys to group your favourite charging routes together. "),Y.qZA(),Y.YNc(10,me,2,0,"p",4),Y.qZA(),Y.YNc(11,et,11,3,"ion-card",5),Y.qZA(),Y.TgZ(12,"ion-footer")(13,"ion-toolbar")(14,"ion-buttons",6)(15,"ion-button",1),Y.NdJ("click",function(){return ye.dismiss()}),Y._UZ(16,"ion-icon",7),Y._uU(17," Close "),Y.qZA()()()()),2&Le&&(Y.xp6(10),Y.Q6J("ngIf",null==ye.journeyManager.journeys||0==ye.journeyManager.journeys.length),Y.xp6(1),Y.Q6J("ngForOf",ye.journeyManager.journeys))},dependencies:[Ne.sg,Ne.O5,E.oU,E.YG,E.Sm,E.PM,E.FN,E.W2,E.fr,E.Gu,E.gu,E.Ie,E.q_,E.yh,E.Bs,E.wd,E.sr,E.cs],encapsulation:2})),ct})()},2309:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{LayerEditorPageModule:()=>he});var x=k(1180),h=k(6814),y=k(6223),s=k(9843),J=k(6800),ie=k(8062),Y=k(2029);const E=[{path:"",component:ie.A}];let Ne=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[J.Bz.forChild(E),J.Bz]})),ee})();var me=k(5086);let he=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[h.ez,y.u5,s.Pc,Ne,me.e]})),ee})()},8062:(Nn,yt,k)=>{"use strict";k.d(yt,{A:()=>Ne});var x=k(5861),h=k(1180),y=k(9159),s=k(2029),J=k(9843),ie=k(6814),Y=k(8696);function E(me,he){if(1&me&&(s.TgZ(0,"div"),s._uU(1),s._UZ(2,"app-poi-list",10),s.qZA()),2&me){const _e=s.oxw();s.xp6(1),s.hij(" Items Parsed: ",_e.fileData.length," "),s.xp6(1),s.Q6J("poiList",_e.fileData)}}let Ne=(()=>{var me;class he{constructor(ee,ae){(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"refData",void 0),(0,h.Z)(this,"fileData",void 0),this.modalController=ee,this.refData=ae}ngOnInit(){}previewFile(){var ee=this;return(0,x.Z)(function*(){yield ee.loadFile(!1)})()}cancel(){var ee=this;return(0,x.Z)(function*(){yield ee.modalController.dismiss(ee.fileData)})()}loadFile(ee=!0){var ae=this;return(0,x.Z)(function*(){const oe=new FileReader;oe.onload=()=>{let Ie=JSON.parse(oe.result),Ee=5e6;for(let Ue of Ie)(null==Ue.ID||""==Ue.ID)&&(Ue.ID=Ee.toString()),Ue.ID="imp_"+Ue.ID,Ee++;ae.fileData=ae.refData.hydrateCompactPOIList(Ie),ee&&ae.modalController.dismiss(ae.fileData)},oe.onerror=()=>{},oe.readAsText(document.getElementById("file-upload").files[0])})()}add(){var ee=this;return(0,x.Z)(function*(){ee.modalController.dismiss(ee.fileData)})()}}return me=he,(0,h.Z)(he,"\u0275fac",function(ee){return new(ee||me)(s.Y36(J.IN),s.Y36(y.W))}),(0,h.Z)(he,"\u0275cmp",s.Xpm({type:me,selectors:[["app-layer-editor"]],decls:27,vars:1,consts:[[1,"ion-padding"],[1,"upload"],["name","file","aria-label","file","slot","start"],["type","file","required","","id","file-upload",3,"change"],[4,"ngIf"],["slot","secondary"],[3,"click"],["name","close","slot","start"],["slot","primary"],["name","checkmark-circle-outline","slot","end"],[3,"poiList"]],template:function(ee,ae){1&ee&&(s.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),s._uU(3," Edit Layer "),s.qZA()()(),s.TgZ(4,"ion-content",0)(5,"p"),s._uU(6,"POI layers are used to preview data from other Open Data sources. "),s.qZA(),s.TgZ(7,"p"),s._uU(8,"Select a POI layer JSON file: "),s.qZA(),s.TgZ(9,"div")(10,"label",1)(11,"ion-button"),s._UZ(12,"ion-icon",2),s.TgZ(13,"ion-label"),s._uU(14,"Choose File.."),s.qZA()(),s.TgZ(15,"input",3),s.NdJ("change",function(){return ae.previewFile()}),s.qZA()()(),s.YNc(16,E,3,2,"div",4),s.qZA(),s.TgZ(17,"ion-footer")(18,"ion-toolbar")(19,"ion-buttons",5)(20,"ion-button",6),s.NdJ("click",function(){return ae.cancel()}),s._UZ(21,"ion-icon",7),s._uU(22," Cancel "),s.qZA()(),s.TgZ(23,"ion-buttons",8)(24,"ion-button",6),s.NdJ("click",function(){return ae.add()}),s._uU(25," Add "),s._UZ(26,"ion-icon",9),s.qZA()()()()),2&ee&&(s.xp6(16),s.Q6J("ngIf",ae.fileData&&ae.fileData.length>0))},dependencies:[ie.O5,J.YG,J.Sm,J.W2,J.fr,J.Gu,J.gu,J.Q$,J.wd,J.sr,Y.o],styles:[".upload[_ngcontent-%COMP%] input[type=file][_ngcontent-%COMP%]{position:fixed;top:-1000px}"]})),he})()},9723:(Nn,yt,k)=>{"use strict";k.d(yt,{H:()=>zn});var x=k(1180),h=k(6470),y=k(2029),s=k(9843),J=k(5861),ie=k(989),Y=k(7430),E=k(6814),Ne=k(6223);function me(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",13),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",xe.ID),y.xp6(1),y.Oqu(xe.Title)}}function he(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",16),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",ze.index),y.xp6(1),y.Oqu(xe.Title)}}function _e(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"ion-item")(1,"ion-label",2),y._uU(2,"Journey Stage"),y.qZA(),y.TgZ(3,"ion-select",3),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.selectedStageIndex=Ze)}),y.TgZ(4,"ion-select-option",14),y._uU(5,"Create a Journey Stage"),y.qZA(),y.YNc(6,he,2,2,"ion-select-option",15),y.qZA()()}if(2&pe){const xe=y.oxw();y.xp6(3),y.Q6J("ngModel",xe.selectedStageIndex),y.xp6(3),y.Q6J("ngForOf",xe.journeyManager.getJourneyStages(xe.selectedJourneyID))}}function ee(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"ion-item")(1,"ion-label",2),y._uU(2,"New Journey Name"),y.qZA(),y.TgZ(3,"ion-input",7),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.newJourneyName=Ze)}),y.qZA()()}if(2&pe){const xe=y.oxw();y.xp6(3),y.Q6J("ngModel",xe.newJourneyName)}}let ae=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"selectedJourneyID",void 0),(0,x.Z)(this,"selectedStageIndex",void 0),(0,x.Z)(this,"newJourneyName",void 0),(0,x.Z)(this,"waypoint",void 0),(0,x.Z)(this,"poi",void 0),this.appManager=be,this.navParams=Ze,this.journeyManager=Pt,this.modalController=bn,this.poi=this.navParams.get("poi"),this.waypoint=new Y.kA,this.waypoint.Title=this.poi.AddressInfo.Title,this.waypoint.PoiIDs=[this.poi.ID],this.waypoint.PoiList=[];const Kn=new Y.Qp("charging",1);Kn.Poi=this.poi,Kn.PoiID=this.poi.ID,this.waypoint.PoiList.push(Kn),this.newJourneyName="Trip to "+this.poi.AddressInfo.Title}cancel(){this.modalController.dismiss()}add(){if(null!=this.selectedJourneyID&&""!==this.selectedJourneyID)this.journeyManager.addJourneyWaypoint(this.selectedJourneyID,this.selectedStageIndex,this.waypoint);else{const be=new Y.fw;be.ID=Date.now().toString(),""===this.newJourneyName&&(this.newJourneyName="New Journey"),be.Title=this.newJourneyName,this.journeyManager.addJourney(be,this.waypoint)}this.journeyManager.saveJourneys(),this.modalController.dismiss()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(h.c),y.Y36(s.X1),y.Y36(ie.i),y.Y36(s.IN))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:39,vars:8,consts:[[1,"journeys-page","ion-padding"],[1,"banner"],["position","stacked"],[3,"ngModel","ngModelChange"],["value","","checked",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["type","text",3,"ngModel","ngModelChange"],["slot","secondary"],[3,"click"],["name","close","slot","start"],["slot","primary"],["name","add","slot","end"],[3,"value"],["value",""],["checked","",3,"value",4,"ngFor","ngForOf"],["checked","",3,"value"]],template:function(be,Ze){1&be&&(y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),y._uU(3," Edit Favourite "),y.qZA()()(),y.TgZ(4,"ion-content",0)(5,"div",1)(6,"h1"),y._uU(7),y.qZA(),y.TgZ(8,"p"),y._uU(9),y.qZA()(),y.TgZ(10,"p"),y._uU(11," Add Charging Location as a Journey Waypoint "),y.qZA(),y.TgZ(12,"ion-item")(13,"ion-label",2),y._uU(14,"Add to a Journey"),y.qZA(),y.TgZ(15,"ion-select",3),y.NdJ("ngModelChange",function(bn){return Ze.selectedJourneyID=bn}),y.TgZ(16,"ion-select-option",4),y._uU(17,"Create a New Journey"),y.qZA(),y.YNc(18,me,2,2,"ion-select-option",5),y.qZA()(),y.YNc(19,_e,7,2,"ion-item",6),y.YNc(20,ee,4,1,"ion-item",6),y.TgZ(21,"ion-item")(22,"ion-label",2),y._uU(23,"Name for this step of your journey"),y.qZA(),y.TgZ(24,"ion-input",7),y.NdJ("ngModelChange",function(bn){return Ze.waypoint.Title=bn}),y.qZA()(),y.TgZ(25,"ion-item")(26,"ion-label",2),y._uU(27,"Other Notes"),y.qZA(),y.TgZ(28,"ion-textarea",3),y.NdJ("ngModelChange",function(bn){return Ze.waypoint.Notes=bn}),y.qZA()()(),y.TgZ(29,"ion-footer")(30,"ion-toolbar")(31,"ion-buttons",8)(32,"ion-button",9),y.NdJ("click",function(){return Ze.cancel()}),y._UZ(33,"ion-icon",10),y._uU(34," Cancel "),y.qZA()(),y.TgZ(35,"ion-buttons",11)(36,"ion-button",9),y.NdJ("click",function(){return Ze.add()}),y._uU(37," Add "),y._UZ(38,"ion-icon",12),y.qZA()()()()),2&be&&(y.xp6(7),y.Oqu(Ze.poi.AddressInfo.Title),y.xp6(2),y.Oqu(Ze.poi.AddressInfo.AddressLine1),y.xp6(6),y.Q6J("ngModel",Ze.selectedJourneyID),y.xp6(3),y.Q6J("ngForOf",Ze.journeyManager.journeys),y.xp6(1),y.Q6J("ngIf",Ze.selectedJourneyID),y.xp6(1),y.Q6J("ngIf",!Ze.selectedJourneyID),y.xp6(4),y.Q6J("ngModel",Ze.waypoint.Title),y.xp6(4),y.Q6J("ngModel",Ze.waypoint.Notes))},dependencies:[E.sg,E.O5,Ne.JJ,Ne.On,s.YG,s.Sm,s.W2,s.fr,s.Gu,s.gu,s.pK,s.Ie,s.Q$,s.t9,s.n0,s.g2,s.wd,s.sr,s.QI,s.j9],encapsulation:2})),ze})();var oe=k(9127);function Be(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"ion-card")(1,"ion-toolbar")(2,"ion-title",14),y._uU(3,"Preview"),y.qZA(),y.TgZ(4,"ion-buttons",15)(5,"ion-button",4),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.rotateImage())}),y._UZ(6,"ion-icon",16),y.TgZ(7,"ion-label"),y._uU(8,"Rotate"),y.qZA()()()(),y.TgZ(9,"ion-card-content")(10,"ion-list")(11,"ion-item")(12,"ion-label",17),y._uU(13,"Comment"),y.qZA(),y.TgZ(14,"ion-input",18),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.comment=Ze)}),y.qZA()()(),y._UZ(15,"img",19),y.qZA()()}if(2&pe){const xe=y.oxw();y.xp6(14),y.Q6J("ngModel",xe.comment)}}let Ie=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn){(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"mode",void 0),(0,x.Z)(this,"processingQuality",void 0),(0,x.Z)(this,"imgData",void 0),(0,x.Z)(this,"targetWidth",void 0),(0,x.Z)(this,"targetHeight",void 0),(0,x.Z)(this,"comment",void 0),(0,x.Z)(this,"chargePointId",void 0),(0,x.Z)(this,"poi",void 0),this.navParams=be,this.appManager=Ze,this.nav=Pt,this.modalController=bn,this.logging=Kn,this.processingQuality=.8,this.targetWidth=1024,this.targetHeight=800,this.mode=Ze.platformMode,this.chargePointId=this.navParams.get("id"),this.poi=this.navParams.get("poi"),this.comment=""}processNativeImageSource(be){let Ze=be;const Pt=document.getElementById("img-upload-canvas"),bn=Pt.getContext("2d"),Kn=new Image;Kn.onload=()=>{this.logging.log("img load:"+Kn.width),Pt.width=Kn.width,Pt.height=Kn.height,bn.fillStyle="rgb(0,0,0)",bn.fillRect(0,0,Pt.width,Pt.height),bn.drawImage(Kn,0,0,Pt.width,Pt.height),this.imgData=Pt.toDataURL("image/png"),this.processImage()},Kn.src=Ze}loadCameraOrLibraryImage(be=!1){this.logging.log("PWA mode: fetching image");const Ze=new FileReader;Ze.onload=()=>{this.imgData=Ze.result,this.processImage()},Ze.onerror=()=>{},Ze.readAsDataURL(document.getElementById("img-upload-media").files[0])}isBrowserMode(){return this.appManager.isPlatform("desktop")||this.appManager.isPlatform("hybrid")}processImage(){if(null!=this.imgData){const Ze=document.getElementById("img-upload-canvas"),Pt=Ze.getContext("2d"),bn=new Image;bn.onload=()=>{Ze.width=bn.width,Ze.height=bn.height,Pt.fillStyle="rgb(0,0,0)",Pt.fillRect(0,0,Ze.width,Ze.height),Pt.drawImage(bn,0,0,Ze.width,Ze.height),this.refreshImageFromCanvas()},bn.src=this.imgData}else this.logging.log("processImage: nothing to process.")}refreshImageFromCanvas(){const be=document.getElementById("img-upload-canvas");this.imgData=be.toDataURL("image/jpeg",.8),document.getElementById("preview").src=this.imgData}rotateImage(){const be=document.getElementById("img-upload-canvas");let Ze=new Image;Ze.src=be.toDataURL(),Ze.onload=()=>{let Pt=be.height,bn=be.width;be.width=Pt,be.height=bn,Pt=be.height,bn=be.width;const Kn=be.getContext("2d");Kn.save(),Kn.translate(bn,Pt/bn),Kn.rotate(Math.PI/2),Kn.drawImage(Ze,0,0),Kn.restore(),Ze=null,this.refreshImageFromCanvas()}}performUpload(){var be=this;return(0,J.Z)(function*(){if(!be.imgData)return void(yield be.appManager.showToastNotification("Select an image to upload."));const Ze={chargePointID:be.chargePointId,comment:be.comment,imageDataBase64:be.imgData};yield be.appManager.showLoadingProgress("Uploading photo..");try{yield be.appManager.submitMediaItem(Ze),be.appManager.dismissLoadingProgress().then(()=>{be.appManager.showToastNotification("Upload completed"),be.modalController.dismiss()}),be.appManager.analytics.appEvent("MediaUpload","Completed")}catch{yield be.appManager.dismissLoadingProgress(),yield be.appManager.showToastNotification("Upload failed, please try again."),be.appManager.analytics.appEvent("MediaUpload","Failed")}})()}cancel(){var be=this;return(0,J.Z)(function*(){yield be.modalController.dismiss()})()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(s.X1),y.Y36(h.c),y.Y36(s.SH),y.Y36(s.IN),y.Y36(oe.z))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:32,vars:3,consts:[[1,"media-upload"],[1,"ion-padding"],[1,"banner"],[1,"upload"],[3,"click"],["name","camera","aria-label","camera","slot","start"],["type","file","required","","id","img-upload-media",3,"change"],["inputFile",""],["id","img-upload-canvas",2,"display","none","width","500","height","500","border","1px solid red"],[4,"ngIf"],["slot","secondary"],["name","close","slot","start"],["slot","primary"],["name","send","slot","end"],["slot","start"],["slot","end"],["name","refresh","slot","start"],["position","floating"],["type","text","placeholder","(optional comment)",3,"ngModel","ngModelChange"],["id","preview",2,"max-width","500px"]],template:function(be,Ze){if(1&be){const Pt=y.EpF();y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),y._uU(3," Share Photo "),y.qZA()()(),y.TgZ(4,"ion-content",0)(5,"div",1)(6,"div",2)(7,"h1"),y._uU(8),y.qZA(),y.TgZ(9,"p"),y._uU(10),y.qZA()(),y.TgZ(11,"p"),y._uU(12,"You can upload a photo from your device or take a new photo: "),y.qZA(),y.TgZ(13,"div",3)(14,"ion-button",4),y.NdJ("click",function(){y.CHM(Pt);const Kn=y.MAs(19);return y.KtG(Kn.click())}),y._UZ(15,"ion-icon",5),y.TgZ(16,"ion-label"),y._uU(17,"Choose Photo.."),y.qZA()(),y.TgZ(18,"input",6,7),y.NdJ("change",function(){return Ze.loadCameraOrLibraryImage()}),y.qZA()(),y._UZ(20,"canvas",8),y.YNc(21,Be,16,1,"ion-card",9),y.qZA()(),y.TgZ(22,"ion-footer")(23,"ion-toolbar")(24,"ion-buttons",10)(25,"ion-button",4),y.NdJ("click",function(){return Ze.cancel()}),y._UZ(26,"ion-icon",11),y._uU(27," Cancel "),y.qZA()(),y.TgZ(28,"ion-buttons",12)(29,"ion-button",4),y.NdJ("click",function(){return Ze.performUpload()}),y._uU(30," Upload "),y._UZ(31,"ion-icon",13),y.qZA()()()()}2&be&&(y.xp6(8),y.Oqu(Ze.poi.AddressInfo.Title),y.xp6(2),y.Oqu(Ze.poi.AddressInfo.AddressLine1),y.xp6(11),y.Q6J("ngIf",null!=Ze.imgData))},dependencies:[E.O5,Ne.JJ,Ne.On,s.YG,s.Sm,s.PM,s.FN,s.W2,s.fr,s.Gu,s.gu,s.pK,s.Ie,s.Q$,s.q_,s.wd,s.sr,s.j9],styles:[".upload[_ngcontent-%COMP%] input[type=file][_ngcontent-%COMP%]{position:fixed;top:-1000px}"]})),ze})();var Ee=k(6800);function Ue(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",19),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",xe.ID),y.xp6(1),y.Oqu(xe.Title)}}function et(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",19),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",xe.ID),y.xp6(1),y.Oqu(xe.Title)}}let le=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn,Ci,wi,cr){(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"zone",void 0),(0,x.Z)(this,"loadingController",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"router",void 0),(0,x.Z)(this,"commentModel",void 0),(0,x.Z)(this,"poi",void 0),(0,x.Z)(this,"commentTypes",void 0),(0,x.Z)(this,"checkinTypes",void 0),this.navParams=be,this.appManager=Ze,this.nav=Pt,this.zone=bn,this.loadingController=Kn,this.modalController=Ci,this.logging=wi,this.router=cr,this.commentModel={ChargePointID:this.navParams.get("id"),Comment:"",CheckinStatusTypeID:10,CommentTypeID:10,Rating:null},this.poi=this.navParams.get("poi"),this.commentTypes=Ze.referenceDataManager.getCommentTypes(!0,!0),this.checkinTypes=Ze.referenceDataManager.getCheckinStatusTypes(!0,!0)}onPageWillEnter(){}cancel(){this.modalController.dismiss()}add(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.loadingController.create({message:"Sending .."});yield Ze.present(),(yield be.appManager.submitComment(be.commentModel).catch(bn=>{be.appManager.showToastNotification("There was a problem submitting your comment."),be.loadingController.dismiss(),be.appManager.analytics.appEvent("Comment","Failed")}))&&(be.logging.log("Comment submitted"),yield Ze.dismiss(),yield be.modalController.dismiss(),be.appManager.analytics.appEvent("Comment","Submitted"))})()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(s.X1),y.Y36(h.c),y.Y36(s.SH),y.Y36(y.R0b),y.Y36(s.HT),y.Y36(s.IN),y.Y36(oe.z),y.Y36(Ee.F0))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:53,vars:8,consts:[["color","primary"],[1,"comment-page","ion-padding"],[1,"banner"],[1,"ion-padding"],["position","stacked"],[3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["type","text","placeholder","(optional comment)",3,"ngModel","ngModelChange"],["value","5"],["value","4"],["value","3"],["value","2"],["value","1"],["value",""],["slot","secondary"],[3,"click"],["name","close","slot","start"],["slot","primary"],["name","send","slot","end"],[3,"value"]],template:function(be,Ze){1&be&&(y.TgZ(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-title"),y._uU(3," Add Comment "),y.qZA()()(),y.TgZ(4,"ion-content",1)(5,"div",2)(6,"h1"),y._uU(7),y.qZA(),y.TgZ(8,"p"),y._uU(9),y.qZA()(),y.TgZ(10,"p",3),y._uU(11,"Recent Check-ins are a big help to other drivers when planning their journey. Tell everyone what you thought about this charging location. "),y.qZA(),y.TgZ(12,"ion-list")(13,"ion-item")(14,"ion-label",4),y._uU(15,"Comment Type"),y.qZA(),y.TgZ(16,"ion-select",5),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.CommentTypeID=bn}),y.YNc(17,Ue,2,2,"ion-select-option",6),y.qZA()(),y.TgZ(18,"ion-item")(19,"ion-label",4),y._uU(20,"What Did You Think?"),y.qZA(),y.TgZ(21,"ion-input",7),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.Comment=bn}),y.qZA()(),y.TgZ(22,"ion-item")(23,"ion-label",4),y._uU(24,"Did You Successfully Charge?"),y.qZA(),y.TgZ(25,"ion-select",5),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.CheckinStatusTypeID=bn}),y.YNc(26,et,2,2,"ion-select-option",6),y.qZA()(),y.TgZ(27,"ion-item")(28,"ion-label",4),y._uU(29,"Your Rating"),y.qZA(),y.TgZ(30,"ion-select",5),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.Rating=bn}),y.TgZ(31,"ion-select-option",8),y._uU(32,"5 - Excellent"),y.qZA(),y.TgZ(33,"ion-select-option",9),y._uU(34,"4 - Good"),y.qZA(),y.TgZ(35,"ion-select-option",10),y._uU(36,"3 - Average"),y.qZA(),y.TgZ(37,"ion-select-option",11),y._uU(38,"2 - Not Good"),y.qZA(),y.TgZ(39,"ion-select-option",12),y._uU(40,"1 - Bad"),y.qZA(),y.TgZ(41,"ion-select-option",13),y._uU(42,"Not Rated"),y.qZA()()()()(),y.TgZ(43,"ion-footer")(44,"ion-toolbar")(45,"ion-buttons",14)(46,"ion-button",15),y.NdJ("click",function(){return Ze.cancel()}),y._UZ(47,"ion-icon",16),y._uU(48," Cancel "),y.qZA()(),y.TgZ(49,"ion-buttons",17)(50,"ion-button",15),y.NdJ("click",function(){return Ze.add()}),y._uU(51," Submit "),y._UZ(52,"ion-icon",18),y.qZA()()()()),2&be&&(y.xp6(7),y.Oqu(Ze.poi.AddressInfo.Title),y.xp6(2),y.Oqu(Ze.poi.AddressInfo.AddressLine1),y.xp6(7),y.Q6J("ngModel",Ze.commentModel.CommentTypeID),y.xp6(1),y.Q6J("ngForOf",Ze.commentTypes),y.xp6(4),y.Q6J("ngModel",Ze.commentModel.Comment),y.xp6(4),y.Q6J("ngModel",Ze.commentModel.CheckinStatusTypeID),y.xp6(1),y.Q6J("ngForOf",Ze.checkinTypes),y.xp6(4),y.Q6J("ngModel",Ze.commentModel.Rating))},dependencies:[E.sg,Ne.JJ,Ne.On,s.YG,s.Sm,s.W2,s.fr,s.Gu,s.gu,s.pK,s.Ie,s.Q$,s.q_,s.t9,s.n0,s.wd,s.sr,s.QI,s.j9],encapsulation:2})),ze})();var ue=k(7777),ct=k(4669),ht=k(8767),Le=k(6662),ye=k(866),gt=k(3999),Te=k(1163);function Pe(pe,ze){if(1&pe&&(y.TgZ(0,"div")(1,"small"),y._uU(2),y.qZA()()),2&pe){const xe=y.oxw(2);y.xp6(2),y.Oqu(xe.connectionSummary)}}function Ae(pe,ze){if(1&pe&&(y.TgZ(0,"div")(1,"small"),y._uU(2),y.qZA()()),2&pe){const xe=y.oxw(2);y.xp6(2),y.Oqu(xe.poi.OperatorInfo.Title)}}function Ye(pe,ze){1&pe&&(y.TgZ(0,"div")(1,"small"),y._uU(2,"[Submission Awaiting Review]"),y.qZA()())}function _t(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",26),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.addFavourite())}),y._UZ(2,"ion-icon",27),y.TgZ(3,"ion-label"),y._uU(4,"Favourite"),y.qZA()(),y.TgZ(5,"ion-button",28),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.edit())}),y._UZ(6,"ion-icon",29),y.TgZ(7,"ion-label"),y._uU(8,"Edit"),y.qZA()(),y.BQk()}}function hn(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",30),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.launchNavigation())}),y._UZ(2,"ion-icon",31),y.TgZ(3,"ion-label"),y._uU(4,"Navigate"),y.qZA()(),y.BQk()}}function qt(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",32),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.addComment())}),y._UZ(2,"ion-icon",33),y.TgZ(3,"ion-label"),y._uU(4,"Add Comment"),y.qZA()(),y.BQk()}}function Ht(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",34),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.addMedia())}),y._UZ(2,"ion-icon",35),y.TgZ(3,"ion-label"),y._uU(4," Add Photo"),y.qZA()(),y.BQk()}}function De(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.AddressLine1,"")}}function Je(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.AddressLine2,"")}}function Re(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.Town,"")}}function Fe(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.StateOrProvince,"")}}function St(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.Postcode,"")}}function Ce(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.Country.Title,"")}}function Rt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.AccessComments," ")}}function Qt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",40),y.TgZ(2,"span",38),y._uU(3),y.qZA()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.Oqu(xe.poi.AddressInfo.ContactTelephone1)}}function Gt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",40),y.TgZ(2,"span",38),y._uU(3),y.qZA()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.Oqu(xe.poi.AddressInfo.ContactTelephone2)}}function Zt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",41),y.TgZ(2,"span",38),y._uU(3),y.qZA()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.Oqu(xe.poi.AddressInfo.ContactEmail)}}function Jt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",42),y.TgZ(2,"span",38)(3,"a",43),y._uU(4),y.qZA()()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.s9C("href",xe.poi.AddressInfo.RelatedURL,y.LSH),y.xp6(1),y.Oqu(xe.poi.AddressInfo.RelatedURL)}}function kt(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card")(1,"ion-card-header")(2,"ion-card-subtitle"),y._uU(3),y.ALo(4,"translate"),y.qZA()(),y.TgZ(5,"ion-card-content")(6,"ion-grid")(7,"ion-row")(8,"ion-col")(9,"ion-label"),y._uU(10),y.ALo(11,"translate"),y.qZA(),y.TgZ(12,"div",38),y.YNc(13,De,2,1,"div",0),y.YNc(14,Je,2,1,"div",0),y.YNc(15,Re,2,1,"div",0),y.YNc(16,Fe,2,1,"div",0),y.YNc(17,St,2,1,"div",0),y.YNc(18,Ce,2,1,"div",0),y.qZA()(),y.TgZ(19,"ion-col"),y.YNc(20,Rt,2,1,"p",0),y.YNc(21,Qt,4,1,"p",0),y.YNc(22,Gt,4,1,"p",0),y.YNc(23,Zt,4,1,"p",0),y.YNc(24,Jt,5,2,"p",0),y.qZA()(),y.TgZ(25,"ion-row")(26,"ion-col")(27,"ion-label",39),y._uU(28),y.ALo(29,"number"),y.ALo(30,"number"),y.qZA()()()()()()),2&pe){const xe=y.oxw(3);y.xp6(3),y.hij(" ",y.lcZ(4,15,"ocm.details.location.sectionTitle")," "),y.xp6(7),y.hij(" ",y.lcZ(11,17,"ocm.details.location.address"),""),y.xp6(3),y.Q6J("ngIf",xe.poi.AddressInfo.AddressLine1),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.AddressLine2),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.Town),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.StateOrProvince),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.Postcode),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.Country),y.xp6(2),y.Q6J("ngIf",xe.poi.AddressInfo.AccessComments),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.ContactTelephone1),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.ContactTelephone2),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.ContactEmail),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.RelatedURL),y.xp6(4),y.AsE(" Lat/Long: ",y.xi3(29,19,xe.poi.AddressInfo.Latitude,"1.1-6")," , ",y.xi3(30,22,xe.poi.AddressInfo.Longitude,"1.1-6")," ")}}function dt(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",38),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.numberOfPoints"),":"),y.xp6(3),y.Oqu(xe.poi.NumberOfPoints)}}function Ot(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",38),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.operationalStatus"),":"),y.xp6(3),y.hij(" ",xe.poi.StatusType.Title," ")}}function pt(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",38),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.usageType"),":"),y.xp6(3),y.Oqu(xe.poi.UsageType.Title)}}function Yt(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",38),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.usageCost"),":"),y.xp6(3),y.hij(" ",xe.poi.UsageCost,"")}}function Ut(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"br"),y._uU(2),y.ALo(3,"translate"),y._UZ(4,"br"),y.TgZ(5,"span",38),y._uU(6),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.generalComments"),": "),y.xp6(4),y.Oqu(xe.poi.GeneralComments)}}function ii(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",46),y._uU(2),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(2),y.hij(" ",xe.poi.OperatorInfo.WebsiteURL," ")}}function gn(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",41),y._uU(2),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(2),y.hij(" ",xe.poi.OperatorInfo.ContactEmail," ")}}function Ft(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",41),y._uU(2),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(2),y.hij(" ",xe.poi.OperatorInfo.FaultReportEmail," ")}}function Jn(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card")(1,"ion-card-header")(2,"ion-card-subtitle"),y._uU(3),y.ALo(4,"translate"),y.qZA()(),y.TgZ(5,"ion-card-content")(6,"div",38)(7,"p",45),y._uU(8),y.qZA(),y.YNc(9,ii,3,1,"p",0),y.YNc(10,gn,3,1,"p",0),y.YNc(11,Ft,3,1,"p",0),y.qZA()()()),2&pe){const xe=y.oxw(3);y.xp6(3),y.hij(" ",y.lcZ(4,5,"ocm.details.operator.sectionTitle")," "),y.xp6(5),y.hij(" ",xe.poi.OperatorInfo.Title," "),y.xp6(1),y.Q6J("ngIf",xe.poi.OperatorInfo.WebsiteURL),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.OperatorInfo.ContactEmail),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.OperatorInfo.FaultReportEmail&&xe.poi.OperatorInfo.FaultReportEmail!=xe.poi.OperatorInfo.ContactEmail)}}function Wt(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"a",48),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(4);return y.KtG(Ze.launchURL(Ze.poi.DataProvider.WebsiteURL))}),y._uU(1),y.qZA()}if(2&pe){const xe=y.oxw(4);y.xp6(1),y.Oqu(xe.poi.DataProvider.WebsiteURL)}}function wt(pe,ze){if(1&pe&&(y.TgZ(0,"div",38)(1,"h3"),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"p"),y._uU(5),y.qZA(),y.YNc(6,Wt,2,1,"a",47),y.TgZ(7,"p"),y._uU(8),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij(" ",y.lcZ(3,4,"ocm.details.dataProvider.sectionTitle")," "),y.xp6(3),y.Oqu(null==xe.poi.DataProvider?null:xe.poi.DataProvider.Title),y.xp6(1),y.Q6J("ngIf",xe.poi.DataProvider.WebsiteURL),y.xp6(2),y.Oqu(null==xe.poi.DataProvider?null:xe.poi.DataProvider.License)}}function vt(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y.YNc(1,kt,31,25,"ion-card",0),y.TgZ(2,"ion-card")(3,"ion-card-header")(4,"ion-card-subtitle"),y._uU(5),y.ALo(6,"translate"),y.qZA()(),y.TgZ(7,"ion-card-content"),y.YNc(8,dt,6,4,"p",0),y._UZ(9,"app-equipment-details",36),y.qZA()(),y.TgZ(10,"ion-card")(11,"ion-card-header")(12,"ion-card-subtitle"),y._uU(13,"Usage Restrictions"),y.qZA()(),y.TgZ(14,"ion-card-content"),y.YNc(15,Ot,6,4,"p",0),y.YNc(16,pt,6,4,"p",0),y.YNc(17,Yt,6,4,"p",0),y.YNc(18,Ut,7,4,"p",0),y.qZA()(),y.YNc(19,Jn,12,7,"ion-card",0),y.TgZ(20,"ion-card")(21,"ion-card-header"),y._uU(22),y.ALo(23,"translate"),y.qZA(),y.TgZ(24,"ion-card-content"),y.YNc(25,wt,9,6,"div",37),y.qZA()()()),2&pe){const xe=y.oxw(2);y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo),y.xp6(4),y.hij(" ",y.lcZ(6,11,"ocm.details.equipment.sectionTitle")," "),y.xp6(3),y.Q6J("ngIf",null!=xe.poi.NumberOfPoints),y.xp6(1),y.Q6J("item",xe.poi),y.xp6(6),y.Q6J("ngIf",null!=xe.poi.StatusType),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.UsageType),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.UsageCost),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.GeneralComments),y.xp6(1),y.Q6J("ngIf",xe.poi.OperatorInfo),y.xp6(3),y.hij(" ",y.lcZ(23,13,"ocm.details.advancedDetails")," "),y.xp6(3),y.Q6J("ngIf",xe.poi.DataProvider)}}function ln(pe,ze){if(1&pe&&y._UZ(0,"img",51),2&pe){const xe=y.oxw().$implicit;y.s9C("src",null==xe.User?null:xe.User.ProfileImageURL,y.LSH)}}function ni(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.User.Username)}}function er(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.Username)}}function lr(pe,ze){if(1&pe&&(y.TgZ(0,"p",38),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.hij(" ",null==xe.CommentType?null:xe.CommentType.Title," ")}}function mi(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2,"Rating:"),y.qZA(),y.TgZ(3,"span",38),y._uU(4),y.qZA()()),2&pe){const xe=y.oxw().$implicit;y.xp6(4),y.hij("",xe.Rating," out of 5")}}function Fi(pe,ze){1&pe&&(y.ynx(0),y._UZ(1,"ion-icon",52),y.BQk())}function Cn(pe,ze){1&pe&&(y.ynx(0),y._UZ(1,"ion-icon",53),y.BQk())}function Mn(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y.YNc(1,Fi,2,0,"ng-container",0),y.YNc(2,Cn,2,0,"ng-container",0),y._uU(3),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Q6J("ngIf",!0===xe.CheckinStatusType.IsPositive),y.xp6(1),y.Q6J("ngIf",!1===xe.CheckinStatusType.IsPositive),y.xp6(1),y.hij(" ",xe.CheckinStatusType.Title," ")}}function qn(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card")(1,"ion-item")(2,"ion-avatar",19),y.YNc(3,ln,1,1,"img",50),y.qZA(),y.TgZ(4,"ion-label"),y.YNc(5,ni,2,1,"span",0),y.YNc(6,er,2,1,"span",0),y.qZA(),y.TgZ(7,"ion-label",20),y._uU(8),y.ALo(9,"date"),y.qZA()(),y.TgZ(10,"ion-card-content")(11,"p"),y._uU(12),y.qZA(),y.YNc(13,lr,2,1,"p",37),y.YNc(14,mi,5,1,"p",0),y.YNc(15,Mn,4,3,"p",0),y.qZA()()),2&pe){const xe=ze.$implicit;y.xp6(3),y.Q6J("ngIf",xe.User&&xe.User.ProfileImageURL),y.xp6(2),y.Q6J("ngIf",xe.User),y.xp6(1),y.Q6J("ngIf",!xe.User),y.xp6(2),y.hij(" ",y.lcZ(9,8,xe.DateCreated)," "),y.xp6(4),y.Oqu(xe.Comment),y.xp6(1),y.Q6J("ngIf",10!=xe.CommentTypeID),y.xp6(1),y.Q6J("ngIf",xe.Rating),y.xp6(1),y.Q6J("ngIf",xe.CheckinStatusType)}}function yn(pe,ze){if(1&pe&&(y.ynx(0),y.YNc(1,qn,16,10,"ion-card",49),y.BQk()),2&pe){const xe=y.oxw(3);y.xp6(1),y.Q6J("ngForOf",xe.poi.UserComments)}}function _n(pe,ze){1&pe&&(y.ynx(0),y.TgZ(1,"ion-card")(2,"ion-card-content")(3,"p"),y._uU(4),y.ALo(5,"translate"),y.qZA()()(),y.BQk()),2&pe&&(y.xp6(4),y.hij(" ",y.lcZ(5,1,"ocm.details.commentsAndRatings.addPrompt")," "))}function Hi(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y.YNc(1,yn,2,1,"ng-container",0),y.YNc(2,_n,6,3,"ng-container",0),y.qZA()),2&pe){const xe=y.oxw(2);y.xp6(1),y.Q6J("ngIf",1==xe.poi._hasComments),y.xp6(1),y.Q6J("ngIf",0==xe.poi._hasComments)}}function nt(pe,ze){if(1&pe&&y._UZ(0,"img",51),2&pe){const xe=y.oxw().$implicit;y.s9C("src",null==xe.User?null:xe.User.ProfileImageURL,y.LSH)}}function ge(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.User.Username)}}function ve(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.Username)}}function Xe(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card"),y._UZ(1,"img",51),y.TgZ(2,"ion-item")(3,"ion-avatar",19),y.YNc(4,nt,1,1,"img",50),y.qZA(),y.TgZ(5,"ion-label"),y.YNc(6,ge,2,1,"span",0),y.YNc(7,ve,2,1,"span",0),y.qZA(),y.TgZ(8,"ion-label",20),y._uU(9),y.ALo(10,"date"),y.qZA()(),y.TgZ(11,"ion-card-content")(12,"p"),y._uU(13),y.qZA()()()),2&pe){const xe=ze.$implicit;y.xp6(1),y.s9C("src",xe.ItemMediumURL,y.LSH),y.xp6(3),y.Q6J("ngIf",xe.User&&xe.User.ProfileImageURL),y.xp6(2),y.Q6J("ngIf",xe.User),y.xp6(1),y.Q6J("ngIf",!xe.User),y.xp6(2),y.hij(" ",y.lcZ(10,6,xe.DateCreated)," "),y.xp6(4),y.Oqu(xe.Comment)}}function ft(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y.YNc(1,Xe,14,8,"ion-card",49),y.qZA()),2&pe){const xe=y.oxw(3);y.xp6(1),y.Q6J("ngForOf",xe.poi.MediaItems)}}function Ct(pe,ze){1&pe&&(y.ynx(0),y.TgZ(1,"ion-card")(2,"ion-card-content")(3,"p"),y._uU(4),y.ALo(5,"translate"),y.qZA()()(),y.BQk()),2&pe&&(y.xp6(4),y.hij(" ",y.lcZ(5,1,"ocm.details.mediaItems.addPrompt")," "))}function Bt(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y.YNc(1,ft,2,1,"div",0),y.YNc(2,Ct,6,3,"ng-container",0),y.qZA()),2&pe){const xe=y.oxw(2);y.xp6(1),y.Q6J("ngIf",xe.poi._hasPhotos),y.xp6(1),y.Q6J("ngIf",0==xe.poi._hasPhotos)}}function jt(pe,ze){if(1&pe&&(y.TgZ(0,"p",54),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(2);y.xp6(1),y.hij(" ",xe.json,"")}}function Et(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"div")(1,"div",1)(2,"div",2)(3,"h2"),y._uU(4),y.qZA(),y.TgZ(5,"div")(6,"small"),y._uU(7),y.qZA()(),y.YNc(8,Pe,3,1,"div",0),y.YNc(9,Ae,3,1,"div",0),y.YNc(10,Ye,3,0,"div",0),y.TgZ(11,"ion-badge",3),y._uU(12),y.ALo(13,"number"),y.qZA()(),y.TgZ(14,"ion-fab",4)(15,"ion-fab-button"),y._UZ(16,"ion-icon",5),y.qZA(),y.TgZ(17,"ion-fab-list",6)(18,"ion-fab-button",7),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.addComment())}),y._UZ(19,"ion-icon",8),y.qZA(),y.TgZ(20,"ion-fab-button",9),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.addMedia())}),y._UZ(21,"ion-icon",10),y.qZA(),y.TgZ(22,"ion-fab-button",11),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.addFavourite())}),y._UZ(23,"ion-icon",12),y.qZA(),y.TgZ(24,"ion-fab-button",13),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.edit())}),y._UZ(25,"ion-icon",14),y.qZA(),y.TgZ(26,"ion-fab-button",15),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.refresh())}),y._UZ(27,"ion-icon",16),y.qZA()()()(),y.TgZ(28,"ion-refresher",17),y.NdJ("ionRefresh",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.refresh(Ze))}),y._UZ(29,"ion-refresher-content",18),y.qZA(),y.TgZ(30,"ion-toolbar")(31,"ion-buttons",19),y.YNc(32,_t,9,0,"ng-container",0),y.qZA(),y.TgZ(33,"ion-buttons",20),y.YNc(34,hn,5,0,"ng-container",0),y.YNc(35,qt,5,0,"ng-container",0),y.YNc(36,Ht,5,0,"ng-container",0),y.qZA()(),y.TgZ(37,"ion-segment",21),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.selectedTab=Ze)}),y.TgZ(38,"ion-segment-button",22)(39,"ion-label"),y._uU(40," Details "),y.qZA()(),y.TgZ(41,"ion-segment-button",23)(42,"ion-label"),y._uU(43),y.qZA()(),y.TgZ(44,"ion-segment-button",24)(45,"ion-label"),y._uU(46),y.qZA()()(),y.YNc(47,vt,26,15,"div",0),y.YNc(48,Hi,3,2,"div",0),y.YNc(49,Bt,3,2,"div",0),y.YNc(50,jt,2,1,"p",25),y.qZA()}if(2&pe){const xe=y.oxw();y.xp6(1),y.Udp("background-image",xe.backdropImage?"url("+xe.backdropImage+")":""),y.xp6(3),y.hij(" ",xe.poi.AddressInfo.Title," "),y.xp6(3),y.hij("OCM-",xe.poi.ID,""),y.xp6(1),y.Q6J("ngIf",xe.connectionSummary),y.xp6(1),y.Q6J("ngIf",xe.poi.OperatorInfo),y.xp6(1),y.Q6J("ngIf",1==xe.poi.SubmissionStatusTypeID),y.xp6(2),y.Oqu(y.xi3(13,19,xe.avgRating,"1.1-1")),y.xp6(20),y.Q6J("ngIf","location"==xe.selectedTab),y.xp6(2),y.Q6J("ngIf","location"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","comments"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","media"==xe.selectedTab),y.xp6(1),y.Q6J("ngModel",xe.selectedTab),y.xp6(6),y.hij("Comments (",xe.poi.UserComments?xe.poi.UserComments.length:0,")"),y.xp6(3),y.hij(" Photos (",xe.poi.MediaItems?xe.poi.MediaItems.length:0,")"),y.xp6(1),y.Q6J("ngIf","location"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","comments"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","media"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf",1==xe.appManager.isDebugMode)}}function Xt(pe,ze){1&pe&&(y.TgZ(0,"div")(1,"h2"),y._uU(2,"POI Not Found"),y.qZA(),y.TgZ(3,"p"),y._uU(4,"The POI details could not be loaded."),y.qZA()())}let Sn=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn,Ci,wi,cr){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"translate",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"actionSheetController",void 0),(0,x.Z)(this,"poiManager",void 0),(0,x.Z)(this,"router",void 0),(0,x.Z)(this,"poi",void 0),(0,x.Z)(this,"selectedTab",void 0),(0,x.Z)(this,"json",void 0),(0,x.Z)(this,"hasNavBar",!1),(0,x.Z)(this,"backdropImage",void 0),(0,x.Z)(this,"avgRating",void 0),(0,x.Z)(this,"connectionSummary",void 0),this.appManager=be,this.nav=Ze,this.translate=Pt,this.logging=bn,this.modalController=Kn,this.actionSheetController=Ci,this.poiManager=wi,this.router=cr}ngOnChanges(be){if(this.logging.log("In ngOnChanges of POI Details"),null!=this.poi&&null!=this.poi.AddressInfo){if(this.selectedTab="location",null!=this.poi.MediaItems&&this.poi.MediaItems.length>0){this.poi._hasPhotos=!0;for(let Ze of this.poi.MediaItems)Ze.ItemMediumURL=Ze.ItemThumbnailURL.replace(".thmb.",".medi.");this.backdropImage=this.poi.MediaItems[this.poi.MediaItems.length-1].ItemThumbnailURL.replace(".thmb.",".medi.")}else this.poi._hasPhotos=!1,this.backdropImage=null;if(null!=this.poi.UserComments&&this.poi.UserComments.length>0){this.poi._hasComments=!0;try{let Ze=this.poi.UserComments.filter(Pt=>Pt.Rating>0);if(Ze.length>0){let Pt=0;for(let bn of Ze)Pt+=bn.Rating;this.avgRating=Pt/Ze.length}else this.avgRating=null}catch{}}else this.poi._hasComments=!1;if(this.poi.Connections&&this.poi.Connections.length>0){let Ze="";for(let Pt of this.poi.Connections)-1==Ze.indexOf(Pt.ConnectionType.Title)&&(Ze+=(""!=Ze?", ":"")+Pt.ConnectionType.Title);this.connectionSummary=Ze}}}ngOnInit(){this.logging.log("In ngInit of POI Details")}get staticMapURL(){return"https://maps.googleapis.com/maps/api/staticmap?key="+(new ue.X).googleMapsAPIKey+"¢er="+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude+"&zoom=13&scale=2&size="+this.staticMapSize+"&maptype=roadmap&format=jpg&visual_refresh=true&markers=size:small%7Ccolor:0xff0000%7Clabel:%7C"+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude}get staticMapSize(){return 0===this.appManager.clientWidth?"240x100":this.appManager.clientWidth>=800?"640x100":this.appManager.clientWidth>=400?"400x100":"240x100"}continueAddComment(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.modalController.create({component:le,componentProps:{id:be.poi.ID,poi:be.poi}});setTimeout(()=>{be.refresh()},1e3),yield Ze.present()})()}addComment(){var be=this;return(0,J.Z)(function*(){if(be.appManager.isUserAuthenticated(!0))yield be.continueAddComment();else{const Ze=yield be.modalController.create({component:ht.F});Ze.onDidDismiss().then((0,J.Z)(function*(){be.appManager.isUserAuthenticated(!0)&&(yield be.continueAddComment())})),yield Ze.present()}})()}continueAddMedia(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.modalController.create({component:Ie,componentProps:{id:be.poi.ID,poi:be.poi}});Ze.onDidDismiss().then(()=>{setTimeout(()=>{be.refresh()},1e3)}),yield Ze.present()})()}addMedia(){var be=this;return(0,J.Z)(function*(){if(be.appManager.isUserAuthenticated(!0))yield be.continueAddMedia();else{const Ze=yield be.modalController.create({component:ht.F});Ze.onDidDismiss().then((0,J.Z)(function*(){be.appManager.isUserAuthenticated(!0)&&(yield be.continueAddMedia())})),yield Ze.present()}})()}addFavourite(){var be=this;return(0,J.Z)(function*(){yield(yield be.actionSheetController.create({header:"Add Favourite",buttons:[{text:"Add to Journey",handler:()=>{be.modalController.create({component:ae,componentProps:{poi:be.poi}}).then(Pt=>Pt.present())}},{text:"Cancel",role:"cancel",handler:()=>{}}]})).present()})()}launchNavigation(){this.appManager.isPlatform("ios")?this.appManager.launchWebPage("https://maps.apple.com/?ll="+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude):this.appManager.launchWebPage("https://maps.google.com/?q="+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude)}launchURL(be){this.appManager.launchWebPage(be)}continueEdit(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.modalController.create({component:Le.Y,componentProps:{id:be.poi.ID}});return Ze.onDidDismiss().then(Pt=>{be.refresh()}),yield Ze.present()})()}edit(){var be=this;return(0,J.Z)(function*(){if(ye.c.isFeatureEnabled("EDIT_POI"))if(be.appManager.isUserAuthenticated(!0))yield be.continueEdit();else{const Ze=yield be.modalController.create({component:ht.F});Ze.onDidDismiss().then((0,J.Z)(function*(){be.appManager.isUserAuthenticated(!0)&&(yield be.continueEdit())})),yield Ze.present()}else be.appManager.launchOCMWebPage("/poi/edit/"+be.poi.ID)})()}refresh(be=null){this.poi&&this.poiManager.getPOIById(this.poi.ID,!0,!0).then(Ze=>{Ze&&(this.poi=Ze,this.ngOnChanges(null)),be&&be.target.complete()})}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(h.c),y.Y36(s.SH),y.Y36(gt.sK),y.Y36(oe.z),y.Y36(s.IN),y.Y36(s.BX),y.Y36(ct.R),y.Y36(Ee.F0))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["poi-details"]],inputs:{poi:"poi"},features:[y.TTD],decls:2,vars:2,consts:[[4,"ngIf"],[1,"banner"],[1,"banner-content"],["color","primary","title","Average User Rating"],["vertical","top","horizontal","end","slot","fixed"],["name","add"],["side","bottom"],["title","Add a comment or charging check-in",3,"click"],["name","chatbubbles"],["title","Add a Photo",3,"click"],["name","camera"],["title","Add to Favourites",3,"click"],["name","star"],["title","Submit an Edit",3,"click"],["name","create"],["title","Refresh",3,"click"],["name","refresh"],["slot","fixed",3,"ionRefresh"],["pullingIcon","caret-down","pullingText","Pull to refresh","refreshingSpinner","circles","refreshingText","Refreshing..."],["slot","start"],["slot","end"],[3,"ngModel","ngModelChange"],["value","location","selected",""],["value","comments"],["value","media"],["style","white-space: pre-wrap;",4,"ngIf"],["size","small","title","Add to Favourites",3,"click"],["name","star","slot","start"],["size","small","title","Submit an Edit",3,"click"],["name","create","slot","start"],["size","small","title","Navigate to this location",3,"click"],["name","navigate","slot","start"],["size","small","title","Add a comment or charging check-in",3,"click"],["name","chatbubbles","slot","start"],["size","small","title","Add a Photo",3,"click"],["name","camera","slot","start"],[3,"item"],["class","details",4,"ngIf"],[1,"details"],[1,"details-minor"],["name","call"],["name","mail"],["name","globe"],["target","_system",3,"href"],[1,"label"],[1,"ion-padding-left"],["name","link"],["href","javascript:void(0)",3,"click",4,"ngIf"],["href","javascript:void(0)",3,"click"],[4,"ngFor","ngForOf"],[3,"src",4,"ngIf"],[3,"src"],["name","checkmark-circle","color","success",2,"font-size","2em"],["name","close-circle","color","danger"],[2,"white-space","pre-wrap"]],template:function(be,Ze){1&be&&(y.YNc(0,Et,51,22,"div",0),y.YNc(1,Xt,5,0,"div",0)),2&be&&(y.Q6J("ngIf",null!=Ze.poi&&null!=Ze.poi.AddressInfo),y.xp6(1),y.Q6J("ngIf",null==Ze.poi||null==Ze.poi.AddressInfo))},dependencies:[E.sg,E.O5,s.BJ,s.yp,s.YG,s.Sm,s.PM,s.FN,s.Zi,s.tO,s.wI,s.IJ,s.W4,s.zq,s.jY,s.gu,s.Ie,s.Q$,s.nJ,s.Wo,s.Nd,s.cJ,s.GO,s.sr,s.QI,Ne.JJ,Ne.On,Te.B,E.JJ,E.uU,gt.X$],styles:[".banner[_ngcontent-%COMP%]{background-color:#4f712f;color:#ffffffec;padding:1em;text-shadow:#000 1px 1px 1px;min-height:180px;background-size:cover}.banner[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.banner-content[_ngcontent-%COMP%]{padding-right:48px}h3[_ngcontent-%COMP%]{font-weight:700}.label[_ngcontent-%COMP%]{color:#000;font-weight:700;font-size:12px}.details[_ngcontent-%COMP%]{color:#707d61;margin-left:1em;font-size:12px}.details-minor[_ngcontent-%COMP%]{color:#707d61;font-size:12px}p[_ngcontent-%COMP%]{display:block;padding:4px}"]})),ze})(),zn=(()=>{var pe;class ze{constructor(be,Ze,Pt){(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"poi",void 0),(0,x.Z)(this,"hasNavbar",!1),this.modalController=be,this.navParams=Ze,this.appManager=Pt,this.poi=this.navParams.get("item"),this.appManager.analytics.viewEvent("POIDetails")}close(){this.modalController.dismiss()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(s.IN),y.Y36(s.X1),y.Y36(h.c))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:11,vars:3,consts:[["color","primary"],["slot","start"],[3,"click"],["name","close","slot","icon-only"],[1,"poi-details"],[3,"poi"]],template:function(be,Ze){1&be&&(y.TgZ(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-title"),y._uU(3),y.TgZ(4,"small"),y._uU(5),y.qZA()(),y.TgZ(6,"ion-buttons",1)(7,"ion-button",2),y.NdJ("click",function(){return Ze.close()}),y._UZ(8,"ion-icon",3),y.qZA()()()(),y.TgZ(9,"ion-content",4),y._UZ(10,"poi-details",5),y.qZA()),2&be&&(y.xp6(3),y.hij(" ",Ze.poi.AddressInfo.Title," "),y.xp6(2),y.hij("OCM-",Ze.poi.ID,""),y.xp6(5),y.Q6J("poi",Ze.poi))},dependencies:[s.YG,s.Sm,s.W2,s.Gu,s.gu,s.wd,s.sr,Sn],styles:['.left-col[_ngcontent-%COMP%]{float:left;width:50%;overflow:auto}.right-col[_ngcontent-%COMP%]{float:right;width:50%;overflow:auto}.row[_ngcontent-%COMP%]:after{content:"";display:table;clear:both;overflow:auto}.row[_ngcontent-%COMP%]{margin-bottom:1em}.subtle[_ngcontent-%COMP%]{color:silver}@media screen and (max-width: 768px){.left-col[_ngcontent-%COMP%]{float:none;width:100%}.right-col[_ngcontent-%COMP%]{margin-top:1em;float:none;width:100%}}.address-details[_ngcontent-%COMP%] ion-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:200px;width:auto}ion-label[_ngcontent-%COMP%]{overflow:inherit}ion-title[_ngcontent-%COMP%] > small[_ngcontent-%COMP%]{color:#ffffffbf}']})),ze})()},5722:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{PoiEditorPageModule:()=>he});var x=k(1180),h=k(6814),y=k(6223),s=k(6800),J=k(9843),ie=k(6662),Y=k(3999),E=k(5086),Ne=k(2029);const me=[{path:"",component:ie.Y}];let he=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Ne.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Ne.cJS({imports:[h.ez,y.u5,J.Pc,Y.aw,E.e,s.Bz.forChild(me)]})),ee})()},6662:(Nn,yt,k)=>{"use strict";k.d(yt,{Y:()=>gn});var x=k(5861),h=k(1180),y=k(6470),s=k(7518),J=k(866),ie=k(4669),Y=k(1847),E=k(2029),Ne=k(3955),me=k(9903),he=k(9127),_e=k(5957),ee=k(9862),ae=k(6814),oe=k(9843);function Be(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.TgZ(1,"ion-note")(2,"p"),E._uU(3," The closest address to this position is: "),E.qZA(),E.TgZ(4,"p")(5,"strong"),E._uU(6),E.qZA(),E._UZ(7,"br"),E._uU(8),E._UZ(9,"br"),E.TgZ(10,"ion-button",3),E.NdJ("click",function(){E.CHM(Wt);const vt=E.oxw();return E.KtG(vt.useAddressSelection())}),E._uU(11,"Use this address below "),E._UZ(12,"ion-icon",4),E.qZA()()(),E.BQk()}if(2&Ft){const Wt=E.oxw();E.xp6(6),E.Oqu(Wt.suggestedAddress.AddressLine1),E.xp6(2),E.HOy(" ",Wt.suggestedAddress.AddressLine2," ",Wt.suggestedAddress.Town," ",Wt.suggestedAddress.StateOrProvince," ",Wt.suggestedAddress.Postcode," ")}}let Ie=(()=>{var Ft;class Jn{constructor(wt,vt,ln,ni,er){(0,h.Z)(this,"mapping",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"latitude",void 0),(0,h.Z)(this,"latitudeChange",new E.vpe),(0,h.Z)(this,"longitude",void 0),(0,h.Z)(this,"longitudeChange",new E.vpe),(0,h.Z)(this,"suggestedAddress",null),(0,h.Z)(this,"suggestedAddressChange",new E.vpe),(0,h.Z)(this,"onUseSuggestedAddress",new E.vpe),(0,h.Z)(this,"suggestedAddressAttribution",null),(0,h.Z)(this,"suggestedAddressAttributionChange",new E.vpe),(0,h.Z)(this,"originalMarkerPos",void 0),(0,h.Z)(this,"mapService",void 0),(0,h.Z)(this,"mapOptions",void 0),(0,h.Z)(this,"debouncedGecode",void 0),(0,h.Z)(this,"isMapInitialised",!1),this.mapping=wt,this.events=vt,this.logging=ln,this.http=ni,this.appManager=er}ngOnInit(){this.mapService=new me.k(this.events,this.logging,this.http),this.mapService.initAPI(),this.mapOptions=new Ne._,this.mapOptions.mapType=this.appManager.searchSettings.MapType,this.mapOptions.onMapMoveCompleted=()=>{let wt;wt=this.mapService.getMapCenter(),wt.subscribe(vt=>{vt&&(this.latitude=vt.coords.latitude,this.longitude=vt.coords.longitude,this.latitudeChange.emit(this.latitude),this.longitudeChange.emit(this.longitude),this.getAddressForCurrentLatLng())})}}ngAfterContentInit(){this.focusMap()}ngOnDestroy(){this.mapService.disposeMap()}focusMap(){0==this.isMapInitialised&&this.mapService&&0!=this.latitude&&0!=this.longitude&&(this.isMapInitialised=!0,this.mapService.initMap("editor-map",this.mapOptions,null),this.mapService.setMapCenter(new s.jR(this.latitude,this.longitude)),this.originalMarkerPos=new s.wC(this.latitude,this.longitude))}ngOnChanges(wt){this.focusMap()}getAddressForCurrentLatLng(){var wt=this;return(0,x.Z)(function*(){wt.latitude&&wt.longitude&&wt.appManager.api.fetchReverseGeocodeResult(wt.latitude,wt.longitude).then(vt=>{vt.AddressInfo&&(wt.suggestedAddress=vt.AddressInfo)})})()}useAddressSelection(){this.onUseSuggestedAddress.emit({suggestedAddress:this.suggestedAddress,attribution:this.suggestedAddressAttribution}),this.suggestedAddress=null,this.suggestedAddressAttribution=null}}return Ft=Jn,(0,h.Z)(Jn,"\u0275fac",function(wt){return new(wt||Ft)(E.Y36(Y.v),E.Y36(_e.z),E.Y36(he.z),E.Y36(ee.eN),E.Y36(y.c))}),(0,h.Z)(Jn,"\u0275cmp",E.Xpm({type:Ft,selectors:[["app-poi-location-editor"]],inputs:{latitude:"latitude",longitude:"longitude"},outputs:{latitudeChange:"latitudeChange",longitudeChange:"longitudeChange",suggestedAddressChange:"suggestedAddressChange",onUseSuggestedAddress:"onUseSuggestedAddress",suggestedAddressAttributionChange:"suggestedAddressAttributionChange"},features:[E.TTD],decls:4,vars:1,consts:[[1,"instruction"],["id","editor-map"],[4,"ngIf"],["size","small",3,"click"],["slot","end","name","copy"]],template:function(wt,vt){1&wt&&(E.TgZ(0,"p",0),E._uU(1,"Drag the map to center the marker on the charging location:"),E.qZA(),E._UZ(2,"div",1),E.YNc(3,Be,13,5,"ng-container",2)),2&wt&&(E.xp6(3),E.Q6J("ngIf",vt.suggestedAddress))},dependencies:[ae.O5,oe.YG,oe.gu,oe.uN],styles:["#editor-map[_ngcontent-%COMP%]{border:1px solid gainsboro;background-color:gray;width:100%;height:128px}"]})),Jn})();var Ee=k(9159),Ue=k(6223);function et(Ft,Jn){if(1&Ft&&(E.TgZ(0,"ion-select-option",14),E._uU(1),E.qZA()),2&Ft){const Wt=Jn.$implicit;E.Q6J("value",Wt.ID),E.xp6(1),E.Oqu(Wt.Title)}}function le(Ft,Jn){if(1&Ft&&(E.TgZ(0,"ion-select-option",14),E._uU(1),E.qZA()),2&Ft){const Wt=Jn.$implicit;E.Q6J("value",Wt.ID),E.xp6(1),E.Oqu(Wt.Title)}}function ue(Ft,Jn){if(1&Ft&&(E.TgZ(0,"ion-select-option",14),E._uU(1),E.qZA()),2&Ft){const Wt=Jn.$implicit;E.Q6J("value",Wt.ID),E.xp6(1),E.Oqu(Wt.Title)}}let ct=(()=>{var Ft;class Jn{constructor(wt,vt){(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"referenceDataManager",void 0),(0,h.Z)(this,"conn",void 0),(0,h.Z)(this,"useFilteredConnectionTypes",!0),(0,h.Z)(this,"useFilteredOperators",!0),this.modalController=wt,this.referenceDataManager=vt}get isAddMode(){return!(null!=this.conn&&this.conn.ID>0)}get connectionTypes(){return this.referenceDataManager.getConnectionTypes(this.useFilteredConnectionTypes)}get currentTypes(){return this.referenceDataManager.getOutputCurrentTypes()}get statusTypes(){return this.referenceDataManager.getStatusTypes().filter(wt=>1==wt.IsUserSelectable)}ngOnInit(){}save(){var wt=!0;null!=this.conn.Quantity&&(this.conn.Quantity<0||this.conn.Quantity>100||!Number.isInteger(this.conn.Quantity))&&(alert("Quantity must be a whole number, or leave it blank."),wt=!1),wt&&this.modalController.dismiss({item:this.conn})}cancel(){this.modalController.dismiss()}}return Ft=Jn,(0,h.Z)(Jn,"\u0275fac",function(wt){return new(wt||Ft)(E.Y36(oe.IN),E.Y36(Ee.W))}),(0,h.Z)(Jn,"\u0275cmp",E.Xpm({type:Ft,selectors:[["app-poi-equipment-editor"]],decls:60,vars:13,consts:[[1,"ion-padding"],["position","floating"],[3,"ngModel","ngModelChange"],["value","0"],[3,"value",4,"ngFor","ngForOf"],["type","number",3,"ngModel","ngModelChange"],["type","text","placeholder","(optional) other comments",3,"ngModel","ngModelChange"],["type","text",3,"ngModel","ngModelChange"],["slot","start"],[3,"click"],["name","close","slot","start"],["slot","end"],["color","success",3,"click"],["name","send","slot","end"],[3,"value"]],template:function(wt,vt){1&wt&&(E.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),E._uU(3),E.qZA()()(),E.TgZ(4,"ion-content",0)(5,"p"),E._uU(6,"Please provide as much information as you can about the equipment. If you don't know then leave the field blank. At a minimum you should include the Connection Type and approximate Power kW (max)."),E.qZA(),E.TgZ(7,"ion-item")(8,"ion-label",1),E._uU(9,"Connection Type"),E.qZA(),E.TgZ(10,"ion-select",2),E.NdJ("ngModelChange",function(ni){return vt.conn.ConnectionTypeID=ni}),E.TgZ(11,"ion-select-option",3),E._uU(12,"Unknown"),E.qZA(),E.YNc(13,et,2,2,"ion-select-option",4),E.qZA()(),E.TgZ(14,"ion-item")(15,"ion-label",1),E._uU(16,"Supply Type"),E.qZA(),E.TgZ(17,"ion-select",2),E.NdJ("ngModelChange",function(ni){return vt.conn.CurrentTypeID=ni}),E.TgZ(18,"ion-select-option",3),E._uU(19,"Unknown"),E.qZA(),E.YNc(20,le,2,2,"ion-select-option",4),E.qZA()(),E.TgZ(21,"ion-item")(22,"ion-label",1),E._uU(23,"Power (kW)"),E.qZA(),E.TgZ(24,"ion-input",5),E.NdJ("ngModelChange",function(ni){return vt.conn.PowerKW=ni}),E.qZA()(),E.TgZ(25,"ion-item")(26,"ion-label",1),E._uU(27,"Amps"),E.qZA(),E.TgZ(28,"ion-input",5),E.NdJ("ngModelChange",function(ni){return vt.conn.Amps=ni}),E.qZA()(),E.TgZ(29,"ion-item")(30,"ion-label",1),E._uU(31,"Voltage"),E.qZA(),E.TgZ(32,"ion-input",5),E.NdJ("ngModelChange",function(ni){return vt.conn.Voltage=ni}),E.qZA()(),E.TgZ(33,"ion-item")(34,"ion-label",1),E._uU(35,"Status"),E.qZA(),E.TgZ(36,"ion-select",2),E.NdJ("ngModelChange",function(ni){return vt.conn.StatusTypeID=ni}),E.YNc(37,ue,2,2,"ion-select-option",4),E.qZA()(),E.TgZ(38,"ion-item")(39,"ion-label",1),E._uU(40,"Quantity Available"),E.qZA(),E.TgZ(41,"ion-input",5),E.NdJ("ngModelChange",function(ni){return vt.conn.Quantity=ni}),E.qZA()(),E.TgZ(42,"ion-item")(43,"ion-label",1),E._uU(44,"Comment"),E.qZA(),E.TgZ(45,"ion-input",6),E.NdJ("ngModelChange",function(ni){return vt.conn.Comments=ni}),E.qZA()(),E.TgZ(46,"ion-item")(47,"ion-label",1),E._uU(48,"Operators Reference"),E.qZA(),E.TgZ(49,"ion-input",7),E.NdJ("ngModelChange",function(ni){return vt.conn.Reference=ni}),E.qZA()()(),E.TgZ(50,"ion-footer")(51,"ion-toolbar")(52,"ion-buttons",8)(53,"ion-button",9),E.NdJ("click",function(){return vt.cancel()}),E._UZ(54,"ion-icon",10),E._uU(55," Cancel "),E.qZA()(),E.TgZ(56,"ion-buttons",11)(57,"ion-button",12),E.NdJ("click",function(){return vt.save()}),E._uU(58," OK "),E._UZ(59,"ion-icon",13),E.qZA()()()()),2&wt&&(E.xp6(3),E.Oqu(vt.isAddMode?"Add Equipment":"Edit Equipment"),E.xp6(7),E.Q6J("ngModel",vt.conn.ConnectionTypeID),E.xp6(3),E.Q6J("ngForOf",vt.connectionTypes),E.xp6(4),E.Q6J("ngModel",vt.conn.CurrentTypeID),E.xp6(3),E.Q6J("ngForOf",vt.currentTypes),E.xp6(4),E.Q6J("ngModel",vt.conn.PowerKW),E.xp6(4),E.Q6J("ngModel",vt.conn.Amps),E.xp6(4),E.Q6J("ngModel",vt.conn.Voltage),E.xp6(4),E.Q6J("ngModel",vt.conn.StatusTypeID),E.xp6(1),E.Q6J("ngForOf",vt.statusTypes),E.xp6(4),E.Q6J("ngModel",vt.conn.Quantity),E.xp6(4),E.Q6J("ngModel",vt.conn.Comments),E.xp6(4),E.Q6J("ngModel",vt.conn.Reference))},dependencies:[ae.sg,oe.YG,oe.Sm,oe.W2,oe.fr,oe.Gu,oe.gu,oe.pK,oe.Ie,oe.Q$,oe.t9,oe.n0,oe.wd,oe.sr,oe.as,oe.QI,oe.j9,Ue.JJ,Ue.On]})),Jn})();var ht=function(Ft){return Ft[Ft.Unknown=0]="Unknown",Ft[Ft.CurrentlyAvailable=10]="CurrentlyAvailable",Ft[Ft.CurrentlyInUse=20]="CurrentlyInUse",Ft[Ft.TemporarilyUnavailable=30]="TemporarilyUnavailable",Ft[Ft.Operational=50]="Operational",Ft[Ft.PartlyOperational=75]="PartlyOperational",Ft[Ft.NotOperational=100]="NotOperational",Ft[Ft.PlannedForFutureDate=150]="PlannedForFutureDate",Ft[Ft.RemovedDecomissioned=200]="RemovedDecomissioned",Ft}(ht||{}),Le=function(Ft){return Ft[Ft.UnknownOperator=1]="UnknownOperator",Ft[Ft.SiteOwner=45]="SiteOwner",Ft}(Le||{}),Te=k(8696),Pe=k(1163),Ae=k(6086);function Ye(Ft,Jn){1&Ft&&E._UZ(0,"ion-icon",13)}function _t(Ft,Jn){1&Ft&&E._UZ(0,"ion-icon",13)}function hn(Ft,Jn){1&Ft&&E._UZ(0,"ion-icon",13)}function qt(Ft,Jn){if(1&Ft&&(E.TgZ(0,"ion-select-option",27),E._uU(1),E.qZA()),2&Ft){const Wt=Jn.$implicit;E.Q6J("value",Wt.ID),E.xp6(1),E.Oqu(Wt.Title)}}function Ht(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.TgZ(1,"app-poi-location-editor",14,15),E.NdJ("latitudeChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.Latitude=vt)})("longitudeChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.Longitude=vt)})("onUseSuggestedAddress",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.useSuggestedAddress(vt))}),E.qZA(),E.TgZ(3,"ion-list")(4,"ion-item")(5,"ion-label",16),E._uU(6,"Location Name"),E.qZA(),E.TgZ(7,"ion-input",17),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.Title=vt)}),E.qZA()(),E.TgZ(8,"ion-item")(9,"ion-label",16),E._uU(10,"Address Line 1"),E.qZA(),E.TgZ(11,"ion-input",18),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.AddressLine1=vt)}),E.qZA()(),E.TgZ(12,"ion-item")(13,"ion-label",16),E._uU(14,"Address Line 2"),E.qZA(),E.TgZ(15,"ion-input",19),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.AddressLine2=vt)}),E.qZA()(),E.TgZ(16,"ion-item")(17,"ion-label",16),E._uU(18,"Town"),E.qZA(),E.TgZ(19,"ion-input",20),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.Town=vt)}),E.qZA()(),E.TgZ(20,"ion-item")(21,"ion-label",16),E._uU(22,"State or Province"),E.qZA(),E.TgZ(23,"ion-input",21),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.StateOrProvince=vt)}),E.qZA()(),E.TgZ(24,"ion-item")(25,"ion-label",16),E._uU(26,"Postal Code"),E.qZA(),E.TgZ(27,"ion-input",22),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.Postcode=vt)}),E.qZA()(),E.TgZ(28,"ion-item")(29,"ion-label",16),E._uU(30,"Country"),E.qZA(),E.TgZ(31,"ion-select",23),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.CountryID=vt)})("ionChange",function(){E.CHM(Wt);const vt=E.oxw(2);return E.KtG(vt.onCountryChange())}),E.YNc(32,qt,2,2,"ion-select-option",24),E.qZA()(),E.TgZ(33,"ion-item")(34,"ion-input",25),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.Latitude=vt)}),E.qZA()(),E.TgZ(35,"ion-item")(36,"ion-input",26),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.AddressInfo.Longitude=vt)}),E.qZA()()(),E.BQk()}if(2&Ft){const Wt=E.oxw(2);E.xp6(1),E.Q6J("latitude",Wt.item.AddressInfo.Latitude)("longitude",Wt.item.AddressInfo.Longitude),E.xp6(6),E.Q6J("ngModel",Wt.item.AddressInfo.Title),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.AddressLine1),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.AddressLine2),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.Town),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.StateOrProvince),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.Postcode),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.CountryID),E.xp6(1),E.Q6J("ngForOf",Wt.countries),E.xp6(2),E.Q6J("ngModel",Wt.item.AddressInfo.Latitude),E.xp6(2),E.Q6J("ngModel",Wt.item.AddressInfo.Longitude)}}function De(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.TgZ(1,"h3"),E._uU(2,"Locations Nearby"),E.qZA(),E.TgZ(3,"p")(4,"strong"),E._uU(5,"The following locations already exist nearby."),E.qZA()(),E.TgZ(6,"div",28)(7,"p"),E._uU(8,"Ensure you are not adding a duplicate site unless it is for different equipment from another network operator."),E.qZA(),E.TgZ(9,"p"),E._uU(10,"You can edit any of these listings if required instead:"),E.qZA()(),E.TgZ(11,"app-poi-list",29),E.NdJ("onEdit",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.editPOI(vt))}),E.qZA(),E.BQk()}if(2&Ft){const Wt=E.oxw(2);E.xp6(11),E.Q6J("poiList",Wt.nearbySites)("enableEditOption",!0)}}function Je(Ft,Jn){if(1&Ft&&(E.ynx(0),E.YNc(1,Ht,37,12,"ng-container",9),E.YNc(2,De,12,2,"ng-container",9),E.BQk()),2&Ft){const Wt=E.oxw();E.xp6(1),E.Q6J("ngIf","location"==Wt.step),E.xp6(1),E.Q6J("ngIf","poi-nearby"==Wt.step)}}function Re(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.TgZ(1,"p"),E._uU(2,"Copied the equipment configuration from:"),E.qZA(),E.TgZ(3,"ion-item")(4,"ion-label"),E._uU(5),E._UZ(6,"br"),E._uU(7),E._UZ(8,"br"),E._uU(9),E._UZ(10,"br"),E._uU(11),E._UZ(12,"br"),E._uU(13),E.qZA(),E.TgZ(14,"ion-button",31),E.NdJ("click",function(){E.CHM(Wt);const vt=E.oxw(5);return E.KtG(vt.changeTemplatePOI())}),E._uU(15,"Change.."),E.qZA()(),E.BQk()}if(2&Ft){const Wt=E.oxw(5);E.xp6(5),E.hij(" ",Wt.selectedTemplatePOI.AddressInfo.Title," "),E.xp6(2),E.hij(" ",Wt.selectedTemplatePOI.AddressInfo.AddressLine1," "),E.xp6(2),E.hij(" ",null==Wt.selectedTemplatePOI.Connections[0].ConnectionType?null:Wt.selectedTemplatePOI.Connections[0].ConnectionType.Title," "),E.xp6(2),E.hij(" ",Wt.selectedTemplatePOI.Connections[0].PowerKW," "),E.xp6(2),E.hij(" ",Wt.selectedTemplatePOI.DateCreated," ")}}function Fe(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.TgZ(1,"h4"),E._uU(2,"Similar Sites"),E.qZA(),E.TgZ(3,"app-poi-list",32),E.NdJ("onCopy",function(vt){E.CHM(Wt);const ln=E.oxw(6);return E.KtG(ln.useTemplatePOI(vt))}),E.qZA(),E.BQk()}if(2&Ft){const Wt=E.oxw(6);E.xp6(3),E.Q6J("enableCopyOption",!0)("poiList",Wt.templateSites)}}function St(Ft,Jn){1&Ft&&(E.ynx(0),E.TgZ(1,"p"),E._uU(2," There are no suggested sites to copy for this network operator. "),E.qZA(),E.BQk())}function Ce(Ft,Jn){if(1&Ft&&(E.ynx(0),E.YNc(1,Fe,4,2,"ng-container",9),E.YNc(2,St,3,0,"ng-container",9),E.BQk()),2&Ft){const Wt=E.oxw(5);E.xp6(1),E.Q6J("ngIf",Wt.templateSites.length>0),E.xp6(1),E.Q6J("ngIf",0==Wt.templateSites.length)}}function Rt(Ft,Jn){if(1&Ft&&(E.ynx(0),E.YNc(1,Re,16,5,"ng-container",9),E.YNc(2,Ce,3,2,"ng-container",9),E.BQk()),2&Ft){const Wt=E.oxw(4);E.xp6(1),E.Q6J("ngIf",Wt.selectedTemplatePOI),E.xp6(1),E.Q6J("ngIf",!Wt.selectedTemplatePOI)}}function Qt(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.TgZ(1,"p",28),E._uU(2,"You can copy the equipment settings from other sites operated by the same network operator or choose 'Next' to skip this step: "),E.qZA(),E.TgZ(3,"app-operator-lookup",30),E.NdJ("operatorChanged",function(vt){E.CHM(Wt);const ln=E.oxw(3);return E.KtG(ln.onOperatorChange(vt))}),E.qZA(),E.YNc(4,Rt,3,2,"ng-container",9),E.BQk()}if(2&Ft){const Wt=E.oxw(3);E.xp6(3),E.Q6J("operatorId",Wt.item.OperatorID),E.xp6(1),E.Q6J("ngIf",Wt.item.AddressInfo.CountryID&&Wt.item.OperatorID)}}function Gt(Ft,Jn){if(1&Ft&&(E.ynx(0),E.YNc(1,Qt,5,2,"ng-container",9),E.BQk()),2&Ft){const Wt=E.oxw(2);E.xp6(1),E.Q6J("ngIf",!Wt.skipPOICopy)}}function Zt(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.TgZ(1,"app-operator-lookup",33),E.NdJ("operatorChanged",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.onOperatorChange(vt))}),E.qZA(),E.TgZ(2,"ion-item")(3,"ion-input",34),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.item.NumberOfPoints=vt)}),E.qZA()(),E.TgZ(4,"h4"),E._uU(5,"Equipment"),E.qZA(),E.TgZ(6,"ion-button",35),E.NdJ("click",function(){E.CHM(Wt);const vt=E.oxw(2);return E.KtG(vt.addConnection())}),E._UZ(7,"ion-icon",36),E.qZA(),E.TgZ(8,"app-equipment-details",37),E.NdJ("onEdit",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.editConnection(vt))})("onDelete",function(vt){E.CHM(Wt);const ln=E.oxw(2);return E.KtG(ln.deleteConnection(vt))}),E.qZA(),E.BQk()}if(2&Ft){const Wt=E.oxw(2);E.xp6(1),E.Q6J("operatorId",Wt.item.OperatorID)("useFilteredOperators",!1),E.xp6(2),E.Q6J("ngModel",Wt.item.NumberOfPoints),E.xp6(5),E.Q6J("item",Wt.item)("enableEdit",!0)}}function Jt(Ft,Jn){if(1&Ft&&(E.ynx(0),E.YNc(1,Gt,2,1,"ng-container",9),E.YNc(2,Zt,9,5,"ng-container",9),E.BQk()),2&Ft){const Wt=E.oxw();E.xp6(1),E.Q6J("ngIf","copy-equipment"==Wt.step),E.xp6(1),E.Q6J("ngIf","edit-equipment"==Wt.step)}}function kt(Ft,Jn){if(1&Ft&&(E.TgZ(0,"p",44)(1,"strong"),E._uU(2,"Your changes cannot be saved until the following issues are resolved:"),E.qZA(),E.TgZ(3,"ion-label",45),E._uU(4),E.qZA()()),2&Ft){const Wt=E.oxw(2);E.xp6(4),E.hij(" ",Wt.validationMsg,"")}}function dt(Ft,Jn){if(1&Ft&&(E.TgZ(0,"ion-select-option",27),E._uU(1),E.qZA()),2&Ft){const Wt=Jn.$implicit;E.Q6J("value",Wt.ID),E.xp6(1),E.Oqu(Wt.Title)}}function Ot(Ft,Jn){if(1&Ft&&(E.TgZ(0,"ion-select-option",27),E._uU(1),E.qZA()),2&Ft){const Wt=Jn.$implicit;E.Q6J("value",Wt.ID),E.xp6(1),E.Oqu(Wt.Title)}}function pt(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.ynx(0),E.YNc(1,kt,5,1,"p",38),E.TgZ(2,"p"),E._uU(3,"Please provide any other facts related to this site. Additional comments (your charging experiences etc) can be added as check-in comments once the site is listed."),E.qZA(),E.TgZ(4,"ion-item")(5,"ion-label",16),E._uU(6,"Operational Status (All Equipment))"),E.qZA(),E.TgZ(7,"ion-select",39),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.StatusTypeID=vt)}),E.YNc(8,dt,2,2,"ion-select-option",24),E.qZA()(),E.TgZ(9,"ion-item")(10,"ion-label",16),E._uU(11,"Usage Type"),E.qZA(),E.TgZ(12,"ion-select",39),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.UsageTypeID=vt)}),E.YNc(13,Ot,2,2,"ion-select-option",24),E.qZA()(),E.TgZ(14,"ion-item")(15,"ion-label",16),E._uU(16,"Usage Cost"),E.qZA(),E.TgZ(17,"ion-input",21),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.UsageCost=vt)}),E.qZA()(),E.TgZ(18,"ion-item")(19,"ion-label",16),E._uU(20,"General Comments"),E.qZA(),E.TgZ(21,"ion-input",40),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.GeneralComments=vt)}),E.qZA()(),E.TgZ(22,"ion-item")(23,"ion-label",16),E._uU(24,"Main Telephone Number "),E.qZA(),E.TgZ(25,"ion-input",41),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.AddressInfo.ContactTelephone1=vt)}),E.qZA()(),E.TgZ(26,"ion-item")(27,"ion-label",16),E._uU(28,"Other Telephone Number "),E.qZA(),E.TgZ(29,"ion-input",41),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.AddressInfo.ContactTelephone2=vt)}),E.qZA()(),E.TgZ(30,"ion-item")(31,"ion-label",16),E._uU(32,"Access Comments"),E.qZA(),E.TgZ(33,"ion-input",42),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.AddressInfo.AccessComments=vt)}),E.qZA()(),E.TgZ(34,"ion-item")(35,"ion-label",16),E._uU(36,"Related Website"),E.qZA(),E.TgZ(37,"ion-input",43),E.NdJ("ngModelChange",function(vt){E.CHM(Wt);const ln=E.oxw();return E.KtG(ln.item.AddressInfo.RelatedURL=vt)}),E.qZA()(),E.BQk()}if(2&Ft){const Wt=E.oxw();E.xp6(1),E.Q6J("ngIf",Wt.validationMsg),E.xp6(6),E.Q6J("ngModel",Wt.item.StatusTypeID),E.xp6(1),E.Q6J("ngForOf",Wt.statusTypes),E.xp6(4),E.Q6J("ngModel",Wt.item.UsageTypeID),E.xp6(1),E.Q6J("ngForOf",Wt.usageTypes),E.xp6(4),E.Q6J("ngModel",Wt.item.UsageCost),E.xp6(4),E.Q6J("ngModel",Wt.item.GeneralComments),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.ContactTelephone1),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.ContactTelephone2),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.AccessComments),E.xp6(4),E.Q6J("ngModel",Wt.item.AddressInfo.RelatedURL)}}function Yt(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.TgZ(0,"ion-button",1),E.NdJ("click",function(){E.CHM(Wt);const vt=E.oxw();return E.KtG(vt.previous())}),E._uU(1," Previous "),E._UZ(2,"ion-icon",46),E.qZA()}}function Ut(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.TgZ(0,"ion-button",1),E.NdJ("click",function(){E.CHM(Wt);const vt=E.oxw();return E.KtG(vt.next())}),E._uU(1," Next "),E._UZ(2,"ion-icon",47),E.qZA()}}function ii(Ft,Jn){if(1&Ft){const Wt=E.EpF();E.TgZ(0,"ion-button",48),E.NdJ("click",function(){E.CHM(Wt);const vt=E.oxw();return E.KtG(vt.save())}),E._uU(1," Submit "),E._UZ(2,"ion-icon",49),E.qZA()}}let gn=(()=>{var Ft;class Jn{get countries(){return this.appManager.referenceDataManager.getCountries()}get usageTypes(){return this.appManager.referenceDataManager.getUsageTypes()}get statusTypes(){return this.appManager.referenceDataManager.getStatusTypes().filter(wt=>1==wt.IsUserSelectable)}get isAddMode(){return this.item.ID<=0}constructor(wt,vt,ln,ni,er,lr){(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"poiManager",void 0),(0,h.Z)(this,"mapping",void 0),(0,h.Z)(this,"loadingController",void 0),(0,h.Z)(this,"alertController",void 0),(0,h.Z)(this,"id",void 0),(0,h.Z)(this,"item",void 0),(0,h.Z)(this,"step",void 0),(0,h.Z)(this,"selectedTab",void 0),(0,h.Z)(this,"startPos",void 0),(0,h.Z)(this,"useFilteredConnectionTypes",!0),(0,h.Z)(this,"templateSites",[]),(0,h.Z)(this,"nearbySites",[]),(0,h.Z)(this,"selectedTemplatePOI",null),(0,h.Z)(this,"suggestedAddress",null),(0,h.Z)(this,"suggestedAddressAttribution",null),(0,h.Z)(this,"isNonDuplicateConfirmed",!1),(0,h.Z)(this,"skipPOICopy",!1),(0,h.Z)(this,"validationMsg",null),(0,h.Z)(this,"loading",void 0),(0,h.Z)(this,"editorMap",void 0),this.appManager=wt,this.modalController=vt,this.poiManager=ln,this.mapping=ni,this.loadingController=er,this.alertController=lr,this.initNewItem()}initNewItem(){this.item={ID:-1,DataProviderID:1,DataProvidersReference:null,OperatorsReference:null,OperatorID:1,UsageCost:null,UsageTypeID:4,NumberOfPoints:1,GeneralComments:null,DatePlanned:null,StatusTypeID:50,SubmissionStatusTypeID:null,Connections:[],MetadataValues:[],AddressInfo:{ID:-1,CountryID:18,Title:"",AddressLine1:"",Latitude:0,Longitude:0}},this.step="location",this.selectedTab="location"}get isReadyToSubmit(){return this.validate().isValid&&"info"==this.step}ngOnInit(){}presentLoadingUI(){var wt=this;return(0,x.Z)(function*(){wt.loading=yield wt.loadingController.create({message:"Please Wait.."}),yield wt.loading.present()})()}dismissLoadingUI(){var wt=this;return(0,x.Z)(function*(){wt.loading&&(yield wt.loading.dismiss())})()}ionViewDidEnter(){if(null!=this.id)this.editExistingPOI(this.id);else{let wt=localStorage.getItem("_editor-operatorid");wt&&(this.item.OperatorID=parseInt(wt,10)),this.startPos?(this.item.AddressInfo.Latitude=this.startPos.latitude,this.item.AddressInfo.Longitude=this.startPos.longitude):this.mapping&&this.mapping.getMapCenter().subscribe(vt=>{vt&&(this.item.AddressInfo.Latitude=vt.coords.latitude,this.item.AddressInfo.Longitude=vt.coords.longitude)})}this.refreshFilteredReferenceData()}previous(){var wt=this;return(0,x.Z)(function*(){switch(wt.step){case"info":wt.step="edit-equipment";break;case"edit-equipment":wt.step=wt.isAddMode?"copy-equipment":"location";break;case"copy-equipment":case"poi-nearby":wt.step="location"}yield wt.initCurrentStep(!1)})()}next(){var wt=this;return(0,x.Z)(function*(){if("poi-nearby"==wt.step&&wt.nearbySites.length>0&&!wt.isNonDuplicateConfirmed)return void(yield wt.alertController.create({header:"Confirm",message:"Please confirm you are not adding a duplicate site.",buttons:[{text:"Cancel",role:"cancel",cssClass:"secondary",handler:ni=>{}},{text:"Confirm",handler:()=>{wt.isNonDuplicateConfirmed=!0,wt.next()}}]})).present();const vt=wt.validate(wt.step);if(vt.isValid){switch(wt.step){case"location":wt.step=wt.isAddMode?"poi-nearby":"edit-equipment";break;case"poi-nearby":wt.step=wt.isAddMode?"copy-equipment":"edit-equipment";break;case"copy-equipment":wt.step="edit-equipment";break;case"edit-equipment":wt.step="info"}yield wt.initCurrentStep(!0)}else(yield wt.alertController.create({message:vt.msg})).present()})()}initCurrentStep(wt){var vt=this;return(0,x.Z)(function*(){"poi-nearby"==vt.step?(vt.selectedTab="location",0==(yield vt.refreshNearbySites())&&(wt?yield vt.next():yield vt.previous())):"location"==vt.step?vt.selectedTab="location":"copy-equipment"==vt.step?(vt.selectedTab="equipment",yield vt.refreshTemplateSites()):"edit-equipment"==vt.step?vt.selectedTab="equipment":"info"==vt.step&&(vt.selectedTab="info")})()}onCountryChange(){var wt=this;return(0,x.Z)(function*(){wt.refreshFilteredReferenceData()})()}onOperatorChange(wt=null){var vt=this;return(0,x.Z)(function*(){null!=wt&&vt.item.OperatorID!=wt.ID&&(vt.item.OperatorID=wt.ID,localStorage.setItem("_editor-operatorid",vt.item.OperatorID.toString()),yield vt.refreshTemplateSites())})()}useSuggestedAddress(wt=null){wt&&(this.suggestedAddress=wt.suggestedAddress,this.suggestedAddressAttribution=wt.suggestedAddressAttribution),Object.assign(this.item.AddressInfo,this.suggestedAddress),this.suggestedAddressAttribution&&(this.item.MetadataValues.find(vt=>4==vt.MetadataFieldID)||this.item.MetadataValues.push({ID:-1,MetadataFieldID:4,ItemValue:this.suggestedAddressAttribution,MetadataFieldOptionID:null,MetadataFieldOption:null}))}editConnection(wt){var vt=this;return(0,x.Z)(function*(){const ln=vt.item.Connections.find(lr=>lr.ID==wt.ID),ni=Object.assign({},ln),er=yield vt.modalController.create({component:ct,componentProps:{conn:ni}});return er.onWillDismiss().then(lr=>{lr&&lr.data&&lr.data.item&&vt.updateConnection(lr.data.item)}),yield er.present()})()}deleteConnection(wt){var vt=this;return(0,x.Z)(function*(){const ln=vt.item.Connections.find(er=>er.ID==wt.ID);(yield vt.alertController.create({header:"Confirm Delete",message:"Are you sure you want to delete this connection information?",buttons:[{text:"No",role:"cancel",cssClass:"secondary",handler:()=>{}},{text:"Yes",handler:()=>{vt.item.Connections=vt.item.Connections.filter(er=>er.ID!=ln.ID),vt.appManager.referenceDataManager.hydrateCompactPOI(vt.item,!0)}}]})).present()})()}addConnection(){var wt=this;return(0,x.Z)(function*(){const vt={ID:-J.c.getRandomInt(1e4),ConnectionTypeID:null,StatusTypeID:50,PowerKW:null,Quantity:1},ln=yield wt.modalController.create({component:ct,componentProps:{conn:vt}});return ln.onWillDismiss().then(ni=>{ni&&ni.data&&ni.data.item&&wt.updateConnection(ni.data.item)}),yield ln.present()})()}refreshFilteredReferenceData(){this.appManager.referenceDataManager.refreshFilteredReferenceData(this.appManager.api,{CountryIds:[this.item.AddressInfo.CountryID]})}updateConnection(wt){if(wt){let vt=this.item.Connections.find(ln=>ln.ID==wt.ID);vt?Object.assign(vt,wt):this.item.Connections.push(wt)}this.appManager.referenceDataManager.hydrateCompactPOI(this.item,!0)}validate(wt="all"){let vt=null;return("all"==wt||"location"==wt)&&((!this.item.AddressInfo.Latitude||!this.item.AddressInfo.Longitude)&&(vt="Location is required"),""==this.item.AddressInfo.Title&&(vt="A location title is required"),!this.item.AddressInfo.AddressLine1&&!this.item.AddressInfo.AddressLine2&&(vt="An approximate address is required."),this.item.AddressInfo.CountryID||(vt="A country selection is required"),(!this.item.AddressInfo.Latitude||!this.item.AddressInfo.Longitude)&&(vt="A location latitude and longitude is required")),("all"==wt||"poi-nearby"==wt)&&this.nearbySites.length>0&&!this.isNonDuplicateConfirmed&&(vt="Please confirm that the site is not a duplicate"),("all"==wt||"equipment"==wt)&&(this.item.OperatorID||(vt="Please confirm the charging network or equipment operator."),0==this.item.Connections.length&&(vt="Equipment information is required")),vt?(this.validationMsg=vt,{isValid:!1,msg:vt}):(this.validationMsg=null,{isValid:!0,msg:null})}save(){var wt=this;return(0,x.Z)(function*(){let vt=wt.validate();if(vt.isValid){yield wt.presentLoadingUI();try{yield wt.appManager.submitPOI(wt.item),yield wt.dismissLoadingUI(),wt.appManager.showToastNotification("You submission will be reviewed (if required) and published shortly."),wt.modalController.dismiss()}catch(ln){yield wt.dismissLoadingUI(),ln.error&&alert("Sorry, your submission could not be completed at this time. Please try again later.")}}else alert(vt.msg)})()}cancel(){var wt=this;return(0,x.Z)(function*(){wt.modalController.dismiss()})()}refreshTemplateSites(){var wt=this;return(0,x.Z)(function*(){if(wt.item.AddressInfo.CountryID&&wt.item.OperatorID){yield wt.presentLoadingUI(),wt.templateSites=[];let vt=new s.be;vt.countryIdList=[wt.item.AddressInfo.CountryID],vt.minPowerKW=1,vt.operatorIdList=[wt.item.OperatorID],vt.maxResults=10;let ln=yield wt.poiManager.fetchPOIList(vt);ln.sort((ni,er)=>new Date(ni.DateCreated).getTime()-new Date(er.DateCreated).getTime()),wt.templateSites=ln,wt.dismissLoadingUI()}})()}refreshNearbySites(){var wt=this;return(0,x.Z)(function*(){if(wt.item.AddressInfo.Latitude&&wt.item.AddressInfo.Longitude){yield wt.presentLoadingUI(),wt.nearbySites=[];let vt=new s.be;vt.latitude=wt.item.AddressInfo.Latitude,vt.longitude=wt.item.AddressInfo.Longitude,vt.distance=5,vt.distanceUnit="km",vt.maxResults=10;let ln=yield wt.poiManager.fetchPOIList(vt);return ln.sort((ni,er)=>ni.Distance-er.Distance),wt.nearbySites=ln,wt.dismissLoadingUI(),ln.length}return 0})()}confirmNonDuplicate(){this.isNonDuplicateConfirmed=!0,this.next()}changeTemplatePOI(){this.selectedTemplatePOI=null}editPOI(wt){this.editExistingPOI(wt.ID)}editExistingPOI(wt){var vt=this;return(0,x.Z)(function*(){vt.skipPOICopy=!0,vt.isNonDuplicateConfirmed=!0,yield vt.presentLoadingUI(),vt.poiManager.getPOIById(wt,!0,!0).then(ln=>{vt.item=Object.assign({},ln),null==vt.item.OperatorID&&(vt.item.OperatorID=Le.UnknownOperator),vt.refreshFilteredReferenceData(),vt.dismissLoadingUI()})})()}useTemplatePOI(wt){this.selectedTemplatePOI=wt,Object.assign(this.item.Connections,wt.Connections);for(let vt of this.item.Connections)vt.ID=-J.c.getRandomInt(1e4),vt.Reference=null,vt.Comments=null,vt.StatusTypeID=ht.Operational;this.item.UsageCost=wt.UsageCost,this.item.UsageTypeID=wt.UsageTypeID,this.appManager.referenceDataManager.hydrateCompactPOI(this.item)}skipCopyingPOI(){this.skipPOICopy=!0}}return Ft=Jn,(0,h.Z)(Jn,"\u0275fac",function(wt){return new(wt||Ft)(E.Y36(y.c),E.Y36(oe.IN),E.Y36(ie.R),E.Y36(Y.v),E.Y36(oe.HT),E.Y36(oe.Br))}),(0,h.Z)(Jn,"\u0275cmp",E.Xpm({type:Ft,selectors:[["app-poi-editor"]],viewQuery:function(wt,vt){if(1&wt&&E.Gf(Ie,5),2&wt){let ln;E.iGM(ln=E.CRH())&&(vt.editorMap=ln.first)}},decls:33,vars:14,consts:[["slot","end"],[3,"click"],["name","close","slot","start"],[1,"ion-padding"],[3,"ngModel"],["value","location","layout","icon-start",3,"disabled"],["name","caret-forward",4,"ngIf"],["value","equipment","layout","icon-start",3,"disabled"],["value","info","layout","icon-start",3,"disabled"],[4,"ngIf"],["slot","start"],[3,"click",4,"ngIf"],["color","success",3,"click",4,"ngIf"],["name","caret-forward"],[3,"latitude","longitude","latitudeChange","longitudeChange","onUseSuggestedAddress"],["editorMap",""],["position","floating"],["type","text","autocapitalize","words","placeholder","A title for this location",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","The nearest street address",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","Optional",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","Town or City",3,"ngModel","ngModelChange"],["type","text",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","Optional Postal Code",3,"ngModel","ngModelChange"],[3,"ngModel","ngModelChange","ionChange"],[3,"value",4,"ngFor","ngForOf"],["label","Latitude","labelPlacement","floating","type","number","placeholder","Latitude (if entering manually)",3,"ngModel","ngModelChange"],["label","Longitude","labelPlacement","floating","type","number","placeholder","Longitude (if entering manually)",3,"ngModel","ngModelChange"],[3,"value"],[1,"instruction"],[3,"poiList","enableEditOption","onEdit"],[3,"operatorId","operatorChanged"],["slot","start","size","small",3,"click"],[3,"enableCopyOption","poiList","onCopy"],[3,"operatorId","useFilteredOperators","operatorChanged"],["label","Number of Stations or Parking Bays","labelPlacement","floating","min","1","type","number",3,"ngModel","ngModelChange"],["size","small",3,"click"],["name","add","slot","icon-only"],[3,"item","enableEdit","onEdit","onDelete"],["color","warning",4,"ngIf"],[3,"ngModel","ngModelChange"],["type","text","autocapitalize","sentences",3,"ngModel","ngModelChange"],["type","tel","placeholder","",3,"ngModel","ngModelChange"],["type","text","autocapitalize","sentences","placeholder","Instructions for access or tips for finding charging location",3,"ngModel","ngModelChange"],["type","url","placeholder","Website related to this site",3,"ngModel","ngModelChange"],["color","warning"],["color","danger"],["name","caret-back","slot","start"],["name","caret-forward","slot","end"],["color","success",3,"click"],["name","send","slot","end"]],template:function(wt,vt){1&wt&&(E.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),E._uU(3),E.qZA(),E.TgZ(4,"ion-buttons",0)(5,"ion-button",1),E.NdJ("click",function(){return vt.cancel()}),E._UZ(6,"ion-icon",2),E._uU(7," Cancel "),E.qZA()()()(),E.TgZ(8,"ion-content",3),E.ynx(9),E.TgZ(10,"ion-segment",4)(11,"ion-segment-button",5),E.YNc(12,Ye,1,0,"ion-icon",6),E.TgZ(13,"ion-label"),E._uU(14,"Location"),E.qZA()(),E.TgZ(15,"ion-segment-button",7),E.YNc(16,_t,1,0,"ion-icon",6),E.TgZ(17,"ion-label"),E._uU(18,"Equipment"),E.qZA()(),E.TgZ(19,"ion-segment-button",8),E.YNc(20,hn,1,0,"ion-icon",6),E.TgZ(21,"ion-label"),E._uU(22,"Info"),E.qZA()()(),E.YNc(23,Je,3,2,"ng-container",9),E.YNc(24,Jt,3,2,"ng-container",9),E.YNc(25,pt,38,11,"ng-container",9),E.BQk(),E.qZA(),E.TgZ(26,"ion-footer")(27,"ion-toolbar")(28,"ion-buttons",10),E.YNc(29,Yt,3,0,"ion-button",11),E.qZA(),E.TgZ(30,"ion-buttons",0),E.YNc(31,Ut,3,0,"ion-button",11),E.YNc(32,ii,3,0,"ion-button",12),E.qZA()()()),2&wt&&(E.xp6(3),E.Oqu(vt.isAddMode?"Add Location":"Edit Location"),E.xp6(7),E.Q6J("ngModel",vt.selectedTab),E.xp6(1),E.Q6J("disabled",!0),E.xp6(1),E.Q6J("ngIf","location"==vt.selectedTab),E.xp6(3),E.Q6J("disabled",!0),E.xp6(1),E.Q6J("ngIf","equipment"==vt.selectedTab),E.xp6(3),E.Q6J("disabled",!0),E.xp6(1),E.Q6J("ngIf","info"==vt.selectedTab),E.xp6(3),E.Q6J("ngIf","location"==vt.selectedTab),E.xp6(1),E.Q6J("ngIf","equipment"==vt.selectedTab),E.xp6(1),E.Q6J("ngIf","info"==vt.selectedTab),E.xp6(4),E.Q6J("ngIf","location"!=vt.step),E.xp6(2),E.Q6J("ngIf",!vt.isReadyToSubmit&&"info"!=vt.step),E.xp6(1),E.Q6J("ngIf",vt.isReadyToSubmit))},dependencies:[ae.sg,ae.O5,Ue.JJ,Ue.On,oe.YG,oe.Sm,oe.W2,oe.fr,oe.Gu,oe.gu,oe.pK,oe.Ie,oe.Q$,oe.q_,oe.cJ,oe.GO,oe.t9,oe.n0,oe.wd,oe.sr,oe.as,oe.QI,oe.j9,oe.yf,Te.o,Pe.B,Ie,Ae.z],styles:['ul.breadcrumb[_ngcontent-%COMP%]{display:inline-flex;margin:0;padding:0}ul.breadcrumb[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline-flex;margin-right:6px;color:var(--ion-color-light-shade);font-size:10px}ul.breadcrumb[_ngcontent-%COMP%] li.active[_ngcontent-%COMP%]{color:var(--ion-color-dark-shade)}ul.breadcrumb[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:before{content:">";padding-right:4px}']})),Jn})()},3247:(Nn,yt,k)=>{"use strict";k.d(yt,{u:()=>Le});var x=k(1180),h=k(2029),y=k(9843),s=k(3052),J=k(989),ie=k(9127),Y=k(7430),E=k(9862);let Ne=(()=>{var ye;class gt{constructor(Pe,Ae){(0,x.Z)(this,"http",void 0),(0,x.Z)(this,"journeyManager",void 0),this.http=Pe,this.journeyManager=Ae}getDirections(Pe,Ae){return new Promise((Ye,_t)=>{(new google.maps.DirectionsService).route({origin:Pe,destination:Ae,travelMode:google.maps.TravelMode.DRIVING},(qt,Ht)=>{Ht===google.maps.DirectionsStatus.OK?Ye(qt):_t(Ht)})})}analyseRoutes(Pe,Ae){const Ye=new Array;return Pe.routes.forEach(_t=>{const hn=new Y.JJ;hn.Title=""+Ye.length+1,hn.JourneyRouteLegs=new Array,hn.TotalDistanceKM=0,hn.TotalDurationMinutes=0,hn.TotalEnergykWh=0,_t.legs.forEach(qt=>{const Ht=qt.duration.value,De=qt.distance.value/1e3,Je=this.journeyManager.calculateEnergyConsumptionkWh(De,0,null,Ae),Re=new Y.eN;Re.DistanceKM=De,Re.DurationMinutes=Ht/60,Re.EnergyConsumptionkWh=Je,hn.JourneyRouteLegs.push(Re),hn.TotalDistanceKM+=Re.DistanceKM,hn.TotalDurationMinutes+=Re.DurationMinutes,hn.TotalEnergykWh=Re.EnergyConsumptionkWh}),Ye.push(hn)}),Ye}}return ye=gt,(0,x.Z)(gt,"\u0275fac",function(Pe){return new(Pe||ye)(h.LFG(E.eN),h.LFG(J.i))}),(0,x.Z)(gt,"\u0275prov",h.Yz7({token:ye,factory:ye.\u0275fac,providedIn:"root"})),gt})();var me=k(1847),he=k(6814),_e=k(6223),ee=k(5460);function ae(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"ion-item"),h._UZ(1,"ion-icon",12),h.TgZ(2,"ion-searchbar",13),h.NdJ("ngModelChange",function(Ae){h.CHM(Te);const Ye=h.oxw();return h.KtG(Ye.routeStart=Ae)})("ionInput",function(Ae){h.CHM(Te),h.oxw();const Ye=h.MAs(18);return h.KtG(Ye.getPlacesAutoComplete(Ae,"routeStart"))})("ionCancel",function(Ae){h.CHM(Te);const Ye=h.oxw();return h.KtG(Ye.onPlaceSearchCancel(Ae))}),h.qZA()()}if(2&ye){const Te=h.oxw();h.xp6(2),h.Q6J("ngModel",Te.routeStart)("debounce",500)}}function oe(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"ion-item",14),h.NdJ("click",function(){h.CHM(Te);const Ae=h.oxw();return h.KtG(Ae.clearRouteStart())}),h._UZ(1,"ion-icon",12),h.TgZ(2,"h2"),h._uU(3),h.qZA()()}if(2&ye){h.oxw();const Te=h.MAs(18);h.xp6(3),h.Oqu(null==Te.selectedPlace?null:Te.selectedPlace.name)}}function Be(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"ion-item"),h._UZ(1,"ion-icon",15),h.TgZ(2,"ion-searchbar",16),h.NdJ("ngModelChange",function(Ae){h.CHM(Te);const Ye=h.oxw();return h.KtG(Ye.routeDestination=Ae)})("ionInput",function(Ae){h.CHM(Te),h.oxw();const Ye=h.MAs(20);return h.KtG(Ye.getPlacesAutoComplete(Ae,"routeDestination"))})("ionCancel",function(Ae){h.CHM(Te);const Ye=h.oxw();return h.KtG(Ye.onPlaceSearchCancel(Ae))}),h.qZA()()}if(2&ye){const Te=h.oxw();h.xp6(2),h.Q6J("ngModel",Te.routeDestination)("debounce",500)}}function Ie(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"ion-item",14),h.NdJ("click",function(){h.CHM(Te);const Ae=h.oxw();return h.KtG(Ae.clearRouteDestination())}),h._UZ(1,"ion-icon",15),h.TgZ(2,"h2"),h._uU(3),h.qZA()()}if(2&ye){h.oxw();const Te=h.MAs(20);h.xp6(3),h.Oqu(null==Te.selectedPlace?null:Te.selectedPlace.name)}}function Ee(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"ion-button",14),h.NdJ("click",function(){h.CHM(Te);const Ae=h.oxw();return h.KtG(Ae.clearRoute())}),h._UZ(1,"ion-icon",17),h._uU(2," Clear Route "),h.qZA()}}function Ue(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"ion-button",14),h.NdJ("click",function(){h.CHM(Te);const Ae=h.oxw();return h.KtG(Ae.showSettings())}),h._uU(1," Show Settings "),h._UZ(2,"ion-icon",18),h.qZA()}}function et(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"ion-button",14),h.NdJ("click",function(){h.CHM(Te);const Ae=h.oxw();return h.KtG(Ae.hideSettings())}),h._uU(1," Hide Settings "),h._UZ(2,"ion-icon",18),h.qZA()}}function le(ye,gt){1&ye&&(h.TgZ(0,"p",19),h._UZ(1,"ion-spinner",19),h._uU(2," Calculating Route.. "),h.qZA())}function ue(ye,gt){if(1&ye&&(h.TgZ(0,"ion-list")(1,"ion-list-header"),h._uU(2),h.ALo(3,"number"),h.ALo(4,"number"),h.qZA()()),2&ye){const Te=h.oxw();h.xp6(2),h.lnq(" Total Distance ",h.xi3(3,3,Te.selectedJourneyRoute.TotalDistanceKM,"1.0-2")," km, ",Te.formatDuration(Te.selectedJourneyRoute.TotalDurationMinutes),", ",h.xi3(4,6,Te.selectedJourneyRoute.TotalEnergykWh,"1.0-2")," kWh ")}}function ct(ye,gt){if(1&ye){const Te=h.EpF();h.TgZ(0,"div")(1,"ion-list")(2,"ion-list-header"),h._UZ(3,"ion-icon",20),h._uU(4," Route Settings "),h.qZA(),h.TgZ(5,"ion-item")(6,"ion-label",21),h._uU(7),h.qZA(),h.TgZ(8,"ion-range",22),h.NdJ("ngModelChange",function(Ae){h.CHM(Te);const Ye=h.oxw();return h.KtG(Ye.routeSearchDistance=Ae)}),h._UZ(9,"ion-icon",23)(10,"ion-icon",24),h.qZA()(),h.TgZ(11,"ion-item")(12,"ion-label",21),h._uU(13,"Energy Efficiency (kWh Per km)"),h.qZA(),h.TgZ(14,"ion-input",25),h.NdJ("ngModelChange",function(Ae){h.CHM(Te);const Ye=h.oxw();return h.KtG(Ye.kWhPerKM=Ae)}),h.qZA()()()()}if(2&ye){const Te=h.oxw();h.xp6(7),h.hij("Search Distance (",Te.routeSearchDistance,")"),h.xp6(1),h.Q6J("ngModel",Te.routeSearchDistance),h.xp6(6),h.Q6J("ngModel",Te.kWhPerKM)}}let ht=(()=>{var ye;class gt{constructor(Pe,Ae,Ye,_t,hn,qt){(0,x.Z)(this,"mapping",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"directions",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"changeDetector",void 0),(0,x.Z)(this,"numberPipe",void 0),(0,x.Z)(this,"routeSearchDistance",5),(0,x.Z)(this,"journeyRoutes",void 0),(0,x.Z)(this,"selectedJourneyRoute",void 0),(0,x.Z)(this,"routePolyline",void 0),(0,x.Z)(this,"kWhPerKM",void 0),(0,x.Z)(this,"routeStartPlace",void 0),(0,x.Z)(this,"routeDestinationPlace",void 0),(0,x.Z)(this,"routeCalcInProgress",!1),(0,x.Z)(this,"advancedSettingsMode",!1),(0,x.Z)(this,"routeStart",""),(0,x.Z)(this,"routeDestination",""),this.mapping=Pe,this.logging=Ae,this.directions=Ye,this.journeyManager=_t,this.changeDetector=hn,this.numberPipe=qt,this.kWhPerKM=.212}get isRouteSet(){return null!=this.routeStartPlace&&null!=this.routeDestinationPlace}showSettings(){this.advancedSettingsMode=!0}hideSettings(){this.advancedSettingsMode=!1}routeStartSelected(Pe){this.routeStartPlace=Pe,this.calculateRoute(),this.changeDetector.detectChanges()}routeDestinationSelected(Pe){this.routeDestinationPlace=Pe,this.calculateRoute(),this.changeDetector.detectChanges()}clearRouteStart(){this.routeStartPlace=null,this.changeDetector.detectChanges()}clearRouteDestination(){this.routeDestinationPlace=null,this.changeDetector.detectChanges()}clearRoute(){this.routeStartPlace=null,this.routeDestinationPlace=null,this.journeyManager.setRoutePolyline(null),this.mapping.clearPolyline()}formatDuration(Pe){if(Pe<=60)return this.numberPipe.transform(Pe,"1.0-2")+" mins";{const Ae=Math.round(Pe/60),Ye=Math.floor(Pe-60*Ae);return Ae+" hours "+(Ye>0?Ye+" mins":"")}}calculateRoute(){null!=this.routeStartPlace&&null!=this.routeDestinationPlace&&(this.logging.log("Fetching route directions.."),this.routeCalcInProgress=!0,this.directions.getDirections(this.routeStartPlace.Location.latitude+","+this.routeStartPlace.Location.longitude,this.routeDestinationPlace.Location.latitude+","+this.routeDestinationPlace.Location.longitude).then(Pe=>{if(null!=Pe.routes&&Pe.routes.length>0){this.logging.log("Got route directions, analysing.."),this.routePolyline=Pe.routes[0].overview_polyline;const Ae=Pe.routes[0].bounds.getSouthWest(),Ye=Pe.routes[0].bounds.getNorthEast(),_t=new s.wC(Ye.lat(),Ye.lng()),hn=new s.wC(Ae.lat(),Ae.lng()),qt=new s.LL(_t,hn);this.journeyRoutes=this.directions.analyseRoutes(Pe,this.kWhPerKM),this.journeyRoutes.length>0&&(this.selectedJourneyRoute=this.journeyRoutes[0]),this.journeyManager.setRoutePolyline(this.routePolyline),this.mapping.renderPolyline(this.routePolyline),this.mapping.moveToMapBounds(qt)}else this.logging.log("No route returned..");this.routeCalcInProgress=!1}))}}return ye=gt,(0,x.Z)(gt,"\u0275fac",function(Pe){return new(Pe||ye)(h.Y36(me.v),h.Y36(ie.z),h.Y36(Ne),h.Y36(J.i),h.Y36(h.sBO),h.Y36(he.JJ))}),(0,x.Z)(gt,"\u0275cmp",h.Xpm({type:ye,selectors:[["route-planner"]],decls:24,vars:10,consts:[[1,"route"],[1,"route-places"],["name","map","slot","start"],[4,"ngIf"],[3,"click",4,"ngIf"],["primary",""],["slot","secondary"],["slot","primary"],[3,"placeChanged"],["placeSearchRouteStart",""],["placeSearchRouteDestination",""],["class","ion-padding",4,"ngIf"],["name","ionic","item-left",""],["placeholder","Starting Point",3,"ngModel","debounce","ngModelChange","ionInput","ionCancel"],[3,"click"],["name","pin","item-left",""],["placeholder","Destination",3,"ngModel","debounce","ngModelChange","ionInput","ionCancel"],["name","close","slot","start"],["name","cog","slot","end"],[1,"ion-padding"],["name","cog"],["position","stacked"],["min","1","max","200","step","5","snaps","true","pin","true","light","",3,"ngModel","ngModelChange"],["slot","start","small","","name","map"],["slot","end","large","","name","map"],["type","number","min","0.1","max","1",3,"ngModel","ngModelChange"]],template:function(Pe,Ae){1&Pe&&(h.TgZ(0,"div",0)(1,"div",1)(2,"ion-list")(3,"ion-list-header"),h._UZ(4,"ion-icon",2),h.TgZ(5,"ion-label"),h._uU(6,"Plan Your Journey"),h.qZA()(),h.YNc(7,ae,3,2,"ion-item",3),h.YNc(8,oe,4,1,"ion-item",4),h.YNc(9,Be,3,2,"ion-item",3),h.YNc(10,Ie,4,1,"ion-item",4),h.qZA(),h.TgZ(11,"ion-toolbar",5)(12,"ion-buttons",6),h.YNc(13,Ee,3,0,"ion-button",4),h.qZA(),h.TgZ(14,"ion-buttons",7),h.YNc(15,Ue,3,0,"ion-button",4),h.YNc(16,et,3,0,"ion-button",4),h.qZA()()(),h.TgZ(17,"place-search",8,9),h.NdJ("placeChanged",function(_t){return Ae.routeStartSelected(_t)}),h.qZA(),h.TgZ(19,"place-search",8,10),h.NdJ("placeChanged",function(_t){return Ae.routeDestinationSelected(_t)}),h.qZA(),h.YNc(21,le,3,0,"p",11),h.YNc(22,ue,5,9,"ion-list",3),h.YNc(23,ct,15,3,"div",3),h.qZA()),2&Pe&&(h.xp6(7),h.Q6J("ngIf",null==Ae.routeStartPlace),h.xp6(1),h.Q6J("ngIf",null!=Ae.routeStartPlace),h.xp6(1),h.Q6J("ngIf",null==Ae.routeDestinationPlace),h.xp6(1),h.Q6J("ngIf",null!=Ae.routeDestinationPlace),h.xp6(3),h.Q6J("ngIf",Ae.isRouteSet),h.xp6(2),h.Q6J("ngIf",!Ae.advancedSettingsMode),h.xp6(1),h.Q6J("ngIf",Ae.advancedSettingsMode),h.xp6(5),h.Q6J("ngIf",Ae.routeCalcInProgress),h.xp6(1),h.Q6J("ngIf",null!=Ae.selectedJourneyRoute),h.xp6(1),h.Q6J("ngIf",Ae.advancedSettingsMode))},dependencies:[he.O5,y.YG,y.Sm,y.gu,y.pK,y.Ie,y.Q$,y.q_,y.yh,y.I_,y.VI,y.PQ,y.sr,y.as,y.QI,y.j9,y.yf,y.Uj,_e.JJ,_e.On,ee.v,he.JJ],encapsulation:2})),gt})(),Le=(()=>{var ye;class gt{constructor(Pe){(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"hasNavbar",!1),this.modalController=Pe}close(){this.modalController.dismiss()}}return ye=gt,(0,x.Z)(gt,"\u0275fac",function(Pe){return new(Pe||ye)(h.Y36(y.IN))}),(0,x.Z)(gt,"\u0275cmp",h.Xpm({type:ye,selectors:[["ng-component"]],decls:10,vars:0,consts:[["slot","end"],[3,"click"],["name","close","slot","end"],[1,"route-planner","ion-padding"]],template:function(Pe,Ae){1&Pe&&(h.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),h._uU(3," Route Planner "),h.qZA(),h.TgZ(4,"ion-buttons",0)(5,"ion-button",1),h.NdJ("click",function(){return Ae.close()}),h._UZ(6,"ion-icon",2),h._uU(7," Close "),h.qZA()()()(),h.TgZ(8,"ion-content",3),h._UZ(9,"route-planner"),h.qZA())},dependencies:[y.YG,y.Sm,y.W2,y.Gu,y.gu,y.wd,y.sr,ht],encapsulation:2})),gt})()},4606:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{SearchPageModule:()=>Jt});var x=k(1180),h=k(5086),y=k(3999),s=k(6814),J=k(6223),ie=k(9843),Y=k(6800),E=k(5861),Ne=k(553),me=k(7777),he=k(4119),_e=k(3247),ee=k(9723),ae=k(3052),oe=k(4677),Be=k(866),Ie=k(9127),Ee=k(989),Ue=k(1847),et=k(4669),le=k(6470),ue=k(5460),ct=k(2438),ht=k(7394);class Le extends ht.w0{constructor(dt,Ot){super()}schedule(dt,Ot=0){return this}}const ye={setInterval(kt,dt,...Ot){const{delegate:pt}=ye;return pt?.setInterval?pt.setInterval(kt,dt,...Ot):setInterval(kt,dt,...Ot)},clearInterval(kt){const{delegate:dt}=ye;return(dt?.clearInterval||clearInterval)(kt)},delegate:void 0};var gt=k(9039),Pe=k(4552);class Ae{constructor(dt,Ot=Ae.now){this.schedulerActionCtor=dt,this.now=Ot}schedule(dt,Ot=0,pt){return new this.schedulerActionCtor(this,dt).schedule(pt,Ot)}}Ae.now=Pe.l.now;const _t=new class Ye extends Ae{constructor(dt,Ot=Ae.now){super(dt,Ot),this.actions=[],this._active=!1}flush(dt){const{actions:Ot}=this;if(this._active)return void Ot.push(dt);let pt;this._active=!0;do{if(pt=dt.execute(dt.state,dt.delay))break}while(dt=Ot.shift());if(this._active=!1,pt){for(;dt=Ot.shift();)dt.unsubscribe();throw pt}}}(class Te extends Le{constructor(dt,Ot){super(dt,Ot),this.scheduler=dt,this.work=Ot,this.pending=!1}schedule(dt,Ot=0){var pt;if(this.closed)return this;this.state=dt;const Yt=this.id,Ut=this.scheduler;return null!=Yt&&(this.id=this.recycleAsyncId(Ut,Yt,Ot)),this.pending=!0,this.delay=Ot,this.id=null!==(pt=this.id)&&void 0!==pt?pt:this.requestAsyncId(Ut,this.id,Ot),this}requestAsyncId(dt,Ot,pt=0){return ye.setInterval(dt.flush.bind(dt,this),pt)}recycleAsyncId(dt,Ot,pt=0){if(null!=pt&&this.delay===pt&&!1===this.pending)return Ot;null!=Ot&&ye.clearInterval(Ot)}execute(dt,Ot){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const pt=this._execute(dt,Ot);if(pt)return pt;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(dt,Ot){let Yt,pt=!1;try{this.work(dt)}catch(Ut){pt=!0,Yt=Ut||new Error("Scheduled action threw falsy error")}if(pt)return this.unsubscribe(),Yt}unsubscribe(){if(!this.closed){const{id:dt,scheduler:Ot}=this,{actions:pt}=Ot;this.work=this.state=this.scheduler=null,this.pending=!1,(0,gt.P)(pt,this),null!=dt&&(this.id=this.recycleAsyncId(Ot,dt,null)),this.delay=null,super.unsubscribe()}}});var qt=k(9360),Ht=k(8251);const Re=(0,k(2726).fo)("Geolocation",{web:()=>k.e(579).then(k.bind(k,579)).then(kt=>new kt.GeolocationWeb)});var Fe=k(2029),St=k(5957);function Ce(kt,dt){1&kt&&Fe._UZ(0,"ion-icon",13)}function Rt(kt,dt){1&kt&&Fe._UZ(0,"ion-spinner")}function Qt(kt,dt){if(1&kt){const Ot=Fe.EpF();Fe.TgZ(0,"ion-button",3),Fe.NdJ("click",function(){Fe.CHM(Ot);const Yt=Fe.oxw();return Fe.KtG(Yt.openSideView())}),Fe._UZ(1,"ion-icon",14),Fe.qZA()}}function Gt(kt,dt){1&kt&&(Fe.ynx(0),Fe.TgZ(1,"div",15)(2,"p"),Fe._uU(3,"There was a problem communicating with Open Charge Map. Please check your data connection."),Fe.qZA()(),Fe.BQk())}let Zt=(()=>{var kt;class dt{constructor(pt,Yt,Ut,ii,gn,Ft,Jn,Wt,wt,vt,ln,ni){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"events",void 0),(0,x.Z)(this,"translate",void 0),(0,x.Z)(this,"platform",void 0),(0,x.Z)(this,"poiManager",void 0),(0,x.Z)(this,"mapping",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"zone",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"alertController",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"mapDisplayed",!1),(0,x.Z)(this,"debouncedRefreshMapResults",void 0),(0,x.Z)(this,"mapCanvasID",void 0),(0,x.Z)(this,"initialResultsShown",!1),(0,x.Z)(this,"searchOnDemand",!1),(0,x.Z)(this,"poiViewMode","modal"),(0,x.Z)(this,"sideViewAvailable",!1),(0,x.Z)(this,"searchPolyline",void 0),(0,x.Z)(this,"routePlanningMode",!0),(0,x.Z)(this,"searchKeyword",""),(0,x.Z)(this,"selectedPOI",void 0),(0,x.Z)(this,"appConfig",new me.X),(0,x.Z)(this,"defaultMapZoom",15),(0,x.Z)(this,"defaultStartPos",new ae.wC(37.415328,-122.076575)),(0,x.Z)(this,"placeSearchMapPOI",void 0),(0,x.Z)(this,"_watchId",null),this.appManager=pt,this.nav=Yt,this.events=Ut,this.translate=ii,this.platform=gn,this.poiManager=Ft,this.mapping=Jn,this.journeyManager=Wt,this.zone=wt,this.modalController=vt,this.alertController=ln,this.logging=ni,this.mapCanvasID="map-canvas",this.mapping.setMapType(pt.searchSettings.MapType),this.mapping.setMapAPI(Ne.N.defaultMapProvider),(0,ct.R)(window,"resize").pipe(function De(kt,dt=_t){return(0,qt.e)((Ot,pt)=>{let Yt=null,Ut=null,ii=null;const gn=()=>{if(Yt){Yt.unsubscribe(),Yt=null;const Jn=Ut;Ut=null,pt.next(Jn)}};function Ft(){const Jn=ii+kt,Wt=dt.now();if(Wt{Ut=Jn,ii=dt.now(),Yt||(Yt=dt.schedule(Ft,kt),pt.add(Yt))},()=>{gn(),pt.complete()},void 0,()=>{Ut=Yt=null}))})}(500)).subscribe(lr=>{let mi={width:Be.c.getClientHeight(),height:Be.c.getClientWidth()};this.events.publish("ocm:window:resized",[mi])})}ionViewDidEnter(){this.logging.log("Entered search page.",Ie.i.VERBOSE),this.mapping.focusMap(),this.mapping.updateMapSize()}ionViewWillLeave(){this.logging.log("Leaving search page.",Ie.i.VERBOSE),this.mapping.unfocusMap()}getPreferredMapHeight(pt){return null==pt&&(pt=Be.c.getClientHeight()),pt-56}enforceMapHeight(pt){this.logging.log("Would resize map:"+pt.width+" "+pt.height,Ie.i.VERBOSE);const Yt=this.getPreferredMapHeight(pt[0]);document.getElementById(this.mapCanvasID).offsetHeight!==Yt&&(document.getElementById(this.mapCanvasID).style.height=Yt+"px"),this.mapping&&(this.logging.log("Map height:"+Yt,Ie.i.VERBOSE),this.mapping.updateMapSize())}initialiseMapping(){var pt=this;return(0,E.Z)(function*(){yield pt.platform.ready(),pt.debouncedRefreshMapResults=Be.c.debounce(pt.refreshMapResults,1e3,!1),pt.events.subscribe("ocm:mapping:ready",(0,E.Z)(function*(){if(pt.logging.log("init map: mapping ready"),pt.mapping&&pt.mapping.updateMapSize(),!pt.initialResultsShown)if(pt.appManager.searchSettings.StartSearchPosition&&!pt.appManager.searchSettings.StartViewPoiId)pt.searchOnDemand=!0,pt.mapping.updateMapCentrePos(pt.appManager.searchSettings.StartSearchPosition.latitude,pt.appManager.searchSettings.StartSearchPosition.longitude,!0,pt.defaultMapZoom);else{let Yt=localStorage.getItem("_locationEnabled");1==pt.appManager.isEmbeddedMode&&"true"!=Yt?yield(yield pt.alertController.create({header:"Search using your location?",message:"Select OK to continue.",buttons:[{text:"Cancel",role:"cancel",cssClass:"secondary",handler:(ii=(0,E.Z)(function*(gn){yield pt.useFallbackPosition()}),function(Ft){return ii.apply(this,arguments)})},{text:"OK",handler:function(){var ii=(0,E.Z)(function*(){yield pt.locateUser()});return function(){return ii.apply(this,arguments)}}()}]})).present():(yield pt.locateUser(),pt.mapping&&pt.mapping.updateMapSize())}var ii})),pt.events.subscribe("ocm:mapping:zoom",()=>{pt.debouncedRefreshMapResults()}),pt.events.subscribe("ocm:mapping:dragend",()=>{pt.debouncedRefreshMapResults()}),pt.events.subscribe("ocm:poiList:updated",Yt=>{pt.showPOIListOnMap(Yt)}),pt.events.subscribe("ocm:poiList:cleared",()=>{pt.mapping.clearMarkers(),setTimeout(()=>{pt.debouncedRefreshMapResults()},500)}),pt.events.subscribe("ocm:window:resized",Yt=>{null!=Yt&&Yt.length>0&&pt.enforceMapHeight(Yt[0])}),pt.events.subscribe("ocm:poi:selected",Yt=>{if(Yt.poi)pt.viewPOIDetails(Yt,Yt.poi);else{let Ut=pt.getPOIByID(Yt.poiId);pt.viewPOIDetails(Yt,Ut)}}),pt.mapping.initMap(pt.mapCanvasID)})()}ngAfterViewInit(){var pt=this;return(0,E.Z)(function*(){yield pt.initialiseMapping()})()}ngOnInit(){var pt=this;return(0,E.Z)(function*(){pt.logging.log("Refreshing reference data ..",Ie.i.VERBOSE),(yield pt.appManager.referenceDataManager.refreshReferenceData(pt.appManager.api))||(pt.appManager.isOffline=!0)})()}showPOIListOnMap(pt){const Yt=this.getPreferredMapHeight(null);this.mapping.refreshMapView(Yt,this.poiManager.poiList,null),this.mapDisplayed||(this.mapDisplayed=!0)}getIconForPOI(pt){return Be.c.getIconForPOI(pt)}getPOIByID(pt){const Yt=this.poiManager.poiList;for(let Ut=0;Ut0&&(Yt.minPowerKW=pt.appManager.searchSettings.MinPowerKW),null!=pt.appManager.searchSettings.MaxPowerKW&&pt.appManager.searchSettings.MaxPowerKW>0&&(Yt.maxPowerKW=pt.appManager.searchSettings.MaxPowerKW),null!=pt.appManager.searchSettings.MaxResults&&pt.appManager.searchSettings.MaxResults>0&&pt.appManager.searchSettings.MaxResults<=1e4&&(Yt.maxResults=pt.appManager.searchSettings.MaxResults),null!=pt.journeyManager.getRoutePolyline()&&(Yt.polyline=pt.journeyManager.getRoutePolyline(),Yt.boundingbox=null,Yt.levelOfDetail=null,Yt.latitude=null,Yt.longitude=null)),pt.appManager.searchSettings.EnablePOIPendingApproval&&(Yt.submissionStatusTypeIdList=[1,100,200]),pt.appManager.isRequestInProgress=!0;let ii=yield pt.poiManager.refreshPOIList(Yt);pt.appManager.isRequestInProgress=!1,pt.initialResultsShown=!0,ii>=Yt.maxResults&&pt.appManager.showToastNotification("A maximum of "+ii+" results are returned per search. Zoom in for details.")})()}viewPOIDetails(pt,Yt){this.logging.log("Viewing/fetching ["+this.poiViewMode+"] POI Details "+pt.poiId),null!=Yt?(this.mapping.unfocusMap(),this.modalController.create({component:ee.H,componentProps:{item:Yt}}).then(Ut=>{Ut.onDidDismiss().then(()=>{this.logging.log("Dismissing POI Details."),this.mapping.focusMap(),this.searchOnDemand=!0}),Ut.present()})):this.poiManager.getPOIById(pt.poiId,!0).then(Ut=>{this.logging.log("Got POI Details "+Ut.ID),"modal"===this.poiViewMode&&(this.searchOnDemand=!1,this.modalController.create({component:ee.H,componentProps:{item:Ut}}).then(ii=>{ii.onDidDismiss().then(()=>{this.logging.log("Dismissing POI Details."),this.mapping.focusMap(),this.searchOnDemand=!0}),ii.present()}),this.mapping.unfocusMap()),"side"===this.poiViewMode&&(this.selectedPOI=Ut)},Ut=>{this.appManager.showToastNotification("POI Details not available")})}closePOIDetails(){this.selectedPOI=null}openRoutePlannerModal(){this.searchOnDemand=!1,this.mapping.unfocusMap(),this.modalController.create({component:_e.u}).then(pt=>{pt.onDidDismiss().then(Yt=>{this.logging.log("Dismissing Route Planner Details."),this.mapping.focusMap(),this.searchOnDemand=!0}),pt.present()})}openSearchOptions(){this.searchOnDemand=!1,this.mapping.unfocusMap(),this.modalController.create({component:he.N}).then(pt=>{pt.onDidDismiss().then(Yt=>{this.mapping.focusMap(),this.searchOnDemand=!0}),pt.present()})}openSideView(){this.poiViewMode="side",this.mapping.updateMapSize()}closeSideView(){this.poiViewMode="modal",this.mapping.updateMapSize()}planRoute(){this.routePlanningMode=!0}search(pt){this.placeSearchMapPOI.getPlacesAutoComplete(pt,"poiSearch")}useFallbackPosition(){let pt=this.defaultStartPos;null!=this.appManager.searchSettings.LastSearchPosition&&(pt=this.appManager.searchSettings.LastSearchPosition),this.appManager.searchSettings.StartSearchPosition=pt,this.appManager.searchSettings.LastSearchPosition=null,this.searchOnDemand=!0,this.mapping.updateMapCentrePos(pt.latitude,pt.longitude,!0,this.defaultMapZoom)}getPosition(pt={}){var Yt=this;return(0,E.Z)(function*(){return new Promise((Ut,ii)=>{Yt._watchId=Re.watchPosition(pt,(gn,Ft)=>{Yt._watchId&&Re.clearWatch({id:Yt._watchId}),Ft?ii(Ft):Ut(gn)})})})()}locateUser(){var pt=this;return(0,E.Z)(function*(){pt.useFallbackPosition();try{pt.logging.log("Attempting to locate user..");const Yt=yield pt.getPosition({timeout:1e4});if(!Yt)throw"Failed to get user location.";return pt.logging.log("Got user location."),pt.appManager.searchSettings.StartSearchPosition=new ae.wC(Yt.coords.latitude,Yt.coords.longitude),pt.searchOnDemand=!0,pt.mapping.updateMapCentrePos(Yt.coords.latitude,Yt.coords.longitude,!0,pt.defaultMapZoom),localStorage.setItem("_locationEnabled","true"),!0}catch(Yt){return pt.logging.log("Failed to get user location. Searching using default or last position."+Yt),pt.appManager.showToastNotification("Your location could not be determined."),pt.useFallbackPosition(),!1}})()}placeSelected(pt){this.searchKeyword=pt.Address,this.logging.log("Got place details:"+pt.Address),this.mapping.focusMap(),this.mapping.updateMapCentrePos(pt.Location.latitude,pt.Location.longitude,!0),this.debouncedRefreshMapResults()}}return kt=dt,(0,x.Z)(dt,"\u0275fac",function(pt){return new(pt||kt)(Fe.Y36(le.c),Fe.Y36(ie.SH),Fe.Y36(St.z),Fe.Y36(y.sK),Fe.Y36(ie.t4),Fe.Y36(et.R),Fe.Y36(Ue.v),Fe.Y36(Ee.i),Fe.Y36(Fe.R0b),Fe.Y36(ie.IN),Fe.Y36(ie.Br),Fe.Y36(Ie.z))}),(0,x.Z)(dt,"\u0275cmp",Fe.Xpm({type:kt,selectors:[["ng-component"]],viewQuery:function(pt,Yt){if(1&pt&&Fe.Gf(ue.v,7),2&pt){let Ut;Fe.iGM(Ut=Fe.CRH())&&(Yt.placeSearchMapPOI=Ut.first)}},decls:18,vars:10,consts:[["slot","start"],["autocapitalize","on","autocomplete","on",3,"ngModel","placeholder","debounce","ngModelChange","ionInput"],["slot","end"],[3,"click"],["name","locate","slot","start",4,"ngIf"],[4,"ngIf"],[3,"color","click"],["name","options","slot","end"],[3,"click",4,"ngIf"],[1,"search-page"],[3,"placeChanged"],["placeSearchMapPOI",""],["id","map-canvas",2,"height","100%","width","100%","min-height","300px"],["name","locate","slot","start"],["name","car","title","Route","slot","end"],[2,"position","absolute"]],template:function(pt,Yt){1&pt&&(Fe.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-buttons",0),Fe._UZ(3,"ion-menu-button"),Fe.qZA(),Fe.TgZ(4,"ion-searchbar",1),Fe.NdJ("ngModelChange",function(ii){return Yt.searchKeyword=ii})("ionInput",function(ii){return Yt.search(ii)}),Fe.ALo(5,"translate"),Fe.qZA(),Fe.TgZ(6,"ion-buttons",2)(7,"ion-button",3),Fe.NdJ("click",function(){return Yt.locateUser()}),Fe.YNc(8,Ce,1,0,"ion-icon",4),Fe.YNc(9,Rt,1,0,"ion-spinner",5),Fe.qZA(),Fe.TgZ(10,"ion-button",6),Fe.NdJ("click",function(){return Yt.openSearchOptions()}),Fe._UZ(11,"ion-icon",7),Fe.qZA(),Fe.YNc(12,Qt,2,0,"ion-button",8),Fe.qZA()()(),Fe.TgZ(13,"ion-content",9)(14,"place-search",10,11),Fe.NdJ("placeChanged",function(ii){return Yt.placeSelected(ii)}),Fe.qZA(),Fe.YNc(16,Gt,4,0,"ng-container",5),Fe._UZ(17,"div",12),Fe.qZA()),2&pt&&(Fe.xp6(4),Fe.Q6J("ngModel",Yt.searchKeyword)("placeholder",Fe.lcZ(5,8,"ocm.search.performSearch"))("debounce",500),Fe.xp6(4),Fe.Q6J("ngIf",!Yt.appManager.isRequestInProgress),Fe.xp6(1),Fe.Q6J("ngIf",Yt.appManager.isRequestInProgress),Fe.xp6(1),Fe.Q6J("color",Yt.appManager.searchSettings.HasActiveFilters?"danger":"default"),Fe.xp6(2),Fe.Q6J("ngIf",1==Yt.sideViewAvailable&&"modal"==Yt.poiViewMode),Fe.xp6(4),Fe.Q6J("ngIf",Yt.appManager.isOffline))},dependencies:[s.O5,J.JJ,J.On,ie.YG,ie.Sm,ie.W2,ie.Gu,ie.gu,ie.fG,ie.VI,ie.PQ,ie.sr,ie.j9,ue.v,y.X$],styles:[".search-page[_ngcontent-%COMP%] #map-canvas[_ngcontent-%COMP%]{width:100%;height:98%}.search-page[_ngcontent-%COMP%] #place-search[_ngcontent-%COMP%]{min-height:300px;background-color:#f0f0f0;position:absolute;z-index:100;width:100%}.search-page[_ngcontent-%COMP%] scroll-content[_ngcontent-%COMP%]{overflow-y:hidden}.search-page[_ngcontent-%COMP%] .banner[_ngcontent-%COMP%]{padding-left:2em}.search-page[_ngcontent-%COMP%] .sideview[_ngcontent-%COMP%]{background:rgb(238,238,238);background:linear-gradient(to bottom,rgb(238,238,238) 0%,rgb(255,255,255) 100%)}"]})),dt})(),Jt=(()=>{var kt;class dt{}return kt=dt,(0,x.Z)(dt,"\u0275fac",function(pt){return new(pt||kt)}),(0,x.Z)(dt,"\u0275mod",Fe.oAB({type:kt})),(0,x.Z)(dt,"\u0275inj",Fe.cJS({imports:[s.ez,J.u5,ie.Pc,y.aw,h.e,Y.Bz.forChild([{path:"",component:Zt}])]})),dt})()},4119:(Nn,yt,k)=>{"use strict";k.d(yt,{N:()=>ct});var x=k(5861),h=k(1180),y=k(4669),s=k(6470),J=k(4783),ie=k(866),Y=k(1847),E=k(2029),Ne=k(9843),me=k(5957),he=k(6814),_e=k(6223),ee=k(6086),ae=k(3999);let oe=(()=>{var ht;class Le extends ae.X${constructor(gt,Te){super(gt,Te)}transform(gt,...Te){let Pe=super.transform(gt,...Te);return Pe==gt?null!=Te&&Te[0].default?Te[0].default:Te[0].Title?Te[0].Title:Pe:Pe}}return ht=Le,(0,h.Z)(Le,"\u0275fac",function(gt){return new(gt||ht)(E.Y36(ae.sK,16),E.Y36(E.sBO,16))}),(0,h.Z)(Le,"\u0275pipe",E.Yjl({name:"nullableTranslate",type:ht,pure:!0})),(0,h.Z)(Le,"\u0275prov",E.Yz7({token:ht,factory:ht.\u0275fac})),Le})();function Be(ht,Le){if(1&ht){const ye=E.EpF();E.TgZ(0,"p",23),E._UZ(1,"ion-icon",24),E._uU(2," One or more filters are currently being applied. "),E.TgZ(3,"ion-button",25),E.NdJ("click",function(){E.CHM(ye);const Te=E.oxw();return E.KtG(Te.clearFilters())}),E._UZ(4,"ion-icon",26),E.TgZ(5,"ion-label"),E._uU(6,"Clear"),E.qZA()()()}}function Ie(ht,Le){if(1&ht&&(E.TgZ(0,"ion-select-option",28),E._uU(1),E.qZA()),2&ht){const ye=Le.$implicit;E.Q6J("value",ye.ID),E.xp6(1),E.Oqu(ye.Title)}}function Ee(ht,Le){if(1&ht){const ye=E.EpF();E.TgZ(0,"ion-item")(1,"ion-select",15),E.NdJ("ngModelChange",function(Te){E.CHM(ye);const Pe=E.oxw();return E.KtG(Pe.searchSettings.FilterOptionsByCountryId=Te)})("ionChange",function(){E.CHM(ye);const Te=E.oxw();return E.KtG(Te.onCountryChange())}),E.ALo(2,"translate"),E.TgZ(3,"ion-select",27),E._uU(4,"(All Countries)"),E.qZA(),E.YNc(5,Ie,2,2,"ion-select-option",5),E.qZA()()}if(2&ht){const ye=E.oxw();E.xp6(1),E.Q6J("label",E.lcZ(2,3,"ocm.search.countries"))("ngModel",ye.searchSettings.FilterOptionsByCountryId),E.xp6(4),E.Q6J("ngForOf",ye.countries)}}function Ue(ht,Le){if(1&ht&&(E.TgZ(0,"ion-select-option",28),E._uU(1),E.ALo(2,"nullableTranslate"),E.qZA()),2&ht){const ye=Le.$implicit;E.Q6J("value",ye.ID),E.xp6(1),E.Oqu(E.xi3(2,2,"ocm.reference.usageType.value_"+ye.ID,ye))}}function et(ht,Le){if(1&ht&&(E.TgZ(0,"ion-select-option",28),E._uU(1),E.ALo(2,"nullableTranslate"),E.qZA()),2&ht){const ye=Le.$implicit;E.Q6J("value",ye.ID),E.xp6(1),E.Oqu(E.xi3(2,2,"ocm.reference.statusType.value_"+ye.ID,ye))}}function le(ht,Le){if(1&ht&&(E.TgZ(0,"ion-select-option",28),E._uU(1),E.ALo(2,"nullableTranslate"),E.qZA()),2&ht){const ye=Le.$implicit;E.Q6J("value",ye.ID),E.xp6(1),E.Oqu(E.xi3(2,2,"ocm.reference.connectionType.value_"+ye.ID,ye))}}function ue(ht,Le){if(1&ht&&(E.TgZ(0,"ion-select-option",28),E._uU(1),E.qZA()),2&ht){const ye=Le.$implicit;E.Q6J("value",ye.code),E.xp6(1),E.Oqu(ye.title)}}let ct=(()=>{var ht;class Le{constructor(gt,Te,Pe,Ae,Ye){(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"poiManager",void 0),(0,h.Z)(this,"mapping",void 0),(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"searchSettings",void 0),(0,h.Z)(this,"maxPower",J.U),(0,h.Z)(this,"powerRange",{lower:0,upper:this.maxPower}),(0,h.Z)(this,"_languages",[]),this.appManager=gt,this.poiManager=Te,this.mapping=Pe,this.modalController=Ae,this.events=Ye,this.searchSettings=gt.searchSettings}ngOnInit(){var gt=this;return(0,x.Z)(function*(){null!=gt.searchSettings.MinPowerKW&&(gt.powerRange.lower=gt.searchSettings.MinPowerKW),null!=gt.searchSettings.MaxPowerKW&&(gt.powerRange.upper=gt.searchSettings.MaxPowerKW),0==gt.powerRange.upper&&(gt.powerRange.upper=gt.maxPower),gt.appManager.analytics.viewEvent("Settings"),gt.useFilteredOptions&&(yield gt.onCountryChange())})()}get useFilteredOptions(){return this.searchSettings.FilterOptionsByCountryId>0}clearFilters(){this.searchSettings.ClearActiveFilters(),this.powerRange={lower:0,upper:this.maxPower},this.searchSettings.CheckForActiveFilters()}get operators(){return this.appManager.referenceDataManager.getNetworkOperators(this.useFilteredOptions)}get connectionTypes(){return this.appManager.referenceDataManager.getConnectionTypes(this.useFilteredOptions)}get usageTypes(){return this.appManager.referenceDataManager.getUsageTypes(this.useFilteredOptions)}get statusTypes(){return this.appManager.referenceDataManager.getStatusTypes(this.useFilteredOptions)}get countries(){return this.appManager.referenceDataManager.getCountries(this.useFilteredOptions)}get isCountryFilterFeatureEnabled(){return ie.c.isFeatureEnabled("FILTER_OPTIONS_BY_COUNTRY")}get languages(){return this._languages.length>0||(this._languages=this.appManager.getLanguages()),this._languages}ionViewWillLeave(){null!=this.searchSettings.Language&&this.appManager.setLanguage(this.searchSettings.Language),this.searchSettings.MinPowerKW=this.powerRange.lower,this.searchSettings.MaxPowerKW=this.powerRange.upper,1==this.searchSettings.MinPowerKW&&(this.searchSettings.MinPowerKW=null),this.searchSettings.MaxPowerKW==this.maxPower&&(this.searchSettings.MaxPowerKW=null),this.appManager.searchSettings=this.searchSettings,this.appManager.saveSearchSettings(),this.events.publish("ocm:poiList:cleared")}onLanguageChange(){null!=this.searchSettings.Language&&""!=this.searchSettings.Language&&this.appManager.setLanguage(this.searchSettings.Language)}onCountryChange(){var gt=this;return(0,x.Z)(function*(){gt.appManager.referenceDataManager.refreshFilteredReferenceData(gt.appManager.api,{CountryIds:[gt.searchSettings.FilterOptionsByCountryId]})})()}onMapTypeChange(){var gt=this;return(0,x.Z)(function*(){gt.mapping.setMapType(gt.searchSettings.MapType)})()}onOperatorSelected(gt=null){var Te=this;return(0,x.Z)(function*(){null!=gt&&(Te.searchSettings.OperatorList.find(Pe=>Pe==gt.ID)||Te.searchSettings.OperatorList.push(gt.ID))})()}onOperatorRemoved(gt){var Te=this;return(0,x.Z)(function*(){Te.searchSettings.OperatorList=Te.searchSettings.OperatorList.filter(Pe=>Pe!=gt)})()}close(){this.modalController.dismiss()}}return ht=Le,(0,h.Z)(Le,"\u0275fac",function(gt){return new(gt||ht)(E.Y36(s.c),E.Y36(y.R),E.Y36(Y.v),E.Y36(Ne.IN),E.Y36(me.z))}),(0,h.Z)(Le,"\u0275cmp",E.Xpm({type:ht,selectors:[["ng-component"]],decls:66,vars:41,consts:[[1,"settings-page","ion-padding"],["danger","",4,"ngIf"],[4,"ngIf"],["mode","multi",3,"operatorList","useFilteredOperators","operatorRemoved","operatorChanged"],["multiple","true","cancelText","Cancel","okText","OK",3,"label","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["lines","none"],["dualKnobs","true","min","0","max","650","pin","true",3,"ngModel","ticks","snaps","min","max","ngModelChange"],["slot","start","size","small","name","flash"],["slot","end","name","flash"],["slot","start",2,"padding-top","0"],["type","number","min","0",2,"width","3em","border","none",3,"ngModel","max","ngModelChange"],["slot","end",2,"padding-top","0"],["type","number",2,"width","3em","border","none",3,"ngModel","max","min","ngModelChange"],["label","Language","multiple","false",3,"ngModel","ngModelChange","ionChange"],["multiple","false","cancelText","Cancel","okText","OK",3,"label","ngModel","ngModelChange","ionChange"],["value","ROADMAP"],["value","SATELLITE"],[3,"ngModel","ngModelChange"],["label","Max Results","type","number","placeholder","500","min","100","max","10000",3,"ngModel","ngModelChange"],["slot","end"],[3,"click"],["name","close","slot","start"],["danger",""],["name","alert"],["size","small","color","light",3,"click"],["slot","start","name","close"],["value",""],[3,"value"]],template:function(gt,Te){1>&&(E.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),E._uU(3),E.ALo(4,"translate"),E.qZA()()(),E.TgZ(5,"ion-content",0)(6,"h2"),E._uU(7,"Search Filters"),E.qZA(),E.TgZ(8,"p"),E._uU(9,"Note: Filters will remove usable charging locations from your search results if we do not have complete data (i.e Operator or Power Levels)."),E.qZA(),E.YNc(10,Be,7,0,"p",1),E.TgZ(11,"ion-list"),E.YNc(12,Ee,6,5,"ion-item",2),E.TgZ(13,"app-operator-lookup",3),E.NdJ("operatorRemoved",function(Ae){return Te.onOperatorRemoved(Ae)})("operatorChanged",function(Ae){return Te.onOperatorSelected(Ae)}),E.qZA(),E.TgZ(14,"ion-item")(15,"ion-select",4),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.UsageTypeList=Ae}),E.ALo(16,"translate"),E.YNc(17,Ue,3,5,"ion-select-option",5),E.qZA()(),E.TgZ(18,"ion-item")(19,"ion-select",4),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.StatusTypeList=Ae}),E.ALo(20,"translate"),E.YNc(21,et,3,5,"ion-select-option",5),E.qZA()(),E.TgZ(22,"ion-item")(23,"ion-select",4),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.ConnectionTypeList=Ae}),E.ALo(24,"translate"),E.YNc(25,le,3,5,"ion-select-option",5),E.qZA()(),E.TgZ(26,"ion-item",6)(27,"ion-range",7),E.NdJ("ngModelChange",function(Ae){return Te.powerRange=Ae}),E.TgZ(28,"ion-icon",8),E._uU(29,"0"),E.qZA(),E._UZ(30,"ion-icon",9),E.qZA()(),E.TgZ(31,"ion-item",6)(32,"ion-note",10),E._uU(33,"Min. Power (kW)"),E._UZ(34,"br"),E.TgZ(35,"input",11),E.NdJ("ngModelChange",function(Ae){return Te.powerRange.lower=Ae}),E.qZA()(),E.TgZ(36,"ion-note",12),E._uU(37,"Max. Power (kW)"),E._UZ(38,"br"),E.TgZ(39,"input",13),E.NdJ("ngModelChange",function(Ae){return Te.powerRange.upper=Ae}),E.qZA()()()(),E.TgZ(40,"h2"),E._uU(41," General Settings "),E.qZA(),E.TgZ(42,"ion-item")(43,"ion-select",14),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.Language=Ae})("ionChange",function(){return Te.onLanguageChange()}),E.YNc(44,ue,2,2,"ion-select-option",5),E.qZA()(),E.TgZ(45,"ion-item")(46,"ion-select",15),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.MapType=Ae})("ionChange",function(){return Te.onMapTypeChange()}),E.ALo(47,"translate"),E.TgZ(48,"ion-select-option",16),E._uU(49,"Road Map"),E.qZA(),E.TgZ(50,"ion-select-option",17),E._uU(51,"Satellite"),E.qZA()()(),E.TgZ(52,"ion-item")(53,"ion-toggle",18),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.EnableAdvancedEditorFeatures=Ae}),E._uU(54,"Enable Advanced Editor Options"),E.qZA()(),E.TgZ(55,"ion-item")(56,"ion-toggle",18),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.EnablePOIPendingApproval=Ae}),E._uU(57,"Show POIs Pending Approval"),E.qZA()(),E.TgZ(58,"ion-item")(59,"ion-input",19),E.NdJ("ngModelChange",function(Ae){return Te.searchSettings.MaxResults=Ae}),E.qZA()()(),E.TgZ(60,"ion-footer")(61,"ion-toolbar")(62,"ion-buttons",20)(63,"ion-button",21),E.NdJ("click",function(){return Te.close()}),E._UZ(64,"ion-icon",22),E._uU(65," Close "),E.qZA()()()()),2>&&(E.xp6(3),E.hij(" ",E.lcZ(4,31,"ocm.general.settings")," "),E.xp6(7),E.Q6J("ngIf",1==Te.searchSettings.HasActiveFilters),E.xp6(2),E.Q6J("ngIf",Te.isCountryFilterFeatureEnabled),E.xp6(1),E.Q6J("operatorList",Te.searchSettings.OperatorList)("useFilteredOperators",!1),E.xp6(2),E.Q6J("label",E.lcZ(16,33,"ocm.search.usageTypes"))("ngModel",Te.searchSettings.UsageTypeList),E.xp6(2),E.Q6J("ngForOf",Te.usageTypes),E.xp6(2),E.Q6J("label",E.lcZ(20,35,"ocm.search.operationalStatusTypes"))("ngModel",Te.searchSettings.StatusTypeList),E.xp6(2),E.Q6J("ngForOf",Te.statusTypes),E.xp6(2),E.Q6J("label",E.lcZ(24,37,"ocm.search.connectionTypes"))("ngModel",Te.searchSettings.ConnectionTypeList),E.xp6(2),E.Q6J("ngForOf",Te.connectionTypes),E.xp6(2),E.Q6J("ngModel",Te.powerRange)("ticks",!0)("snaps",!0)("min",Te.powerRange.lower)("max",Te.powerRange.upper),E.xp6(8),E.Q6J("ngModel",Te.powerRange.lower)("max",Te.powerRange.upper),E.xp6(4),E.Q6J("ngModel",Te.powerRange.upper)("max",Te.maxPower)("min",Te.powerRange.lower),E.xp6(4),E.Q6J("ngModel",Te.searchSettings.Language),E.xp6(1),E.Q6J("ngForOf",Te.languages),E.xp6(2),E.Q6J("label",E.lcZ(47,39,"ocm.details.location.map"))("ngModel",Te.searchSettings.MapType),E.xp6(7),E.Q6J("ngModel",Te.searchSettings.EnableAdvancedEditorFeatures),E.xp6(3),E.Q6J("ngModel",Te.searchSettings.EnablePOIPendingApproval),E.xp6(3),E.Q6J("ngModel",Te.searchSettings.MaxResults))},dependencies:[he.sg,he.O5,_e.Fj,_e.wV,_e.JJ,_e.qQ,_e.Fd,_e.On,Ne.YG,Ne.Sm,Ne.W2,Ne.fr,Ne.Gu,Ne.gu,Ne.pK,Ne.Ie,Ne.Q$,Ne.q_,Ne.uN,Ne.I_,Ne.t9,Ne.n0,Ne.wd,Ne.ho,Ne.sr,Ne.w,Ne.as,Ne.QI,Ne.yf,Ne.Uj,ee.z,ae.X$,oe],encapsulation:2})),Le})()},9472:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{SignInModule:()=>me});var x=k(1180),h=k(8767),y=k(5086),s=k(3999),J=k(6814),ie=k(6223),Y=k(9843),E=k(6800),Ne=k(2029);let me=(()=>{var he;class _e{}return he=_e,(0,x.Z)(_e,"\u0275fac",function(ae){return new(ae||he)}),(0,x.Z)(_e,"\u0275mod",Ne.oAB({type:he})),(0,x.Z)(_e,"\u0275inj",Ne.cJS({imports:[J.ez,ie.u5,Y.Pc,s.aw,y.e,E.Bz.forChild([{path:"",component:h.F}])]})),_e})()},8767:(Nn,yt,k)=>{"use strict";k.d(yt,{F:()=>he});var x=k(5861),h=k(1180),y=k(9127),s=k(6470),J=k(2029),ie=k(9843),Y=k(3999),E=k(6800),Ne=k(6814),me=k(6223);let he=(()=>{var _e;class ee{constructor(oe,Be,Ie,Ee,Ue,et,le,ue){(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"translate",void 0),(0,h.Z)(this,"alertController",void 0),(0,h.Z)(this,"loadingController",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"router",void 0),(0,h.Z)(this,"location",void 0),(0,h.Z)(this,"email",void 0),(0,h.Z)(this,"password",void 0),this.appManager=oe,this.modalController=Be,this.translate=Ie,this.alertController=Ee,this.loadingController=Ue,this.logging=et,this.router=le,this.location=ue,this.email=""}cancelSignIn(){this.modalController.dismiss()}performSignIn(){var oe=this;return(0,x.Z)(function*(){const Be=yield oe.loadingController.create({message:"Signing In.."});yield Be.present();let Ie=!1;try{yield oe.appManager.api.performSignIn(oe.email,oe.password),Be.dismiss(),localStorage.setItem("authResponse",JSON.stringify(oe.appManager.api.authResponse)),oe.appManager.isUserAuthenticated(!0),oe.modalController.dismiss(),oe.appManager.analytics.appEvent("Profile","SignedIn")}catch(Ee){Ie=!0,Be.dismiss(),yield(yield oe.alertController.create({header:"Open Charge Map",subHeader:"Email or Password not recognised",buttons:["Ok"]})).present(),oe.logging.log("Error logging in:"+Ee)}})()}}return _e=ee,(0,h.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)(J.Y36(s.c),J.Y36(ie.IN),J.Y36(Y.sK),J.Y36(ie.Br),J.Y36(ie.HT),J.Y36(y.z),J.Y36(E.F0),J.Y36(Ne.Ye))}),(0,h.Z)(ee,"\u0275cmp",J.Xpm({type:_e,selectors:[["ng-component"]],decls:37,vars:8,consts:[[1,"signin-page","ion-padding"],["item-left",""],["src","assets/images/icons/branding/AppIcon_128x128.png"],[1,"ion-padding"],["position","floating"],["type","text",3,"ngModel","ngModelChange"],["type","password",3,"ngModel","ngModelChange"],[3,"click"],["slot","secondary"],["name","close","slot","start"],["slot","primary"],["type","submit","color","primary",3,"click"],["name","log-in","slot","start"]],template:function(oe,Be){1&oe&&(J.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),J._uU(3),J.ALo(4,"translate"),J.qZA()()(),J.TgZ(5,"ion-content",0)(6,"ion-avatar",1),J._UZ(7,"img",2),J.qZA(),J.TgZ(8,"p",3),J._uU(9," Sign in using your Open Charge Map account. "),J.qZA(),J.TgZ(10,"ion-list")(11,"ion-item")(12,"ion-label",4),J._uU(13,"Email"),J.qZA(),J.TgZ(14,"ion-input",5),J.NdJ("ngModelChange",function(Ee){return Be.email=Ee}),J.qZA()(),J.TgZ(15,"ion-item")(16,"ion-label",4),J._uU(17,"Password"),J.qZA(),J.TgZ(18,"ion-input",6),J.NdJ("ngModelChange",function(Ee){return Be.password=Ee}),J.qZA()()(),J.TgZ(19,"p"),J._uU(20,"or "),J.TgZ(21,"a",7),J.NdJ("click",function(){return Be.appManager.launchWebPage("https://openchargemap.org/site/loginprovider/register")}),J._uU(22,"Register as New User"),J.qZA(),J._uU(23," or "),J.TgZ(24,"a",7),J.NdJ("click",function(){return Be.appManager.launchWebPage("https://openchargemap.org/site/loginprovider/passwordreset")}),J._uU(25,"Reset your password"),J.qZA()()(),J.TgZ(26,"ion-footer")(27,"ion-toolbar")(28,"ion-buttons",8)(29,"ion-button",7),J.NdJ("click",function(){return Be.cancelSignIn()}),J._UZ(30,"ion-icon",9),J._uU(31," Cancel"),J.qZA()(),J.TgZ(32,"ion-buttons",10)(33,"ion-button",11),J.NdJ("click",function(){return Be.performSignIn()}),J._UZ(34,"ion-icon",12),J._uU(35),J.ALo(36,"translate"),J.qZA()()()()),2&oe&&(J.xp6(3),J.hij(" ",J.lcZ(4,4,"ocm.general.signIn")," "),J.xp6(11),J.Q6J("ngModel",Be.email),J.xp6(4),J.Q6J("ngModel",Be.password),J.xp6(17),J.hij(" ",J.lcZ(36,6,"ocm.general.signIn"),""))},dependencies:[me.JJ,me.On,ie.BJ,ie.YG,ie.Sm,ie.W2,ie.fr,ie.Gu,ie.gu,ie.pK,ie.Ie,ie.Q$,ie.q_,ie.wd,ie.sr,ie.j9,Y.X$],encapsulation:2})),ee})()},439:(Nn,yt,k)=>{"use strict";k.d(yt,{l:()=>Ne});var x=k(5861),h=k(1180),y=k(9127),s=k(9159),J=k(7518),ie=k(9862),Y=k(553),E=k(2029);let Ne=(()=>{var me;class he{constructor(ee,ae,oe){(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"refData",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"serviceBase","https://api.openchargemap.io"),(0,h.Z)(this,"serviceBaseURL",this.serviceBase+"/v3"),(0,h.Z)(this,"hasAuthorizationError",!1),(0,h.Z)(this,"ATTRIBUTION_METADATAFIELDID",4),(0,h.Z)(this,"authResponse",void 0),(0,h.Z)(this,"clientName","ocm.api.default"),(0,h.Z)(this,"authorizationErrorCallback",void 0),(0,h.Z)(this,"generalErrorCallback",void 0),(0,h.Z)(this,"allowMirror",!1),(0,h.Z)(this,"lastPOIApiCallURL",""),this.http=ee,this.refData=ae,this.logging=oe,this.serviceBaseURL=Y.N.apiBase+"/v3"}getNumberListString(ee){let ae="";for(let oe=0;oe0&&(Be+="&connectiontypeid="+ae.getNumberListString(ee.connectionTypeIdList)),null!=ee.operatorIdList&&ee.operatorIdList.length>0&&(Be+="&operatorid="+ae.getNumberListString(ee.operatorIdList)),null!=ee.usageTypeIdList&&ee.usageTypeIdList.length>0&&(Be+="&usagetypeid="+ae.getNumberListString(ee.usageTypeIdList)),null!=ee.statusTypeIdList&&ee.statusTypeIdList.length>0&&(Be+="&statustypeid="+ae.getNumberListString(ee.statusTypeIdList)),null!=ee.locationTitle&&(Be+="&locationtitle="+ee.locationTitle),null!=ee.minPowerKW&&ee.minPowerKW>0&&(Be+="&minpowerkw="+ee.minPowerKW),null!=ee.maxPowerKW&&ee.maxPowerKW>0&&(Be+="&maxpowerkw="+ee.maxPowerKW),null!=ee.submissionStatusTypeIdList&&(Be+="&submissionstatustypeid="+ae.getNumberListString(ee.submissionStatusTypeIdList)),null!=ee.poiIdList&&ee.poiIdList.length>0&&(Be+="&chargepointid="+ae.getNumberListString(ee.poiIdList)),0==ee.enableCaching&&(Be+="&enablecaching=false"),null!=ee.compact&&(Be+="&compact="+ee.compact),ee.levelOfDetail>1&&(Be+="&levelofdetail="+ee.levelOfDetail),null!=ee.polyline&&(Be+="&polyline="+ee.polyline),null!=ee.boundingbox&&(Be+="&boundingbox="+ee.boundingbox),null!=ee.additionalParams&&(Be+="&"+ee.additionalParams);const Ie=oe+Be;if(ae.lastPOIApiCallURL===Ie&&0!=ee.enableCaching)return ae.logging.log("Skipped API call due to same query being repeated."),[];ae.lastPOIApiCallURL=Ie,ae.logging.log("API Call:"+Ie,y.i.VERBOSE);try{let Ee=yield ae.http.get(Ie,ae.getHttpRequestOptions()).toPromise();return ae.refData.hydrateCompactPOIList(Ee)}catch(Ee){const Ue=Ee.message||"Could not fetch POI list from server.";throw ae.logging.log("API Client: "+JSON.stringify(Ee),y.i.ERROR),Ue}})()}getHttpRequestOptions(ee=!0){let ae=new ie.WM;return ee&&(ae=ae.append("Content-Type","application/json")),this.authResponse&&this.authResponse.Data&&this.authResponse.Data.access_token&&(ae=ae.append("Authorization","Bearer "+this.authResponse.Data.access_token)),ae=ae.append("X-API-Key",Y.N.apiKey),{headers:ae}}fetchCoreReferenceData(ee){let ae=this.serviceBaseURL+"/referencedata/?client="+this.clientName+"&output=json"+(this.allowMirror?"&allowmirror=true":"")+"&verbose=false&compact=true";return null!=ee&&null!=ee.CountryIds&&(ae+="&countryid="+this.getNumberListString(ee.CountryIds)),this.logging.log("API Call:"+ae,y.i.VERBOSE),this.http.get(ae,this.getHttpRequestOptions())}performSignIn(ee,ae){return this.http.post(this.serviceBaseURL+"/profile/authenticate/",JSON.stringify({emailaddress:ee,password:ae}),this.getHttpRequestOptions()).toPromise().then(Ie=>(this.authResponse=Ie,this.authResponse))}performSubmission(ee,ae){return ee===J.qO.POI?this.submitPOI(ae):ee===J.qO.Comment?this.submitUserComment(ae):ee===J.qO.Media?this.submitMediaItem(ae):void 0}submitUserComment(ee){const ae=JSON.stringify(ee);return this.logging.log("[api] Submitting user comment"),this.http.post(this.serviceBaseURL+"/comment/",ae,this.getHttpRequestOptions()).toPromise()}submitMediaItem(ee){const ae=JSON.stringify(ee);return this.http.post(this.serviceBaseURL+"/mediaitem/",ae,this.getHttpRequestOptions()).toPromise()}submitPOI(ee){const ae=JSON.stringify(ee);return this.http.post(this.serviceBaseURL+"/poi/",ae,this.getHttpRequestOptions()).toPromise()}getPanoramioLocationPhotos(ee){return new Promise(ae=>{const Be="https://www.panoramio.com/map/get_panoramas.php?set=public&from=0&to=2&minx="+(ee.longitude-.001)+"&miny="+(ee.latitude-.001)+"&maxx="+(ee.longitude+.001)+"maxy="+(ee.latitude+.001)+"&size=medium&mapfilter=true&callback=?";return console.log(Be),this.http.get(Be).toPromise()})}fetchReverseGeocodeResult(ee,ae){return this.http.get(this.serviceBaseURL+"/geocode/?client="+this.clientName+"&output=json&camelcase=false&latitude="+ee+"&longitude="+ae,this.getHttpRequestOptions()).toPromise()}isLocalStorageAvailable(){return typeof window.localStorage<"u"}setCachedDataObject(ee,ae){this.isLocalStorageAvailable()&&(typeof ae>"u"&&(ae=null),null===ae?localStorage.removeItem(ee):localStorage.setItem(ee,JSON.stringify(ae)))}getCachedDataObject(ee){if(this.isLocalStorageAvailable()){const ae=localStorage.getItem(ee);if(null!=ae&&ae.length>0)return JSON.parse(ae)}return null}}return me=he,(0,h.Z)(he,"\u0275fac",function(ee){return new(ee||me)(E.LFG(ie.eN),E.LFG(s.W),E.LFG(y.z))}),(0,h.Z)(he,"\u0275prov",E.Yz7({token:me,factory:me.\u0275fac,providedIn:"root"})),he})()},3294:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>ie});var x=k(5861),h=k(1180),y=k(9127),s=k(2029),J=k(9843);let ie=(()=>{var Y;class E{constructor(me,he){(0,h.Z)(this,"logger",void 0),(0,h.Z)(this,"platform",void 0),(0,h.Z)(this,"isCordova",!1),(0,h.Z)(this,"ga",null),this.logger=me,this.platform=he,this.isCordova=!(!he.is("cordova")&&!he.is("capacitor"))}init(me){var he=this;return(0,x.Z)(function*(){he.isCordova&&he.ga?yield he.ga.startTrackerWithId(me):he.logger.log("Could not initialise analytics")})()}setAppVersion(me){var he=this;return(0,x.Z)(function*(){if(he.isCordova&&he.ga)return he.ga.setAppVersion(me);he.logger.log(me)})()}appEvent(me,he){var _e=this;return(0,x.Z)(function*(){if(_e.isCordova&&_e.ga)return _e.ga.trackEvent(me,he);_e.logger.log(he)})()}viewEvent(me){var he=this;return(0,x.Z)(function*(){if(he.isCordova&&he.ga)return he.ga.trackView(me);he.logger.log(me)})()}}return Y=E,(0,h.Z)(E,"\u0275fac",function(me){return new(me||Y)(s.LFG(y.z),s.LFG(J.t4))}),(0,h.Z)(E,"\u0275prov",s.Yz7({token:Y,factory:Y.\u0275fac,providedIn:"root"})),E})()},6470:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>Ie});var x=k(5861),h=k(1180),y=k(9127),s=k(439),J=k(7518),ie=k(2029),Y=k(5957);let E=(()=>{var Ee;class Ue{constructor(le){(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"isQueueProcessing",void 0),(0,h.Z)(this,"appManager",void 0),this.events=le,this.isQueueProcessing=!1}setAppManager(le){this.appManager=le}add(le,ue){let ct=this.getQueueItems();ct.push(new J.aX(le,ue)),this.saveQueueItems(ct)}update(le){let ue=this.getQueueItems(),ct=new Array;return ue.forEach(ht=>{ct.push(ht.ID==le.ID?le:ht)}),ct}processNextQueueItem(){let le=this.getNextQueueItem();null!=le&&null!=this.appManager&&this.appManager.api.performSubmission(le.SubmissionType,le.Data).then(()=>{le.IsSubmitted=!0,le.Attempts++,this.update(le),this.clear()})}getNextQueueItem(){let le=this.getQueueItems(),ue=null;return le.forEach(ct=>{null==ue&&!ct.IsCancelled&&!ct.IsInProgress&&!ct.IsSubmitted&&(ue=ct)}),ue}hasPendingItems(){let le=!1;return this.getQueueItems().forEach(ct=>{!ct.IsFailure&&!ct.IsCancelled&&!ct.IsSubmitted&&(le=!0)}),le}isCompleted(){let le=this.getQueueItems(),ue=!0;return le.forEach(ct=>{(ct.IsInProgress||ct.IsFailure)&&(ue=!1)}),ue}clear(le=!1){let ue=this.getQueueItems(),ct=new Array;le||ue.forEach(ht=>{(ht.IsInProgress||ht.IsFailure)&&ct.push(ht)}),this.saveQueueItems(ct)}saveQueueItems(le){localStorage.setItem("submissionQueue",JSON.stringify(le))}getQueueItems(){let le=localStorage.getItem("submissionQueue");return null!=le?JSON.parse(le):new Array}}return Ee=Ue,(0,h.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ie.LFG(Y.z))}),(0,h.Z)(Ue,"\u0275prov",ie.Yz7({token:Ee,factory:Ee.\u0275fac,providedIn:"root"})),Ue})();var Ne=k(9159),me=k(989),he=k(3294),_e=k(553),ee=k(9862),ae=k(9843),oe=k(3999),Be=k(6091);let Ie=(()=>{var Ee;class Ue{constructor(le,ue,ct,ht,Le,ye,gt,Te,Pe,Ae,Ye,_t,hn){(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"api",void 0),(0,h.Z)(this,"submissionQueue",void 0),(0,h.Z)(this,"platform",void 0),(0,h.Z)(this,"referenceDataManager",void 0),(0,h.Z)(this,"journeyManager",void 0),(0,h.Z)(this,"translateService",void 0),(0,h.Z)(this,"toastController",void 0),(0,h.Z)(this,"loadingController",void 0),(0,h.Z)(this,"jwtHelper",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"analytics",void 0),(0,h.Z)(this,"enableSubmissionQueue",void 0),(0,h.Z)(this,"searchSettings",void 0),(0,h.Z)(this,"platformMode",void 0),(0,h.Z)(this,"journeys",void 0),(0,h.Z)(this,"isDebugMode",void 0),(0,h.Z)(this,"clientWidth",void 0),(0,h.Z)(this,"clientHeight",void 0),(0,h.Z)(this,"isRequestInProgress",!1),(0,h.Z)(this,"title","Open Charge Map"),(0,h.Z)(this,"_isUserAuthenticated",null),(0,h.Z)(this,"isEmbeddedMode",!1),(0,h.Z)(this,"isOffline",!1),this.http=le,this.events=ue,this.api=ct,this.submissionQueue=ht,this.platform=Le,this.referenceDataManager=ye,this.journeyManager=gt,this.translateService=Te,this.toastController=Pe,this.loadingController=Ae,this.jwtHelper=Ye,this.logging=_t,this.analytics=hn,this.api.clientName="ocm.app.ionic."+_e.N.version,this.isDebugMode=!1,this.enableSubmissionQueue=!1,this.submissionQueue.setAppManager(this),this.platformMode=Le.is("cordova")?"cordova":"web",this.initAppManager(),this.searchSettings=new J.Nm,this.loadSearchSettings(),this.applyURLQueryStringOptions(),this.searchSettings.CheckForActiveFilters(),this.journeyManager.loadJourneys()}loadSearchSettings(){if(null!=localStorage.getItem("searchSettings")){this.searchSettings=new J.Nm;try{let le=JSON.parse(localStorage.getItem("searchSettings"));Object.assign(this.searchSettings,le)}catch{}}}savePushRegistration(le){localStorage.setItem("_pushToken",le.toString())}getPushRegistration(){localStorage.getItem("_pushToken")}getQueryVariable(le){let ct=window.location.search.substring(1).split("&");for(let ht=0;htdecodeURIComponent(Te))}return null}applyURLQueryStringOptions(){if(this.getQueryVariable("mode")&&"embedded"==this.getQueryVariable("mode")[0]&&(this.isEmbeddedMode=!0),this.getQueryVariable("operatorid")){let le=this.getQueryVariable("operatorid");for(let ue of le)this.searchSettings.OperatorList.unshift(parseInt(ue,10))}if(this.getQueryVariable("latitude")&&this.getQueryVariable("longitude")){let le=this.getQueryVariable("latitude")[0],ue=this.getQueryVariable("longitude")[0];this.searchSettings.StartSearchPosition=new J.wC(parseFloat(le),parseFloat(ue))}this.getQueryVariable("title")&&(this.title=this.getQueryVariable("title")[0]),this.getQueryVariable("languagecode")&&this.setLanguage(this.getQueryVariable("languagecode")[0]),this.getQueryVariable("id")&&(this.searchSettings.StartViewPoiId=this.getQueryVariable("id")[0])}saveSearchSettings(){this.searchSettings.CheckForActiveFilters(),localStorage.setItem("searchSettings",JSON.stringify(this.searchSettings))}getLanguages(){return[{code:"ar",title:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 / Arabic"},{code:"bg",title:"Bulgarian / \u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"},{code:"cs",title:"Czech / \u010ce\u0161tina"},{code:"de",title:"German / Deutsch"},{code:"el",title:"Greek / \u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae"},{code:"en",title:"English"},{code:"es",title:"Spanish / Espa\xf1ol"},{code:"et",title:"Estonian / Eesti"},{code:"fi",title:"Finnish / Suomi"},{code:"fr",title:"French / Fran\xe7ais"},{code:"fy",title:"West Frisian / Frysk"},{code:"hu",title:"Hungarian / Magyar"},{code:"it",title:"Italian / Italiano"},{code:"ja",title:"Japanese / \u65e5\u672c\u8a9e"},{code:"lt",title:"Lithuanian / Lietuvi\u0173"},{code:"nl",title:"Dutch / Nederlands"},{code:"pt",title:"Portuguese / portugu\xeas"},{code:"ro",title:"Romanian / Rom\xe2n\u0103"},{code:"ru",title:"Russian / P\u0443\u0441\u0441\u043a\u0438\u0439"},{code:"sk",title:"Slovak / Sloven\u010dina"},{code:"tr",title:"Turkish / T\xfcrk\xe7e"},{code:"zh",title:"Chinese / \u4e2d\u56fd\u7684"}]}setLanguage(le){(null==le||""==le)&&(le="en"),this.logging.log("Changing language: "+le),this.translateService.use(le)}initAppManager(){this.initAuthFromStorage(),this.isUserAuthenticated(!0)&&this.enableSubmissionQueue&&null!=this.submissionQueue&&this.submissionQueue.hasPendingItems()&&this.submissionQueue.processNextQueueItem()}initAuthFromStorage(){let le=localStorage.getItem("authResponse");if(null!=le){let ue=JSON.parse(le);null!=ue.Data&&null!=ue.Data.access_token&&(this.jwtHelper.decodeToken(ue.Data.access_token),this.jwtHelper.isTokenExpired(ue.Data.access_token)?localStorage.removeItem("authResponse"):(this.api.authResponse=ue,this.logging.log("User has valid auth token in local storage",y.i.VERBOSE)))}}isUserAuthenticated(le=!1){return!1===le&&null!=this._isUserAuthenticated||(this._isUserAuthenticated=!1,null!=this.api.authResponse&&(this.jwtHelper.isTokenExpired(this.api.authResponse.Data.access_token)||(this._isUserAuthenticated=!0))),this._isUserAuthenticated}getCurrentAuthToken(){return null!=this.api.authResponse?this.api.authResponse.Data.access_token:null}getUserProfile(){return null!=this.api.authResponse?this.api.authResponse.Data.UserProfile:null}signOutCurrentUser(){localStorage.removeItem("authResponse"),this.api.authResponse=null,this._isUserAuthenticated=!1}submitComment(le){if(!this.enableSubmissionQueue)return this.api.performSubmission(J.qO.Comment,le);this.submissionQueue.add(J.qO.Comment,le),this.submissionQueue.processNextQueueItem()}submitMediaItem(le){if(!this.enableSubmissionQueue)return this.api.performSubmission(J.qO.Media,le);this.submissionQueue.add(J.qO.Media,le),this.submissionQueue.processNextQueueItem()}submitPOI(le){if(!this.enableSubmissionQueue)return this.api.performSubmission(J.qO.POI,le);this.submissionQueue.add(J.qO.POI,le),this.submissionQueue.processNextQueueItem()}showToastNotification(le){var ue=this;return(0,x.Z)(function*(){yield(yield ue.toastController.create({message:le,duration:3e3})).present()})()}showLoadingProgress(le){var ue=this;return(0,x.Z)(function*(){yield(yield ue.loadingController.create({message:le})).present()})()}dismissLoadingProgress(){var le=this;return(0,x.Z)(function*(){return le.loadingController.dismiss()})()}launchOCMWebPage(le){this.isUserAuthenticated(!0)&&(-1===le.indexOf("?")&&(le+="?"),le+="&auth="+this.getCurrentAuthToken()),le="https://openchargemap.org/site"+le,window.open(le,"_system")}launchWebPage(le){window.open(le,"_system")}isPlatform(le){return this.platform.is(le)}}return Ee=Ue,(0,h.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ie.LFG(ee.eN),ie.LFG(Y.z),ie.LFG(s.l),ie.LFG(E),ie.LFG(ae.t4),ie.LFG(Ne.W),ie.LFG(me.i),ie.LFG(oe.sK),ie.LFG(ae.yF),ie.LFG(ae.HT),ie.LFG(Be.N0),ie.LFG(y.z),ie.LFG(he.c))}),(0,h.Z)(Ue,"\u0275prov",ie.Yz7({token:Ee,factory:Ee.\u0275fac,providedIn:"root"})),Ue})()},5957:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>y});var x=k(1180),h=k(2029);let y=(()=>{var s;class J{constructor(){(0,x.Z)(this,"c",new Map)}subscribe(Y,...E){let Ne=this.c.get(Y);Ne||this.c.set(Y,Ne=[]),Ne.push(...E)}unsubscribe(Y,E){if(!E)return this.c.delete(Y);const Ne=this.c.get(Y);if(!Ne)return!1;const me=Ne.indexOf(E);return!(me<0||(Ne.splice(me,1),0===Ne.length&&this.c.delete(Y),0))}publish(Y,...E){const Ne=this.c.get(Y);return Ne?Ne.map(me=>{try{return me(...E)}catch(he){return console.error(he),null}}):null}}return s=J,(0,x.Z)(J,"\u0275fac",function(Y){return new(Y||s)}),(0,x.Z)(J,"\u0275prov",h.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})),J})()},989:(Nn,yt,k)=>{"use strict";k.d(yt,{i:()=>Y});var x=k(1180),h=k(9127),y=k(439),s=k(4669),J=k(7518),ie=k(2029);let Y=(()=>{var E;class Ne{constructor(he,_e,ee){(0,x.Z)(this,"api",void 0),(0,x.Z)(this,"poiManager",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"journeys",void 0),(0,x.Z)(this,"favourites",void 0),(0,x.Z)(this,"routePolyline",void 0),this.api=he,this.poiManager=_e,this.logging=ee,this.journeys=[],this.favourites=[]}loadJourneys(){let he=localStorage.getItem("journeys");if(null!=he&&(this.journeys=JSON.parse(he)),null!=this.journeys)for(let _e of this.journeys)this.fetchAllJourneyPOIDetails(_e)}fetchAllJourneyPOIDetails(he){this.logging.log("Journeys - fetching poi details for Journey "+he.Title);let _e=new J.be;_e.poiIdList=[];for(let ee of he.Stages)for(let ae of ee.WayPoints)for(let oe of ae.PoiIDs)_e.poiIdList.push(oe);this.api.fetchPOIListByParam(_e).then(ee=>{for(let ae of ee)this.updateStoredPOI(ae)})}updateStoredPOI(he){if(this.journeys.forEach(_e=>{_e.Stages.forEach(ee=>{ee.WayPoints.forEach(ae=>{ae.PoiIDs.forEach(oe=>{if(oe==he.ID)if(null==ae.PoiList){ae.PoiList=[];let Be=new J.Qp("charging",1);Be.Poi=he,Be.PoiID=he.ID,ae.PoiList.push(Be)}else for(let Be of ae.PoiList)Be.PoiID==he.ID&&(Be.Poi=he)})})})}),null!=this.favourites)for(let _e of this.favourites)"charging"==_e.Type&&_e.PoiID==he.ID&&(_e.Poi=he)}saveJourneys(){let he=JSON.parse(JSON.stringify(this.journeys));for(let ee of he)for(const ae of ee.Stages)for(let oe of ae.WayPoints)for(let Be of oe.PoiList)Be.Poi=null,Be.Photos=null;const _e=JSON.stringify(he);localStorage.setItem("journeys",_e)}addJourney(he,_e){let ee=new J.vw;ee.Title="Stage 1",null!=_e&&ee.WayPoints.push(_e),he.Stages.push(ee),this.journeys.push(he)}deleteJourney(he){this.journeys=this.journeys.filter(_e=>_e.ID!=he),this.saveJourneys()}getJourney(he){let _e=this.journeys.filter(ee=>ee.ID==he);return _e.length>0?_e[0]:null}getJourneyStages(he){return this.getJourney(he).Stages}addJourneyWaypoint(he,_e,ee){let ae=this.getJourney(he);if(null==_e){let oe=new J.vw;oe.Title="Stage "+(ae.Stages.length+1),oe.WayPoints.push(ee),ae.Stages.push(oe)}else{let oe=ae.Stages[_e];null==oe.WayPoints&&(oe.WayPoints=[]),oe.WayPoints.push(ee)}}addJourneyStage(he,_e){return this.getJourney(he).Stages.push(_e)-1}setupTestJourneys(){this.journeys=[];let he=new J.fw;he.Title="New York to Brooklyn",he.Notes="A little jaunt to Brooklyn",he.Stages=[];let _e=new J.vw,ee=new J.kA;ee.Notes="Starting point",ee.Position=new J.wC(40,1.2),ee.Title="Start",_e.WayPoints.push(ee);let ae=new J.kA;ae.Notes="Middle point",ae.Position=new J.wC(40,1.33),ae.Title="Middle",_e.WayPoints.push(ae);let oe=new J.kA;oe.Notes="End point",oe.Position=new J.wC(40,1.33),oe.Title="End",_e.WayPoints.push(oe),he.Stages.push(_e),this.journeys.push(he);let Be=new J.fw;Be.Title="Aberdeen to London",Be.Notes="Roadtrip",Be.Stages=[],this.journeys.push(Be)}calculateEnergyConsumptionkWh(he,_e,ee=0,ae){return he*ae}setRoutePolyline(he){this.routePolyline=he}getRoutePolyline(){return this.routePolyline}}return E=Ne,(0,x.Z)(Ne,"\u0275fac",function(he){return new(he||E)(ie.LFG(y.l),ie.LFG(s.R),ie.LFG(h.z))}),(0,x.Z)(Ne,"\u0275prov",ie.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"})),Ne})()},9127:(Nn,yt,k)=>{"use strict";k.d(yt,{i:()=>s,z:()=>J});var x=k(1180),h=k(553),y=k(2029),s=function(ie){return ie[ie.VERBOSE=0]="VERBOSE",ie[ie.INFO=1]="INFO",ie[ie.WARNING=2]="WARNING",ie[ie.ERROR=3]="ERROR",ie}(s||{});let J=(()=>{var ie;class Y{constructor(){(0,x.Z)(this,"logLevel",void 0),this.logLevel=s.VERBOSE,h.N.production&&(this.logLevel=s.INFO)}log(Ne,me=s.VERBOSE){console&&console.log&&me>=this.logLevel&&console.log("["+s[me]+"] {"+(new Date).toLocaleTimeString()+"} "+Ne)}}return ie=Y,(0,x.Z)(Y,"\u0275fac",function(Ne){return new(Ne||ie)}),(0,x.Z)(Y,"\u0275prov",y.Yz7({token:ie,factory:ie.\u0275fac,providedIn:"root"})),Y})()},4669:(Nn,yt,k)=>{"use strict";k.d(yt,{R:()=>E});var x=k(5861),h=k(1180),y=k(9127),s=k(439),J=k(3294),ie=k(2029),Y=k(5957);let E=(()=>{var Ne;class me{constructor(_e,ee,ae,oe){(0,h.Z)(this,"api",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"analytics",void 0),(0,h.Z)(this,"poiList",void 0),(0,h.Z)(this,"isRequestInProgress",!1),this.api=_e,this.events=ee,this.logging=ae,this.analytics=oe}refreshPOIList(_e){var ee=this;return(0,x.Z)(function*(){try{return ee.poiList=yield ee.fetchPOIList(_e),ee.events.publish("ocm:poiList:updated"),ee.analytics.appEvent("Search","Fetched Results"),ee.poiList.length}catch{return 0}})()}fetchPOIList(_e){var ee=this;return(0,x.Z)(function*(){ee.isRequestInProgress=!0;try{let ae=yield ee.api.fetchPOIListByParam(_e);return ee.isRequestInProgress=!1,ae&&ae.length&&ee.logging.log("fetched POI list ["+ae.length+"]"),ae}catch{return ee.isRequestInProgress=!1,[]}})()}clearResults(){this.poiList=[],this.events.publish("ocm:poiList:cleared"),this.logging.log("clearing results after settings change",y.i.VERBOSE)}getPOIById(_e,ee=!1,ae=!1){var oe=this;return(0,x.Z)(function*(){if(!ae&&null!=oe.poiList){const Ee=oe.poiList.find(Ue=>Ue.ID==_e);if(Ee)return Ee}const Be={poiIdList:[_e],enableCaching:!ae,includeComments:!0},Ie=yield oe.api.fetchPOIListByParam(Be);return Ie&&Ie.length>0?(oe.poiList&&Ie[0].ID==_e&&(oe.poiList=oe.poiList.filter(Ee=>Ee.ID!=_e),oe.poiList.push(Ie[0]),oe.logging.log("POI refreshed in cache "+_e)),Ie[0]):null})()}}return Ne=me,(0,h.Z)(me,"\u0275fac",function(_e){return new(_e||Ne)(ie.LFG(s.l),ie.LFG(Y.z),ie.LFG(y.z),ie.LFG(J.c))}),(0,h.Z)(me,"\u0275prov",ie.Yz7({token:Ne,factory:Ne.\u0275fac,providedIn:"root"})),me})()},9159:(Nn,yt,k)=>{"use strict";k.d(yt,{W:()=>ie});var x=k(5861),h=k(1180),y=k(9127),s=k(2029),J=k(9862);let ie=(()=>{var Y;class E{constructor(me,he){(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"referenceData",void 0),(0,h.Z)(this,"filteredReferenceData",void 0),this.http=me,this.logging=he,this.loadCachedRefData()}refreshReferenceData(me){var he=this;return(0,x.Z)(function*(){try{const _e=yield me.fetchCoreReferenceData(null).toPromise();return he.setCoreReferenceData(_e),he.setFilteredReferenceData(_e),he.logging.log("Got refreshed core ref data.",y.i.VERBOSE),he.sortCoreReferenceData(),he.cacheCurrentRefData(),!0}catch(_e){return he.logging.log("Error fetching core ref data:"+_e),!1}})()}refreshFilteredReferenceData(me,he){me.fetchCoreReferenceData(he).subscribe(_e=>{this.setFilteredReferenceData(_e),this.sortCoreReferenceData(),this.logging.log("Got refreshed filtered reference data.",y.i.VERBOSE)},_e=>{this.logging.log("Error fetching filtered reference data:"+_e)})}setCoreReferenceData(me){this.referenceData=me}setFilteredReferenceData(me){this.filteredReferenceData=me}referenceDataLoaded(){return null!=this.referenceData}getCountries(me=!1){return 1==me?this.filteredReferenceData.Countries:this.referenceData.Countries}getCountryByID(me){return this.getRefDataByID(this.referenceData.Countries,me)}getConnectionTypes(me=!1){return 1==me?this.filteredReferenceData.ConnectionTypes:this.referenceData.ConnectionTypes}getConnectionTypeByID(me){return this.getRefDataByID(this.referenceData.ConnectionTypes,me)}getUsageTypes(me=!1){return 1==me?this.filteredReferenceData.UsageTypes:this.referenceData.UsageTypes.filter(he=>he.ID>0)}getUsageTypeByID(me){return this.getRefDataByID(this.referenceData.UsageTypes,me)}getStatusTypes(me=!1){return 1==me?this.filteredReferenceData.StatusTypes:this.referenceData.StatusTypes.filter(he=>he.ID>0)}getStatusTypeByID(me){return this.getRefDataByID(this.referenceData.StatusTypes,me)}getNetworkOperators(me=!1){return 1==me?this.filteredReferenceData.Operators:this.referenceData.Operators}getNetworkOperatorByID(me){return this.getRefDataByID(this.referenceData.Operators,me)}getDataProviders(me=!1){return 1==me?this.filteredReferenceData.DataProviders:this.referenceData.DataProviders}getDataProviderByID(me){return this.getRefDataByID(this.referenceData.DataProviders,me)}getCheckinStatusTypes(me=!1,he=!0){let _e=null;return _e=1==me?this.filteredReferenceData.CheckinStatusTypes:this.referenceData.CheckinStatusTypes,he&&(_e=_e.filter(ee=>!1===ee.IsAutomatedCheckin)),_e}getCheckinStatusTypeByID(me){return this.getRefDataByID(this.referenceData.CheckinStatusTypes,me)}getCommentTypes(me=!1,he=!0){let _e;return _e=1==me?this.filteredReferenceData.UserCommentTypes:this.referenceData.UserCommentTypes,he&&(_e=_e.filter(ee=>100!==ee.ID&&110!==ee.ID)),_e}getCommentTypeByID(me){return this.getRefDataByID(this.referenceData.UserCommentTypes,me)}getSubmissionStatusTypes(me=!1){return 1==me?this.filteredReferenceData.SubmissionStatusTypes:this.referenceData.SubmissionStatusTypes}getSubmissionStatusTypesByID(me){return this.getRefDataByID(this.referenceData.SubmissionStatusTypes,me)}getChargingLevelTypes(me=!1){return 1==me?this.filteredReferenceData.ChargerTypes:this.referenceData.ChargerTypes}getChargingLevelTypeByID(me){return this.getRefDataByID(this.referenceData.ChargerTypes,me)}getOutputCurrentTypes(me=!1){return me?this.referenceData.CurrentTypes:this.filteredReferenceData.CurrentTypes}getOutputCurrentTypeByID(me){return this.getRefDataByID(this.referenceData.CurrentTypes,me)}loadCachedRefData(){const me=localStorage.getItem("referenceData");if(null==me)this.http.get("./assets/data/CoreReferenceData.json").subscribe(he=>{this.logging.log("Using bundled reference data as cached ref data."),this.setCoreReferenceData(he),this.setFilteredReferenceData(he)});else{let he=JSON.parse(me);this.setCoreReferenceData(he)}this.setFilteredReferenceData(this.referenceData)}cacheCurrentRefData(){null!=this.referenceData&&(this.referenceData.CacheDate=new Date,localStorage.setItem("referenceData",JSON.stringify(this.referenceData)))}getRefDataByID(me,he){if(""!==he&&(he=parseInt(he,10)),null!=me)for(let _e=0;_ehe.Title?1:0}getMetadataValueByMetadataFieldID(me,he){if(""!==he&&(he=parseInt(he,10)),null!=me)for(let _e=0;_e{"use strict";k.d(yt,{v:()=>Ie});var x=k(1180),h=k(9903),y=k(3955),s=k(866),J=k(9127),ie=k(5861),Y=k(5592),E=k(3052),Ne=k(553),me=k(7518);class he{constructor(Ue,et){(0,x.Z)(this,"events",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"mapAPIType",void 0),(0,x.Z)(this,"mapReady",void 0),(0,x.Z)(this,"providerError",void 0),(0,x.Z)(this,"mapCanvasID",void 0),(0,x.Z)(this,"map",void 0),(0,x.Z)(this,"markerList",void 0),(0,x.Z)(this,"polylinePath",void 0),(0,x.Z)(this,"mapkitUtils",void 0),this.events=Ue,this.logging=et,this.events=Ue,this.mapAPIType=y.b.MAPKIT_JS,this.mapReady=!1,this.markerList=new Map,this.mapkitUtils=new _e}initAPI(){mapkit&&mapkit.init({authorizationCallback:function(Ue){Ue(Ne.N.mapKitToken)}})}disposeMap(){}initMap(Ue,et,le){this.mapCanvasID=Ue;let ue=!0;if(ue=!(typeof mapkit>"u"),!ue)return this.logging.log("Call to initMap before API is ready:"+y.b[this.mapAPIType],J.i.ERROR),this.mapReady=!1,!1;this.initAPI(),null==this.map&&(document.getElementById(Ue),this.map=new mapkit.Map(Ue),this.map.annotationForCluster=function(ht){"poi"===ht.clusteringIdentifier&&(ht.title="Charging Location",ht.subtitle=ht.memberAnnotations.reduce((Le,ye)=>Le+ye.population,0))},this.mapReady=!0,mapkit.addEventListener("configuration-change",ht=>{this.events.publish("ocm:mapping:ready")}),this.map.addEventListener("scroll-end",ht=>{this.events.publish("ocm:mapping:dragend")}),this.map.addEventListener("zoom-end",ht=>{this.events.publish("ocm:mapping:zoom")}))}clearMarkers(){null!=this.markerList&&this.markerList.forEach((Ue,et)=>{try{this.map.removeAnnotation(et)}catch{}}),this.markerList=new Map}showPOIListOnMap(Ue,et){let ht=0,ye=0==this.markerList.size;if(null!=Ue){let Te=[];for(let Pe=0;Pe{const St=Fe.target.poi;this.events.publish("ocm:poi:selected",{poi:St,poiId:St.ID})}),this.markerList.set(Ae.ID,Re),Te.push(Re),ht++}}Te.length>0&&(this.map.addAnnotations(Te),ye&&this.map.showItems(Te,{animate:!0,padding:new mapkit.Padding(60,25,60,25)})),this.logging.log(ht+" new map markers added out of a total "+this.markerList.size)}}refreshMapLayout(){null!=this.map&&setTimeout(()=>{this.logging.log("MapKit: refreshMapLayout",J.i.VERBOSE)},200)}setMapCenter(Ue,et){this.map&&(this.map.setCenterAnimated(new mapkit.Coordinate(Ue.coords.latitude,Ue.coords.longitude),!1),et&&this.setMapZoom(et))}getMapCenter(){return new Y.y(et=>{if(null!=this.map){let le=this.map.center;null!=le&&(et.next(new E.jR(le.latitude,le.longitude)),et.complete())}})}setMapZoom(Ue){const et=Math.min(Ue,28),le=this.mapkitUtils.deltaFromZoomLevel(this.map,this.map.center,Math.round(et)),ue=new mapkit.CoordinateSpan(111*le.latitudeDelta,111*le.longitudeDelta),ct=new mapkit.CoordinateRegion(this.map.center,ue);this.map.setRegionAnimated(ct)}getMapZoom(){return new Y.y(et=>{this.logging.log("MapKit: getMapZoom not supported",J.i.VERBOSE),et.next(this.map._impl.zoomLevel),et.complete()})}setMapType(Ue){this.logging.log("MapKit: skipped setting Map Type :"+Ue)}getMapBounds(){return new Y.y(et=>{let le=new Array,ue=this.map.region.toBoundingRegion();le.push(new E.wC(ue.southLatitude,ue.westLongitude)),le.push(new E.wC(ue.northLatitude,ue.eastLongitude)),et.next(le),et.complete()})}moveToMapBounds(Ue){this.logging.log("MapKit: map bounds not implemented")}renderMap(Ue,et,le){return document.getElementById(this.mapCanvasID).style.height=et+"px",this.mapReady&&this.showPOIListOnMap(Ue,le),!0}renderPolyline(Ue){this.clearPolyline()}clearPolyline(){null!=this.polylinePath&&this.polylinePath.setMap(null)}focusMap(){}unfocusMap(){}placeSearch(Ue){return(0,ie.Z)(function*(){let et=new mapkit.Search({getsUserLocation:!0});return new Promise(function(){var le=(0,ie.Z)(function*(ue,ct){let ht=[];et.search(Ue,function(){var Le=(0,ie.Z)(function*(ye,gt){ye&&ct(ye),ht=[],gt.places.map(Te=>{let Pe=new me.nS;Pe.Title=Te.name,Pe.Address=Te.formattedAddress,Pe.Type="place",Pe.Location=new E.wC(Te.coordinate.latitude,Te.coordinate.longitude),ht.push(Pe)}),ue(ht)});return function(ye,gt){return Le.apply(this,arguments)}}())});return function(ue,ct){return le.apply(this,arguments)}}())})()}addPOILayer(Ue){this.logging.log("Add POI Layer not implemented in this provider.")}}class _e{constructor(){(0,x.Z)(this,"mercatorRadius",85445659.44705395),(0,x.Z)(this,"mercatorOffset",268435456)}longitudeToPixelSpaceX(Ue){return Math.round(this.mercatorOffset+this.mercatorRadius*Ue*Math.PI/180)}latitudeToPixelSpaceY(Ue){return Math.round(this.mercatorOffset-this.mercatorRadius*Math.log((1+Math.sin(Ue*Math.PI/180))/(1-Math.sin(Ue*Math.PI/180)))/2)}pixelSpaceXToLongitude(Ue){return(Math.round(Ue)-this.mercatorOffset)/this.mercatorRadius*180/Math.PI}pixelSpaceYToLatitude(Ue){return 180*(Math.PI/2-2*Math.atan(Math.exp((Math.round(Ue)-this.mercatorOffset)/this.mercatorRadius)))/Math.PI}deltaFromZoomLevel(Ue,et,le){let ue=this.longitudeToPixelSpaceX(et.longitude),ct=this.latitudeToPixelSpaceY(et.latitude),Le=Math.pow(2,20-le),ye=Ue.visibleMapRect.size,gt=ye.width*Le,Te=ye.height*Le,Pe=ue-gt/2,Ae=ct-Te/2,Ye=this.pixelSpaceXToLongitude(Pe),hn=this.pixelSpaceXToLongitude(Pe+gt)-Ye,qt=this.pixelSpaceYToLatitude(Ae);return{latitudeDelta:-1*(this.pixelSpaceYToLatitude(Ae+Te)-qt),longitudeDelta:hn}}}var ee=k(2029),ae=k(5957),oe=k(9862);let Be=(()=>{var Ee;class Ue extends h.k{constructor(le,ue,ct){super(le,ue,ct),this.mapAPIType=y.b.MAPTILER,this.mapTileSet="https://maps.tilehosting.com/styles/streets/style.json?key=Gs9z7krALe3CGI60d5cL"}initAPI(){}}return Ee=Ue,(0,x.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ee.LFG(ae.z),ee.LFG(J.z),ee.LFG(oe.eN))}),(0,x.Z)(Ue,"\u0275prov",ee.Yz7({token:Ee,factory:Ee.\u0275fac})),Ue})(),Ie=(()=>{var Ee;class Ue{constructor(le,ue,ct){(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"http",void 0),(0,x.Z)(this,"map",void 0),(0,x.Z)(this,"mapCentreMarker",void 0),(0,x.Z)(this,"mapsInitialised",void 0),(0,x.Z)(this,"mapAPIReady",void 0),(0,x.Z)(this,"mapOptions",void 0),(0,x.Z)(this,"searchMarker",void 0),(0,x.Z)(this,"errorMessage",void 0),(0,x.Z)(this,"parentAppContext",void 0),(0,x.Z)(this,"mapProvider",void 0),(0,x.Z)(this,"debouncedMapPositionUpdate",void 0),(0,x.Z)(this,"events",void 0),(0,x.Z)(this,"isFocused",!1),this.logging=ue,this.http=ct,this.events=le,this.mapOptions=new y._,this.mapAPIReady=!1,this.mapsInitialised=!1,this.setMapAPI(this.mapOptions.mapAPI);let ht=this;this.debouncedMapPositionUpdate=s.c.debounce(()=>{this.logging.log("signaling map position change:"),ht.mapProvider.mapReady&&ht.getMapCenter().subscribe(Le=>{null!=Le?(this.logging.log("Map centre/zoom changed, updating search position:"+Le),this.updateMapCentrePos(Le.coords.latitude,Le.coords.longitude,!1)):this.logging.log("Map centre/zoom changed - map not ready to change centre pos:")})},300,!1)}setParentAppContext(le){this.parentAppContext=le}setMapAPI(le){this.mapOptions.mapAPI=le,this.mapOptions.mapAPI==y.b.MAPBOX&&(this.mapProvider=new h.k(this.events,this.logging,this.http)),this.mapOptions.mapAPI==y.b.MAPKIT_JS&&(this.mapProvider=new he(this.events,this.logging)),this.mapOptions.mapAPI==y.b.MAPTILER&&(this.mapProvider=new Be(this.events,this.logging,this.http))}isMapReady(){return null!=this.mapProvider&&this.mapProvider.mapReady}externalAPILoaded(le){this.mapAPIReady=!0,this.logging.log("Mapping API Loaded: "+y.b[le])}initMap(le){if(!this.isMapReady())if(null!=this.mapProvider)this.mapsInitialised&&this.logging.log("initMap: Map provider already initialised"),this.logging.log("Mapping Manager: Init "+y.b[this.mapProvider.mapAPIType]),this.mapProvider.initMap(le,this.mapOptions,this);else{if(this.mapsInitialised)return void this.logging.log("initMap: map already initialised");this.logging.log("initMap: "+this.mapOptions.mapAPI)}}mapManipulationPerformed(le){this.logging.log("map manipulated:"+le),("drag"==le||"zoom"==le)&&this.debouncedMapPositionUpdate()}updateMapSize(){this.mapProvider&&this.mapProvider.refreshMapLayout()}updateMapCentrePos(le,ue,ct,ht){ct&&null!=this.mapProvider&&this.mapProvider.setMapCenter(new E.jR(le,ue),ht),this.mapOptions.mapCentre=new E.jR(le,ue)}moveToMapBounds(le){this.mapProvider.moveToMapBounds(le)}refreshMapView(le,ue,ct){return null!=this.mapProvider?(this.logging.log("Mapping Manager: renderMap "+y.b[this.mapProvider.mapAPIType]),this.isMapReady()?this.mapProvider.renderMap(ue,le,this.parentAppContext):this.logging.log("refreshMapView: map provider not initialised..")):this.logging.log("Unsupported Map API: refreshMapView",J.i.ERROR),!0}setMapType(le){this.mapOptions.mapType!=le&&(this.mapOptions.mapType=le,this.isMapReady()&&null!=this.mapProvider?(this.logging.log("Changing map type:"+le),this.mapProvider.setMapType(le)):this.logging.log("Map type set, maps not initialised yet."))}unfocusMap(){this.logging.log("[mapping] Unfocus Map."),this.isFocused=!1,this.mapProvider.unfocusMap()}focusMap(){this.logging.log("[mapping] Focus Map."),this.isFocused=!0,this.mapProvider.focusMap()}getMapBounds(){return this.mapProvider.getMapBounds()}getMapZoom(){return this.mapProvider.getMapZoom()}setMapZoom(le){this.mapProvider.setMapZoom(le)}getMapCenter(){return this.mapProvider.getMapCenter()}showPOIOnStaticMap(le,ue,ct=!1,ht=!1,Le=200,ye=200){let gt=document.getElementById(le);if(null!=gt){let Pe=ue.AddressInfo.Latitude,Ae=ue.AddressInfo.Longitude;Le>640&&(Le=640),ye>640&&(ye=640);let Ye=Le,_t=ye,hn="https://maps.googleapis.com/maps/api/staticmap?center="+Pe+","+Ae+"&zoom=14&size="+Ye+"x"+_t+"&maptype=roadmap&markers=color:blue%7Clabel:A%7C"+Pe+","+Ae+"&sensor=false",qt="";qt+=1==ct?"
"+s.c.formatMapLink(ue,'
',ht)+"
":'
',gt.innerHTML=qt}}renderPolyline(le){this.mapProvider.renderPolyline(le)}clearPolyline(){this.mapProvider.clearPolyline()}clearMarkers(){this.logging.log("mapping: clearing markers"),this.mapProvider.clearMarkers()}addPOILayer(le){this.mapProvider.addPOILayer(le)}}return Ee=Ue,(0,x.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ee.LFG(ae.z),ee.LFG(J.z),ee.LFG(oe.eN))}),(0,x.Z)(Ue,"\u0275prov",ee.Yz7({token:Ee,factory:Ee.\u0275fac,providedIn:"root"})),Ue})()},3955:(Nn,yt,k)=>{"use strict";k.d(yt,{_:()=>s,b:()=>y});var x=k(1180),h=k(553),y=function(J){return J[J.GOOGLE_WEB=1]="GOOGLE_WEB",J[J.GOOGLE_NATIVE=2]="GOOGLE_NATIVE",J[J.LEAFLET=3]="LEAFLET",J[J.MAPBOX=4]="MAPBOX",J[J.MAPKIT_JS=5]="MAPKIT_JS",J[J.MAPTILER=6]="MAPTILER",J}(y||{});class s{constructor(){(0,x.Z)(this,"enableClustering",void 0),(0,x.Z)(this,"resultBatchID",void 0),(0,x.Z)(this,"useMarkerIcons",void 0),(0,x.Z)(this,"useMarkerAnimation",void 0),(0,x.Z)(this,"enableTrackingMapCentre",void 0),(0,x.Z)(this,"enableSearchByWatchingLocation",void 0),(0,x.Z)(this,"mapCentre",void 0),(0,x.Z)(this,"searchDistanceKM",void 0),(0,x.Z)(this,"iconSet",void 0),(0,x.Z)(this,"mapAPI",void 0),(0,x.Z)(this,"mapMoveQueryRefreshMS",void 0),(0,x.Z)(this,"requestSearchUpdate",void 0),(0,x.Z)(this,"enableSearchRadiusIndicator",void 0),(0,x.Z)(this,"mapType",void 0),(0,x.Z)(this,"minZoomLevel",void 0),(0,x.Z)(this,"onMapMoveCompleted",void 0),this.enableClustering=!1,this.resultBatchID=-1,this.useMarkerIcons=!0,this.useMarkerAnimation=!0,this.enableTrackingMapCentre=!1,this.enableSearchByWatchingLocation=!1,this.mapCentre=null,this.mapAPI=h.N.defaultMapProvider,this.mapType="ROADMAP",this.searchDistanceKM=1e5,this.mapMoveQueryRefreshMS=300,this.enableSearchRadiusIndicator=!1,this.minZoomLevel=2}}},9903:(Nn,yt,k)=>{"use strict";k.d(yt,{k:()=>Be});var x=k(5861),h=k(1180),y=k(866),s=k(3955),J=k(5592),ie=k(3052),Y=k(9127),E=k(2574),me=k(553),he=k(7518),_e=k(2029),ee=k(5957),ae=k(9862);let Be=(()=>{var Ie;class Ee{constructor(et,le,ue){(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"mapAPIType",void 0),(0,h.Z)(this,"mapReady",void 0),(0,h.Z)(this,"providerError",void 0),(0,h.Z)(this,"mapCanvasID",void 0),(0,h.Z)(this,"map",void 0),(0,h.Z)(this,"markerList",void 0),(0,h.Z)(this,"polylinePath",void 0),(0,h.Z)(this,"_isMapAnimating",!1),(0,h.Z)(this,"searchMarker",void 0),(0,h.Z)(this,"mapTileSet",void 0),this.events=et,this.logging=le,this.http=ue,this.events=et,this.mapAPIType=s.b.MAPBOX,this.mapReady=!1,this.markerList=new Map}initAPI(){E&&(E.accessToken=me.N.mapBoxToken)}disposeMap(){this.map&&(this.logging.log("Disposing map",Y.i.INFO),this.map.remove())}getCurrentMapTileSet(et){return"SATELLITE"==et?"mapbox://styles/mapbox/satellite-streets-v12?optimize=true":"mapbox://styles/mapbox/streets-v12?optimize=true"}flyAroundPoint(et){if(this._isMapAnimating){this.map.rotateTo(et/100%360,{duration:0});const le=this;requestAnimationFrame(function(ue){le.flyAroundPoint(ue)})}}initMap(et,le,ue){this.mapCanvasID=et;let ct=!0;if(ct=!(typeof E>"u"),!ct)return this.logging.log("Call to initMap before API is ready:"+s.b[this.mapAPIType],Y.i.ERROR),this.mapReady=!1,!1;if(null==this.map){let gt=function(Pe){return Pe*(2-Pe)};document.getElementById(et),this.initAPI(),this.map=new E.Map({container:et,style:this.getCurrentMapTileSet(le.mapType),zoom:15,attributionControl:!1}),this.map.addControl(new E.AttributionControl({compact:!0,customAttribution:["Open Charge Map Contributors"]})),this.map.addControl(new E.NavigationControl),this.mapReady=!0,this.map.getCanvas().focus();let Le=100,ye=25;this.map.getCanvas().addEventListener("keydown",Pe=>{Pe.preventDefault(),38===Pe.which?this.map.panBy([0,-Le],{easing:gt}):40===Pe.which?this.map.panBy([0,Le],{easing:gt}):37===Pe.which?this.map.easeTo({bearing:this.map.getBearing()-ye,easing:gt}):39===Pe.which?this.map.easeTo({bearing:this.map.getBearing()+ye,easing:gt}):32===Pe.which&&(this._isMapAnimating?this._isMapAnimating=!1:(this._isMapAnimating=!0,this.flyAroundPoint(0)))},!0),this.map.on("load",()=>{this.events.publish("ocm:mapping:ready")});let Te=y.c.debounce(()=>{this.getMapCenter().subscribe(Pe=>{this.searchMarker.setLngLat(new E.LngLat(Pe.coords.longitude,Pe.coords.latitude))})},500,!1);this.map.on("move",()=>{this.searchMarker&&Te()}),this.map.on("moveend",()=>{this.events.publish("ocm:mapping:dragend"),le.onMapMoveCompleted&&le.onMapMoveCompleted()}),this.map.on("zoomend",()=>{this.events.publish("ocm:mapping:zoom")})}}clearMarkers(){null!=this.markerList&&this.markerList.forEach((et,le)=>{et.remove()}),this.markerList=new Map}showPOIListOnMap(et,le,ue=!0){let ht=this.map,Le=new E.LngLatBounds,ye=0;if(ht.getZoom(),null!=et){for(let Ye=0;Ye{const Ce=St.currentTarget.poi;this.events.publish("ocm:poi:selected",{poiId:Ce.ID,poi:Ce})}),Le.extend(Re.getLngLat()),this.markerList.set(_t.ID,Re),ye++}}this.logging.log(ye+" new map markers added out of a total "+this.markerList.size)}if(null!=et&&et.length>0)if(null==le||le.appConfig.enableLiveMapQuerying)null==ht.getCenter()&&ht.setCenter(Le.getCenter());else{this.logging.log("Fitting to marker bounds:"+Le),ht.setCenter(Le.getCenter()),this.logging.log("zoom before fit bounds:"+ht.getZoom()),ht.fitBounds(Le);let Ae=ht.getZoom();ht.setZoom(Ae<6?6:Ae)}}refreshMapLayout(){null!=this.map&&setTimeout(()=>{this.logging.log("MapBoxGL: refreshMapLayout",Y.i.VERBOSE),this.map.resize()},200)}setMapCenter(et){this.mapReady&&(this.map.setCenter(new E.LngLat(et.coords.longitude,et.coords.latitude)),this.searchMarker||(this.searchMarker=new E.Marker({color:"#99ccff",anchor:"bottom"}).setLngLat(new E.LngLat(et.coords.longitude,et.coords.latitude)).addTo(this.map),this.searchMarker.getElement().addEventListener("click",()=>{let le=this.searchMarker.getLngLat();this.events.publish("ocm:mapping:addpoi",new ie.wC(le.lat,le.lng))})))}getMapCenter(){return new J.y(le=>{if(null!=this.map){let ue=this.map.getCenter();null!=ue&&(le.next(new ie.jR(ue.lat,ue.lng)),le.complete())}})}setMapZoom(et){this.map.setZoom(et)}getMapZoom(){return new J.y(le=>{let ue=this.map.getZoom();le.next(ue),le.complete()})}setMapType(et){this.map.setStyle(this.getCurrentMapTileSet(et))}getMapBounds(){return new J.y(le=>{let ue=new Array,ct=this.map.getBounds();ue.push(new ie.wC(ct.getSouthWest().lat,ct.getSouthWest().lng)),ue.push(new ie.wC(ct.getNorthEast().lat,ct.getNorthEast().lng)),le.next(ue),le.complete()})}moveToMapBounds(et){this.map.fitBounds(new E.LngLatBounds(new E.LngLat(et.southWest.longitude,et.southWest.latitude),new E.LngLat(et.northEast.longitude,et.northEast.latitude)))}renderMap(et,le,ue){return document.getElementById(this.mapCanvasID).style.height=le+"px",this.mapReady&&this.showPOIListOnMap(et,ue),!0}renderPolyline(et){this.clearPolyline()}clearPolyline(){null!=this.polylinePath&&this.polylinePath.setMap(null)}focusMap(){}unfocusMap(){}placeSearch(et,le,ue){var ct=this;return(0,x.Z)(function*(){let ht=`https://api.mapbox.com/geocoding/v5/mapbox.places/${et||ue+","+le}.json?access_token=${me.N.mapBoxToken}`;return new Promise(function(){var Le=(0,x.Z)(function*(ye,gt){ct.http.get(ht).toPromise().then(Te=>{let Pe=[];Pe=[],Te.features&&Te.features.map(Ae=>{let Ye=new he.nS;Ye.Title=Ae.place_name,Ye.Address=Ae.place_name,Ye.Type="place",Ye.Location=new ie.wC(Ae.center[1],Ae.center[0]),Ye.Attribution=Te.attribution,Pe.push(Ye)}),ye(Pe)})});return function(ye,gt){return Le.apply(this,arguments)}}())})()}addPOILayer(et){this.logging.log("Add POI Layer not implemented in this provider."),this.showPOIListOnMap(et,null,!1)}}return Ie=Ee,(0,h.Z)(Ee,"\u0275fac",function(et){return new(et||Ie)(_e.LFG(ee.z),_e.LFG(Y.z),_e.LFG(ae.eN))}),(0,h.Z)(Ee,"\u0275prov",_e.Yz7({token:Ie,factory:Ie.\u0275fac})),Ee})()},553:(Nn,yt,k)=>{"use strict";k.d(yt,{N:()=>x});const x={name:"prod",version:"8.5.7",production:!0,analyticsId:"",googleMapsKey:"",mapBoxToken:"pk.eyJ1Ijoid2VicHJvZnVzaW9uIiwiYSI6ImNrdHZlc2N5dTI5Zjcydm8zYWFwc2JnbTMifQ.M7b5SOzbPcg_8XAHCOeP0w",mapKitToken:"",enableStaticMaps:!1,defaultMapProvider:4,apiBase:"https://api.openchargemap.io",apiKey:"9bb03e5b-0fb2-4916-9b2b-26c6bd27a56a",enabledFeatures:["MAP","ADD_COMMENT","ADD_PHOTO","FAVOURITES","FILTER_OPTIONS_BY_COUNTRY","ADD_POI","EDIT_POI","LAYERS"]}},3108:(Nn,yt,k)=>{"use strict";var x=k(6593),h=k(2029),y=k(1180),s=k(5086),J=k(3999),ie=k(6814),Y=k(6223),E=k(9843);let Ne=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,E.Pc,J.aw,s.e]})),Mn})(),me=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,E.Pc,J.aw,s.e]})),Mn})(),he=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,E.Pc,J.aw,s.e]})),Mn})();var _e=k(4606),ee=k(9862),ae=k(6800),oe=k(6091);class Be{constructor(Mn,qn="/assets/i18n/",yn=".json"){(0,y.Z)(this,"http",void 0),(0,y.Z)(this,"prefix",void 0),(0,y.Z)(this,"suffix",void 0),this.http=Mn,this.prefix=qn,this.suffix=yn}getTranslation(Mn){return this.http.get(`${this.prefix}${Mn}${this.suffix}`)}}var Ie=k(5861),Ee=k(1847),Ue=k(3247),et=k(8767),le=k(4292),ue=k(6470);function ct(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"div"),h._uU(1," You are not signed in. "),h.TgZ(2,"button",5),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.showSignInModal())}),h._uU(3),h.ALo(4,"translate"),h.qZA()()}2&Cn&&(h.xp6(3),h.Oqu(h.lcZ(4,1,"ocm.general.signIn")))}function ht(Cn,Mn){if(1&Cn&&(h.TgZ(0,"div")(1,"ion-card")(2,"ion-item")(3,"ion-avatar",6),h._UZ(4,"img",7),h.qZA(),h.TgZ(5,"h2"),h._uU(6),h.qZA()(),h.TgZ(7,"ion-card-content")(8,"p"),h._uU(9),h.qZA(),h.TgZ(10,"p"),h._uU(11),h.qZA()(),h.TgZ(12,"ion-item")(13,"ion-note",8),h._UZ(14,"ion-icon",9),h._uU(15),h.qZA()()()()),2&Cn){const qn=h.oxw();h.xp6(4),h.s9C("src",qn.userProfile.ProfileImageURL,h.LSH),h.xp6(2),h.Oqu(qn.userProfile.Username),h.xp6(3),h.hij(" ",qn.userProfile.Profile,""),h.xp6(2),h.hij(" Date Joined: ",qn.userProfile.DateCreated," "),h.xp6(4),h.hij(" ",qn.userProfile.ReputationPoints," Contributor Points ")}}let Le=(()=>{var Cn;class Mn{constructor(yn,_n,Hi,nt){(0,y.Z)(this,"appManager",void 0),(0,y.Z)(this,"nav",void 0),(0,y.Z)(this,"translate",void 0),(0,y.Z)(this,"modalController",void 0),(0,y.Z)(this,"userProfile",void 0),this.appManager=yn,this.nav=_n,this.translate=Hi,this.modalController=nt}ionViewDidEnter(){this.userProfile=this.appManager.getUserProfile(),null!=this.userProfile&&this.appManager.isUserAuthenticated(!0)?this.refreshProfileView():this.showSignInModal(),this.appManager.analytics.viewEvent("Profile")}refreshProfileView(){this.userProfile=this.appManager.getUserProfile()}showSignInModal(){this.modalController.create({component:et.F,componentProps:{Profile:this.userProfile}}).then(yn=>{yn.onDidDismiss().then(()=>{this.refreshProfileView()}),yn.present()})}close(){this.modalController.dismiss()}}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)(h.Y36(ue.c),h.Y36(E.SH),h.Y36(J.sK),h.Y36(E.IN))}),(0,y.Z)(Mn,"\u0275cmp",h.Xpm({type:Cn,selectors:[["ng-component"]],decls:14,vars:5,consts:[[1,"profile-page","ion-padding"],[4,"ngIf"],["slot","end"],[3,"click"],["name","close","slot","start"],["ion-button","",3,"click"],["slot","start"],[3,"src"],["item-left",""],["name","star"]],template:function(yn,_n){1&yn&&(h.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),h._uU(3),h.ALo(4,"translate"),h.qZA()()(),h.TgZ(5,"ion-content",0),h.YNc(6,ct,5,3,"div",1),h.YNc(7,ht,16,5,"div",1),h.qZA(),h.TgZ(8,"ion-footer")(9,"ion-toolbar")(10,"ion-buttons",2)(11,"ion-button",3),h.NdJ("click",function(){return _n.close()}),h._UZ(12,"ion-icon",4),h._uU(13," Close "),h.qZA()()()()),2&yn&&(h.xp6(3),h.hij(" ",h.lcZ(4,3,"ocm.navigation.profile.sectionTitle")," "),h.xp6(3),h.Q6J("ngIf",null==_n.userProfile),h.xp6(1),h.Q6J("ngIf",null!=_n.userProfile))},dependencies:[ie.O5,E.BJ,E.YG,E.Sm,E.PM,E.FN,E.W2,E.fr,E.Gu,E.gu,E.Ie,E.uN,E.wd,E.sr,J.X$],encapsulation:2})),Mn})();var ye=k(9127),gt=k(553),Te=k(6662),Pe=k(3294),Ae=k(866),Ye=k(9236),_t=k(8062),hn=k(2726);const qt=(0,hn.fo)("PushNotifications",{}),Fe=(0,hn.fo)("StatusBar"),St=(0,hn.fo)("SplashScreen",{web:()=>k.e(4485).then(k.bind(k,4485)).then(Cn=>new Cn.SplashScreenWeb)}),Ce=(0,hn.fo)("App",{web:()=>k.e(2912).then(k.bind(k,2912)).then(Cn=>new Cn.AppWeb)});var Rt=k(5957);function Qt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.openRoutePlannerModal())}),h._UZ(1,"ion-icon",12),h.TgZ(2,"ion-label"),h._uU(3," Route Planner "),h.qZA()()}}function Gt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.add())}),h._UZ(1,"ion-icon",13),h.TgZ(2,"ion-label"),h._uU(3),h.ALo(4,"translate"),h.qZA()()}2&Cn&&(h.xp6(3),h.hij(" ",h.lcZ(4,1,"ocm.general.addLocation")," "))}function Zt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.journeys())}),h._UZ(1,"ion-icon",12),h.TgZ(2,"ion-label"),h._uU(3," Journeys "),h.qZA()()}}function Jt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.addLayer())}),h._UZ(1,"ion-icon",14),h.TgZ(2,"ion-label"),h._uU(3," Add Layer "),h.qZA()()}}function kt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.ynx(0),h.TgZ(1,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.signIn())}),h._UZ(2,"ion-icon",15),h.TgZ(3,"ion-label"),h._uU(4),h.ALo(5,"translate"),h.qZA()(),h.BQk()}2&Cn&&(h.xp6(4),h.hij(" ",h.lcZ(5,1,"ocm.general.signIn")," "))}function dt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.ynx(0),h.TgZ(1,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.profile())}),h._UZ(2,"ion-icon",15),h.TgZ(3,"ion-label"),h._uU(4),h.ALo(5,"translate"),h.qZA()(),h.TgZ(6,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.signOut())}),h._UZ(7,"ion-icon",16),h.TgZ(8,"ion-label"),h._uU(9),h.ALo(10,"translate"),h._UZ(11,"br"),h.TgZ(12,"small",17),h._uU(13),h.qZA()()(),h.BQk()}if(2&Cn){const qn=h.oxw();h.xp6(4),h.hij(" ",h.lcZ(5,3,"ocm.navigation.profile.sectionTitle")," "),h.xp6(5),h.hij(" ",h.lcZ(10,5,"ocm.general.signOut")," "),h.xp6(4),h.hij(" ",qn.getUserName(),"")}}const Ot=function(){return["/search"]};let pt=(()=>{var Cn;class Mn{constructor(yn,_n,Hi,nt,ge,ve,Xe,ft){(0,y.Z)(this,"platform",void 0),(0,y.Z)(this,"translate",void 0),(0,y.Z)(this,"mapping",void 0),(0,y.Z)(this,"modalController",void 0),(0,y.Z)(this,"appManager",void 0),(0,y.Z)(this,"logger",void 0),(0,y.Z)(this,"analytics",void 0),(0,y.Z)(this,"events",void 0),(0,y.Z)(this,"enabledFeatures",void 0),this.platform=yn,this.translate=_n,this.mapping=Hi,this.modalController=nt,this.appManager=ge,this.logger=ve,this.analytics=Xe,this.events=ft,this.logger.log("Environment: "+gt.N.name),this.initializeApp(),this.enabledFeatures=gt.N.enabledFeatures,1!=ge.searchSettings.EnableAdvancedEditorFeatures&&(this.enabledFeatures=this.enabledFeatures.filter(Ct=>"LAYERS"!=Ct))}configurePushNotifications(){qt.register(),qt.addListener("registration",yn=>{this.logger.log("Push registration success, token: "+yn.value),this.appManager.savePushRegistration(yn.value)}),qt.addListener("registrationError",yn=>{this.logger.log("Error on registration: "+JSON.stringify(yn))}),qt.addListener("pushNotificationReceived",yn=>{this.logger.log("Push received: "+JSON.stringify(yn),ye.i.INFO)}),qt.addListener("pushNotificationActionPerformed",yn=>{this.logger.log("Push action performed: "+JSON.stringify(yn))})}isUserAuthenticated(){return this.appManager.isUserAuthenticated()}getUserName(){let yn=this.appManager.getUserProfile();return yn?yn.EmailAddress?yn.EmailAddress:yn.Username:"Not Signed In"}initializeApp(){var yn=this;this.platform.ready().then(()=>{this.platform.is("capacitor")&&(Fe.show(),St.hide()),this.translate.addLangs(this.appManager.getLanguages().map(_n=>_n.code)),this.translate.setDefaultLang("en"),null!=this.appManager.searchSettings.Language?this.translate.use(this.appManager.searchSettings.Language):this.translate.currentLang||this.translate.use("en"),this.translate.get("ocm.search.performSearch").toPromise().then(_n=>{}),this.analytics.init(gt.N.analyticsId).then(()=>{this.analytics.setAppVersion(gt.N.version),this.analytics.appEvent("Startup","App Loaded")}).catch(_n=>this.logger.log("Error starting analytics")),this.events.subscribe("ocm:mapping:addpoi",function(){var _n=(0,Ie.Z)(function*(Hi){Ae.c.isFeatureEnabled("ADD_POI")&&yn.add(Hi)});return function(Hi){return _n.apply(this,arguments)}}()),(this.platform.is("ios")||this.platform.is("android"))&&(this.configurePushNotifications(),this.checkForAppOpenUrl())})}checkForAppOpenUrl(){return(0,Ie.Z)(function*(){Ce.addListener("appUrlOpen",_n=>{alert("App (re)opened with URL: "+_n.url)});let yn=yield Ce.getLaunchUrl();yn&&yn.url&&alert("App opened with URL: "+yn.url)})()}openRoutePlannerModal(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:Ue.u});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}continueAdd(yn){var _n=this;return(0,Ie.Z)(function*(){const Hi=yield _n.modalController.create({component:Te.Y,componentProps:{startPos:yn}});Hi.onDidDismiss().then(nt=>{_n.mapping.focusMap()}),yield Hi.present()})()}add(yn){var _n=this;return(0,Ie.Z)(function*(){if(_n.mapping.unfocusMap(),!_n.appManager.isUserAuthenticated(!0)){const Hi=yield _n.modalController.create({component:et.F});return Hi.onDidDismiss().then(function(){var nt=(0,Ie.Z)(function*(ge){_n.mapping.focusMap(),_n.appManager.isUserAuthenticated(!0)&&(yield _n.continueAdd(yn))});return function(ge){return nt.apply(this,arguments)}}()),yield Hi.present()}yield _n.continueAdd(yn)})()}signIn(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:et.F});return _n.onDidDismiss().then(Hi=>{yn.mapping.focusMap(),yn.appManager.isUserAuthenticated(!0)}),yield _n.present()})()}signOut(){var yn=this;return(0,Ie.Z)(function*(){yn.appManager.signOutCurrentUser()})()}profile(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:Le});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}journeys(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:le.g});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}addLayer(){var yn=this;return(0,Ie.Z)(function*(){const _n=yield yn.modalController.create({component:_t.A});yield _n.present();const{data:Hi}=yield _n.onWillDismiss();Hi&&yn.mapping.addPOILayer(Hi)})()}about(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:Ye.t});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)(h.Y36(E.t4),h.Y36(J.sK),h.Y36(Ee.v),h.Y36(E.IN),h.Y36(ue.c),h.Y36(ye.z),h.Y36(Pe.c),h.Y36(Rt.z))}),(0,y.Z)(Mn,"\u0275cmp",h.Xpm({type:Cn,selectors:[["app-root"]],decls:29,vars:17,consts:[["contentId","main-content",3,"disabled"],["contentId","main-content","swipeGesture","false"],["slot","start"],["src","assets/images/icons/branding/AppIcon_128x128.png"],["auto-hide","false"],[3,"routerDirection","routerLink"],["slot","start","name","home"],[3,"click",4,"ngIf"],[4,"ngIf"],[3,"click"],["slot","start","name","information-circle-outline"],["id","main-content"],["slot","start","name","map"],["slot","start","name","add-circle-outline"],["slot","start","name","albums"],["slot","start","name","person"],["slot","start","name","log-out"],[2,"color","#c0c0c0"]],template:function(yn,_n){1&yn&&(h.TgZ(0,"ion-app")(1,"ion-split-pane",0)(2,"ion-menu",1)(3,"ion-header")(4,"ion-toolbar")(5,"ion-thumbnail",2),h._UZ(6,"img",3),h.qZA(),h.TgZ(7,"ion-title"),h._uU(8),h.qZA()()(),h.TgZ(9,"ion-content")(10,"ion-list")(11,"ion-menu-toggle",4)(12,"ion-item",5),h._UZ(13,"ion-icon",6),h.TgZ(14,"ion-label"),h._uU(15),h.ALo(16,"translate"),h.qZA()(),h.YNc(17,Qt,4,0,"ion-item",7),h.YNc(18,Gt,5,3,"ion-item",7),h.YNc(19,Zt,4,0,"ion-item",7),h.YNc(20,Jt,4,0,"ion-item",7),h.YNc(21,kt,6,3,"ng-container",8),h.YNc(22,dt,14,7,"ng-container",8),h.TgZ(23,"ion-item",9),h.NdJ("click",function(){return _n.about()}),h._UZ(24,"ion-icon",10),h.TgZ(25,"ion-label"),h._uU(26),h.ALo(27,"translate"),h.qZA()()()()()(),h._UZ(28,"ion-router-outlet",11),h.qZA()()),2&yn&&(h.xp6(1),h.Q6J("disabled",!0),h.xp6(7),h.Oqu(_n.appManager.title),h.xp6(4),h.Q6J("routerDirection","root")("routerLink",h.DdM(16,Ot)),h.xp6(3),h.hij(" ",h.lcZ(16,12,"ocm.search.sectionTitle")," "),h.xp6(2),h.Q6J("ngIf",_n.enabledFeatures.includes("ROUTE_PLANNER")),h.xp6(1),h.Q6J("ngIf",_n.enabledFeatures.includes("ADD_POI")),h.xp6(1),h.Q6J("ngIf",_n.enabledFeatures.includes("FAVOURITES")),h.xp6(1),h.Q6J("ngIf",_n.enabledFeatures.includes("LAYERS")),h.xp6(1),h.Q6J("ngIf",!_n.isUserAuthenticated()),h.xp6(1),h.Q6J("ngIf",_n.isUserAuthenticated()),h.xp6(4),h.hij(" ",h.lcZ(27,14,"ocm.general.about")," "))},dependencies:[ie.O5,E.dr,E.W2,E.Gu,E.gu,E.Ie,E.Q$,E.q_,E.z0,E.zc,E.jI,E.Bs,E.wd,E.sr,E.jP,E.YI,ae.rH,J.X$],encapsulation:2})),Mn})();const Yt=[{path:"",redirectTo:"search",pathMatch:"full"},{path:"search",loadChildren:()=>Promise.resolve().then(k.bind(k,4606)).then(Cn=>Cn.SearchPageModule)},{path:"journeys",loadChildren:()=>Promise.resolve().then(k.bind(k,9192)).then(Cn=>Cn.JourneysModule)},{path:"signin",loadChildren:()=>Promise.resolve().then(k.bind(k,9472)).then(Cn=>Cn.SignInModule)},{path:"poi-editor/:id",loadChildren:()=>Promise.resolve().then(k.bind(k,5722)).then(Cn=>Cn.PoiEditorPageModule)},{path:"about",loadChildren:()=>Promise.resolve().then(k.bind(k,7425)).then(Cn=>Cn.AboutPageModule)},{path:"layer-editor",loadChildren:()=>Promise.resolve().then(k.bind(k,2309)).then(Cn=>Cn.LayerEditorPageModule)}];let Ut=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ae.Bz.forRoot(Yt,{useHash:!0}),ae.Bz]})),Mn})(),ii=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,E.Pc,J.aw,s.e]})),Mn})();var gn=k(9472);let Ft=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,E.Pc,J.aw,s.e,ae.Bz.forChild([{path:"",component:Le}])]})),Mn})();var Jn=k(4119);let Wt=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,E.Pc,J.aw,s.e,ae.Bz.forChild([{path:"",component:Jn.N}])]})),Mn})();var wt=k(9192),vt=k(5722),ln=k(7425),ni=k(2309);function er(){return localStorage.getItem("access_token")}function lr(Cn){return new Be(Cn,"/assets/i18n/",".json")}let Fi=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn,bootstrap:[pt]})),(0,y.Z)(Mn,"\u0275inj",h.cJS({providers:[{provide:ae.wN,useClass:E.r4}],imports:[x.b2,ee.JF,J.aw.forRoot({loader:{provide:J.Zw,useFactory:lr,deps:[ee.eN]}}),E.Pc.forRoot(),Ut,oe.Ar.forRoot({config:{tokenGetter:er}}),_e.SearchPageModule,ii,wt.JourneysModule,gn.SignInModule,he,Ne,me,vt.PoiEditorPageModule,Ft,Wt,ln.AboutPageModule,ni.LayerEditorPageModule]})),Mn})();gt.N.production&&(0,h.G48)(),x.q6().bootstrapModule(Fi).catch(Cn=>console.log(Cn))},2574:function(Nn){Nn.exports=function(){"use strict";var yt,k,x;function h(s,J){if(yt)if(k){var ie="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+yt+")(sharedChunk); ("+k+")(sharedChunk); self.onerror = null;",Y={};yt(Y),x=J(Y),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(x.workerUrl=window.URL.createObjectURL(new Blob([ie],{type:"text/javascript"})))}else k=J;else yt=J}return h(0,function(s){var J=typeof self<"u"?self:{},ie="2.15.0";let Y;const E={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==Y){const n=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Y=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):n}catch{Y=n}}return Y},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!E.API_URL)return null;try{const n=new URL(E.API_URL);return"api.mapbox.cn"===n.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===n.hostname?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ne={supported:!1,testSupport:function(n){!_e&&he&&(ee?ae(n):me=n)}};let me,he,_e=!1,ee=!1;function ae(n){const e=n.createTexture();n.bindTexture(n.TEXTURE_2D,e);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,he),n.isContextLost())return;Ne.supported=!0}catch{}n.deleteTexture(e),_e=!0}J.document&&(he=J.document.createElement("img"),he.onload=function(){me&&ae(me),me=null,ee=!0},he.onerror=function(){_e=!0,me=null},he.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const oe="01";function Be(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ie=Ee;function Ee(n,e,i,a){this.cx=3*n,this.bx=3*(i-n)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=n,this.p1y=e,this.p2x=i,this.p2y=a}Ee.prototype={sampleCurveX:function(n){return((this.ax*n+this.bx)*n+this.cx)*n},sampleCurveY:function(n){return((this.ay*n+this.by)*n+this.cy)*n},sampleCurveDerivativeX:function(n){return(3*this.ax*n+2*this.bx)*n+this.cx},solveCurveX:function(n,e){if(void 0===e&&(e=1e-6),n<0)return 0;if(n>1)return 1;for(var i=n,a=0;a<8;a++){var u=this.sampleCurveX(i)-n;if(Math.abs(u)u?_=i:w=i,i=.5*(w-_)+_;return i},solve:function(n,e){return this.sampleCurveY(this.solveCurveX(n,e))}};var Ue=Be(Ie),et=le;function le(n,e){this.x=n,this.y=e}le.prototype={clone:function(){return new le(this.x,this.y)},add:function(n){return this.clone()._add(n)},sub:function(n){return this.clone()._sub(n)},multByPoint:function(n){return this.clone()._multByPoint(n)},divByPoint:function(n){return this.clone()._divByPoint(n)},mult:function(n){return this.clone()._mult(n)},div:function(n){return this.clone()._div(n)},rotate:function(n){return this.clone()._rotate(n)},rotateAround:function(n,e){return this.clone()._rotateAround(n,e)},matMult:function(n){return this.clone()._matMult(n)},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(n){return this.x===n.x&&this.y===n.y},dist:function(n){return Math.sqrt(this.distSqr(n))},distSqr:function(n){var e=n.x-this.x,i=n.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(n){return Math.atan2(this.y-n.y,this.x-n.x)},angleWith:function(n){return this.angleWithSep(n.x,n.y)},angleWithSep:function(n,e){return Math.atan2(this.x*e-this.y*n,this.x*n+this.y*e)},_matMult:function(n){var e=n[2]*this.x+n[3]*this.y;return this.x=n[0]*this.x+n[1]*this.y,this.y=e,this},_add:function(n){return this.x+=n.x,this.y+=n.y,this},_sub:function(n){return this.x-=n.x,this.y-=n.y,this},_mult:function(n){return this.x*=n,this.y*=n,this},_div:function(n){return this.x/=n,this.y/=n,this},_multByPoint:function(n){return this.x*=n.x,this.y*=n.y,this},_divByPoint:function(n){return this.x/=n.x,this.y/=n.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var n=this.y;return this.y=this.x,this.x=-n,this},_rotate:function(n){var e=Math.cos(n),i=Math.sin(n),a=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=a,this},_rotateAround:function(n,e){var i=Math.cos(n),a=Math.sin(n),u=e.y+a*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-a*(this.y-e.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},le.convert=function(n){return n instanceof le?n:Array.isArray(n)?new le(n[0],n[1]):n};var ue=Be(et);const ct=Math.PI/180,ht=180/Math.PI;function Le(n){return n*ct}function ye(n){return n*ht}const gt=[[0,0],[1,0],[1,1],[0,1]];function Te(n){if(n<=0)return 0;if(n>=1)return 1;const e=n*n,i=e*n;return 4*(n<.5?i:3*(n-e)+i-.75)}function Pe(n,e,i,a){const u=new Ue(n,e,i,a);return function(p){return u.solve(p)}}const Ae=Pe(.25,.1,.25,1);function Ye(n,e,i){return Math.min(i,Math.max(e,n))}function _t(n,e,i){return(i=Ye((i-n)/(e-n),0,1))*i*(3-2*i)}function hn(n,e,i){const a=i-e,u=((n-e)%a+a)%a+e;return u===e?i:u}function qt(n,e,i){if(!n.length)return i(null,[]);let a=n.length;const u=new Array(n.length);let p=null;n.forEach((_,w)=>{e(_,(I,S)=>{I&&(p=I),u[w]=S,0==--a&&i(p,u)})})}function Ht(n){const e=[];for(const i in n)e.push(n[i]);return e}function De(n,...e){for(const i of e)for(const a in i)n[a]=i[a];return n}let Je=1;function Re(){return Je++}function Fe(){return function n(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,n)}()}function St(n){return n<=1?1:Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Ce(n){return!!n&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n)}function Rt(n,e){n.forEach(i=>{e[i]&&(e[i]=e[i].bind(e))})}function Qt(n,e){return-1!==n.indexOf(e,n.length-e.length)}function Gt(n,e,i){const a={};for(const u in n)a[u]=e.call(i||this,n[u],u,n);return a}function Zt(n,e,i){const a={};for(const u in n)e.call(i||this,n[u],u,n)&&(a[u]=n[u]);return a}function Jt(n){return Array.isArray(n)?n.map(Jt):"object"==typeof n&&n?Gt(n,Jt):n}const kt={};function dt(n){kt[n]||(typeof console<"u"&&console.warn(n),kt[n]=!0)}function Ot(n,e,i){return(i.y-n.y)*(e.x-n.x)>(e.y-n.y)*(i.x-n.x)}function pt(n){let e=0;for(let i,a,u=0,p=n.length,_=p-1;u@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,u,p)=>{const _=u||p;return e[a]=!_||_.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let ii=null;function gn(n){if(null==ii){const e=n.navigator?n.navigator.userAgent:null;ii=!!n.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return ii}function Ft(n){try{const e=J[n];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function Jn(n,e){return[n[4*e],n[4*e+1],n[4*e+2],n[4*e+3]]}const Wt="mapbox-tiles";let ln,ni,wt=500,vt=50;function er(){try{return J.caches}catch{}}function lr(){er()&&!ln&&(ln=J.caches.open(Wt))}function mi(n){const e=n.indexOf("?");if(e<0)return n;const a=function(u){const p=u.indexOf("?");return p>0?u.slice(p+1).split("&"):[]}(n).filter(u=>{const p=u.split("=");return"language"===p[0]||"worldview"===p[0]});return a.length?`${n.slice(0,e)}?${a.join("&")}`:n.slice(0,e)}let Fi=1/0;const Cn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Cn);class Mn extends Error{constructor(e,i,a){401===i&&Bt(a)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=a}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const qn=Yt()?()=>self.worker&&self.worker.referrer:()=>("blob:"===J.location.protocol?J.parent:J).location.href,yn=function(n,e){if(!(/^file:/.test(i=n.url)||/^file:/.test(qn())&&!/^\w+:/.test(i))){if(J.fetch&&J.Request&&J.AbortController&&J.Request.prototype.hasOwnProperty("signal"))return function(a,u){const p=new J.AbortController,_=new J.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:qn(),referrerPolicy:a.referrerPolicy,signal:p.signal});let w=!1,I=!1;const S=(B=_.url).indexOf("sku=")>0&&Bt(B);var B;"json"===a.type&&_.headers.set("Accept","application/json");const j=(X,te,de)=>{if(I)return;if(X&&"SecurityError"!==X.message&&dt(X.toString()),te&&de)return H(te);const ke=Date.now();J.fetch(_).then(tt=>{if(tt.ok){const mt=S?tt.clone():null;return H(tt,mt,ke)}return u(new Mn(tt.statusText,tt.status,a.url))}).catch(tt=>{"AbortError"!==tt.name&&u(new Error(`${tt.message} ${a.url}`))})},H=(X,te,de)=>{("arrayBuffer"===a.type?X.arrayBuffer():"json"===a.type?X.json():X.text()).then(ke=>{I||(te&&de&&function(tt,mt,Qe){if(lr(),!ln)return;const ut={status:mt.status,statusText:mt.statusText,headers:new J.Headers};mt.headers.forEach((tn,nn)=>ut.headers.set(nn,tn));const xt=Ut(mt.headers.get("Cache-Control")||"");if(xt["no-store"])return;xt["max-age"]&&ut.headers.set("Expires",new Date(Qe+1e3*xt["max-age"]).toUTCString());const bt=ut.headers.get("Expires");bt&&(new Date(bt).getTime()-Qe<42e4||function(tn,nn){if(void 0===ni)try{new Response(new ReadableStream),ni=!0}catch{ni=!1}ni?nn(tn.body):tn.blob().then(nn)}(mt,tn=>{const nn=new J.Response(tn,ut);lr(),ln&&ln.then(Tn=>Tn.put(mi(tt.url),nn)).catch(Tn=>dt(Tn.message))}))}(_,te,de),w=!0,u(null,ke,X.headers.get("Cache-Control"),X.headers.get("Expires")))}).catch(ke=>{I||u(new Error(ke.message))})};return S?function(X,te){if(lr(),!ln)return te(null);const de=mi(X.url);ln.then(ke=>{ke.match(de).then(tt=>{const mt=function(Qe){if(!Qe)return!1;const ut=new Date(Qe.headers.get("Expires")||0),xt=Ut(Qe.headers.get("Cache-Control")||"");return ut>Date.now()&&!xt["no-cache"]}(tt);ke.delete(de),mt&&ke.put(de,tt.clone()),te(null,tt,mt)}).catch(te)}).catch(te)}(_,j):j(null,null),{cancel:()=>{I=!0,w||p.abort()}}}(n,e);if(Yt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",n,e,void 0,!0)}var i;return function(a,u){const p=new J.XMLHttpRequest;p.open(a.method||"GET",a.url,!0),"arrayBuffer"===a.type&&(p.responseType="arraybuffer");for(const _ in a.headers)p.setRequestHeader(_,a.headers[_]);return"json"===a.type&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials="include"===a.credentials,p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||0===p.status)&&null!==p.response){let _=p.response;if("json"===a.type)try{_=JSON.parse(p.response)}catch(w){return u(w)}u(null,_,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else u(new Mn(p.statusText,p.status,a.url))},p.send(a.body),{cancel:()=>p.abort()}}(n,e)},_n=function(n,e){return yn(De(n,{type:"arrayBuffer"}),e)};function Hi(n){const e=J.document.createElement("a");return e.href=n,e.protocol===J.document.location.protocol&&e.host===J.document.location.host}const nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ge,ve;ge=[],ve=0;const Xe=function(n,e){if(Ne.supported&&(n.headers||(n.headers={}),n.headers.accept="image/webp,*/*"),ve>=E.MAX_PARALLEL_IMAGE_REQUESTS){const p={requestParameters:n,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return ge.push(p),p}ve++;let i=!1;const a=()=>{if(!i)for(i=!0,ve--;ge.length&&ve{a(),p?e(p):_&&(J.createImageBitmap?function(S,B){const j=new J.Blob([new Uint8Array(S)],{type:"image/png"});J.createImageBitmap(j).then(H=>{B(null,H)}).catch(H=>{B(new Error(`Could not load image because of ${H.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(_,(S,B)=>e(S,B,w,I)):function(S,B){const j=new J.Image,H=J.URL;j.onload=()=>{B(null,j),H.revokeObjectURL(j.src),j.onload=null,J.requestAnimationFrame(()=>{j.src=nt})},j.onerror=()=>B(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const X=new J.Blob([new Uint8Array(S)],{type:"image/png"});j.src=S.byteLength?H.createObjectURL(X):nt}(_,(S,B)=>e(S,B,w,I)))});return{cancel:()=>{u.cancel(),a()}}},ft="NO_ACCESS_TOKEN";function Ct(n){return 0===n.indexOf("mapbox:")}function Bt(n){return E.API_URL_REGEX.test(n)}function jt(n){return E.API_CDN_URL_REGEX.test(n)}function Et(n){return E.API_STYLE_REGEX.test(n)&&!Xt(n)}function Xt(n){return E.API_SPRITE_REGEX.test(n)}const Sn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function zn(n){const e=n.match(Sn);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function pe(n){const e=n.params.length?`?${n.params.join("&")}`:"";return`${n.protocol}://${n.authority}${n.path}${e}`}const ze="mapbox.eventData";function xe(n){if(!n)return null;const e=n.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(J.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class be{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=xe(E.ACCESS_TOKEN);let a="";return a=i&&i.u?J.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(u,p)=>String.fromCharCode(+("0x"+p)))):E.ACCESS_TOKEN||"",e?`${ze}.${e}:${a}`:`${ze}:${a}`}fetchEventData(){const e=Ft("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(e)try{const u=J.localStorage.getItem(i);u&&(this.eventData=JSON.parse(u));const p=J.localStorage.getItem(a);p&&(this.anonId=p)}catch{dt("Unable to read from LocalStorage")}}saveEventData(){const e=Ft("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(e)try{J.localStorage.setItem(a,this.anonId),Object.keys(this.eventData).length>=1&&J.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{dt("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,a,u){if(!E.EVENTS_URL)return;const p=zn(E.EVENTS_URL);p.params.push(`access_token=${u||E.ACCESS_TOKEN||""}`);const _={event:this.type,created:new Date(e).toISOString()},w=i?De(_,i):_,I={url:pe(p),headers:{"Content-Type":"text/plain"},body:JSON.stringify([w])};var B;this.pendingRequest=(B=S=>{this.pendingRequest=null,a(S),this.saveEventData(),this.processRequests(u)},yn(De(I,{method:"POST"}),B))}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const Ze=new class extends be{constructor(n){super("appUserTurnstile"),this._customAccessToken=n}postTurnstileEvent(n,e){E.EVENTS_URL&&E.ACCESS_TOKEN&&Array.isArray(n)&&n.some(i=>Ct(i)||Bt(i))&&this.queueRequest(Date.now(),e)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=xe(E.ACCESS_TOKEN),i=e?e.u:E.ACCESS_TOKEN;let a=i!==this.eventData.tokenU;Ce(this.anonId)||(this.anonId=Fe(),a=!0);const u=this.queue.shift();if(this.eventData.lastSuccess){const p=new Date(this.eventData.lastSuccess),_=new Date(u),w=(u-this.eventData.lastSuccess)/864e5;a=a||w>=1||w<-1||p.getDate()!==_.getDate()}else a=!0;a?this.postEvent(u,{sdkIdentifier:"mapbox-gl-js",sdkVersion:ie,skuId:oe,"enabled.telemetry":!1,userId:this.anonId},p=>{p||(this.eventData.lastSuccess=u,this.eventData.tokenU=i)},n):this.processRequests()}},Pt=Ze.postTurnstileEvent.bind(Ze),bn=new class extends be{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(n,e,i,a){this.skuToken=e,this.errorCb=a,E.EVENTS_URL&&(i||E.ACCESS_TOKEN?this.queueRequest({id:n,timestamp:Date.now()},i):this.errorCb(new Error(ft)))}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),Ce(this.anonId)||(this.anonId=Fe()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:ie,skuId:oe,skuToken:this.skuToken,userId:this.anonId},a=>{a?this.errorCb(a):e&&(this.success[e]=!0)},n))}},Kn=bn.postMapLoadEvent.bind(bn),Ci=new class extends be{constructor(){super("gljs.performance")}postPerformanceEvent(n,e){E.EVENTS_URL&&(n||E.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},n)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:e,performanceData:i}=this.queue.shift(),a=function(u){const p=J.performance.getEntriesByType("resource"),_=J.performance.getEntriesByType("mark"),w=function(H){const X={};if(H)for(const te in H)if("other"!==te)for(const de of H[te]){const ke=`${te}ResolveRangeMin`,tt=`${te}ResolveRangeMax`,mt=`${te}RequestCount`,Qe=`${te}RequestCachedCount`;X[ke]=Math.min(X[ke]||1/0,de.startTime),X[tt]=Math.max(X[tt]||-1/0,de.responseEnd);const ut=xt=>{void 0===X[xt]&&(X[xt]=0),++X[xt]};void 0!==de.transferSize&&0===de.transferSize&&ut(Qe),ut(mt)}return X}(function(H,X){const te={};if(H)for(const de of H){const ke=X(de);void 0===te[ke]&&(te[ke]=[]),te[ke].push(de)}return te}(p,mn)),I=J.devicePixelRatio,S=J.navigator.connection||J.navigator.mozConnection||J.navigator.webkitConnection,B={counters:[],metadata:[],attributes:[]},j=(H,X,te)=>{null!=te&&H.push({name:X,value:te.toString()})};for(const H in w)j(B.counters,H,w[H]);if(u.interactionRange[0]!==1/0&&u.interactionRange[1]!==-1/0&&(j(B.counters,"interactionRangeMin",u.interactionRange[0]),j(B.counters,"interactionRangeMax",u.interactionRange[1])),_)for(const H of Object.keys(st)){const X=st[H],te=_.find(de=>de.name===X);te&&j(B.counters,X,te.startTime)}return j(B.counters,"visibilityHidden",u.visibilityHidden),j(B.attributes,"style",function(H){if(H)for(const X of H){const te=X.name.split("?")[0];if(Et(te)){const de=te.split("/").slice(-2);if(2===de.length)return`mapbox://styles/${de[0]}/${de[1]}`}}}(p)),j(B.attributes,"terrainEnabled",u.terrainEnabled?"true":"false"),j(B.attributes,"fogEnabled",u.fogEnabled?"true":"false"),j(B.attributes,"projection",u.projection),j(B.attributes,"zoom",u.zoom),j(B.metadata,"devicePixelRatio",I),j(B.metadata,"connectionEffectiveType",S?S.effectiveType:void 0),j(B.metadata,"navigatorUserAgent",J.navigator.userAgent),j(B.metadata,"screenWidth",J.screen.width),j(B.metadata,"screenHeight",J.screen.height),j(B.metadata,"windowWidth",J.innerWidth),j(B.metadata,"windowHeight",J.innerHeight),j(B.metadata,"mapWidth",u.width/I),j(B.metadata,"mapHeight",u.height/I),j(B.metadata,"webglRenderer",u.renderer),j(B.metadata,"webglVendor",u.vendor),j(B.metadata,"sdkVersion",ie),j(B.metadata,"sdkIdentifier","mapbox-gl-js"),B}(i);for(const u of a.metadata);for(const u of a.counters);for(const u of a.attributes);this.postEvent(e,a,()=>{},n)}},wi=Ci.postPerformanceEvent.bind(Ci),cr=new class extends be{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(n,e,i,a){if(!E.API_URL||!E.SESSION_PATH)return;const u=zn(E.API_URL+E.SESSION_PATH);u.params.push(`sku=${e||""}`),u.params.push(`access_token=${a||E.ACCESS_TOKEN||""}`);const p={url:pe(u),headers:{"Content-Type":"text/plain"}};var w;this.pendingRequest=(w=_=>{this.pendingRequest=null,i(_),this.saveEventData(),this.processRequests(a)},yn(De(p,{method:"GET"}),w))}getSessionAPI(n,e,i,a){this.skuToken=e,this.errorCb=a,E.SESSION_PATH&&E.API_URL&&(i||E.ACCESS_TOKEN?this.queueRequest({id:n,timestamp:Date.now()},i):this.errorCb(new Error(ft)))}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,a=>{a?this.errorCb(a):e&&(this.success[e]=!0)},n)}},Ui=cr.getSessionAPI.bind(cr),Lt=new Set,st={create:"create",load:"load",fullLoad:"fullLoad"},pn={mark(n){J.performance.mark(n)},measure(n,e,i){J.performance.measure(n,e,i)}};function mn(n){const e=n.name.split("?")[0];return jt(e)&&e.includes("mapbox-gl.js")?"javascript":jt(e)&&e.includes("mapbox-gl.css")?"css":E.API_FONTS_REGEX.test(e)?"fontRange":Xt(e)?"sprite":Et(e)?"style":E.API_TILEJSON_REGEX.test(e)?"tilejson":"other"}const En=J.performance;function ti(n){const e=n?n.url.toString():void 0;return En.getEntriesByName(e)}let gi,_i,Li,bi;const ir={now:()=>void 0!==Li?Li:J.performance.now(),setNow(n){Li=n},restoreNow(){Li=void 0},frame(n){const e=J.requestAnimationFrame(n);return{cancel:()=>J.cancelAnimationFrame(e)}},getImageData(n,e=0){const{width:i,height:a}=n;bi||(bi=J.document.createElement("canvas"));const u=bi.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return(i>bi.width||a>bi.height)&&(bi.width=i,bi.height=a),u.clearRect(-e,-e,i+2*e,a+2*e),u.drawImage(n,0,0,i,a),u.getImageData(-e,-e,i+2*e,a+2*e)},resolveURL:n=>(gi||(gi=J.document.createElement("a")),gi.href=n,gi.href),get devicePixelRatio(){return J.devicePixelRatio},get prefersReducedMotion(){return!!J.matchMedia&&(null==_i&&(_i=J.matchMedia("(prefers-reduced-motion: reduce)")),_i.matches)}};function Dr(n,e,i){i[n]&&-1!==i[n].indexOf(e)||(i[n]=i[n]||[],i[n].push(e))}function vi(n,e,i){if(i&&i[n]){const a=i[n].indexOf(e);-1!==a&&i[n].splice(a,1)}}class Ar{constructor(e,i={}){De(this,i),this.type=e}}class qi extends Ar{constructor(e,i={}){super("error",De({error:e},i))}}class Bi{on(e,i){return this._listeners=this._listeners||{},Dr(e,i,this._listeners),this}off(e,i){return vi(e,i,this._listeners),vi(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Dr(e,i,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,i){"string"==typeof e&&(e=new Ar(e,i||{}));const a=e.type;if(this.listens(a)){e.target=this;const u=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const w of u)w.call(this,e);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const w of p)vi(a,w,this._oneTimeListeners),w.call(this,e);const _=this._eventedParent;_&&(De(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof qi&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var Kt=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Wi(n,...e){for(const i of e)for(const a in i)n[a]=i[a];return n}function rr(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function yr(n){if(Array.isArray(n))return n.map(yr);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const e={};for(const i in n)e[i]=yr(n[i]);return e}return rr(n)}class xr extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var Sr=xr;class Go{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[a,u]of i)this.bindings[a]=u}concat(e){return new Go(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var Eo=Go;const to={kind:"null"},Xn={kind:"number"},Ei={kind:"string"},Si={kind:"boolean"},we={kind:"color"},fe={kind:"object"},je={kind:"value"},lt={kind:"collator"},an={kind:"formatted"},Vt={kind:"resolvedImage"};function vn(n,e){return{kind:"array",itemType:n,N:e}}function Dn(n){if("array"===n.kind){const e=Dn(n.itemType);return"number"==typeof n.N?`array<${e}, ${n.N}>`:"value"===n.itemType.kind?"array":`array<${e}>`}return n.kind}const In=[to,Xn,Ei,Si,we,an,fe,vn(je),Vt];function Fn(n,e){if("error"===e.kind)return null;if("array"===n.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Fn(n.itemType,e.itemType))&&("number"!=typeof n.N||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if("value"===n.kind)for(const i of In)if(!Fn(i,e))return null}return`Expected ${Dn(n)} but found ${Dn(e)} instead.`}function di(n,e){return e.some(i=>i.kind===n.kind)}function Ai(n,e){return e.some(i=>"null"===i?null===n:"array"===i?Array.isArray(n):"object"===i?n&&!Array.isArray(n)&&"object"==typeof n:i===typeof n)}var Ni,vr={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function go(n){return(n=Math.round(n))<0?0:n>255?255:n}function Nr(n){return go("%"===n[n.length-1]?parseFloat(n)/100*255:parseInt(n))}function co(n){return(e="%"===n[n.length-1]?parseFloat(n)/100:parseFloat(n))<0?0:e>1?1:e;var e}function uo(n,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?n+(e-n)*i*6:2*i<1?e:3*i<2?n+(e-n)*(2/3-i)*6:n}try{Ni={}.parseCSSColor=function(n){var e,i=n.replace(/ /g,"").toLowerCase();if(i in vr)return vr[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var a=i.indexOf("("),u=i.indexOf(")");if(-1!==a&&u+1===i.length){var p=i.substr(0,a),_=i.substr(a+1,u-(a+1)).split(","),w=1;switch(p){case"rgba":if(4!==_.length)return null;w=co(_.pop());case"rgb":return 3!==_.length?null:[Nr(_[0]),Nr(_[1]),Nr(_[2]),w];case"hsla":if(4!==_.length)return null;w=co(_.pop());case"hsl":if(3!==_.length)return null;var I=(parseFloat(_[0])%360+360)%360/360,S=co(_[1]),B=co(_[2]),j=B<=.5?B*(S+1):B+S-B*S,H=2*B-j;return[go(255*uo(H,j,I+1/3)),go(255*uo(H,j,I)),go(255*uo(H,j,I-1/3)),w];default:return null}}return null}}catch{}class Jr{constructor(e,i,a,u=1){this.r=e,this.g=i,this.b=a,this.a=u}static parse(e){if(!e)return;if(e instanceof Jr)return e;if("string"!=typeof e)return;const i=Ni(e);return i?new Jr(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,a,u]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(a)},${u})`}toArray(){const{r:e,g:i,b:a,a:u}=this;return 0===u?[0,0,0,0]:[255*e/u,255*i/u,255*a/u,u]}toArray01(){const{r:e,g:i,b:a,a:u}=this;return 0===u?[0,0,0,0]:[e/u,i/u,a/u,u]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:a,a:u}=this;return[e,i,a,u]}}Jr.black=new Jr(0,0,0,1),Jr.white=new Jr(1,1,1,1),Jr.transparent=new Jr(0,0,0,0),Jr.red=new Jr(1,0,0,1),Jr.blue=new Jr(0,0,1,1);var kr=Jr;class To{constructor(e,i,a){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ds{constructor(e,i,a,u,p){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=a,this.fontStack=u,this.textColor=p}}class xo{constructor(e){this.sections=e}static fromString(e){return new xo([new ds(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof xo?e:xo.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const a={};i.fontStack&&(a["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(a["font-scale"]=i.scale),i.textColor&&(a["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(a)}return e}}class zi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new zi({name:e,available:!1}):null}serialize(){return["image",this.name]}}function Fr(n,e,i,a){return"number"==typeof n&&n>=0&&n<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===a||"number"==typeof a&&a>=0&&a<=1?null:`Invalid rgba value [${[n,e,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof a?[n,e,i,a]:[n,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Or(n){if(null===n||"string"==typeof n||"boolean"==typeof n||"number"==typeof n||n instanceof kr||n instanceof To||n instanceof xo||n instanceof zi)return!0;if(Array.isArray(n)){for(const e of n)if(!Or(e))return!1;return!0}if("object"==typeof n){for(const e in n)if(!Or(n[e]))return!1;return!0}return!1}function Er(n){if(null===n)return to;if("string"==typeof n)return Ei;if("boolean"==typeof n)return Si;if("number"==typeof n)return Xn;if(n instanceof kr)return we;if(n instanceof To)return lt;if(n instanceof xo)return an;if(n instanceof zi)return Vt;if(Array.isArray(n)){const e=n.length;let i;for(const a of n){const u=Er(a);if(i){if(i===u)continue;i=je;break}i=u}return vn(i||je,e)}return fe}function so(n){const e=typeof n;return null===n?"":"string"===e||"number"===e||"boolean"===e?String(n):n instanceof kr||n instanceof xo||n instanceof zi?n.toString():JSON.stringify(n)}class Gs{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(2!==e.length)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Or(e[1]))return i.error("invalid value");const a=e[1];let u=Er(a);const p=i.expectedType;return"array"!==u.kind||0!==u.N||!p||"array"!==p.kind||"number"==typeof p.N&&0!==p.N||(u=p),new Gs(u,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof kr?["rgba"].concat(this.value.toArray()):this.value instanceof xo?this.value.serialize():this.value}}var Po=Gs,Hr=class{constructor(n){this.name="ExpressionEvaluationError",this.message=n}toJSON(){return this.message}};const wa={string:Ei,number:Xn,boolean:Si,object:fe};class bs{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let a,u=1;const p=e[0];if("array"===p){let w,I;if(e.length>2){const S=e[1];if("string"!=typeof S||!(S in wa)||"object"===S)return i.error('The item type argument of "array" must be one of string, number, boolean',1);w=wa[S],u++}else w=je;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);I=e[2],u++}a=vn(w,I)}else a=wa[p];const _=[];for(;ue.outputDefined())}serialize(){const e=this.type,i=[e.kind];if("array"===e.kind){const a=e.itemType;if("string"===a.kind||"number"===a.kind||"boolean"===a.kind){i.push(a.kind);const u=e.N;("number"==typeof u||this.args.length>1)&&i.push(u)}}return i.concat(this.args.map(a=>a.serialize()))}}var gr=bs;class li{constructor(e){this.type=an,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&"object"==typeof a)return i.error("First argument must be an image or text section.");const u=[];let p=!1;for(let _=1;_<=e.length-1;++_){const w=e[_];if(p&&"object"==typeof w&&!Array.isArray(w)){p=!1;let I=null;if(w["font-scale"]&&(I=i.parse(w["font-scale"],1,Xn),!I))return null;let S=null;if(w["text-font"]&&(S=i.parse(w["text-font"],1,vn(Ei)),!S))return null;let B=null;if(w["text-color"]&&(B=i.parse(w["text-color"],1,we),!B))return null;const j=u[u.length-1];j.scale=I,j.font=S,j.textColor=B}else{const I=i.parse(e[_],1,je);if(!I)return null;const S=I.type.kind;if("string"!==S&&"value"!==S&&"null"!==S&&"resolvedImage"!==S)return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,u.push({content:I,scale:null,font:null,textColor:null})}}return new li(u)}evaluate(e){return new xo(this.sections.map(i=>{const a=i.content.evaluate(e);return Er(a)===Vt?new ds("",a,null,null,null):new ds(so(a),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const a={};i.scale&&(a["font-scale"]=i.scale.serialize()),i.font&&(a["text-font"]=i.font.serialize()),i.textColor&&(a["text-color"]=i.textColor.serialize()),e.push(a)}return e}}class Zi{constructor(e){this.type=Vt,this.input=e}static parse(e,i){if(2!==e.length)return i.error("Expected two arguments.");const a=i.parse(e[1],1,Ei);return a?new Zi(a):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),a=zi.fromString(i);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(i)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Rr={"to-boolean":Si,"to-color":we,"to-number":Xn,"to-string":Ei};class _o{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const a=e[0];if(("to-boolean"===a||"to-string"===a)&&2!==e.length)return i.error("Expected one argument.");const u=Rr[a],p=[];for(let _=1;_4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Fr(i[0],i[1],i[2],i[3]),!a))return new kr(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Hr(a||`Could not parse color from value '${"string"==typeof i?i:String(JSON.stringify(i))}'`)}if("number"===this.type.kind){let i=null;for(const a of this.args){if(i=a.evaluate(e),null===i)return 0;const u=Number(i);if(!isNaN(u))return u}throw new Hr(`Could not convert ${JSON.stringify(i)} to number.`)}return"formatted"===this.type.kind?xo.fromString(so(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?zi.fromString(so(this.args[0].evaluate(e))):so(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if("formatted"===this.type.kind)return new li([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Zi(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var rs=_o;const zr=["Unknown","Point","LineString","Polygon"];var ko=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?zr[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const n=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-n[0])+this.featureDistanceData.bearing[1]*(a*e-n[1])}return 0}parseColor(n){let e=this._parseColorCache[n];return e||(e=this._parseColorCache[n]=kr.parse(n)),e}};class br{constructor(e,i,a,u){this.name=e,this.type=i,this._evaluate=a,this.args=u}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const a=e[0],u=br.definitions[a];if(!u)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(u)?u[0]:u.type,_=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,w=_.filter(([S])=>!Array.isArray(S)||S.length===e.length-1);let I=null;for(const[S,B]of w){I=new Bo(i.registry,i.path,null,i.scope);const j=[];let H=!1;for(let X=1;X{return H=j,Array.isArray(H)?`(${H.map(Dn).join(", ")})`:`(${Dn(H.type)}...)`;var H}).join(" | "),B=[];for(let j=1;j=e[2]||n[1]<=e[1]||n[3]>=e[3])}function os(n,e){const i=(180+n[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n[1]*Math.PI/360)))/360,u=Math.pow(2,e.z);return[Math.round(i*u*Ti),Math.round(a*u*Ti)]}function Br(n,e,i){const a=n[0]-e[0],u=n[1]-e[1],p=n[0]-i[0],_=n[1]-i[1];return a*_-p*u==0&&a*p<=0&&u*_<=0}function zs(n,e){let i=!1;for(let _=0,w=e.length;_(a=n)[1]!=(p=I[S+1])[1]>a[1]&&a[0]<(p[0]-u[0])*(a[1]-u[1])/(p[1]-u[1])+u[0]&&(i=!i)}}var a,u,p;return i}function ws(n,e){for(let i=0;i0&&w<0||_<0&&w>0}function Ho(n,e,i){for(const S of i)for(let B=0;Bi[2]){const u=.5*a;let p=n[0]-i[0]>u?-a:i[0]-n[0]>u?a:0;0===p&&(p=n[0]-i[2]>u?-a:i[2]-n[0]>u?a:0),n[0]+=p}Ns(e,n)}function or(n,e,i,a){const u=Math.pow(2,a.z)*Ti,p=[a.x*Ti,a.y*Ti],_=[];if(!n)return _;for(const w of n)for(const I of w){const S=[I.x+p[0],I.y+p[1]];Cs(S,e,i,u),_.push(S)}return _}function Qa(n,e,i,a){const u=Math.pow(2,a.z)*Ti,p=[a.x*Ti,a.y*Ti],_=[];if(!n)return _;for(const I of n){const S=[];for(const B of I){const j=[B.x+p[0],B.y+p[1]];Ns(e,j),S.push(j)}_.push(S)}if(e[2]-e[0]<=u/2){(w=e)[0]=w[1]=1/0,w[2]=w[3]=-1/0;for(const I of _)for(const S of I)Cs(S,e,i,u)}var w;return _}class Os{constructor(e,i){this.type=Si,this.geojson=e,this.geometries=i}static parse(e,i){if(2!==e.length)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Or(e[1])){const a=e[1];if("FeatureCollection"===a.type)for(let u=0;u{e&&!Ur(i)&&(e=!1)}),e}function fs(n){if(n instanceof bo&&"feature-state"===n.name)return!1;let e=!0;return n.eachChild(i=>{e&&!fs(i)&&(e=!1)}),e}function Do(n,e){if(n instanceof bo&&e.indexOf(n.name)>=0)return!1;let i=!0;return n.eachChild(a=>{i&&!Do(a,e)&&(i=!1)}),i}class Hs{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(2!==e.length||"string"!=typeof e[1])return i.error("'var' expression requires exactly one string literal argument.");const a=e[1];return i.scope.has(a)?new Hs(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Io=Hs;class el{constructor(e,i=[],a,u=new Eo,p=[]){this.registry=e,this.path=i,this.key=i.map(_=>`[${_}]`).join(""),this.scope=u,this.errors=p,this.expectedType=a}parse(e,i,a,u,p={}){return i?this.concat(i,a,u)._parse(e,p):this._parse(e,p)}_parse(e,i){function a(u,p,_){return"assert"===_?new gr(p,[u]):"coerce"===_?new rs(p,[u]):u}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=e[0];if("string"!=typeof u)return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[u];if(p){let _=p.parse(e,this);if(!_)return null;if(this.expectedType){const w=this.expectedType,I=_.type;if("string"!==w.kind&&"number"!==w.kind&&"boolean"!==w.kind&&"object"!==w.kind&&"array"!==w.kind||"value"!==I.kind)if("color"!==w.kind&&"formatted"!==w.kind&&"resolvedImage"!==w.kind||"value"!==I.kind&&"string"!==I.kind){if(this.checkSubtype(w,I))return null}else _=a(_,w,i.typeAnnotation||"coerce");else _=a(_,w,i.typeAnnotation||"assert")}if(!(_ instanceof Po)&&"resolvedImage"!==_.type.kind&&yo(_)){const w=new ko;try{_=new Po(_.type,_.evaluate(w))}catch(I){return this.error(I.message),null}}return _}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,a){const u="number"==typeof e?this.path.concat(e):this.path,p=a?this.scope.concat(a):this.scope;return new el(this.registry,u,i||null,p,this.errors)}error(e,...i){const a=`${this.key}${i.map(u=>`[${u}]`).join("")}`;this.errors.push(new Sr(a,e))}checkSubtype(e,i){const a=Fn(e,i);return a&&this.error(a),a}}var Bo=el;function yo(n){if(n instanceof Io)return yo(n.boundExpression);if(n instanceof bo&&"error"===n.name||n instanceof Oo||n instanceof ia)return!1;const e=n instanceof rs||n instanceof gr;let i=!0;return n.eachChild(a=>{i=e?i&&yo(a):i&&a instanceof Po}),!!i&&Ur(n)&&Do(n,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function ra(n,e){const i=n.length-1;let a,u,p=0,_=i,w=0;for(;p<=_;)if(w=Math.floor((p+_)/2),a=n[w],u=n[w+1],a<=e){if(w===i||ee))throw new Hr("Input is not a number.");_=w-1}return 0}class Rs{constructor(e,i,a){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[u,p]of a)this.labels.push(u),this.outputs.push(p)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(e[1],1,Xn);if(!a)return null;const u=[];let p=null;i.expectedType&&"value"!==i.expectedType.kind&&(p=i.expectedType);for(let _=1;_=w)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',S);const j=i.parse(I,B,p);if(!j)return null;p=p||j.type,u.push([w,j])}return new Rs(p,a,u)}evaluate(e){const i=this.labels,a=this.outputs;if(1===i.length)return a[0].evaluate(e);const u=this.input.evaluate(e);if(u<=i[0])return a[0].evaluate(e);const p=i.length;return u>=i[p-1]?a[p-1].evaluate(e):a[ra(i,u)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var Ls=Rs;function ki(n,e,i){return n*(1-i)+e*i}var Ws=Object.freeze({__proto__:null,array:function(n,e,i){return n.map((a,u)=>ki(a,e[u],i))},color:function(n,e,i){return new kr(ki(n.r,e.r,i),ki(n.g,e.g,i),ki(n.b,e.b,i),ki(n.a,e.a,i))},number:ki});const v=.95047,M=1.08883,D=4/29,A=6/29,G=3*A*A,It=A*A*A,Yn=Math.PI/180,pi=180/Math.PI;function tr(n){return n>It?Math.pow(n,1/3):n/G+D}function Zr(n){return n>A?n*n*n:G*(n-D)}function Mo(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function oa(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Es(n){const e=oa(n.r),i=oa(n.g),a=oa(n.b),u=tr((.4124564*e+.3575761*i+.1804375*a)/v),p=tr((.2126729*e+.7151522*i+.072175*a)/1);return{l:116*p-16,a:500*(u-p),b:200*(p-tr((.0193339*e+.119192*i+.9503041*a)/M)),alpha:n.a}}function ks(n){let e=(n.l+16)/116,i=isNaN(n.a)?e:e+n.a/500,a=isNaN(n.b)?e:e-n.b/200;return e=1*Zr(e),i=v*Zr(i),a=M*Zr(a),new kr(Mo(3.2404542*i-1.5371385*e-.4985314*a),Mo(-.969266*i+1.8760108*e+.041556*a),Mo(.0556434*i-.2040259*e+1.0572252*a),n.alpha)}function Fa(n,e,i){const a=e-n;return n+i*(a>180||a<-180?a-360*Math.round(a/360):a)}const tl={forward:Es,reverse:ks,interpolate:function(n,e,i){return{l:ki(n.l,e.l,i),a:ki(n.a,e.a,i),b:ki(n.b,e.b,i),alpha:ki(n.alpha,e.alpha,i)}}},da={forward:function(n){const{l:e,a:i,b:a}=Es(n),u=Math.atan2(a,i)*pi;return{h:u<0?u+360:u,c:Math.sqrt(i*i+a*a),l:e,alpha:n.a}},reverse:function(n){const e=n.h*Yn,i=n.c;return ks({l:n.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:n.alpha})},interpolate:function(n,e,i){return{h:Fa(n.h,e.h,i),c:ki(n.c,e.c,i),l:ki(n.l,e.l,i),alpha:ki(n.alpha,e.alpha,i)}}};var yl=Object.freeze({__proto__:null,hcl:da,lab:tl});class Ba{constructor(e,i,a,u,p){this.type=e,this.operator=i,this.interpolation=a,this.input=u,this.labels=[],this.outputs=[];for(const[_,w]of p)this.labels.push(_),this.outputs.push(w)}static interpolationFactor(e,i,a,u){let p=0;if("exponential"===e.name)p=vl(i,e.base,a,u);else if("linear"===e.name)p=vl(i,1,a,u);else if("cubic-bezier"===e.name){const _=e.controlPoints;p=new Ue(_[0],_[1],_[2],_[3]).solve(vl(i,1,a,u))}return p}static parse(e,i){let[a,u,p,..._]=e;if(!Array.isArray(u)||0===u.length)return i.error("Expected an interpolation type expression.",1);if("linear"===u[0])u={name:"linear"};else if("exponential"===u[0]){const S=u[1];if("number"!=typeof S)return i.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:S}}else{if("cubic-bezier"!==u[0])return i.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const S=u.slice(1);if(4!==S.length||S.some(B=>"number"!=typeof B||B<0||B>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:S}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,Xn),!p)return null;const w=[];let I=null;"interpolate-hcl"===a||"interpolate-lab"===a?I=we:i.expectedType&&"value"!==i.expectedType.kind&&(I=i.expectedType);for(let S=0;S<_.length;S+=2){const B=_[S],j=_[S+1],H=S+3,X=S+4;if("number"!=typeof B)return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',H);if(w.length&&w[w.length-1][0]>=B)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const te=i.parse(j,X,I);if(!te)return null;I=I||te.type,w.push([B,te])}return"number"===I.kind||"color"===I.kind||"array"===I.kind&&"number"===I.itemType.kind&&"number"==typeof I.N?new Ba(I,a,u,p,w):i.error(`Type ${Dn(I)} is not interpolatable.`)}evaluate(e){const i=this.labels,a=this.outputs;if(1===i.length)return a[0].evaluate(e);const u=this.input.evaluate(e);if(u<=i[0])return a[0].evaluate(e);const p=i.length;if(u>=i[p-1])return a[p-1].evaluate(e);const _=ra(i,u),w=Ba.interpolationFactor(this.interpolation,u,i[_],i[_+1]),I=a[_].evaluate(e),S=a[_+1].evaluate(e);return"interpolate"===this.operator?Ws[this.type.kind.toLowerCase()](I,S,w):"interpolate-hcl"===this.operator?da.reverse(da.interpolate(da.forward(I),da.forward(S),w)):tl.reverse(tl.interpolate(tl.forward(I),tl.forward(S),w))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let a=0;aFn(u,w.type));return new cc(_?je:a,p)}evaluate(e){let i,a=null,u=0;for(const p of this.args){if(u++,a=p.evaluate(e),a&&a instanceof zi&&!a.available&&(i||(i=a),a=null,u===this.args.length))return i;if(null!==a)break}return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var ha=cc;class Ca{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Hr(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Hr(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var dc=Ea;class fa{constructor(e,i){this.type=Si,this.needle=e,this.haystack=i}static parse(e,i){if(3!==e.length)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=i.parse(e[1],1,je),u=i.parse(e[2],2,je);return a&&u?di(a.type,[Si,Ei,Xn,to,je])?new fa(a,u):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(a.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(null==a)return!1;if(!Ai(i,["boolean","string","number","null"]))throw new Hr(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Er(i))} instead.`);if(!Ai(a,["string","array"]))throw new Hr(`Expected second argument to be of type array or string, but found ${Dn(Er(a))} instead.`);return a.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Na=fa;class xl{constructor(e,i,a){this.type=Xn,this.needle=e,this.haystack=i,this.fromIndex=a}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=i.parse(e[1],1,je),u=i.parse(e[2],2,je);if(!a||!u)return null;if(!di(a.type,[Si,Ei,Xn,to,je]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(a.type)} instead`);if(4===e.length){const p=i.parse(e[3],3,Xn);return p?new xl(a,u,p):null}return new xl(a,u)}evaluate(e){const i=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!Ai(i,["boolean","string","number","null"]))throw new Hr(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Er(i))} instead.`);if(!Ai(a,["string","array"]))throw new Hr(`Expected second argument to be of type array or string, but found ${Dn(Er(a))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(e);return a.indexOf(i,u)}return a.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Iu=xl;class hc{constructor(e,i,a,u,p,_){this.inputType=e,this.type=i,this.input=a,this.cases=u,this.outputs=p,this.otherwise=_}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let a,u;i.expectedType&&"value"!==i.expectedType.kind&&(u=i.expectedType);const p={},_=[];for(let S=2;SNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof te&&Math.floor(te)!==te)return H.error("Numeric branch labels must be integer values.");if(a){if(H.checkSubtype(a,Er(te)))return null}else a=Er(te);if(void 0!==p[String(te)])return H.error("Branch labels must be unique.");p[String(te)]=_.length}const X=i.parse(j,S,u);if(!X)return null;u=u||X.type,_.push(X)}const w=i.parse(e[1],1,je);if(!w)return null;const I=i.parse(e[e.length-1],e.length-1,u);return I?"value"!==w.type.kind&&i.concat(1).checkSubtype(a,w.type)?null:new hc(a,u,w,p,_,I):null}evaluate(e){const i=this.input.evaluate(e);return(Er(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),a=[],u={};for(const _ of i){const w=u[this.cases[_]];void 0===w?(u[this.cases[_]]=a.length,a.push([this.cases[_],[_]])):a[w][1].push(_)}const p=_=>"number"===this.inputType.kind?Number(_):_;for(const[_,w]of a)e.push(1===w.length?p(w[0]):w.map(p)),e.push(this.outputs[_].serialize());return e.push(this.otherwise.serialize()),e}}var Us=hc;class nl{constructor(e,i,a){this.type=e,this.branches=i,this.otherwise=a}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&"value"!==i.expectedType.kind&&(a=i.expectedType);const u=[];for(let _=1;_i.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Ao=nl;class za{constructor(e,i,a,u){this.type=e,this.input=i,this.beginIndex=a,this.endIndex=u}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=i.parse(e[1],1,je),u=i.parse(e[2],2,Xn);if(!a||!u)return null;if(!di(a.type,[vn(je),Ei,je]))return i.error(`Expected first argument to be of type array or string, but found ${Dn(a.type)} instead`);if(4===e.length){const p=i.parse(e[3],3,Xn);return p?new za(a.type,a,u,p):null}return new za(a.type,a,u)}evaluate(e){const i=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!Ai(i,["string","array"]))throw new Hr(`Expected first argument to be of type array or string, but found ${Dn(Er(i))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(e);return i.slice(a,u)}return i.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Mu=za;function Ua(n,e){return"=="===n||"!="===n?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Vl(n,e,i,a){return 0===a.compare(e,i)}function sa(n,e,i){const a="=="!==n&&"!="!==n;return class X1{constructor(p,_,w){this.type=Si,this.lhs=p,this.rhs=_,this.collator=w,this.hasUntypedArgument="value"===p.type.kind||"value"===_.type.kind}static parse(p,_){if(3!==p.length&&4!==p.length)return _.error("Expected two or three arguments.");const w=p[0];let I=_.parse(p[1],1,je);if(!I)return null;if(!Ua(w,I.type))return _.concat(1).error(`"${w}" comparisons are not supported for type '${Dn(I.type)}'.`);let S=_.parse(p[2],2,je);if(!S)return null;if(!Ua(w,S.type))return _.concat(2).error(`"${w}" comparisons are not supported for type '${Dn(S.type)}'.`);if(I.type.kind!==S.type.kind&&"value"!==I.type.kind&&"value"!==S.type.kind)return _.error(`Cannot compare types '${Dn(I.type)}' and '${Dn(S.type)}'.`);a&&("value"===I.type.kind&&"value"!==S.type.kind?I=new gr(S.type,[I]):"value"!==I.type.kind&&"value"===S.type.kind&&(S=new gr(I.type,[S])));let B=null;if(4===p.length){if("string"!==I.type.kind&&"string"!==S.type.kind&&"value"!==I.type.kind&&"value"!==S.type.kind)return _.error("Cannot use collator to compare non-string types.");if(B=_.parse(p[3],3,lt),!B)return null}return new X1(I,S,B)}evaluate(p){const _=this.lhs.evaluate(p),w=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const I=Er(_),S=Er(w);if(I.kind!==S.kind||"string"!==I.kind&&"number"!==I.kind)throw new Hr(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${I.kind}, ${S.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const I=Er(_),S=Er(w);if("string"!==I.kind||"string"!==S.kind)return e(p,_,w)}return this.collator?i(p,_,w,this.collator.evaluate(p)):e(p,_,w)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}serialize(){const p=[n];return this.eachChild(_=>{p.push(_.serialize())}),p}}}const bl=sa("==",function(n,e,i){return e===i},Vl),vd=sa("!=",function(n,e,i){return e!==i},function(n,e,i,a){return!Vl(0,e,i,a)}),Gc=sa("<",function(n,e,i){return e",function(n,e,i){return e>i},function(n,e,i,a){return a.compare(e,i)>0}),Au=sa("<=",function(n,e,i){return e<=i},function(n,e,i,a){return a.compare(e,i)<=0}),wl=sa(">=",function(n,e,i){return e>=i},function(n,e,i,a){return a.compare(e,i)>=0});class $l{constructor(e,i,a,u,p,_){this.type=Ei,this.number=e,this.locale=i,this.currency=a,this.unit=u,this.minFractionDigits=p,this.maxFractionDigits=_}static parse(e,i){if(3!==e.length)return i.error("Expected two arguments.");const a=i.parse(e[1],1,Xn);if(!a)return null;const u=e[2];if("object"!=typeof u||Array.isArray(u))return i.error("NumberFormat options argument must be an object.");let p=null;if(u.locale&&(p=i.parse(u.locale,1,Ei),!p))return null;let _=null;if(u.currency&&(_=i.parse(u.currency,1,Ei),!_))return null;let w=null;if(u.unit&&(w=i.parse(u.unit,1,Ei),!w))return null;let I=null;if(u["min-fraction-digits"]&&(I=i.parse(u["min-fraction-digits"],1,Xn),!I))return null;let S=null;return u["max-fraction-digits"]&&(S=i.parse(u["max-fraction-digits"],1,Xn),!S)?null:new $l(a,p,_,w,I,S)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class il{constructor(e){this.type=Xn,this.input=e}static parse(e,i){if(2!==e.length)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=i.parse(e[1],1);return a?"array"!==a.type.kind&&"string"!==a.type.kind&&"value"!==a.type.kind?i.error(`Expected argument of type string or array, but found ${Dn(a.type)} instead.`):new il(a):null}evaluate(e){const i=this.input.evaluate(e);if("string"==typeof i||Array.isArray(i))return i.length;throw new Hr(`Expected value to be of type string or array, but found ${Dn(Er(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const xd={"==":bl,"!=":vd,">":fc,"<":Gc,">=":wl,"<=":Au,array:gr,at:dc,boolean:gr,case:Ao,coalesce:ha,collator:Oo,format:li,image:Zi,in:Na,"index-of":Iu,interpolate:Ts,"interpolate-hcl":Ts,"interpolate-lab":Ts,length:il,let:uc,literal:Po,match:Us,number:gr,"number-format":$l,object:gr,slice:Mu,step:Ls,string:gr,"to-boolean":rs,"to-color":rs,"to-number":rs,"to-string":rs,var:Io,within:ia};function pc(n,[e,i,a,u]){e=e.evaluate(n),i=i.evaluate(n),a=a.evaluate(n);const p=u?u.evaluate(n):1,_=Fr(e,i,a,p);if(_)throw new Hr(_);return new kr(e/255*p,i/255*p,a/255*p,p)}function qs(n,e){return n in e}function Ta(n,e){const i=e[n];return void 0===i?null:i}function Zs(n){return{type:n}}bo.register(xd,{error:[{kind:"error"},[Ei],(n,[e])=>{throw new Hr(e.evaluate(n))}],typeof:[Ei,[je],(n,[e])=>Dn(Er(e.evaluate(n)))],"to-rgba":[vn(Xn,4),[we],(n,[e])=>e.evaluate(n).toArray()],rgb:[we,[Xn,Xn,Xn],pc],rgba:[we,[Xn,Xn,Xn,Xn],pc],has:{type:Si,overloads:[[[Ei],(n,[e])=>qs(e.evaluate(n),n.properties())],[[Ei,fe],(n,[e,i])=>qs(e.evaluate(n),i.evaluate(n))]]},get:{type:je,overloads:[[[Ei],(n,[e])=>Ta(e.evaluate(n),n.properties())],[[Ei,fe],(n,[e,i])=>Ta(e.evaluate(n),i.evaluate(n))]]},"feature-state":[je,[Ei],(n,[e])=>Ta(e.evaluate(n),n.featureState||{})],properties:[fe,[],n=>n.properties()],"geometry-type":[Ei,[],n=>n.geometryType()],id:[je,[],n=>n.id()],zoom:[Xn,[],n=>n.globals.zoom],pitch:[Xn,[],n=>n.globals.pitch||0],"distance-from-center":[Xn,[],n=>n.distanceFromCenter()],"heatmap-density":[Xn,[],n=>n.globals.heatmapDensity||0],"line-progress":[Xn,[],n=>n.globals.lineProgress||0],"sky-radial-progress":[Xn,[],n=>n.globals.skyRadialProgress||0],accumulated:[je,[],n=>void 0===n.globals.accumulated?null:n.globals.accumulated],"+":[Xn,Zs(Xn),(n,e)=>{let i=0;for(const a of e)i+=a.evaluate(n);return i}],"*":[Xn,Zs(Xn),(n,e)=>{let i=1;for(const a of e)i*=a.evaluate(n);return i}],"-":{type:Xn,overloads:[[[Xn,Xn],(n,[e,i])=>e.evaluate(n)-i.evaluate(n)],[[Xn],(n,[e])=>-e.evaluate(n)]]},"/":[Xn,[Xn,Xn],(n,[e,i])=>e.evaluate(n)/i.evaluate(n)],"%":[Xn,[Xn,Xn],(n,[e,i])=>e.evaluate(n)%i.evaluate(n)],ln2:[Xn,[],()=>Math.LN2],pi:[Xn,[],()=>Math.PI],e:[Xn,[],()=>Math.E],"^":[Xn,[Xn,Xn],(n,[e,i])=>Math.pow(e.evaluate(n),i.evaluate(n))],sqrt:[Xn,[Xn],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[Xn,[Xn],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[Xn,[Xn],(n,[e])=>Math.log(e.evaluate(n))],log2:[Xn,[Xn],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[Xn,[Xn],(n,[e])=>Math.sin(e.evaluate(n))],cos:[Xn,[Xn],(n,[e])=>Math.cos(e.evaluate(n))],tan:[Xn,[Xn],(n,[e])=>Math.tan(e.evaluate(n))],asin:[Xn,[Xn],(n,[e])=>Math.asin(e.evaluate(n))],acos:[Xn,[Xn],(n,[e])=>Math.acos(e.evaluate(n))],atan:[Xn,[Xn],(n,[e])=>Math.atan(e.evaluate(n))],min:[Xn,Zs(Xn),(n,e)=>Math.min(...e.map(i=>i.evaluate(n)))],max:[Xn,Zs(Xn),(n,e)=>Math.max(...e.map(i=>i.evaluate(n)))],abs:[Xn,[Xn],(n,[e])=>Math.abs(e.evaluate(n))],round:[Xn,[Xn],(n,[e])=>{const i=e.evaluate(n);return i<0?-Math.round(-i):Math.round(i)}],floor:[Xn,[Xn],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[Xn,[Xn],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[Si,[Ei,je],(n,[e,i])=>n.properties()[e.value]===i.value],"filter-id-==":[Si,[je],(n,[e])=>n.id()===e.value],"filter-type-==":[Si,[Ei],(n,[e])=>n.geometryType()===e.value],"filter-<":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a{const i=n.id(),a=e.value;return typeof i==typeof a&&i":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a>u}],"filter-id->":[Si,[je],(n,[e])=>{const i=n.id(),a=e.value;return typeof i==typeof a&&i>a}],"filter-<=":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a<=u}],"filter-id-<=":[Si,[je],(n,[e])=>{const i=n.id(),a=e.value;return typeof i==typeof a&&i<=a}],"filter->=":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a>=u}],"filter-id->=":[Si,[je],(n,[e])=>{const i=n.id(),a=e.value;return typeof i==typeof a&&i>=a}],"filter-has":[Si,[je],(n,[e])=>e.value in n.properties()],"filter-has-id":[Si,[],n=>null!==n.id()&&void 0!==n.id()],"filter-type-in":[Si,[vn(Ei)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[Si,[vn(je)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[Si,[Ei,vn(je)],(n,[e,i])=>i.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[Si,[Ei,vn(je)],(n,[e,i])=>function(a,u,p,_){for(;p<=_;){const w=p+_>>1;if(u[w]===a)return!0;u[w]>a?_=w-1:p=w+1}return!1}(n.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Si,overloads:[[[Si,Si],(n,[e,i])=>e.evaluate(n)&&i.evaluate(n)],[Zs(Si),(n,e)=>{for(const i of e)if(!i.evaluate(n))return!1;return!0}]]},any:{type:Si,overloads:[[[Si,Si],(n,[e,i])=>e.evaluate(n)||i.evaluate(n)],[Zs(Si),(n,e)=>{for(const i of e)if(i.evaluate(n))return!0;return!1}]]},"!":[Si,[Si],(n,[e])=>!e.evaluate(n)],"is-supported-script":[Si,[Ei],(n,[e])=>{const i=n.globals&&n.globals.isSupportedScript;return!i||i(e.evaluate(n))}],upcase:[Ei,[Ei],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[Ei,[Ei],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[Ei,Zs(je),(n,e)=>e.map(i=>so(i.evaluate(n))).join("")],"resolved-locale":[Ei,[lt],(n,[e])=>e.evaluate(n).resolvedLocale()]});var N=xd;function ne(n){return{result:"success",value:n}}function it(n){return{result:"error",value:n}}function Q(n){return"data-driven"===n["property-type"]}function He(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function At(n){return!!n.expression&&n.expression.interpolated}function cn(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":null===n?"null":typeof n}function ri(n){return"object"==typeof n&&null!==n&&!Array.isArray(n)}function fr(n){return n}function Xi(n,e){const i="color"===e.type,a=n.stops&&"object"==typeof n.stops[0][0],u=a||!(a||void 0!==n.property),p=n.type||(At(e)?"exponential":"interval");if(i&&((n=Wi({},n)).stops&&(n.stops=n.stops.map(S=>[S[0],kr.parse(S[1])])),n.default=kr.parse(n.default?n.default:e.default)),n.colorSpace&&"rgb"!==n.colorSpace&&!yl[n.colorSpace])throw new Error(`Unknown color space: ${n.colorSpace}`);let _,w,I;if("exponential"===p)_=Tr;else if("interval"===p)_=Vi;else if("categorical"===p){_=sr,w=Object.create(null);for(const S of n.stops)w[S[0]]=S[1];I=typeof n.stops[0][0]}else{if("identity"!==p)throw new Error(`Unknown function type "${p}"`);_=ho}if(a){const S={},B=[];for(let X=0;XX[0]),evaluate:({zoom:X},te)=>Tr({stops:j,base:n.base},e,X).evaluate(X,te)}}if(u){const S="exponential"===p?{name:"exponential",base:void 0!==n.base?n.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:Ts.interpolationFactor.bind(void 0,S),zoomStops:n.stops.map(B=>B[0]),evaluate:({zoom:B})=>_(n,e,B,w,I)}}return{kind:"source",evaluate(S,B){const j=B&&B.properties?B.properties[n.property]:void 0;return void 0===j?pr(n.default,e.default):_(n,e,j,w,I)}}}function pr(n,e,i){return void 0!==n?n:void 0!==e?e:void 0!==i?i:void 0}function sr(n,e,i,a,u){return pr(typeof i===u?a[i]:void 0,n.default,e.default)}function Vi(n,e,i){if("number"!==cn(i))return pr(n.default,e.default);const a=n.stops.length;if(1===a||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[a-1][0])return n.stops[a-1][1];const u=ra(n.stops.map(p=>p[0]),i);return n.stops[u][1]}function Tr(n,e,i){const a=void 0!==n.base?n.base:1;if("number"!==cn(i))return pr(n.default,e.default);const u=n.stops.length;if(1===u||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[u-1][0])return n.stops[u-1][1];const p=ra(n.stops.map(B=>B[0]),i),_=function(B,j,H,X){const te=X-H,de=B-H;return 0===te?0:1===j?de/te:(Math.pow(j,de)-1)/(Math.pow(j,te)-1)}(i,a,n.stops[p][0],n.stops[p+1][0]),w=n.stops[p][1],I=n.stops[p+1][1];let S=Ws[e.type]||fr;if(n.colorSpace&&"rgb"!==n.colorSpace){const B=yl[n.colorSpace];S=(j,H)=>B.reverse(B.interpolate(B.forward(j),B.forward(H),_))}return"function"==typeof w.evaluate?{evaluate(...B){const j=w.evaluate.apply(void 0,B),H=I.evaluate.apply(void 0,B);if(void 0!==j&&void 0!==H)return S(j,H,_)}}:S(w,I,_)}function ho(n,e,i){return"color"===e.type?i=kr.parse(i):"formatted"===e.type?i=xo.fromString(i.toString()):"resolvedImage"===e.type?i=zi.fromString(i.toString()):cn(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),pr(i,n.default,e.default)}class ao{constructor(e,i){var a;this.expression=e,this._warningHistory={},this._evaluator=new ko,this._defaultValue=i?"color"===(a=i).type&&(ri(a.default)||Array.isArray(a.default))?new kr(0,0,0,0):"color"===a.type?kr.parse(a.default)||null:void 0===a.default?null:a.default:null,this._enumValues=i&&"enum"===i.type?i.values:null}evaluateWithoutErrorHandling(e,i,a,u,p,_,w,I){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=_,this._evaluator.featureTileCoord=w||null,this._evaluator.featureDistanceData=I||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,a,u,p,_,w,I){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=_||null,this._evaluator.featureTileCoord=w||null,this._evaluator.featureDistanceData=I||null;try{const S=this.expression.evaluate(this._evaluator);if(null==S||"number"==typeof S&&S!=S)return this._defaultValue;if(this._enumValues&&!(S in this._enumValues))throw new Hr(`Expected value to be one of ${Object.keys(this._enumValues).map(B=>JSON.stringify(B)).join(", ")}, but found ${JSON.stringify(S)} instead.`);return S}catch(S){return this._warningHistory[S.message]||(this._warningHistory[S.message]=!0,typeof console<"u"&&console.warn(S.message)),this._defaultValue}}}function ps(n){return Array.isArray(n)&&n.length>0&&"string"==typeof n[0]&&n[0]in N}function ss(n,e){const i=new Bo(N,[],e?function(u){const p={color:we,string:Ei,number:Xn,enum:Ei,boolean:Si,formatted:an,resolvedImage:Vt};return"array"===u.type?vn(p[u.value]||je,u.length):p[u.type]}(e):void 0),a=i.parse(n,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return a?ne(new ao(a,e)):it(i.errors)}class No{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent="constant"!==e&&!fs(i.expression)}evaluateWithoutErrorHandling(e,i,a,u,p,_){return this._styleExpression.evaluateWithoutErrorHandling(e,i,a,u,p,_)}evaluate(e,i,a,u,p,_){return this._styleExpression.evaluate(e,i,a,u,p,_)}}class fo{constructor(e,i,a,u){this.kind=e,this.zoomStops=a,this._styleExpression=i,this.isStateDependent="camera"!==e&&!fs(i.expression),this.interpolationType=u}evaluateWithoutErrorHandling(e,i,a,u,p,_){return this._styleExpression.evaluateWithoutErrorHandling(e,i,a,u,p,_)}evaluate(e,i,a,u,p,_){return this._styleExpression.evaluate(e,i,a,u,p,_)}interpolationFactor(e,i,a){return this.interpolationType?Ts.interpolationFactor(this.interpolationType,e,i,a):0}}function as(n,e){if("error"===(n=ss(n,e)).result)return n;const i=n.value.expression,a=Ur(i);if(!a&&!Q(e))return it([new Sr("","data expressions not supported")]);const u=Do(i,["zoom","pitch","distance-from-center"]);if(!u&&!He(e))return it([new Sr("","zoom expressions not supported")]);const p=mc(i);return p||u?p instanceof Sr?it([p]):p instanceof Ts&&!At(e)?it([new Sr("",'"interpolate" expressions cannot be used with this property')]):ne(p?new fo(a?"camera":"composite",n.value,p.labels,p instanceof Ts?p.interpolation:void 0):new No(a?"constant":"source",n.value)):it([new Sr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ys{constructor(e,i){this._parameters=e,this._specification=i,Wi(this,Xi(this._parameters,this._specification))}static deserialize(e){return new Ys(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function mc(n){let e=null;if(n instanceof uc)e=mc(n.result);else if(n instanceof ha){for(const i of n.args)if(e=mc(i),e)break}else(n instanceof Ls||n instanceof Ts)&&n.input instanceof bo&&"zoom"===n.input.name&&(e=n);return e instanceof Sr||n.eachChild(i=>{const a=mc(i);a instanceof Sr?e=a:!e&&a?e=new Sr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new Sr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class ai{constructor(e,i,a,u){this.message=(e?`${e}: `:"")+a,u&&(this.identifier=u),null!=i&&i.__line__&&(this.line=i.__line__)}}function Js(n){const e=n.key,i=n.value,a=n.valueSpec||{},u=n.objectElementValidators||{},p=n.style,_=n.styleSpec;let w=[];const I=cn(i);if("object"!==I)return[new ai(e,i,`object expected, ${I} found`)];for(const S in i){const B=S.split(".")[0];let j;u[B]?j=u[B]:a[B]?j=ts:u["*"]?j=u["*"]:a["*"]&&(j=ts),j?w=w.concat(j({key:(e&&`${e}.`)+S,value:i[S],valueSpec:a[B]||a["*"],style:p,styleSpec:_,object:i,objectKey:S},i)):w.push(new ai(e,i[S],`unknown property "${S}"`))}for(const S in a)u[S]||a[S].required&&void 0===a[S].default&&void 0===i[S]&&w.push(new ai(e,i,`missing required property "${S}"`));return w}function Su(n){const e=n.value,i=n.valueSpec,a=n.style,u=n.styleSpec,p=n.key,_=n.arrayElementValidator||ts;if("array"!==cn(e))return[new ai(p,e,`array expected, ${cn(e)} found`)];if(i.length&&e.length!==i.length)return[new ai(p,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.lengthp)return[new ai(e,i,`${i} is greater than the maximum value ${p}`)]}return[]}function Cl(n){const e=n.valueSpec,i=rr(n.value.type);let a,u,p,_={};const w="categorical"!==i&&void 0===n.value.property,I=!w,S="array"===cn(n.value.stops)&&"array"===cn(n.value.stops[0])&&"object"===cn(n.value.stops[0][0]),B=Js({key:n.key,value:n.value,valueSpec:n.styleSpec.function,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:function(X){if("identity"===i)return[new ai(X.key,X.value,'identity function may not have a "stops" property')];let te=[];const de=X.value;return te=te.concat(Su({key:X.key,value:de,valueSpec:X.valueSpec,style:X.style,styleSpec:X.styleSpec,arrayElementValidator:j})),"array"===cn(de)&&0===de.length&&te.push(new ai(X.key,de,"array must have at least one stop")),te},default:function(X){return ts({key:X.key,value:X.value,valueSpec:e,style:X.style,styleSpec:X.styleSpec})}}});return"identity"===i&&w&&B.push(new ai(n.key,n.value,'missing required property "property"')),"identity"===i||n.value.stops||B.push(new ai(n.key,n.value,'missing required property "stops"')),"exponential"===i&&n.valueSpec.expression&&!At(n.valueSpec)&&B.push(new ai(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(I&&!Q(n.valueSpec)?B.push(new ai(n.key,n.value,"property functions not supported")):w&&!He(n.valueSpec)&&B.push(new ai(n.key,n.value,"zoom functions not supported"))),"categorical"!==i&&!S||void 0!==n.value.property||B.push(new ai(n.key,n.value,'"property" property is required')),B;function j(X){let te=[];const de=X.value,ke=X.key;if("array"!==cn(de))return[new ai(ke,de,`array expected, ${cn(de)} found`)];if(2!==de.length)return[new ai(ke,de,`array length 2 expected, length ${de.length} found`)];if(S){if("object"!==cn(de[0]))return[new ai(ke,de,`object expected, ${cn(de[0])} found`)];if(void 0===de[0].zoom)return[new ai(ke,de,"object stop key must have zoom")];if(void 0===de[0].value)return[new ai(ke,de,"object stop key must have value")];const tt=rr(de[0].zoom);if("number"!=typeof tt)return[new ai(ke,de[0].zoom,"stop zoom values must be numbers")];if(p&&p>tt)return[new ai(ke,de[0].zoom,"stop zoom values must appear in ascending order")];tt!==p&&(p=tt,u=void 0,_={}),te=te.concat(Js({key:`${ke}[0]`,value:de[0],valueSpec:{zoom:{}},style:X.style,styleSpec:X.styleSpec,objectElementValidators:{zoom:es,value:H}}))}else te=te.concat(H({key:`${ke}[0]`,value:de[0],valueSpec:{},style:X.style,styleSpec:X.styleSpec},de));return ps(yr(de[1]))?te.concat([new ai(`${ke}[1]`,de[1],"expressions are not allowed in function stops.")]):te.concat(ts({key:`${ke}[1]`,value:de[1],valueSpec:e,style:X.style,styleSpec:X.styleSpec}))}function H(X,te){const de=cn(X.value),ke=rr(X.value),tt=null!==X.value?X.value:te;if(a){if(de!==a)return[new ai(X.key,tt,`${de} stop domain type must match previous stop domain type ${a}`)]}else a=de;if("number"!==de&&"string"!==de&&"boolean"!==de&&"number"!=typeof ke&&"string"!=typeof ke&&"boolean"!=typeof ke)return[new ai(X.key,tt,"stop domain value must be a number, string, or boolean")];if("number"!==de&&"categorical"!==i){let mt=`number expected, ${de} found`;return Q(e)&&void 0===i&&(mt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ai(X.key,tt,mt)]}return"categorical"!==i||"number"!==de||"number"==typeof ke&&isFinite(ke)&&Math.floor(ke)===ke?"categorical"!==i&&"number"===de&&"number"==typeof ke&&"number"==typeof u&&void 0!==u&&kenew ai(`${n.key}${a.key}`,n.value,a.message));const i=e.value.expression||e.value._styleExpression.expression;if("property"===n.expressionContext&&"text-font"===n.propertyKey&&!i.outputDefined())return[new ai(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===n.expressionContext&&"layout"===n.propertyType&&!fs(i))return[new ai(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===n.expressionContext)return Za(i,n);if(n.expressionContext&&0===n.expressionContext.indexOf("cluster")){if(!Do(i,["zoom","feature-state"]))return[new ai(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===n.expressionContext&&!Ur(i))return[new ai(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Za(n,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const u of e.valueSpec.expression.parameters)i.delete(u);if(0===i.size)return[];const a=[];return n instanceof bo&&i.has(n.name)?[new ai(e.key,e.value,`["${n.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(n.eachChild(u=>{a.push(...Za(u,e))}),a)}function $i(n){const e=n.key,i=n.value,a=n.valueSpec,u=[];return Array.isArray(a.values)?-1===a.values.indexOf(rr(i))&&u.push(new ai(e,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(a.values).indexOf(rr(i))&&u.push(new ai(e,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),u}function gc(n){if(!0===n||!1===n)return!0;if(!Array.isArray(n)||0===n.length)return!1;switch(n[0]){case"has":return n.length>=2&&"$id"!==n[1]&&"$type"!==n[1];case"in":return n.length>=3&&("string"!=typeof n[1]||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==n.length||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!gc(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function _c(n,e="fill"){if(null==n)return{filter:()=>!0,needGeometry:!1,needFeature:!1};gc(n)||(n=ol(n));const i=n;let a=!0;try{a=function(S){if(!El(S))return S;let B=yr(S);return Hc(B),B=bd(B),B}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const u=Kt[`filter_${e}`],p=ss(a,u);let _=null;if("error"===p.result)throw new Error(p.value.map(S=>`${S.key}: ${S.message}`).join(", "));_=(S,B,j)=>p.value.evaluate(S,B,{},j);let w=null,I=null;if(a!==i){const S=ss(i,u);if("error"===S.result)throw new Error(S.value.map(B=>`${B.key}: ${B.message}`).join(", "));w=(B,j,H,X,te)=>S.value.evaluate(B,j,{},H,void 0,void 0,X,te),I=!Ur(S.value.expression)}return{filter:_,dynamicFilter:w||void 0,needGeometry:wd(a),needFeature:!!I}}function bd(n){if(!Array.isArray(n))return n;const e=function(i){if(Tl.has(i[0]))for(let a=1;abd(i))}function Hc(n){let e=!1;const i=[];if("case"===n[0]){for(let a=1;a",">=","<","<=","to-boolean"]);function rl(n,e){return ne?1:0}function wd(n){if(!Array.isArray(n))return!1;if("within"===n[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?aa(n[1],n[2],e):"any"===e?(i=n.slice(1),["any"].concat(i.map(ol))):"all"===e?["all"].concat(n.slice(1).map(ol)):"none"===e?["all"].concat(n.slice(1).map(ol).map(jn)):"in"===e?Wc(n[1],n.slice(2)):"!in"===e?jn(Wc(n[1],n.slice(2))):"has"===e?Pu(n[1]):"!has"===e?jn(Pu(n[1])):"within"!==e||n;var i}function aa(n,e,i){switch(n){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,n,e]}}function Wc(n,e){if(0===e.length)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(i=>typeof i!=typeof e[0])?["filter-in-large",n,["literal",e.sort(rl)]]:["filter-in-small",n,["literal",e]]}}function Pu(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function jn(n){return["!",n]}function wr(n){return gc(yr(n.value))?zo(Wi({},n,{expressionContext:"filter",valueSpec:n.styleSpec[`filter_${n.layerType||"fill"}`]})):sl(n)}function sl(n){const e=n.value,i=n.key;if("array"!==cn(e))return[new ai(i,e,`array expected, ${cn(e)} found`)];const a=n.styleSpec;let u,p=[];if(e.length<1)return[new ai(i,e,"filter array must have at least 1 element")];switch(p=p.concat($i({key:`${i}[0]`,value:e[0],valueSpec:a.filter_operator,style:n.style,styleSpec:n.styleSpec})),rr(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===rr(e[1])&&p.push(new ai(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&p.push(new ai(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(u=cn(e[1]),"string"!==u&&p.push(new ai(`${i}[1]`,e[1],`string expected, ${u} found`)));for(let _=2;_{S in i&&e.push(new ai(a,i[S],`"${S}" is prohibited for ref layers`))}),u.layers.forEach(S=>{rr(S.id)===w&&(I=S)}),I?I.ref?e.push(new ai(a,i.ref,"ref cannot reference another ref layer")):_=rr(I.type):"string"==typeof w&&e.push(new ai(a,i.ref,`ref layer "${w}" not found`))}else if("background"!==_&&"sky"!==_)if(i.source){const I=u.sources&&u.sources[i.source],S=I&&rr(I.type);I?"vector"===S&&"raster"===_?e.push(new ai(a,i.source,`layer "${i.id}" requires a raster source`)):"raster"===S&&"raster"!==_?e.push(new ai(a,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==S||i["source-layer"]?"raster-dem"===S&&"hillshade"!==_?e.push(new ai(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==_||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||"geojson"===S&&I.lineMetrics||e.push(new ai(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ai(a,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new ai(a,i.source,`source "${i.source}" not found`))}else e.push(new ai(a,i,'missing required property "source"'));return e=e.concat(Js({key:a,value:i,valueSpec:p.layer,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{"*":()=>[],type:()=>ts({key:`${a}.type`,value:i.type,valueSpec:p.layer.type,style:n.style,styleSpec:n.styleSpec,object:i,objectKey:"type"}),filter:I=>wr(Wi({layerType:_},I)),layout:I=>Js({layer:i,key:I.key,value:I.value,valueSpec:{},style:I.style,styleSpec:I.styleSpec,objectElementValidators:{"*":S=>yc(Wi({layerType:_},S))}}),paint:I=>Js({layer:i,key:I.key,value:I.value,valueSpec:{},style:I.style,styleSpec:I.styleSpec,objectElementValidators:{"*":S=>Uo(Wi({layerType:_},S))}})}})),e}function ms(n){const e=n.value,i=n.key,a=cn(e);return"string"!==a?[new ai(i,e,`string expected, ${a} found`)]:[]}const Hl={promoteId:function({key:n,value:e}){if("string"===cn(e))return ms({key:n,value:e});{const i=[];for(const a in e)i.push(...ms({key:`${n}.${a}`,value:e[a]}));return i}}};function vc(n){const e=n.value,i=n.key,a=n.styleSpec,u=n.style;if(!e.type)return[new ai(i,e,'"type" is required')];const p=rr(e.type);let _;switch(p){case"vector":case"raster":case"raster-dem":return _=Js({key:i,value:e,valueSpec:a[`source_${p.replace("-","_")}`],style:n.style,styleSpec:a,objectElementValidators:Hl}),_;case"geojson":if(_=Js({key:i,value:e,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Hl}),e.cluster)for(const w in e.clusterProperties){const[I,S]=e.clusterProperties[w],B="string"==typeof I?[I,["accumulated"],["get",w]]:I;_.push(...zo({key:`${i}.${w}.map`,value:S,expressionContext:"cluster-map"})),_.push(...zo({key:`${i}.${w}.reduce`,value:B,expressionContext:"cluster-reduce"}))}return _;case"video":return Js({key:i,value:e,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Js({key:i,value:e,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new ai(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return $i({key:`${i}.type`,value:e.type,valueSpec:{values:_h(a)},style:u,styleSpec:a})}}function _h(n){return n.source.reduce((e,i)=>{const a=n[i];return"enum"===a.type.type&&(e=e.concat(Object.keys(a.type.values))),e},[])}function yh(n){const e=n.value,i=n.styleSpec,a=i.light,u=n.style;let p=[];const _=cn(e);if(void 0===e)return p;if("object"!==_)return p=p.concat([new ai("light",e,`object expected, ${_} found`)]),p;for(const w in e){const I=w.match(/^(.*)-transition$/);p=p.concat(I&&a[I[1]]&&a[I[1]].transition?ts({key:w,value:e[w],valueSpec:i.transition,style:u,styleSpec:i}):a[w]?ts({key:w,value:e[w],valueSpec:a[w],style:u,styleSpec:i}):[new ai(w,e[w],`unknown property "${w}"`)])}return p}function qc(n){const e=n.value,i=n.key,a=n.style,u=n.styleSpec,p=u.terrain;let _=[];const w=cn(e);if(void 0===e)return _;if("object"!==w)return _=_.concat([new ai("terrain",e,`object expected, ${w} found`)]),_;for(const I in e){const S=I.match(/^(.*)-transition$/);_=_.concat(S&&p[S[1]]&&p[S[1]].transition?ts({key:I,value:e[I],valueSpec:u.transition,style:a,styleSpec:u}):p[I]?ts({key:I,value:e[I],valueSpec:p[I],style:a,styleSpec:u}):[new ai(I,e[I],`unknown property "${I}"`)])}if(e.source){const I=a.sources&&a.sources[e.source],S=I&&rr(I.type);I?"raster-dem"!==S&&_.push(new ai(i,e.source,`terrain cannot be used with a source of type ${String(S)}, it only be used with a "raster-dem" source type`)):_.push(new ai(i,e.source,`source "${e.source}" not found`))}else _.push(new ai(i,e,'terrain is missing required property "source"'));return _}function gs(n){const e=n.value,i=n.style,a=n.styleSpec,u=a.fog;let p=[];const _=cn(e);if(void 0===e)return p;if("object"!==_)return p=p.concat([new ai("fog",e,`object expected, ${_} found`)]),p;for(const w in e){const I=w.match(/^(.*)-transition$/);p=p.concat(I&&u[I[1]]&&u[I[1]].transition?ts({key:w,value:e[w],valueSpec:a.transition,style:i,styleSpec:a}):u[w]?ts({key:w,value:e[w],valueSpec:u[w],style:i,styleSpec:a}):[new ai(w,e[w],`unknown property "${w}"`)])}return p}const Da={"*":()=>[],array:Su,boolean:function(n){const e=n.value,i=n.key,a=cn(e);return"boolean"!==a?[new ai(i,e,`boolean expected, ${a} found`)]:[]},number:es,color:function(n){const e=n.key,i=n.value,a=cn(i);return"string"!==a?[new ai(e,i,`color expected, ${a} found`)]:null===Ni(i)?[new ai(e,i,`color expected, "${i}" found`)]:[]},enum:$i,filter:wr,function:Cl,layer:Dl,object:Js,source:vc,light:yh,terrain:qc,fog:gs,string:ms,formatted:function(n){return 0===ms(n).length?[]:zo(n)},resolvedImage:function(n){return 0===ms(n).length?[]:zo(n)},projection:function(n){const e=n.value,i=n.styleSpec,a=i.projection,u=n.style;let p=[];const _=cn(e);if("object"===_)for(const w in e)p=p.concat(ts({key:w,value:e[w],valueSpec:a[w],style:u,styleSpec:i}));else"string"!==_&&(p=p.concat([new ai("projection",e,`object or string expected, ${_} found`)]));return p}};function ts(n){const e=n.value,i=n.valueSpec,a=n.styleSpec;return i.expression&&ri(rr(e))?Cl(n):i.expression&&ps(yr(e))?zo(n):i.type&&Da[i.type]?Da[i.type](n):Js(Wi({},n,{valueSpec:i.type?a[i.type]:i}))}function Il(n){const e=n.value,i=n.key,a=ms(n);return a.length||(-1===e.indexOf("{fontstack}")&&a.push(new ai(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new ai(i,e,'"glyphs" url must include a "{range}" token'))),a}function pa(n,e=Kt){return Ks(ts({key:"",value:n,valueSpec:e.$root,styleSpec:e,style:n,objectElementValidators:{glyphs:Il,"*":()=>[]}}))}const Cd=n=>Ks(Uo(n)),Ou=n=>Ks(yc(n));function Ks(n){return n.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function Ru(n,e){let i=!1;if(e&&e.length)for(const a of e)n.fire(new qi(new Error(a.message))),i=!0;return i}var Yc=Xs,js=3;function Xs(n,e,i){var a=this.cells=[];if(n instanceof ArrayBuffer){this.arrayBuffer=n;var u=new Int32Array(this.arrayBuffer);n=u[0],this.d=(e=u[1])+2*(i=u[2]);for(var p=0;p=B[X+0]&&a>=B[X+1])?(_[H]=!0,p.push(S[H])):_[H]=!1}}},Xs.prototype._forEachCell=function(n,e,i,a,u,p,_,w){for(var I=this._convertToCellCoord(n),S=this._convertToCellCoord(e),B=this._convertToCellCoord(i),j=this._convertToCellCoord(a),H=I;H<=B;H++)for(var X=S;X<=j;X++){var te=this.d*X+H;if((!w||w(this._convertFromCellCoord(H),this._convertFromCellCoord(X),this._convertFromCellCoord(H+1),this._convertFromCellCoord(X+1)))&&u.call(this,n,e,i,a,te,p,_,w))return}},Xs.prototype._convertFromCellCoord=function(n){return(n-this.padding)/this.scale},Xs.prototype._convertToCellCoord=function(n){return Math.max(0,Math.min(this.d-1,Math.floor(n*this.scale)+this.padding))},Xs.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var n=this.cells,e=js+this.cells.length+1+1,i=0,a=0;a=0||(u[p]=Ml(n[p],e)));n instanceof Error&&(u.message=n.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==a&&(u.$name=a),u}throw new Error("can't serialize object of type "+typeof n)}function al(n){if(null==n||"boolean"==typeof n||"number"==typeof n||"string"==typeof n||n instanceof Boolean||n instanceof Number||n instanceof String||n instanceof Date||n instanceof RegExp||xc(n)||Kc(n)||ArrayBuffer.isView(n)||n instanceof J.ImageData)return n;if(Array.isArray(n))return n.map(al);if("object"==typeof n){const e=n.$name||"Object",{klass:i}=Jc[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(n);const a=Object.create(i.prototype);for(const u of Object.keys(n))"$name"!==u&&(a[u]=al(n[u]));return a}throw new Error("can't deserialize object of type "+typeof n)}const R={"Latin-1 Supplement":n=>n>=128&&n<=255,Arabic:n=>n>=1536&&n<=1791,"Arabic Supplement":n=>n>=1872&&n<=1919,"Arabic Extended-A":n=>n>=2208&&n<=2303,"Hangul Jamo":n=>n>=4352&&n<=4607,"Unified Canadian Aboriginal Syllabics":n=>n>=5120&&n<=5759,Khmer:n=>n>=6016&&n<=6143,"Unified Canadian Aboriginal Syllabics Extended":n=>n>=6320&&n<=6399,"General Punctuation":n=>n>=8192&&n<=8303,"Letterlike Symbols":n=>n>=8448&&n<=8527,"Number Forms":n=>n>=8528&&n<=8591,"Miscellaneous Technical":n=>n>=8960&&n<=9215,"Control Pictures":n=>n>=9216&&n<=9279,"Optical Character Recognition":n=>n>=9280&&n<=9311,"Enclosed Alphanumerics":n=>n>=9312&&n<=9471,"Geometric Shapes":n=>n>=9632&&n<=9727,"Miscellaneous Symbols":n=>n>=9728&&n<=9983,"Miscellaneous Symbols and Arrows":n=>n>=11008&&n<=11263,"CJK Radicals Supplement":n=>n>=11904&&n<=12031,"Kangxi Radicals":n=>n>=12032&&n<=12255,"Ideographic Description Characters":n=>n>=12272&&n<=12287,"CJK Symbols and Punctuation":n=>n>=12288&&n<=12351,Hiragana:n=>n>=12352&&n<=12447,Katakana:n=>n>=12448&&n<=12543,Bopomofo:n=>n>=12544&&n<=12591,"Hangul Compatibility Jamo":n=>n>=12592&&n<=12687,Kanbun:n=>n>=12688&&n<=12703,"Bopomofo Extended":n=>n>=12704&&n<=12735,"CJK Strokes":n=>n>=12736&&n<=12783,"Katakana Phonetic Extensions":n=>n>=12784&&n<=12799,"Enclosed CJK Letters and Months":n=>n>=12800&&n<=13055,"CJK Compatibility":n=>n>=13056&&n<=13311,"CJK Unified Ideographs Extension A":n=>n>=13312&&n<=19903,"Yijing Hexagram Symbols":n=>n>=19904&&n<=19967,"CJK Unified Ideographs":n=>n>=19968&&n<=40959,"Yi Syllables":n=>n>=40960&&n<=42127,"Yi Radicals":n=>n>=42128&&n<=42191,"Hangul Jamo Extended-A":n=>n>=43360&&n<=43391,"Hangul Syllables":n=>n>=44032&&n<=55215,"Hangul Jamo Extended-B":n=>n>=55216&&n<=55295,"Private Use Area":n=>n>=57344&&n<=63743,"CJK Compatibility Ideographs":n=>n>=63744&&n<=64255,"Arabic Presentation Forms-A":n=>n>=64336&&n<=65023,"Vertical Forms":n=>n>=65040&&n<=65055,"CJK Compatibility Forms":n=>n>=65072&&n<=65103,"Small Form Variants":n=>n>=65104&&n<=65135,"Arabic Presentation Forms-B":n=>n>=65136&&n<=65279,"Halfwidth and Fullwidth Forms":n=>n>=65280&&n<=65519};function U(n){for(const e of n)if(K(e.charCodeAt(0)))return!0;return!1}function $(n){for(const e of n)if(!z(e.charCodeAt(0)))return!1;return!0}function z(n){return!(R.Arabic(n)||R["Arabic Supplement"](n)||R["Arabic Extended-A"](n)||R["Arabic Presentation Forms-A"](n)||R["Arabic Presentation Forms-B"](n))}function K(n){return!(746!==n&&747!==n&&(n<4352||!(R["Bopomofo Extended"](n)||R.Bopomofo(n)||R["CJK Compatibility Forms"](n)&&!(n>=65097&&n<=65103)||R["CJK Compatibility Ideographs"](n)||R["CJK Compatibility"](n)||R["CJK Radicals Supplement"](n)||R["CJK Strokes"](n)||!(!R["CJK Symbols and Punctuation"](n)||n>=12296&&n<=12305||n>=12308&&n<=12319||12336===n)||R["CJK Unified Ideographs Extension A"](n)||R["CJK Unified Ideographs"](n)||R["Enclosed CJK Letters and Months"](n)||R["Hangul Compatibility Jamo"](n)||R["Hangul Jamo Extended-A"](n)||R["Hangul Jamo Extended-B"](n)||R["Hangul Jamo"](n)||R["Hangul Syllables"](n)||R.Hiragana(n)||R["Ideographic Description Characters"](n)||R.Kanbun(n)||R["Kangxi Radicals"](n)||R["Katakana Phonetic Extensions"](n)||R.Katakana(n)&&12540!==n||!(!R["Halfwidth and Fullwidth Forms"](n)||65288===n||65289===n||65293===n||n>=65306&&n<=65310||65339===n||65341===n||65343===n||n>=65371&&n<=65503||65507===n||n>=65512&&n<=65519)||!(!R["Small Form Variants"](n)||n>=65112&&n<=65118||n>=65123&&n<=65126)||R["Unified Canadian Aboriginal Syllabics"](n)||R["Unified Canadian Aboriginal Syllabics Extended"](n)||R["Vertical Forms"](n)||R["Yijing Hexagram Symbols"](n)||R["Yi Syllables"](n)||R["Yi Radicals"](n))))}function Me(n){return!(K(n)||(e=n,R["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||R["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||R["Letterlike Symbols"](e)||R["Number Forms"](e)||R["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||R["Control Pictures"](e)&&9251!==e||R["Optical Character Recognition"](e)||R["Enclosed Alphanumerics"](e)||R["Geometric Shapes"](e)||R["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||R["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||R["CJK Symbols and Punctuation"](e)||R.Katakana(e)||R["Private Use Area"](e)||R["CJK Compatibility Forms"](e)||R["Small Form Variants"](e)||R["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}function Ge(n){return n>=1424&&n<=2303||R["Arabic Presentation Forms-A"](n)||R["Arabic Presentation Forms-B"](n)}function en(n,e){return!(!e&&Ge(n)||n>=2304&&n<=3583||n>=3840&&n<=4255||R.Khmer(n))}function $n(n){for(const e of n)if(Ge(e.charCodeAt(0)))return!0;return!1}const xn="deferred",Oi="loading",ar="loaded";let po=null,f="unavailable",r=null;const c=function(n){n&&"string"==typeof n&&n.indexOf("NetworkError")>-1&&(f="error"),po&&po(n)};function m(){b.fire(new Ar("pluginStateChange",{pluginStatus:f,pluginURL:r}))}const b=new Bi,T=function(){return f},O=function(){if(f!==xn||!r)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");f=Oi,m(),r&&_n({url:r},n=>{n?c(n):(f=ar,m())})},L={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>f===ar||null!=L.applyArabicShaping,isLoading:()=>f===Oi,setState(n){f=n.pluginStatus,r=n.pluginURL},isParsed:()=>null!=L.applyArabicShaping&&null!=L.processBidirectionalText&&null!=L.processStyledBidirectionalText,getPluginURL:()=>r};class Z{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,a){for(const u of i)if(!en(u.charCodeAt(0),a))return!1;return!0}(e,L.isLoaded())}}class q{constructor(e,i){this.property=e,this.value=i,this.expression=function(a,u){if(ri(a))return new Ys(a,u);if(ps(a)){const p=as(a,u);if("error"===p.result)throw new Error(p.value.map(_=>`${_.key}: ${_.message}`).join(", "));return p.value}{let p=a;return"string"==typeof a&&"color"===u.type&&(p=kr.parse(a)),{kind:"constant",evaluate:()=>p}}}(void 0===i?e.specification.default:i,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,i,a){return this.property.possiblyEvaluate(this,e,i,a)}}class W{constructor(e){this.property=e,this.value=new q(e,void 0)}transitioned(e,i){return new Oe(this.property,this.value,i,De({},e.transition,this.transition),e.now)}untransitioned(){return new Oe(this.property,this.value,null,{},0)}}class se{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Jt(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new W(this._values[e].property)),this._values[e].value=new q(this._values[e].property,null===i?void 0:Jt(i))}getTransition(e){return Jt(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new W(this._values[e].property)),this._values[e].transition=Jt(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const a=this.getValue(i);void 0!==a&&(e[i]=a);const u=this.getTransition(i);void 0!==u&&(e[`${i}-transition`]=u)}return e}transitioned(e,i){const a=new $e(this._properties);for(const u of Object.keys(this._values))a._values[u]=this._values[u].transitioned(e,i._values[u]);return a}untransitioned(){const e=new $e(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class Oe{constructor(e,i,a,u,p){const _=u.delay||0,w=u.duration||0;p=p||0,this.property=e,this.value=i,this.begin=p+_,this.end=this.begin+w,e.specification.transition&&(u.delay||u.duration)&&(this.prior=a)}possiblyEvaluate(e,i,a){const u=e.now||0,p=this.value.possiblyEvaluate(e,i,a),_=this.prior;if(_){if(u>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(uthis.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function zt(n,e=1){let i=0,a=0;return{members:n.map(u=>{const p=Mt[u.type].BYTES_PER_ELEMENT,_=i=dn(i,Math.max(e,p)),w=u.components||1;return a=Math.max(a,p),i+=p*w,{name:u.name,type:u.type,components:w,offset:_}}),size:dn(i,Math.max(a,e)),alignment:e}}function dn(n,e){return Math.ceil(n/e)*e}class Vn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){const u=2*e;return this.int16[u+0]=i,this.int16[u+1]=a,e}}Vn.prototype.bytesPerElement=4,ui(Vn,"StructArrayLayout2i4");class on extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,a)}emplace(e,i,a,u){const p=3*e;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=u,e}}on.prototype.bytesPerElement=6,ui(on,"StructArrayLayout3i6");class Rn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=4*e;return this.int16[_+0]=i,this.int16[_+1]=a,this.int16[_+2]=u,this.int16[_+3]=p,e}}Rn.prototype.bytesPerElement=8,ui(Rn,"StructArrayLayout4i8");class un extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w){const I=this.length;return this.resize(I+1),this.emplace(I,e,i,a,u,p,_,w)}emplace(e,i,a,u,p,_,w,I){const S=6*e,B=12*e,j=3*e;return this.int16[S+0]=i,this.int16[S+1]=a,this.uint8[B+4]=u,this.uint8[B+5]=p,this.uint8[B+6]=_,this.uint8[B+7]=w,this.float32[j+2]=I,e}}un.prototype.bytesPerElement=12,ui(un,"StructArrayLayout2i4ub1f12");class Zn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=4*e;return this.float32[_+0]=i,this.float32[_+1]=a,this.float32[_+2]=u,this.float32[_+3]=p,e}}Zn.prototype.bytesPerElement=16,ui(Zn,"StructArrayLayout4f16");class sn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p){const _=this.length;return this.resize(_+1),this.emplace(_,e,i,a,u,p)}emplace(e,i,a,u,p,_){const w=6*e,I=3*e;return this.uint16[w+0]=i,this.uint16[w+1]=a,this.uint16[w+2]=u,this.uint16[w+3]=p,this.float32[I+2]=_,e}}sn.prototype.bytesPerElement=12,ui(sn,"StructArrayLayout4ui1f12");class An extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=4*e;return this.uint16[_+0]=i,this.uint16[_+1]=a,this.uint16[_+2]=u,this.uint16[_+3]=p,e}}An.prototype.bytesPerElement=8,ui(An,"StructArrayLayout4ui8");class Gn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_){const w=this.length;return this.resize(w+1),this.emplace(w,e,i,a,u,p,_)}emplace(e,i,a,u,p,_,w){const I=6*e;return this.int16[I+0]=i,this.int16[I+1]=a,this.int16[I+2]=u,this.int16[I+3]=p,this.int16[I+4]=_,this.int16[I+5]=w,e}}Gn.prototype.bytesPerElement=12,ui(Gn,"StructArrayLayout6i12");class Ln extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H){const X=this.length;return this.resize(X+1),this.emplace(X,e,i,a,u,p,_,w,I,S,B,j,H)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X){const te=12*e;return this.int16[te+0]=i,this.int16[te+1]=a,this.int16[te+2]=u,this.int16[te+3]=p,this.uint16[te+4]=_,this.uint16[te+5]=w,this.uint16[te+6]=I,this.uint16[te+7]=S,this.int16[te+8]=B,this.int16[te+9]=j,this.int16[te+10]=H,this.int16[te+11]=X,e}}Ln.prototype.bytesPerElement=24,ui(Ln,"StructArrayLayout4i4ui4i24");class Wn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_){const w=this.length;return this.resize(w+1),this.emplace(w,e,i,a,u,p,_)}emplace(e,i,a,u,p,_,w){const I=10*e,S=5*e;return this.int16[I+0]=i,this.int16[I+1]=a,this.int16[I+2]=u,this.float32[S+2]=p,this.float32[S+3]=_,this.float32[S+4]=w,e}}Wn.prototype.bytesPerElement=20,ui(Wn,"StructArrayLayout3i3f20");class Di extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Di.prototype.bytesPerElement=4,ui(Di,"StructArrayLayout1ul4");class Gi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H,X){const te=this.length;return this.resize(te+1),this.emplace(te,e,i,a,u,p,_,w,I,S,B,j,H,X)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X,te){const de=20*e,ke=10*e;return this.int16[de+0]=i,this.int16[de+1]=a,this.int16[de+2]=u,this.int16[de+3]=p,this.int16[de+4]=_,this.float32[ke+3]=w,this.float32[ke+4]=I,this.float32[ke+5]=S,this.float32[ke+6]=B,this.int16[de+14]=j,this.uint32[ke+8]=H,this.uint16[de+18]=X,this.uint16[de+19]=te,e}}Gi.prototype.bytesPerElement=40,ui(Gi,"StructArrayLayout5i4f1i1ul2ui40");class hi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w){const I=this.length;return this.resize(I+1),this.emplace(I,e,i,a,u,p,_,w)}emplace(e,i,a,u,p,_,w,I){const S=8*e;return this.int16[S+0]=i,this.int16[S+1]=a,this.int16[S+2]=u,this.int16[S+4]=p,this.int16[S+5]=_,this.int16[S+6]=w,this.int16[S+7]=I,e}}hi.prototype.bytesPerElement=16,ui(hi,"StructArrayLayout3i2i2i16");class Pi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p){const _=this.length;return this.resize(_+1),this.emplace(_,e,i,a,u,p)}emplace(e,i,a,u,p,_){const w=4*e,I=8*e;return this.float32[w+0]=i,this.float32[w+1]=a,this.float32[w+2]=u,this.int16[I+6]=p,this.int16[I+7]=_,e}}Pi.prototype.bytesPerElement=16,ui(Pi,"StructArrayLayout2f1f2i16");class ur extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=12*e,w=3*e;return this.uint8[_+0]=i,this.uint8[_+1]=a,this.float32[w+1]=u,this.float32[w+2]=p,e}}ur.prototype.bytesPerElement=12,ui(ur,"StructArrayLayout2ub2f12");class dr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,a)}emplace(e,i,a,u){const p=3*e;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=u,e}}dr.prototype.bytesPerElement=12,ui(dr,"StructArrayLayout3f12");class xi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,a)}emplace(e,i,a,u){const p=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=a,this.uint16[p+2]=u,e}}xi.prototype.bytesPerElement=6,ui(xi,"StructArrayLayout3ui6");class Cr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt){const bt=this.length;return this.resize(bt+1),this.emplace(bt,e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt){const tn=30*e,nn=15*e,Tn=60*e;return this.int16[tn+0]=i,this.int16[tn+1]=a,this.int16[tn+2]=u,this.float32[nn+2]=p,this.float32[nn+3]=_,this.uint16[tn+8]=w,this.uint16[tn+9]=I,this.uint32[nn+5]=S,this.uint32[nn+6]=B,this.uint32[nn+7]=j,this.uint16[tn+16]=H,this.uint16[tn+17]=X,this.uint16[tn+18]=te,this.float32[nn+10]=de,this.float32[nn+11]=ke,this.uint8[Tn+48]=tt,this.uint8[Tn+49]=mt,this.uint8[Tn+50]=Qe,this.uint32[nn+13]=ut,this.int16[tn+28]=xt,this.uint8[Tn+58]=bt,e}}Cr.prototype.bytesPerElement=60,ui(Cr,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Kr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,Bn){const Hn=this.length;return this.resize(Hn+1),this.emplace(Hn,e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,Bn)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,Bn,Hn){const wn=38*e,si=19*e;return this.int16[wn+0]=i,this.int16[wn+1]=a,this.int16[wn+2]=u,this.float32[si+2]=p,this.float32[si+3]=_,this.int16[wn+8]=w,this.int16[wn+9]=I,this.int16[wn+10]=S,this.int16[wn+11]=B,this.int16[wn+12]=j,this.int16[wn+13]=H,this.uint16[wn+14]=X,this.uint16[wn+15]=te,this.uint16[wn+16]=de,this.uint16[wn+17]=ke,this.uint16[wn+18]=tt,this.uint16[wn+19]=mt,this.uint16[wn+20]=Qe,this.uint16[wn+21]=ut,this.uint16[wn+22]=xt,this.uint16[wn+23]=bt,this.uint16[wn+24]=tn,this.uint16[wn+25]=nn,this.uint16[wn+26]=Tn,this.uint16[wn+27]=Un,this.uint16[wn+28]=fn,this.uint32[si+15]=Pn,this.float32[si+16]=On,this.float32[si+17]=Bn,this.float32[si+18]=Hn,e}}Kr.prototype.bytesPerElement=76,ui(Kr,"StructArrayLayout3i2f6i15ui1ul3f76");class Wr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Wr.prototype.bytesPerElement=4,ui(Wr,"StructArrayLayout1f4");class qr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p){const _=this.length;return this.resize(_+1),this.emplace(_,e,i,a,u,p)}emplace(e,i,a,u,p,_){const w=5*e;return this.float32[w+0]=i,this.float32[w+1]=a,this.float32[w+2]=u,this.float32[w+3]=p,this.float32[w+4]=_,e}}qr.prototype.bytesPerElement=20,ui(qr,"StructArrayLayout5f20");class ns extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=6*e;return this.uint32[3*e+0]=i,this.uint16[_+2]=a,this.uint16[_+3]=u,this.uint16[_+4]=p,e}}ns.prototype.bytesPerElement=12,ui(ns,"StructArrayLayout1ul3ui12");class _s extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){const u=2*e;return this.uint16[u+0]=i,this.uint16[u+1]=a,e}}_s.prototype.bytesPerElement=4,ui(_s,"StructArrayLayout2ui4");class vo extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}vo.prototype.bytesPerElement=2,ui(vo,"StructArrayLayout1ui2");class ja extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){const u=2*e;return this.float32[u+0]=i,this.float32[u+1]=a,e}}ja.prototype.bytesPerElement=8,ui(ja,"StructArrayLayout2f8");class mo extends Dt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}mo.prototype.size=40;class jr extends Gi{get(e){return new mo(this,e)}}ui(jr,"CollisionBoxArray");class Lr extends Dt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Lr.prototype.size=60;class Zo extends Cr{get(e){return new Lr(this,e)}}ui(Zo,"PlacedSymbolArray");class Ds extends Dt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ds.prototype.size=76;class Vr extends Kr{get(e){return new Ds(this,e)}}ui(Vr,"SymbolInstanceArray");class ls extends Wr{getoffsetX(e){return this.float32[1*e+0]}}ui(ls,"GlyphOffsetArray");class ll extends Vn{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}ui(ll,"SymbolLineVertexArray");class Al extends Dt{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Al.prototype.size=12;class Wl extends ns{get(e){return new Al(this,e)}}ui(Wl,"FeatureIndexArray");class Qs extends _s{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}ui(Qs,"FillExtrusionCentroidArray");const ql=zt([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Yl=zt([{name:"a_dash",components:4,type:"Uint16"}]);var Ed={exports:{}},h_=function(n,e){var i,a,u,p,_,w,I,S;for(a=n.length-(i=3&n.length),u=e,_=3432918353,w=461845907,S=0;S>>16)*_&65535)<<16)&4294967295)<<15|I>>>17))*w+(((I>>>16)*w&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(I=0,i){case 3:I^=(255&n.charCodeAt(S+2))<<16;case 2:I^=(255&n.charCodeAt(S+1))<<8;case 1:u^=I=(65535&(I=(I=(65535&(I^=255&n.charCodeAt(S)))*_+(((I>>>16)*_&65535)<<16)&4294967295)<<15|I>>>17))*w+(((I>>>16)*w&65535)<<16)&4294967295}return u^=n.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0},wv=function(n,e){for(var i,a=n.length,u=e^a,p=0;a>=4;)i=1540483477*(65535&(i=255&n.charCodeAt(p)|(255&n.charCodeAt(++p))<<8|(255&n.charCodeAt(++p))<<16|(255&n.charCodeAt(++p))<<24))+((1540483477*(i>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:u^=(255&n.charCodeAt(p+2))<<16;case 2:u^=(255&n.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&n.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};Ed.exports=h_,Ed.exports.murmur3=h_,Ed.exports.murmur2=wv;var bc=Be(Ed.exports);class xh{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,a,u){this.ids.push(sm(e)),this.positions.push(i,a,u)}getPositions(e){const i=sm(e);let a=0,u=this.ids.length-1;for(;a>1;this.ids[_]>=i?u=_:a=_+1}const p=[];for(;this.ids[a]===i;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(e,i){const a=new Float64Array(e.ids),u=new Uint32Array(e.positions);return cs(a,u,0,a.length-1),i&&i.push(a.buffer,u.buffer),{ids:a,positions:u}}static deserialize(e){const i=new xh;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function sm(n){const e=+n;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:bc(String(n))}function cs(n,e,i,a){for(;i>1];let p=i-1,_=a+1;for(;;){do{p++}while(n[p]u);if(p>=_)break;bh(n,p,_),bh(e,3*p,3*_),bh(e,3*p+1,3*_+1),bh(e,3*p+2,3*_+2)}_-i`u_${u}`),this.type=a}setUniform(e,i,a,u,p){i.set(e,p,u.constantOr(this.value))}getBinding(e,i){return"color"===this.type?new Xc(e):new wh(e)}}class ku{constructor(e,i){this.uniformNames=i.map(a=>`u_${a}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,a,u,p){const _="u_pattern"===p||"u_dash"===p?this.pattern:"u_pixel_ratio"===p?this.pixelRatio:null;_&&i.set(e,p,_)}getBinding(e,i){return"u_pattern"===i||"u_dash"===i?new Aa(e):new wh(e)}}class wc{constructor(e,i,a,u){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:"color"===a?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,a,u,p,_){const w=this.paintVertexArray.length,I=this.expression.evaluate(new Z(0),i,{},p,u,_);this.paintVertexArray.resize(e),this._setPaintValue(w,e,I)}updatePaintArray(e,i,a,u,p){const _=this.expression.evaluate({zoom:0},a,u,void 0,p);this._setPaintValue(e,i,_)}_setPaintValue(e,i,a){if("color"===this.type){const u=Mf(a);for(let p=e;p`u_${w}_t`),this.type=a,this.useIntegerZoom=u,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map(w=>({name:`a_${w}`,type:"Float32",components:"color"===a?4:2,offset:0})),this.paintVertexArray=new _}populatePaintArray(e,i,a,u,p,_){const w=this.expression.evaluate(new Z(this.zoom),i,{},p,u,_),I=this.expression.evaluate(new Z(this.zoom+1),i,{},p,u,_),S=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(S,e,w,I)}updatePaintArray(e,i,a,u,p){const _=this.expression.evaluate({zoom:this.zoom},a,u,void 0,p),w=this.expression.evaluate({zoom:this.zoom+1},a,u,void 0,p);this._setPaintValue(e,i,_,w)}_setPaintValue(e,i,a,u){if("color"===this.type){const p=Mf(a),_=Mf(u);for(let w=e;w!0)){this.binders={},this._buffers=[];const u=[];for(const p in e.paint._values){if(!a(p))continue;const _=e.paint.get(p);if(!(_ instanceof qe&&Q(_.property.specification)))continue;const w=f_(p,e.type),I=_.value,S=_.property.specification.type,B=!!_.property.useIntegerZoom,j="line-dasharray"===p||p.endsWith("pattern"),H="line-dasharray"===p&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==I.kind||H)if("source"===I.kind||H||j){const X=cm(p,S,"source");this.binders[p]=j?new Sl(I,w,S,X,e.id):new wc(I,w,S,X),u.push(`/a_${p}`)}else{const X=cm(p,S,"composite");this.binders[p]=new Wo(I,w,S,B,i,X),u.push(`/z_${p}`)}else this.binders[p]=j?new ku(I.value,w):new Eh(I.value,w,S),u.push(`/u_${p}`)}this.cacheKey=u.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof wc||i instanceof Wo?i.maxValue:0}populatePaintArrays(e,i,a,u,p,_){for(const w in this.binders){const I=this.binders[w];(I instanceof wc||I instanceof Wo||I instanceof Sl)&&I.populatePaintArray(e,i,a,u,p,_)}}setConstantPatternPositions(e){for(const i in this.binders){const a=this.binders[i];a instanceof ku&&a.setConstantPatternPositions(e)}}updatePaintArrays(e,i,a,u,p,_){let w=!1;for(const I in e){const S=i.getPositions(I);for(const B of S){const j=a.feature(B.index);for(const H in this.binders){const X=this.binders[H];if((X instanceof wc||X instanceof Wo||X instanceof Sl)&&!0===X.expression.isStateDependent){const te=u.paint.get(H);X.expression=te.value,X.updatePaintArray(B.start,B.end,j,e[I],p,_),w=!0}}}}return w}defines(){const e=[];for(const i in this.binders){const a=this.binders[i];(a instanceof Eh||a instanceof ku)&&e.push(...a.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof wc||a instanceof Wo||a instanceof Sl)for(let u=0;u!0)){this.programConfigurations={};for(const u of e)this.programConfigurations[u.id]=new Sa(u,i,a);this.needsUpload=!1,this._featureMap=new xh,this._bufferOffset=0}populatePaintArrays(e,i,a,u,p,_,w){for(const I in this.programConfigurations)this.programConfigurations[I].populatePaintArrays(e,i,u,p,_,w);void 0!==i.id&&this._featureMap.add(i.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,a,u,p){for(const _ of a)this.needsUpload=this.programConfigurations[_.id].updatePaintArrays(e,this._featureMap,i,_,u,p)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const lm={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function f_(n,e){return lm[n]||[n.replace(`${e}-`,"").replace(/-/g,"_")]}const p_={"line-pattern":{source:sn,composite:sn},"fill-pattern":{source:sn,composite:sn},"fill-extrusion-pattern":{source:sn,composite:sn},"line-dasharray":{source:An,composite:An}},m_={color:{source:ja,composite:Zn},number:{source:Wr,composite:ja}};function cm(n,e,i){const a=p_[n];return a&&a[i]||m_[e][i]}ui(Eh,"ConstantBinder"),ui(ku,"PatternConstantBinder"),ui(wc,"SourceExpressionBinder"),ui(Sl,"PatternCompositeBinder"),ui(Wo,"CompositeExpressionBinder"),ui(Sa,"ProgramConfiguration",{omit:["_buffers"]}),ui(Fu,"ProgramConfigurationSet");const um="-transition";class cl extends Bi{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new We(i.layout)),i.paint)){this._transitionablePaint=new se(i.paint);for(const a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(const a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ke(i.paint)}}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,a={}){null!=i&&this._validate(Ou,`layers.${this.id}.layout.${e}`,e,i,a)||("visibility"!==e?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return Qt(e,um)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,a={}){if(null!=i&&this._validate(Cd,`layers.${this.id}.paint.${e}`,e,i,a))return!1;if(Qt(e,um))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const u=this._transitionablePaint._values[e],p=u.value.isDataDriven(),_=u.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const w=this._transitionablePaint._values[e].value,I=w.isDataDriven(),S=Qt(e,"pattern")||"line-dasharray"===e;return I||p||S||this._handleOverridablePaintPropertyUpdate(e,_,w)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,a){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Zt(e,(i,a)=>!(void 0===i||"layout"===a&&!Object.keys(i).length||"paint"===a&&!Object.keys(i).length))}_validate(e,i,a,u,p={}){return(!p||!1!==p.validate)&&Ru(this,e.call(pa,{key:i,layerType:this.type,objectKey:a,value:u,styleSpec:Kt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof qe&&Q(i.property.specification)&&("source"===i.value.kind||"composite"===i.value.kind)&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=_c(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const Af=zt([{name:"a_pos",components:2,type:"Int16"}],4),Th=zt([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qo{constructor(e=[]){this.segments=e}prepareSegment(e,i,a,u){let p=this.segments[this.segments.length-1];return e>qo.MAX_VERTEX_ARRAY_LENGTH&&dt(`Max vertices per segment is ${qo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!p||p.vertexLength+e>qo.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==u)&&(p={vertexOffset:i.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},void 0!==u&&(p.sortKey=u),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,a,u){return new qo([{vertexOffset:e,primitiveOffset:i,vertexLength:a,primitiveLength:u,vaos:{},sortKey:0}])}}qo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ui(qo,"SegmentVector");var Ii=8192;class Cc{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof $r?new $r(e.lng,e.lat):$r.convert(e),this}setSouthWest(e){return this._sw=e instanceof $r?new $r(e.lng,e.lat):$r.convert(e),this}extend(e){const i=this._sw,a=this._ne;let u,p;if(e instanceof $r)u=e,p=e;else{if(!(e instanceof Cc))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Cc.convert(e)):this.extend($r.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend($r.convert(e)):this;if(u=e._sw,p=e._ne,!u||!p)return this}return i||a?(i.lng=Math.min(u.lng,i.lng),i.lat=Math.min(u.lat,i.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new $r(u.lng,u.lat),this._ne=new $r(p.lng,p.lat)),this}getCenter(){return new $r((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new $r(this.getWest(),this.getNorth())}getSouthEast(){return new $r(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:i,lat:a}=$r.convert(e);let u=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u}static convert(e){return!e||e instanceof Cc?e:new Cc(e)}}var Qc=1e-6,ma=typeof Float32Array<"u"?Float32Array:Array;function Sf(){var n=new ma(9);return ma!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function Dh(n,e,i){var a=e[0],u=e[1],p=e[2],_=e[3],w=e[4],I=e[5],S=e[6],B=e[7],j=e[8],H=i[0],X=i[1],te=i[2],de=i[3],ke=i[4],tt=i[5],mt=i[6],Qe=i[7],ut=i[8];return n[0]=H*a+X*_+te*S,n[1]=H*u+X*w+te*B,n[2]=H*p+X*I+te*j,n[3]=de*a+ke*_+tt*S,n[4]=de*u+ke*w+tt*B,n[5]=de*p+ke*I+tt*j,n[6]=mt*a+Qe*_+ut*S,n[7]=mt*u+Qe*w+ut*B,n[8]=mt*p+Qe*I+ut*j,n}function ga(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Ih(n,e){var i=e[0],a=e[1],u=e[2],p=e[3],_=e[4],w=e[5],I=e[6],S=e[7],B=e[8],j=e[9],H=e[10],X=e[11],te=e[12],de=e[13],ke=e[14],tt=e[15],mt=i*w-a*_,Qe=i*I-u*_,ut=i*S-p*_,xt=a*I-u*w,bt=a*S-p*w,tn=u*S-p*I,nn=B*de-j*te,Tn=B*ke-H*te,Un=B*tt-X*te,fn=j*ke-H*de,Pn=j*tt-X*de,On=H*tt-X*ke,Bn=mt*On-Qe*Pn+ut*fn+xt*Un-bt*Tn+tn*nn;return Bn?(n[0]=(w*On-I*Pn+S*fn)*(Bn=1/Bn),n[1]=(u*Pn-a*On-p*fn)*Bn,n[2]=(de*tn-ke*bt+tt*xt)*Bn,n[3]=(H*bt-j*tn-X*xt)*Bn,n[4]=(I*Un-_*On-S*Tn)*Bn,n[5]=(i*On-u*Un+p*Tn)*Bn,n[6]=(ke*ut-te*tn-tt*Qe)*Bn,n[7]=(B*tn-H*ut+X*Qe)*Bn,n[8]=(_*Pn-w*Un+S*nn)*Bn,n[9]=(a*Un-i*Pn-p*nn)*Bn,n[10]=(te*bt-de*ut+tt*mt)*Bn,n[11]=(j*ut-B*bt-X*mt)*Bn,n[12]=(w*Tn-_*fn-I*nn)*Bn,n[13]=(i*fn-a*Tn+u*nn)*Bn,n[14]=(de*Qe-te*xt-ke*mt)*Bn,n[15]=(B*xt-j*Qe+H*mt)*Bn,n):null}function eu(n,e,i){var a=e[0],u=e[1],p=e[2],_=e[3],w=e[4],I=e[5],S=e[6],B=e[7],j=e[8],H=e[9],X=e[10],te=e[11],de=e[12],ke=e[13],tt=e[14],mt=e[15],Qe=i[0],ut=i[1],xt=i[2],bt=i[3];return n[0]=Qe*a+ut*w+xt*j+bt*de,n[1]=Qe*u+ut*I+xt*H+bt*ke,n[2]=Qe*p+ut*S+xt*X+bt*tt,n[3]=Qe*_+ut*B+xt*te+bt*mt,n[4]=(Qe=i[4])*a+(ut=i[5])*w+(xt=i[6])*j+(bt=i[7])*de,n[5]=Qe*u+ut*I+xt*H+bt*ke,n[6]=Qe*p+ut*S+xt*X+bt*tt,n[7]=Qe*_+ut*B+xt*te+bt*mt,n[8]=(Qe=i[8])*a+(ut=i[9])*w+(xt=i[10])*j+(bt=i[11])*de,n[9]=Qe*u+ut*I+xt*H+bt*ke,n[10]=Qe*p+ut*S+xt*X+bt*tt,n[11]=Qe*_+ut*B+xt*te+bt*mt,n[12]=(Qe=i[12])*a+(ut=i[13])*w+(xt=i[14])*j+(bt=i[15])*de,n[13]=Qe*u+ut*I+xt*H+bt*ke,n[14]=Qe*p+ut*S+xt*X+bt*tt,n[15]=Qe*_+ut*B+xt*te+bt*mt,n}function Dd(n,e,i){var a,u,p,_,w,I,S,B,j,H,X,te,de=i[0],ke=i[1],tt=i[2];return e===n?(n[12]=e[0]*de+e[4]*ke+e[8]*tt+e[12],n[13]=e[1]*de+e[5]*ke+e[9]*tt+e[13],n[14]=e[2]*de+e[6]*ke+e[10]*tt+e[14],n[15]=e[3]*de+e[7]*ke+e[11]*tt+e[15]):(u=e[1],p=e[2],_=e[3],w=e[4],I=e[5],S=e[6],B=e[7],j=e[8],H=e[9],X=e[10],te=e[11],n[0]=a=e[0],n[1]=u,n[2]=p,n[3]=_,n[4]=w,n[5]=I,n[6]=S,n[7]=B,n[8]=j,n[9]=H,n[10]=X,n[11]=te,n[12]=a*de+w*ke+j*tt+e[12],n[13]=u*de+I*ke+H*tt+e[13],n[14]=p*de+S*ke+X*tt+e[14],n[15]=_*de+B*ke+te*tt+e[15]),n}function Va(n,e,i){var a=i[0],u=i[1],p=i[2];return n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n[3]=e[3]*a,n[4]=e[4]*u,n[5]=e[5]*u,n[6]=e[6]*u,n[7]=e[7]*u,n[8]=e[8]*p,n[9]=e[9]*p,n[10]=e[10]*p,n[11]=e[11]*p,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function tu(n,e,i){var a=Math.sin(i),u=Math.cos(i),p=e[4],_=e[5],w=e[6],I=e[7],S=e[8],B=e[9],j=e[10],H=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=p*u+S*a,n[5]=_*u+B*a,n[6]=w*u+j*a,n[7]=I*u+H*a,n[8]=S*u-p*a,n[9]=B*u-_*a,n[10]=j*u-w*a,n[11]=H*u-I*a,n}function Mh(n,e,i){var a=Math.sin(i),u=Math.cos(i),p=e[0],_=e[1],w=e[2],I=e[3],S=e[8],B=e[9],j=e[10],H=e[11];return e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=p*u-S*a,n[1]=_*u-B*a,n[2]=w*u-j*a,n[3]=I*u-H*a,n[8]=p*a+S*u,n[9]=_*a+B*u,n[10]=w*a+j*u,n[11]=I*a+H*u,n}function g_(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Pf(n,e,i){var a,u,p,_=i[0],w=i[1],I=i[2],S=Math.hypot(_,w,I);return S0&&(p=1/Math.sqrt(p)),n[0]=e[0]*p,n[1]=e[1]*p,n[2]=e[2]*p,n}function Ga(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Md(n,e,i){var a=e[0],u=e[1],p=e[2],_=i[0],w=i[1],I=i[2];return n[0]=u*I-p*w,n[1]=p*_-a*I,n[2]=a*w-u*_,n}function Yo(n,e,i){var a=e[0],u=e[1],p=e[2],_=i[3]*a+i[7]*u+i[11]*p+i[15];return n[0]=(i[0]*a+i[4]*u+i[8]*p+i[12])/(_=_||1),n[1]=(i[1]*a+i[5]*u+i[9]*p+i[13])/_,n[2]=(i[2]*a+i[6]*u+i[10]*p+i[14])/_,n}function y_(n,e,i){var a=i[0],u=i[1],p=i[2],_=e[0],w=e[1],I=e[2],S=u*I-p*w,B=p*_-a*I,j=a*w-u*_,H=u*j-p*B,X=p*S-a*j,te=a*B-u*S,de=2*i[3];return B*=de,j*=de,X*=2,te*=2,n[0]=_+(S*=de)+(H*=2),n[1]=w+B+X,n[2]=I+j+te,n}var nu,Pl=Ah,Cv=fm,Ev=Id;function v_(n,e,i){return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n}function x_(n,e){var i=e[0],a=e[1],u=e[2],p=e[3],_=i*i+a*a+u*u+p*p;return _>0&&(_=1/Math.sqrt(_)),n[0]=i*_,n[1]=a*_,n[2]=u*_,n[3]=p*_,n}function iu(n,e,i){var a=e[0],u=e[1],p=e[2],_=e[3];return n[0]=i[0]*a+i[4]*u+i[8]*p+i[12]*_,n[1]=i[1]*a+i[5]*u+i[9]*p+i[13]*_,n[2]=i[2]*a+i[6]*u+i[10]*p+i[14]*_,n[3]=i[3]*a+i[7]*u+i[11]*p+i[15]*_,n}function Ad(){var n=new ma(4);return ma!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function Sd(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function Of(n,e,i){i*=.5;var a=e[0],u=e[1],p=e[2],_=e[3],w=Math.sin(i),I=Math.cos(i);return n[0]=a*I+_*w,n[1]=u*I+p*w,n[2]=p*I-u*w,n[3]=_*I-a*w,n}function Rf(n,e,i){i*=.5;var a=e[0],u=e[1],p=e[2],_=e[3],w=Math.sin(i),I=Math.cos(i);return n[0]=a*I-p*w,n[1]=u*I+_*w,n[2]=p*I+a*w,n[3]=_*I-u*w,n}dm(),nu=new ma(4),ma!=Float32Array&&(nu[0]=0,nu[1]=0,nu[2]=0,nu[3]=0);var pm=x_;dm(),Bu(1,0,0),Bu(0,1,0),Ad(),Ad(),Sf();const zu=zt([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Lf}=zu,kf=zt([{name:"a_pos_3",components:3,type:"Int16"}]);var Ec=zt([{name:"a_pos",type:"Int16",components:2}]);class Uu{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,a){const u=Ga(i,this.dir);if(Math.abs(u)<1e-6)return!1;const p=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/u;return a[0]=this.pos[0]+this.dir[0]*p,a[1]=this.pos[1]+this.dir[1]*p,a[2]=this.pos[2]+this.dir[2]*p,!0}closestPointOnSphere(e,i,a){if(de=(X=this.pos)[0],ke=X[1],tt=X[2],mt=(te=e)[0],Qe=te[1],ut=te[2],Math.abs(de-mt)<=Qc*Math.max(1,Math.abs(de),Math.abs(mt))&&Math.abs(ke-Qe)<=Qc*Math.max(1,Math.abs(ke),Math.abs(Qe))&&Math.abs(tt-ut)<=Qc*Math.max(1,Math.abs(tt),Math.abs(ut))||0===i)return a[0]=a[1]=a[2]=0,!1;var X,te,de,ke,tt,mt,Qe,ut;const[u,p,_]=this.dir,w=this.pos[0]-e[0],I=this.pos[1]-e[1],S=this.pos[2]-e[2],B=u*u+p*p+_*_,j=2*(w*u+I*p+S*_),H=j*j-4*B*(w*w+I*I+S*S-i*i);if(H<0){const X=Math.max(-j/2,0),te=w+u*X,de=I+p*X,ke=S+_*X,tt=Math.hypot(te,de,ke);return a[0]=te*i/tt,a[1]=de*i/tt,a[2]=ke*i/tt,!1}{const X=(-j-Math.sqrt(H))/(2*B);if(X<0){const te=Math.hypot(w,I,S);return a[0]=w*i/te,a[1]=I*i/te,a[2]=S*i/te,!1}return a[0]=w+u*X,a[1]=I+p*X,a[2]=S+_*X,!0}}}class Zu{constructor(e,i,a,u,p){this.TL=e,this.TR=i,this.BR=a,this.BL=u,this.horizon=p}static fromInvProjectionMatrix(e,i,a){const u=[-1,1,1],p=[1,1,1],_=[1,-1,1],w=[-1,-1,1],I=Yo(u,u,e),S=Yo(p,p,e),B=Yo(_,_,e),j=Yo(w,w,e);return new Zu(I,S,B,j,i/a)}}class Ff{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,a,u){const p=Math.pow(2,a),_=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(I=>{const S=iu([],I,e),B=1/S[3]/i*p;return(j=S)[0]=(H=S)[0]*(X=[B,B,u?1/S[3]:B,B])[0],j[1]=H[1]*X[1],j[2]=H[2]*X[2],j[3]=H[3]*X[3],j;var j,H,X}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const S=ea([],Md([],Pl([],_[I[0]],_[I[1]]),Pl([],_[I[2]],_[I[1]]))),B=-Ga(S,_[I[1]]);return S.concat(B)});return new Ff(_,w)}}class ta{static fromPoints(e){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const u of e)Nu(i,i,u),Sh(a,a,u);return new ta(i,a)}static applyTransform(e,i){const a=e.getCorners();for(let u=0;u=0;if(0===_)return 0;_!==i.length&&(a=!1)}if(a)return 2;for(let u=0;u<3;u++){let p=Number.MAX_VALUE,_=-Number.MAX_VALUE;for(let w=0;wthis.max[u]-this.min[u])return 0}return 1}}const Bf=5,Nf=6,Ha=Ii/Math.PI/2,b_=16383,Pd=[64,32,16],Pa=-Ha,Wa=Ha,w_=[new ta([Pa,Pa,Pa],[Wa,Wa,Wa]),new ta([Pa,Pa,Pa],[0,0,Wa]),new ta([0,Pa,Pa],[Wa,0,Wa]),new ta([Pa,0,Pa],[0,Wa,Wa]),new ta([0,0,Pa],[Wa,Wa,Wa])];function Vs(n){return n*Ha/Rl}function Oh(n,e,i,a=!0){const u=_a([],n._camera.position,n.worldSize),p=[e,i,1,1];iu(p,p,n.pixelMatrixInverse),v_(p,p,1/p[3]);const _=ea([],Pl([],p,u)),w=n.globeMatrix,I=[w[12],w[13],w[14]],S=Pl([],I,u),B=Id(S),j=ea([],S),H=n.worldSize/(2*Math.PI),X=Ga(j,_),te=Math.asin(H/B);if(te1?null:function(a,u,p,_){const w=Math.sin(p);return a*(Math.sin((1-_)*p)/w)+u*(Math.sin(_*p)/w)}(n.a[e],n.b[e],n.angle,Ye(i,0,1))+n.center[e]}function Ro(n){if(n.z<=1)return w_[n.z+2*n.y+n.x];const e=Zf(Rd(n));return ta.fromPoints(e)}function ul(n,e,i){return _a(n,n,1-i),Ph(n,n,e,i)}function zf(n,e){const i=Ol(e.zoom);if(0===i)return Ro(n);const a=Rd(n),u=Zf(a),p=Ll(a.getWest())*e.worldSize,_=Ll(a.getEast())*e.worldSize,w=kl(a.getNorth())*e.worldSize,I=kl(a.getSouth())*e.worldSize,S=[p,w,0],B=[_,w,0],j=[p,I,0],H=[_,I,0],X=Ih([],e.globeMatrix);return Yo(S,S,X),Yo(B,B,X),Yo(j,j,X),Yo(H,H,X),u[0]=ul(u[0],j,i),u[1]=ul(u[1],H,i),u[2]=ul(u[2],B,i),u[3]=ul(u[3],S,i),ta.fromPoints(u)}function Uf(n,e,i){for(const a of n)Yo(a,a,e),_a(a,a,i)}function Rd({x:n,y:e,z:i}){const a=1/(1<Math.PI/2*1.01}const Vf=Le(85),vm=Math.cos(Vf),xm=Math.sin(Vf),Rl=6371008.8,kd=2*Math.PI*Rl;class Jl{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Jl(hn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,a=this.lat*i,u=e.lat*i,p=Math.sin(a)*Math.sin(u)+Math.cos(a)*Math.cos(u)*Math.cos((e.lng-this.lng)*i);return Rl*Math.acos(Math.min(p,1))}toBounds(e=0){const i=360*e/40075017,a=i/Math.cos(Math.PI/180*this.lat);return new Cc(new Jl(this.lng-a,this.lat-i),new Jl(this.lng+a,this.lat+i))}toEcef(e){const i=Vs(e);return ju(this.lat,this.lng,Ha+i)}static convert(e){if(e instanceof Jl)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Jl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Jl(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var $r=Jl;function $u(n){return kd*Math.cos(n*Math.PI/180)}function Ll(n){return(180+n)/360}function kl(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function dl(n,e){return n/$u(e)}function Oa(n){return 360*n-180}function Fs(n){return 360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90}function bm(n,e){return n*$u(Fs(e))}const Is=85.051129;function Fd(n){return 1/Math.cos(n*Math.PI/180)}class Tc{constructor(e,i,a=0){this.x=+e,this.y=+i,this.z=+a}static fromLngLat(e,i=0){const a=$r.convert(e);return new Tc(Ll(a.lng),kl(a.lat),dl(i,a.lat))}toLngLat(){return new $r(Oa(this.x),Fs(this.y))}toAltitude(){return bm(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/kd*Fd(Fs(this.y))}}function Bd(n,e,i,a,u,p,_,w,I){const S=(e+a)/2,B=(i+u)/2,j=new ue(S,B);w(j),function(H,X,te,de,ke,tt){const mt=te-ke,Qe=de-tt;return Math.abs((de-X)*mt-(te-H)*Qe)/Math.hypot(mt,Qe)}(j.x,j.y,p.x,p.y,_.x,_.y)>=I?(Bd(n,e,i,S,B,p,j,w,I),Bd(n,S,B,a,u,j,_,w,I)):n.push(_)}function wm(n,e,i){let a=n[0],u=a.x,p=a.y;e(a);const _=[a];for(let w=1;wn.x+1||an.y+1)&&dt("Geometry exceeds allowed extent, reduce your vector tile buffer size"),n}function Fl(n,e,i){const a=n.loadGeometry(),u=n.extent,p=Ii/u;if(e&&i&&i.projection.isReprojectedInTileSpace){const _=1<{const X=Oa((e.x+H.x/u)/_),te=Fs((e.y+H.y/u)/_),de=B.project(X,te);H.x=(de.x*w-I)*u,H.y=(de.y*w-S)*u};for(let H=0;H=u||te.y<0||te.y>=u||(j(te),X.push(te));a[H]=X}}for(const _ of a)for(const w of _)Cm(w,p);return a}function au(n,e){return{type:n.type,id:n.id,properties:n.properties,geometry:e?Fl(n):[]}}function Hf(n,e,i,a,u){n.emplaceBack(2*e+(a+1)/2,2*i+(u+1)/2)}function lu(n,e,i){n.emplaceBack(e.x,e.y,e.z,16384*i[0],16384*i[1],16384*i[2])}class Wf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Vn,this.indexArray=new xi,this.segments=new qo,this.programConfigurations=new Fu(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,a,u){const p=this.layers[0],_=[];let w=null;"circle"===p.type&&(w=p.layout.get("circle-sort-key"));for(const{feature:S,id:B,index:j,sourceLayerIndex:H}of e){const X=this.layers[0]._featureFilter.needGeometry,te=au(S,X);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),te,a))continue;const de=w?w.evaluate(te,{},a):void 0,ke={id:B,properties:S.properties,type:S.type,sourceLayerIndex:H,index:j,geometry:X?te.geometry:Fl(S,a,u),patterns:{},sortKey:de};_.push(ke)}w&&_.sort((S,B)=>S.sortKey-B.sortKey);let I=null;"globe"===u.projection.name&&(this.globeExtVertexArray=new Gn,I=u.projection);for(const S of _){const{geometry:B,index:j,sourceLayerIndex:H}=S,X=e[j].feature;this.addFeature(S,B,j,i.availableImages,a,I),i.featureIndex.insert(X,B,j,H,this.index)}}update(e,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,a,u)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Af.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Th.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,a,u,p,_){for(const w of i)for(const I of w){const S=I.x,B=I.y;if(S<0||S>=Ii||B<0||B>=Ii)continue;if(_){const X=_.projectTilePoint(S,B,p),te=_.upVector(p,S,B),de=this.globeExtVertexArray;lu(de,X,te),lu(de,X,te),lu(de,X,te),lu(de,X,te)}const j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),H=j.vertexLength;Hf(this.layoutVertexArray,S,B,-1,-1),Hf(this.layoutVertexArray,S,B,1,-1),Hf(this.layoutVertexArray,S,B,1,1),Hf(this.layoutVertexArray,S,B,-1,1),this.indexArray.emplaceBack(H,H+1,H+2),this.indexArray.emplaceBack(H,H+2,H+3),j.vertexLength+=4,j.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},u,p)}}function qf(n,e){for(let i=0;i1){if(kh(n,e))return!0;for(let a=0;a1?i:i.sub(e)._mult(u)._add(e))}function Bh(n,e){let i,a,u,p=!1;for(let _=0;_e.y!=u.y>e.y&&e.x<(u.x-a.x)*(e.y-a.y)/(u.y-a.y)+a.x&&(p=!p)}return p}function Bl(n,e){let i=!1;for(let a=0,u=n.length-1;ae.y!=_.y>e.y&&e.x<(_.x-p.x)*(e.y-p.y)/(_.y-p.y)+p.x&&(i=!i)}return i}function Xf(n,e,i,a,u){for(const _ of n)if(e<=_.x&&i<=_.y&&a>=_.x&&u>=_.y)return!0;const p=[new ue(e,i),new ue(e,u),new ue(a,u),new ue(a,i)];if(n.length>2)for(const _ of p)if(Bl(n,_))return!0;for(let _=0;_u.x&&e.x>u.x||n.yu.y&&e.y>u.y)return!1;const p=Ot(n,e,i[0]);return p!==Ot(n,e,i[1])||p!==Ot(n,e,i[2])||p!==Ot(n,e,i[3])}function Nl(n,e,i){const a=e.paint.get(n).value;return"constant"===a.kind?a.value:i.programConfigurations.get(e.id).getMaxValue(n)}function Nh(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function ep(n,e,i,a,u){if(!e[0]&&!e[1])return n;const p=ue.convert(e)._mult(u);"viewport"===i&&p._rotate(-a);const _=[];for(let w=0;w0){const Qe=i.projection.upVector(S,X.x,X.y);de.x+=Qe[0]*B*te,de.y+=Qe[1]*B*te,de.z+=Qe[2]*B*te}const ke=p?X:Dm(de.x,de.y,de.z,a),tt=p?n.tilespaceRays.map(Qe=>Gu(Qe,te)):n.queryGeometry.screenGeometry,mt=iu([],[de.x,de.y,de.z,1],a);if(!_&&p?I*=mt[3]/i.cameraToCenterDistance:_&&!p&&(I*=i.cameraToCenterDistance/mt[3]),p){const Qe=Fs((H.y/Ii+S.y)/(1<n.width||u.height>n.height||i.x>n.width-u.width||i.y>n.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>e.width||u.height>e.height||a.x>e.width-u.width||a.y>e.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const _=n.data,w=e.data;for(let I=0;I{e[n.evaluationKey]=I;const S=n.expression.evaluate(e);u.data[_+w+0]=Math.floor(255*S.r/S.a),u.data[_+w+1]=Math.floor(255*S.g/S.a),u.data[_+w+2]=Math.floor(255*S.b/S.a),u.data[_+w+3]=Math.floor(255*S.a)};if(n.clips)for(let _=0,w=0;_80*i){a=p=n[0],u=_=n[1];for(var te=i;tep&&(p=w),I>_&&(_=I);S=0!==(S=Math.max(p-a,_-u))?32767/S:0}return Ud(H,X,i,a,u,S,0),X}function Pm(n,e,i,a,u){var p,_;if(u===km(n,e,i,a)>0)for(p=e;p=e;p-=a)_=op(p,n[p],n[p+1],_);return _&&Uh(_,_.next)&&(Ju(_),_=_.next),_}function uu(n,e){if(!n)return n;e||(e=n);var i,a=n;do{if(i=!1,a.steiner||!Uh(a,a.next)&&0!==Jo(a.prev,a,a.next))a=a.next;else{if(Ju(a),(a=e=a.prev)===a.next)break;i=!0}}while(i||a!==e);return e}function Ud(n,e,i,a,u,p,_){if(n){!_&&p&&function(B,j,H,X){var te=B;do{0===te.z&&(te.z=Om(te.x,te.y,j,H,X)),te.prevZ=te.prev,te.nextZ=te.next,te=te.next}while(te!==B);te.prevZ.nextZ=null,te.prevZ=null,function(de){var ke,tt,mt,Qe,ut,xt,bt,tn,nn=1;do{for(tt=de,de=null,ut=null,xt=0;tt;){for(xt++,mt=tt,bt=0,ke=0;ke0||tn>0&&mt;)0!==bt&&(0===tn||!mt||tt.z<=mt.z)?(Qe=tt,tt=tt.nextZ,bt--):(Qe=mt,mt=mt.nextZ,tn--),ut?ut.nextZ=Qe:de=Qe,Qe.prevZ=ut,ut=Qe;tt=mt}ut.nextZ=null,nn*=2}while(xt>1)}(te)}(n,a,u,p);for(var w,I,S=n;n.prev!==n.next;)if(w=n.prev,I=n.next,p?M_(n,a,u,p):I_(n))e.push(w.i/i|0),e.push(n.i/i|0),e.push(I.i/i|0),Ju(n),n=I.next,S=I.next;else if((n=I)===S){_?1===_?Ud(n=Ic(uu(n),e,i),e,i,a,u,p,2):2===_&&Zd(n,e,i,a,u,p):Ud(uu(n),e,i,a,u,p,1);break}}}function I_(n){var e=n.prev,i=n,a=n.next;if(Jo(e,i,a)>=0)return!1;for(var u=e.x,p=i.x,_=a.x,w=e.y,I=i.y,S=a.y,B=up?u>_?u:_:p>_?p:_,X=w>I?w>S?w:S:I>S?I:S,te=a.next;te!==e;){if(te.x>=B&&te.x<=H&&te.y>=j&&te.y<=X&&jd(u,w,p,I,_,S,te.x,te.y)&&Jo(te.prev,te,te.next)>=0)return!1;te=te.next}return!0}function M_(n,e,i,a){var u=n.prev,p=n,_=n.next;if(Jo(u,p,_)>=0)return!1;for(var w=u.x,I=p.x,S=_.x,B=u.y,j=p.y,H=_.y,X=wI?w>S?w:S:I>S?I:S,ke=B>j?B>H?B:H:j>H?j:H,tt=Om(X,te,e,i,a),mt=Om(de,ke,e,i,a),Qe=n.prevZ,ut=n.nextZ;Qe&&Qe.z>=tt&&ut&&ut.z<=mt;){if(Qe.x>=X&&Qe.x<=de&&Qe.y>=te&&Qe.y<=ke&&Qe!==u&&Qe!==_&&jd(w,B,I,j,S,H,Qe.x,Qe.y)&&Jo(Qe.prev,Qe,Qe.next)>=0||(Qe=Qe.prevZ,ut.x>=X&&ut.x<=de&&ut.y>=te&&ut.y<=ke&&ut!==u&&ut!==_&&jd(w,B,I,j,S,H,ut.x,ut.y)&&Jo(ut.prev,ut,ut.next)>=0))return!1;ut=ut.nextZ}for(;Qe&&Qe.z>=tt;){if(Qe.x>=X&&Qe.x<=de&&Qe.y>=te&&Qe.y<=ke&&Qe!==u&&Qe!==_&&jd(w,B,I,j,S,H,Qe.x,Qe.y)&&Jo(Qe.prev,Qe,Qe.next)>=0)return!1;Qe=Qe.prevZ}for(;ut&&ut.z<=mt;){if(ut.x>=X&&ut.x<=de&&ut.y>=te&&ut.y<=ke&&ut!==u&&ut!==_&&jd(w,B,I,j,S,H,ut.x,ut.y)&&Jo(ut.prev,ut,ut.next)>=0)return!1;ut=ut.nextZ}return!0}function Ic(n,e,i){var a=n;do{var u=a.prev,p=a.next.next;!Uh(u,p)&&Lm(u,a,a.next,p)&&Ra(u,p)&&Ra(p,u)&&(e.push(u.i/i|0),e.push(a.i/i|0),e.push(p.i/i|0),Ju(a),Ju(a.next),a=n=p),a=a.next}while(a!==n);return uu(a)}function Zd(n,e,i,a,u,p){var _=n;do{for(var w=_.next.next;w!==_.prev;){if(_.i!==w.i&&Rm(_,w)){var I=Yu(_,w);return _=uu(_,_.next),I=uu(I,I.next),Ud(_,e,i,a,u,p,0),void Ud(I,e,i,a,u,p,0)}w=w.next}_=_.next}while(_!==n)}function A_(n,e){return n.x-e.x}function Tv(n,e){var i=function(u,p){var _,w=p,I=u.x,S=u.y,B=-1/0;do{if(S<=w.y&&S>=w.next.y&&w.next.y!==w.y){var j=w.x+(S-w.y)*(w.next.x-w.x)/(w.next.y-w.y);if(j<=I&&j>B&&(B=j,_=w.x=w.x&&w.x>=te&&I!==w.x&&jd(S_.x||w.x===_.x&&Dv(_,w)))&&(_=w,ke=H)),w=w.next}while(w!==X);return _}(n,e);if(!i)return e;var a=Yu(i,n);return uu(a,a.next),uu(i,i.next)}function Dv(n,e){return Jo(n.prev,n,e.prev)<0&&Jo(e.next,n,n.next)<0}function Om(n,e,i,a,u){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-i)*u|0)|n<<8))|n<<4))|n<<2))|n<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*u|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Iv(n){var e=n,i=n;do{(e.x=(n-_)*(p-w)&&(n-_)*(a-w)>=(i-_)*(e-w)&&(i-_)*(p-w)>=(u-_)*(a-w)}function Rm(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!function(i,a){var u=i;do{if(u.i!==i.i&&u.next.i!==i.i&&u.i!==a.i&&u.next.i!==a.i&&Lm(u,u.next,i,a))return!0;u=u.next}while(u!==i);return!1}(n,e)&&(Ra(n,e)&&Ra(e,n)&&function(i,a){var u=i,p=!1,_=(i.x+a.x)/2,w=(i.y+a.y)/2;do{u.y>w!=u.next.y>w&&u.next.y!==u.y&&_<(u.next.x-u.x)*(w-u.y)/(u.next.y-u.y)+u.x&&(p=!p),u=u.next}while(u!==i);return p}(n,e)&&(Jo(n.prev,n,e.prev)||Jo(n,e.prev,e))||Uh(n,e)&&Jo(n.prev,n,n.next)>0&&Jo(e.prev,e,e.next)>0)}function Jo(n,e,i){return(e.y-n.y)*(i.x-e.x)-(e.x-n.x)*(i.y-e.y)}function Uh(n,e){return n.x===e.x&&n.y===e.y}function Lm(n,e,i,a){var u=qu(Jo(n,e,i)),p=qu(Jo(n,e,a)),_=qu(Jo(i,a,n)),w=qu(Jo(i,a,e));return u!==p&&_!==w||!(0!==u||!Zh(n,i,e))||!(0!==p||!Zh(n,a,e))||!(0!==_||!Zh(i,n,a))||!(0!==w||!Zh(i,e,a))}function Zh(n,e,i){return e.x<=Math.max(n.x,i.x)&&e.x>=Math.min(n.x,i.x)&&e.y<=Math.max(n.y,i.y)&&e.y>=Math.min(n.y,i.y)}function qu(n){return n>0?1:n<0?-1:0}function Ra(n,e){return Jo(n.prev,n,n.next)<0?Jo(n,e,n.next)>=0&&Jo(n,n.prev,e)>=0:Jo(n,e,n.prev)<0||Jo(n,n.next,e)<0}function Yu(n,e){var i=new jh(n.i,n.x,n.y),a=new jh(e.i,e.x,e.y),u=n.next,p=e.prev;return n.next=e,e.prev=n,i.next=u,u.prev=i,a.next=i,i.prev=a,p.next=a,a.prev=p,a}function op(n,e,i,a){var u=new jh(n,e,i);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Ju(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function jh(n,e,i){this.i=n,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function km(n,e,i,a){for(var u=0,p=e,_=i-a;p0&&i.holes.push(a+=n[u-1].length)}return i};var Fm=Be(zh.exports);function Mv(n,e,i,a,u){Vh(n,e,i||0,a||n.length-1,u||Av)}function Vh(n,e,i,a,u){for(;a>i;){if(a-i>600){var p=a-i+1,_=e-i+1,w=Math.log(p),I=.5*Math.exp(2*w/3),S=.5*Math.sqrt(w*I*(p-I)/p)*(_-p/2<0?-1:1);Vh(n,e,Math.max(i,Math.floor(e-_*I/p+S)),Math.min(a,Math.floor(e+(p-_)*I/p+S)),u)}var B=n[e],j=i,H=a;for(du(n,i,e),u(n[a],B)>0&&du(n,i,a);j0;)H--}0===u(n[i],B)?du(n,i,H):du(n,++H,a),H<=e&&(i=H+1),e<=H&&(a=H-1)}}function du(n,e,i){var a=n[e];n[e]=n[i],n[i]=a}function Av(n,e){return ne?1:0}function Bm(n,e){const i=n.length;if(i<=1)return[n];const a=[];let u,p;for(let _=0;_1)for(let _=0;_i.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Vn,this.indexArray=new xi,this.indexArray2=new _s,this.programConfigurations=new Fu(e.layers,e.zoom),this.segments=new qo,this.segments2=new qo,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,a,u){this.hasPattern=sp("fill",this.layers,i);const p=this.layers[0].layout.get("fill-sort-key"),_=[];for(const{feature:w,id:I,index:S,sourceLayerIndex:B}of e){const j=this.layers[0]._featureFilter.needGeometry,H=au(w,j);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),H,a))continue;const X=p?p.evaluate(H,{},a,i.availableImages):void 0,te={id:I,properties:w.properties,type:w.type,sourceLayerIndex:B,index:S,geometry:j?H.geometry:Fl(w,a,u),patterns:{},sortKey:X};_.push(te)}p&&_.sort((w,I)=>w.sortKey-I.sortKey);for(const w of _){const{geometry:I,index:S,sourceLayerIndex:B}=w;if(this.hasPattern){const j=ap("fill",this.layers,w,this.zoom,i);this.patternFeatures.push(j)}else this.addFeature(w,I,S,a,{},i.availableImages);i.featureIndex.insert(e[S].feature,I,S,B,this.index)}}update(e,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,a,u)}addFeatures(e,i,a,u,p){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,i,a,u)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sm),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,i,a,u,p,_=[]){for(const w of Bm(i,500)){let I=0;for(const te of w)I+=te.length;const S=this.segments.prepareSegment(I,this.layoutVertexArray,this.indexArray),B=S.vertexLength,j=[],H=[];for(const te of w){if(0===te.length)continue;te!==w[0]&&H.push(j.length/2);const de=this.segments2.prepareSegment(te.length,this.layoutVertexArray,this.indexArray2),ke=de.vertexLength;this.layoutVertexArray.emplaceBack(te[0].x,te[0].y),this.indexArray2.emplaceBack(ke+te.length-1,ke),j.push(te[0].x),j.push(te[0].y);for(let tt=1;tt>3}if(u--,1===a||2===a)p+=n.readSVarint(),_+=n.readSVarint(),1===a&&(e&&w.push(e),e=[]),e.push(new R_(p,_));else{if(7!==a)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&w.push(e),w},Mc.prototype.bbox=function(){var n=this._pbf;n.pos=this._geometry;for(var e=n.readVarint()+n.pos,i=1,a=0,u=0,p=0,_=1/0,w=-1/0,I=1/0,S=-1/0;n.pos>3}if(a--,1===i||2===i)(u+=n.readSVarint())<_&&(_=u),u>w&&(w=u),(p+=n.readSVarint())S&&(S=p);else if(7!==i)throw new Error("unknown command "+i)}return[_,I,w,S]},Mc.prototype.toGeoJSON=function(n,e,i){var a,u,p=this.extent*Math.pow(2,i),_=this.extent*n,w=this.extent*e,I=this.loadGeometry(),S=Mc.types[this.type];function B(X){for(var te=0;te>3;u=1===_?a.readString():2===_?a.readFloat():3===_?a.readDouble():4===_?a.readVarint64():5===_?a.readVarint():6===_?a.readSVarint():7===_?a.readBoolean():null}return u}(i))}Vm.prototype.feature=function(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];var e=this._pbf.readVarint()+this._pbf.pos;return new k_(this._pbf,e,this.extent,this._keys,this._values)};var Sv=jm;function Pv(n,e,i){if(3===n){var a=new Sv(i,i.readVarint()+i.pos);a.length&&(e[a.name]=a)}}var hu=Kl.VectorTile=function(n,e){this.layers=n.readFields(Pv,{},e)},Gr=Kl.VectorTileFeature=Um;function Ac(n,e,i,a){const u=[],p=0===a?(_,w,I,S,B,j)=>{_.push(new ue(j,I+(j-w)/(S-w)*(B-I)))}:(_,w,I,S,B,j)=>{_.push(new ue(w+(j-I)/(B-I)*(S-w),j))};for(const _ of n){const w=[];for(const I of _){if(I.length<=2)continue;const S=[];for(let H=0;He&&p(S,X,te,de,ke,e):tt>i?mt=e&&p(S,X,te,de,ke,e),mt>i&&tt<=i&&p(S,X,te,de,ke,i)}let B=I[I.length-1];const j=0===a?B.x:B.y;j>=e&&j<=i&&S.push(B),S.length&&(B=S[S.length-1],S[0].x===B.x&&S[0].y===B.y||S.push(S[0]),w.push(S))}w.length&&u.push(w)}return u}Kl.VectorTileLayer=jm;const Gm=Gr.types,Hm=Math.pow(2,13);function fu(n,e,i,a,u,p,_,w){n.emplaceBack((e<<1)+_,(i<<1)+p,(Math.floor(a*Hm)<<1)+u,Math.round(w))}function pu(n,e,i){n.emplaceBack(e.x,e.y,e.z,16384*i[0],16384*i[1],16384*i[2])}class Wm{constructor(){this.acc=new ue(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new ue(e.x,e.y),this.max=new ue(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const a=this.min,u=this.max;e.xu.x&&(u.x=e.x),e.yu.y&&(u.y=e.y),((0===e.x||e.x===Ii)&&e.x===i.x)!=((0===e.y||e.y===Ii)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,ki(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Ii!=e.x>Ii&&this.addBorderIntersection(1,ki(i.y,e.y,(Ii-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,ki(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Ii!=e.y>Ii&&this.addBorderIntersection(3,ki(i.x,e.x,(Ii-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const a=this.borders[e];ia[1]&&(a[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const a=0===e.x?0:1;this.addBorderIntersection(a,i.y),this.addBorderIntersection(a,e.y)}else{const a=0===e.y?2:3;this.addBorderIntersection(a,i.x),this.addBorderIntersection(a,e.x)}}centroid(){const e=this.polyCount.reduce((i,a)=>i+a.edges,0);return 0!==e?this.acc.div(e)._round():new ue(0,0)}span(){return new ue(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class Ku{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new Rn,this.centroidVertexArray=new Qs,this.indexArray=new xi,this.programConfigurations=new Fu(e.layers,e.zoom),this.segments=new qo,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,a,u){this.features=[],this.hasPattern=sp("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(p){const _=Math.exp(Math.PI*(1-p.y/(1<=0;tt--){const mt=X[tt];(0===mt.length||(te=mt[0]).every(Qe=>Qe.x<=0)||te.every(Qe=>Qe.x>=Ii)||te.every(Qe=>Qe.y<=0)||te.every(Qe=>Qe.y>=Ii))&&X.splice(tt,1)}var te;let de;if(B)de=dp(X,I,u);else{de=[];for(const tt of X)de.push({polygon:tt,bounds:I})}const ke=H?this.edgeRadius:0;for(const{polygon:tt,bounds:mt}of de){let Qe=0,ut=0;for(const bt of tt)H&&!bt[0].equals(bt[bt.length-1])&&bt.push(bt[0]),ut+=H?bt.length-1:bt.length;const xt=this.segments.prepareSegment((H?5:4)*ut,this.layoutVertexArray,this.indexArray);if(H){const bt=[],tn=[];Qe=xt.vertexLength;for(const Tn of tt){let Un,fn;Tn.length&&Tn!==tt[0]&&tn.push(bt.length/2),Un=Tn[1].sub(Tn[0])._perp()._unit();for(let Pn=1;Pn4&&qm(bt[bt.length-2],bt[0],bt[1]),fn=ke?Hh(bt[bt.length-2],bt[0],bt[1],ke):0;nn=bt[1].sub(bt[0])._perp()._unit();let Pn=!0;for(let On=1,Bn=0;On0?1:0,Qn=Hn.dist(wn);if(Bn+Qn>32768&&(Bn=0),ke){Tn=si.sub(wn)._perp()._unit();let Ki=F_(Hn,wn,si,cp(nn,Tn),ke);isNaN(Ki)&&(Ki=0);const Ri=wn.sub(Hn)._unit();Hn=Hn.add(Ri.mult(fn))._round(),wn=wn.add(Ri.mult(-Ki))._round(),fn=Ki,nn=Tn}const Mi=xt.vertexLength,Ji=bt.length>4&&qm(Hn,wn,si);let Ir=qh(Bn,Un,Pn);if(fu(this.layoutVertexArray,Hn.x,Hn.y,ci,Yi,0,0,Ir),fu(this.layoutVertexArray,Hn.x,Hn.y,ci,Yi,0,1,Ir),Bn+=Qn,Ir=qh(Bn,Ji,!Pn),Un=Ji,fu(this.layoutVertexArray,wn.x,wn.y,ci,Yi,0,0,Ir),fu(this.layoutVertexArray,wn.x,wn.y,ci,Yi,0,1,Ir),xt.vertexLength+=4,this.indexArray.emplaceBack(Mi+0,Mi+1,Mi+2),this.indexArray.emplaceBack(Mi+1,Mi+3,Mi+2),xt.primitiveLength+=2,ke){const Ki=Qe+(1===On?bt.length-2:On-2),Ri=1===On?Qe:Ki+1;if(this.indexArray.emplaceBack(Mi+1,Ki,Mi+3),this.indexArray.emplaceBack(Ki,Ri,Mi+3),xt.primitiveLength+=2,void 0===tn&&(tn=Mi),!Wh(si,bt[On],mt)){const Xr=On===bt.length-1?tn:xt.vertexLength;this.indexArray.emplaceBack(Mi+2,Mi+3,Xr),this.indexArray.emplaceBack(Mi+3,Xr+1,Xr),this.indexArray.emplaceBack(Mi+3,Ri,Xr+1),xt.primitiveLength+=3}Pn=!Pn}if(B){const Ki=this.layoutVertexExtArray,Ri=S.projectTilePoint(Hn.x,Hn.y,u),Xr=S.projectTilePoint(wn.x,wn.y,u),Qi=S.upVector(u,Hn.x,Hn.y),nr=S.upVector(u,wn.x,wn.y);pu(Ki,Ri,Qi),pu(Ki,Ri,Qi),pu(Ki,Xr,nr),pu(Ki,Xr,nr)}}H&&(Qe+=bt.length-1)}}if(j&&j.polyCount.length>0){if(j.borders){j.vertexArrayOffset=this.centroidVertexArray.length;const tt=j.borders,mt=this.featuresOnBorder.push(j)-1;for(let Qe=0;Qe<4;Qe++)tt[Qe][0]!==Number.MAX_VALUE&&this.borders[Qe].push(mt)}this.encodeCentroid(j.borders?void 0:j.centroid(),j)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,p,_,u)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,a)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[a].borders[e][0])}encodeCentroid(e,i,a=!0){let u,p;if(e)if(0!==e.y){const w=i.span()._mult(this.tileToMeter);u=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(w.x/10)),p=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(w.y/10))}else u=Math.ceil(7*(e.x+450)),p=0;else u=0,p=+a;let _=a?this.centroidVertexArray.length:i.vertexArrayOffset;for(const w of i.polyCount){a&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*w.edges+w.top);for(let I=0;Ii[1].x&&e.x>i[1].x||n.yi[1].y&&e.y>i[1].y}function qm(n,e,i){if(n.x<0||n.x>=Ii||e.x<0||e.x>=Ii||i.x<0||i.x>=Ii)return!1;const a=i.sub(e),u=a.perp(),p=n.sub(e);return(a.x*p.x+a.y*p.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(p.x*p.x+p.y*p.y))>-.866&&u.x*p.x+u.y*p.y<0}function qh(n,e,i){const a=e?2|n:-3&n;return i?1|a:-2&a}function up(){const n=Math.PI/32,e=Math.tan(n),i=Rl;return i*Math.sqrt(1+2*e*e)-i}function dp(n,e,i){const a=1<{for(const nn of bt)te.push({polygon:nn,bounds:tn})},ke=Math.ceil(Math.log2(B)),tt=Math.ceil(Math.log2(j)),mt=ke-tt,Qe=[];for(let bt=0;bt0?0:1);for(let bt=0;bttn+1?xt.push({polygons:Bn,bounds:wn,depth:tn+1}):de(Bn,wn)}if(Hn.length){const wn=[new ue(0===nn?On:Tn.x,1===nn?On:Tn.y),Un];Qe.length>tn+1?xt.push({polygons:Hn,bounds:wn,depth:tn+1}):de(Hn,wn)}}return te}(n,e,Math.ceil((p-u)/11.25),Math.ceil((_-w)/11.25),1,(I,S,B)=>{if(0===I)return.5*(S+B);{const j=Fs((i.y+S/Ii)/a);return(kl(.5*(Fs((i.y+B/Ii)/a)+j))*a-i.y)*Ii}})}ui(Ku,"FillExtrusionBucket",{omit:["layers","features"]}),ui(Wm,"PartMetadata");const mu=new ot({"fill-extrusion-edge-radius":new ce(Kt["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var B_={paint:new ot({"fill-extrusion-opacity":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:mu};function Yh(n,e,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[n*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class gu{constructor(e,i,a){this.z=e,this.x=i,this.y=a,this.key=Sc(0,e,e,i,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const a=(_=this.y,w=this.z,I=Yh(256*(p=this.x),256*(_=Math.pow(2,w)-_-1),w),S=Yh(256*(p+1),256*(_+1),w),I[0]+","+I[1]+","+S[0]+","+S[1]),u=function(p,_,w){let I,S="";for(let B=p;B>0;B--)I=1<this.canonical.z?new Bs(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Bs(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return Sc(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const a=this.canonical.z-e;return Sc(this.wrap*+i,e,e,this.canonical.x>>a,this.canonical.y>>a)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Bs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,u=2*this.canonical.y;return[new Bs(i,this.wrap,i,a,u),new Bs(i,this.wrap,i,a+1,u),new Bs(i,this.wrap,i,a,u+1),new Bs(i,this.wrap,i,a+1,u+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.yi.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new un,this.layoutVertexArray2=new Zn,this.indexArray=new xi,this.programConfigurations=new Fu(e.layers,e.zoom),this.segments=new qo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,a,u){this.hasPattern=sp("line",this.layers,i);const p=this.layers[0].layout.get("line-sort-key"),_=[];for(const{feature:B,id:j,index:H,sourceLayerIndex:X}of e){const te=this.layers[0]._featureFilter.needGeometry,de=au(B,te);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),de,a))continue;const ke=p?p.evaluate(de,{},a):void 0,tt={id:j,properties:B.properties,type:B.type,sourceLayerIndex:X,index:H,geometry:te?de.geometry:Fl(B,a,u),patterns:{},sortKey:ke};_.push(tt)}p&&_.sort((B,j)=>B.sortKey-j.sortKey);const{lineAtlas:w,featureIndex:I}=i,S=this.addConstantDashes(w);for(const B of _){const{geometry:j,index:H,sourceLayerIndex:X}=B;if(S&&this.addFeatureDashes(B,w),this.hasPattern){const te=ap("line",this.layers,B,this.zoom,i);this.patternFeatures.push(te)}else this.addFeature(B,j,H,a,w.positions,i.availableImages);I.insert(e[H].feature,j,H,X,this.index)}}addConstantDashes(e){let i=!1;for(const a of this.layers){const u=a.paint.get("line-dasharray").value,p=a.layout.get("line-cap").value;if("constant"!==u.kind||"constant"!==p.kind)i=!0;else{const _=p.value,w=u.value;if(!w)continue;e.addDash(w,_)}}return i}addFeatureDashes(e,i){const a=this.zoom;for(const u of this.layers){const p=u.paint.get("line-dasharray").value,_=u.layout.get("line-cap").value;if("constant"===p.kind&&"constant"===_.kind)continue;let w,I;if("constant"===p.kind){if(w=p.value,!w)continue}else w=p.evaluate({zoom:a},e);I="constant"===_.kind?_.value:_.evaluate({zoom:a},e),i.addDash(w,I),e.patterns[u.id]=i.getKey(w,I)}}update(e,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,a,u)}addFeatures(e,i,a,u,p){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,i,a,u)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,z_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Km),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,a,u,p,_){const w=this.layers[0].layout,I=w.get("line-join").evaluate(e,{}),S=w.get("line-cap").evaluate(e,{}),B=w.get("line-miter-limit"),j=w.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const H of i)this.addLine(H,e,I,S,B,j);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,p,_,u)}addLine(e,i,a,u,p,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let tt=0;tt=2&&e[I-1].equals(e[I-2]);)I--;let S=0;for(;S0;if(tn&&tt>S){const fn=H.dist(X);if(fn>2*B){const Pn=H.sub(H.sub(X)._mult(B/fn)._round());this.updateDistance(X,Pn),this.addCurrentVertex(Pn,de,0,0,j),X=Pn}}const Tn=X&&te;let Un=Tn?a:w?"butt":u;if(Tn&&"round"===Un&&(xt<_?Un="miter":xt<=2&&(Un="fakeround")),"miter"===Un&&xt>p&&(Un="bevel"),"bevel"===Un&&(xt>2&&(Un="flipbevel"),xt100)mt=ke.mult(-1);else{const fn=xt*de.add(ke).mag()/de.sub(ke).mag();mt._perp()._mult(fn*(nn?-1:1))}this.addCurrentVertex(H,mt,0,0,j),this.addCurrentVertex(H,mt.mult(-1),0,0,j)}else if("bevel"===Un||"fakeround"===Un){const fn=-Math.sqrt(xt*xt-1),Pn=nn?fn:0,On=nn?0:fn;if(X&&this.addCurrentVertex(H,de,Pn,On,j),"fakeround"===Un){const Bn=Math.round(180*bt/Math.PI/20);for(let Hn=1;Hn2*B){const Pn=H.add(te.sub(H)._mult(B/fn)._round());this.updateDistance(H,Pn),this.addCurrentVertex(Pn,ke,0,0,j),H=Pn}}}}addCurrentVertex(e,i,a,u,p,_=!1){const w=i.y*u-i.x,I=-i.y-i.x*u;this.addHalfVertex(e,i.x+i.y*a,i.y-i.x*a,_,!1,a,p),this.addHalfVertex(e,w,I,_,!0,-u,p)}addHalfVertex({x:e,y:i},a,u,p,_,w,I){this.layoutVertexArray.emplaceBack((e<<1)+(p?1:0),(i<<1)+(_?1:0),Math.round(63*a)+128,Math.round(63*u)+128,1+(0===w?0:w<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const S=I.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,S),I.primitiveLength++),_?this.e2=S:this.e1=S}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}ui(Qu,"LineBucket",{omit:["layers","patternFeatures"]});const Xm=new ot({"line-cap":new Ve(Kt.layout_line["line-cap"]),"line-join":new Ve(Kt.layout_line["line-join"]),"line-miter-limit":new ce(Kt.layout_line["line-miter-limit"]),"line-round-limit":new ce(Kt.layout_line["line-round-limit"]),"line-sort-key":new Ve(Kt.layout_line["line-sort-key"])});var Qm={paint:new ot({"line-opacity":new Ve(Kt.paint_line["line-opacity"]),"line-color":new Ve(Kt.paint_line["line-color"]),"line-translate":new ce(Kt.paint_line["line-translate"]),"line-translate-anchor":new ce(Kt.paint_line["line-translate-anchor"]),"line-width":new Ve(Kt.paint_line["line-width"]),"line-gap-width":new Ve(Kt.paint_line["line-gap-width"]),"line-offset":new Ve(Kt.paint_line["line-offset"]),"line-blur":new Ve(Kt.paint_line["line-blur"]),"line-dasharray":new Ve(Kt.paint_line["line-dasharray"]),"line-pattern":new Ve(Kt.paint_line["line-pattern"]),"line-gradient":new rt(Kt.paint_line["line-gradient"]),"line-trim-offset":new ce(Kt.paint_line["line-trim-offset"])}),layout:Xm};const hp=new class extends Ve{possiblyEvaluate(n,e){return e=new Z(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(n,e)}evaluate(n,e,i,a){return e=De({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(n,e,i,a)}}(Qm.paint.properties["line-width"].specification);function Kh(n,e){return e>0?e+2*n:n}hp.useIntegerZoom=!0;const Ov=zt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Rv=zt([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),j_=zt([{name:"a_projected_pos",components:4,type:"Float32"}],4);zt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const V_=zt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Lv=zt([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);zt([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const $_=zt([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Xh=zt([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);zt([{name:"triangle",components:3,type:"Uint16"}]),zt([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),zt([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),zt([{type:"Float32",name:"offsetX"}]),zt([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Ms=24;const La=128;function Vd(n,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Z(n+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:a,interpolationType:u}=i;let p=0;for(;p{a.text=function(u,p,_){const w=p.layout.get("text-transform").evaluate(_,{});return"uppercase"===w?u=u.toLocaleUpperCase():"lowercase"===w&&(u=u.toLocaleLowerCase()),L.applyArabicShaping&&(u=L.applyArabicShaping(u)),u}(a.text,e,i)}),n}const Rc={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42","\u2190":"\u2191","\u2192":"\u2193"};function Gd(n){return"\ufe36"===n||"\ufe48"===n||"\ufe38"===n||"\ufe44"===n||"\ufe42"===n||"\ufe3e"===n||"\ufe3c"===n||"\ufe3a"===n||"\ufe18"===n||"\ufe40"===n||"\ufe10"===n||"\ufe13"===n||"\ufe14"===n||"\uff40"===n||"\uffe3"===n||"\ufe11"===n||"\ufe12"===n}function eg(n){return"\ufe35"===n||"\ufe47"===n||"\ufe37"===n||"\ufe43"===n||"\ufe41"===n||"\ufe3d"===n||"\ufe3b"===n||"\ufe39"===n||"\ufe17"===n||"\ufe3f"===n}var Qh=Yr,Hd=function(n,e,i,a,u){var p,_,w=8*u-a-1,I=(1<>1,B=-7,j=i?u-1:0,H=i?-1:1,X=n[e+j];for(j+=H,p=X&(1<<-B)-1,X>>=-B,B+=w;B>0;p=256*p+n[e+j],j+=H,B-=8);for(_=p&(1<<-B)-1,p>>=-B,B+=a;B>0;_=256*_+n[e+j],j+=H,B-=8);if(0===p)p=1-S;else{if(p===I)return _?NaN:1/0*(X?-1:1);_+=Math.pow(2,a),p-=S}return(X?-1:1)*_*Math.pow(2,p-a)},G_=function(n,e,i,a,u,p){var _,w,I,S=8*p-u-1,B=(1<>1,H=23===u?Math.pow(2,-24)-Math.pow(2,-77):0,X=a?0:p-1,te=a?1:-1,de=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(w=isNaN(e)?1:0,_=B):(_=Math.floor(Math.log(e)/Math.LN2),e*(I=Math.pow(2,-_))<1&&(_--,I*=2),(e+=_+j>=1?H/I:H*Math.pow(2,1-j))*I>=2&&(_++,I/=2),_+j>=B?(w=0,_=B):_+j>=1?(w=(e*I-1)*Math.pow(2,u),_+=j):(w=e*Math.pow(2,j-1)*Math.pow(2,u),_=0));u>=8;n[i+X]=255&w,X+=te,w/=256,u-=8);for(_=_<0;n[i+X]=255&_,X+=te,_/=256,S-=8);n[i+X-te]|=128*de};function Yr(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0),this.pos=0,this.type=0,this.length=this.buf.length}Yr.Varint=0,Yr.Fixed64=1,Yr.Bytes=2,Yr.Fixed32=5;var _u=4294967296,tg=1/_u,pp=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ql(n){return n.type===Yr.Bytes?n.readVarint()+n.pos:n.pos+1}function ef(n,e,i){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(a);for(var u=i.pos-1;u>=n;u--)i.buf[u+a]=i.buf[u]}function ng(n,e){for(var i=0;i>>8,n[i+2]=e>>>16,n[i+3]=e>>>24}function rg(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+(n[e+3]<<24)}Yr.prototype={destroy:function(){this.buf=null},readFields:function(n,e,i){for(i=i||this.length;this.pos>3,p=this.pos;this.type=7&a,n(u,e,this),this.pos===p&&this.skip(a)}return e},readMessage:function(n,e){return this.readFields(n,e,this.readVarint()+this.pos)},readFixed32:function(){var n=td(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=rg(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=td(this.buf,this.pos)+td(this.buf,this.pos+4)*_u;return this.pos+=8,n},readSFixed64:function(){var n=td(this.buf,this.pos)+rg(this.buf,this.pos+4)*_u;return this.pos+=8,n},readFloat:function(){var n=Hd(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=Hd(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var e,i,a=this.buf;return e=127&(i=a[this.pos++]),i<128?e:(e|=(127&(i=a[this.pos++]))<<7,i<128?e:(e|=(127&(i=a[this.pos++]))<<14,i<128?e:(e|=(127&(i=a[this.pos++]))<<21,i<128?e:function(u,p,_){var w,I,S=_.buf;if(w=(112&(I=S[_.pos++]))>>4,I<128||(w|=(127&(I=S[_.pos++]))<<3,I<128)||(w|=(127&(I=S[_.pos++]))<<10,I<128)||(w|=(127&(I=S[_.pos++]))<<17,I<128)||(w|=(127&(I=S[_.pos++]))<<24,I<128)||(w|=(1&(I=S[_.pos++]))<<31,I<128))return function ed(n,e,i){return i?4294967296*e+(n>>>0):4294967296*(e>>>0)+(n>>>0)}(u,w,p);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=a[this.pos]))<<28,n,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2==1?(n+1)/-2:n/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=12&&pp?pp.decode(this.buf.subarray(e,n)):function(i,a,u){for(var p="",_=a;_239?4:B>223?3:B>191?2:1;if(_+H>u)break;1===H?B<128&&(j=B):2===H?128==(192&(w=i[_+1]))&&(j=(31&B)<<6|63&w)<=127&&(j=null):3===H?(I=i[_+2],128==(192&(w=i[_+1]))&&128==(192&I)&&((j=(15&B)<<12|(63&w)<<6|63&I)<=2047||j>=55296&&j<=57343)&&(j=null)):4===H&&(I=i[_+2],S=i[_+3],128==(192&(w=i[_+1]))&&128==(192&I)&&128==(192&S)&&((j=(15&B)<<18|(63&w)<<12|(63&I)<<6|63&S)<=65535||j>=1114112)&&(j=null)),null===j?(j=65533,H=1):j>65535&&(j-=65536,p+=String.fromCharCode(j>>>10&1023|55296),j=56320|1023&j),p+=String.fromCharCode(j),_+=H}return p}(this.buf,e,n)},readBytes:function(){var n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e},readPackedVarint:function(n,e){if(this.type!==Yr.Bytes)return n.push(this.readVarint(e));var i=Ql(this);for(n=n||[];this.pos127;);else if(e===Yr.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Yr.Fixed32)this.pos+=4;else{if(e!==Yr.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(n,e){this.writeVarint(n<<3|e)},realloc:function(n){for(var e=this.length||16;e268435455||n<0?function(e,i){var a,u,p,w;if(e>=0?(a=e%4294967296|0,u=e/4294967296|0):(u=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,u=u+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),p=a,(w=i).buf[w.pos++]=127&p|128,p>>>=7,w.buf[w.pos++]=127&p|128,p>>>=7,w.buf[w.pos++]=127&p|128,p>>>=7,w.buf[w.pos++]=127&p|128,w.buf[w.pos]=127&(p>>>=7),function(p,_){var w=(7&p)<<4;_.buf[_.pos++]|=w|((p>>>=3)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p)))))}(u,i)}(n,this):(this.realloc(4),this.buf[this.pos++]=127&n|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=n>>>7&127))))},writeSVarint:function(n){this.writeVarint(n<0?2*-n-1:2*n)},writeBoolean:function(n){this.writeVarint(!!n)},writeString:function(n){n=String(n),this.realloc(4*n.length),this.pos++;var e=this.pos;this.pos=function(a,u,p){for(var _,w,I=0;I55295&&_<57344){if(!w){_>56319||I+1===u.length?(a[p++]=239,a[p++]=191,a[p++]=189):w=_;continue}if(_<56320){a[p++]=239,a[p++]=191,a[p++]=189,w=_;continue}_=w-55296<<10|_-56320|65536,w=null}else w&&(a[p++]=239,a[p++]=191,a[p++]=189,w=null);_<128?a[p++]=_:(_<2048?a[p++]=_>>6|192:(_<65536?a[p++]=_>>12|224:(a[p++]=_>>18|240,a[p++]=_>>12&63|128),a[p++]=_>>6&63|128),a[p++]=63&_|128)}return p}(this.buf,n,this.pos);var i=this.pos-e;i>=128&&ef(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(n){this.realloc(4),G_(this.buf,n,this.pos,!0,23,4),this.pos+=4},writeDouble:function(n){this.realloc(8),G_(this.buf,n,this.pos,!0,52,8),this.pos+=8},writeBytes:function(n){var e=n.length;this.writeVarint(e),this.realloc(e);for(var i=0;i=128&&ef(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(n,e,i){this.writeTag(n,Yr.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(n,e){e.length&&this.writeMessage(n,ng,e)},writePackedSVarint:function(n,e){e.length&&this.writeMessage(n,H_,e)},writePackedBoolean:function(n,e){e.length&&this.writeMessage(n,q_,e)},writePackedFloat:function(n,e){e.length&&this.writeMessage(n,W_,e)},writePackedDouble:function(n,e){e.length&&this.writeMessage(n,kv,e)},writePackedFixed32:function(n,e){e.length&&this.writeMessage(n,tf,e)},writePackedSFixed32:function(n,e){e.length&&this.writeMessage(n,mp,e)},writePackedFixed64:function(n,e){e.length&&this.writeMessage(n,Y_,e)},writePackedSFixed64:function(n,e){e.length&&this.writeMessage(n,ig,e)},writeBytesField:function(n,e){this.writeTag(n,Yr.Bytes),this.writeBytes(e)},writeFixed32Field:function(n,e){this.writeTag(n,Yr.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(n,e){this.writeTag(n,Yr.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(n,e){this.writeTag(n,Yr.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(n,e){this.writeTag(n,Yr.Fixed64),this.writeSFixed64(e)},writeVarintField:function(n,e){this.writeTag(n,Yr.Varint),this.writeVarint(e)},writeSVarintField:function(n,e){this.writeTag(n,Yr.Varint),this.writeSVarint(e)},writeStringField:function(n,e){this.writeTag(n,Yr.Bytes),this.writeString(e)},writeFloatField:function(n,e){this.writeTag(n,Yr.Fixed32),this.writeFloat(e)},writeDoubleField:function(n,e){this.writeTag(n,Yr.Fixed64),this.writeDouble(e)},writeBooleanField:function(n,e){this.writeVarintField(n,!!e)}};var Wd=Be(Qh);const gp=3;function og(n,e,i){e.glyphs=[],1===n&&i.readMessage(Fv,e)}function Fv(n,e,i){if(3===n){const{id:a,bitmap:u,width:p,height:_,left:w,top:I,advance:S}=i.readMessage(J_,{});e.glyphs.push({id:a,bitmap:new hl({width:p+2*gp,height:_+2*gp},u),metrics:{width:p,height:_,left:w,top:I,advance:S}})}else 4===n?e.ascender=i.readSVarint():5===n&&(e.descender=i.readSVarint())}function J_(n,e,i){1===n?e.id=i.readVarint():2===n?e.bitmap=i.readBytes():3===n?e.width=i.readVarint():4===n?e.height=i.readVarint():5===n?e.left=i.readSVarint():6===n?e.top=i.readSVarint():7===n&&(e.advance=i.readVarint())}const qd=gp;function _p(n){let e=0,i=0;for(const _ of n)e+=_.w*_.h,i=Math.max(i,_.w);n.sort((_,w)=>w.h-_.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let u=0,p=0;for(const _ of n)for(let w=a.length-1;w>=0;w--){const I=a[w];if(!(_.w>I.w||_.h>I.h)){if(_.x=I.x,_.y=I.y,p=Math.max(p,_.y+_.h),u=Math.max(u,_.x+_.w),_.w===I.w&&_.h===I.h){const S=a.pop();we.hasImage(a)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in e.updatedImages)this.patchUpdatedImage(this.iconPositions[a],e.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],e.getImage(a),i)}patchUpdatedImage(e,i,a){if(!e||!i||e.version===i.version)return;e.version=i.version;const[u,p]=e.tl;a.update(i.data,void 0,{x:u,y:p})}}ui(yu,"ImagePosition"),ui(sg,"ImageAtlas");const va={horizontal:1,vertical:2,horizontalOnly:3},ag=-17;class Yd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const a=new Yd;return a.scale=e||1,a.fontStack=i,a}static forImage(e){const i=new Yd;return i.imageName=e,i}}class nd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const a=new nd;for(let u=0;u=0&&a>=e&&rf[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const a=new nd;return a.text=this.text.substring(e,i),a.sectionIndex=this.sectionIndex.slice(e,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(Yd.forText(e.scale,e.fontStack||i));const a=this.sections.length-1;for(let u=0;u=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function nf(n,e,i,a,u,p,_,w,I,S,B,j,H,X,te){const de=nd.fromFeature(n,u);j===va.vertical&&de.verticalizePunctuation(H);let ke=[];const tt=function(bt,tn,nn,Tn,Un,fn){if(!bt)return[];const Pn=[],On=function(si,fi,ci,Yi,Qn,Mi){let Ji=0;for(let Ir=0;Ir=0;let Hn=0;for(let si=0;si0&&gl>oo&&(oo=gl)}else{const na=nn[is.fontStack];if(!na)continue;na[lo]&&(eo=na[lo]);const xs=tn[is.fontStack];if(!xs)continue;const gl=xs.glyphs[lo];if(!gl)continue;if(So=gl.metrics,Vo=8203!==lo?Ms:0,Mi){const gd=void 0!==xs.ascender?Math.abs(xs.ascender):0,Cu=void 0!==xs.descender?Math.abs(xs.descender):0,Zc=(gd+Cu)*Mr;wo-i/2;){if(_--,_<0)return!1;w-=n[_].dist(p),p=n[_]}w+=n[_].dist(n[_+1]),_++;const I=[];let S=0;for(;wa;)S-=I.shift().angleDelta;if(S>u)return!1;_++,w+=B.dist(j)}return!0}function vp(n){let e=0;for(let i=0;iS){const te=(S-I)/X,de=ki(j.x,H.x,te),ke=ki(j.y,H.y,te),tt=new tc(de,ke,0,H.angleTo(j),B);return!_||X_(n,tt,w,_,e)?tt:void 0}I+=X}}function Q_(n,e,i,a,u,p,_,w,I){const S=xp(a,p,_),B=qa(a,u),j=B*_,H=0===n[0].x||n[0].x===I||0===n[0].y||n[0].y===I;return e-j=0&&ut=0&&xt=0&&H+S<=B){const bt=new tc(ut,xt,0,mt,te);bt._round(),a&&!X_(n,bt,p,a,u)||X.push(bt)}}j+=tt}return w||X.length||_||(X=ey(n,j/2,i,a,u,p,_,!0,I)),X}function pg(n,e,i,a,u){const p=[];for(let _=0;_=a&&j.x>=a||(B.x>=a?B=new ue(a,B.y+(a-B.x)/(j.x-B.x)*(j.y-B.y))._round():j.x>=a&&(j=new ue(a,B.y+(a-B.x)/(j.x-B.x)*(j.y-B.y))._round()),B.y>=u&&j.y>=u||(B.y>=u?B=new ue(B.x+(u-B.y)/(j.y-B.y)*(j.x-B.x),u)._round():j.y>=u&&(j=new ue(B.x+(u-B.y)/(j.y-B.y)*(j.x-B.x),u)._round()),I&&B.equals(I[I.length-1])||(I=[B],p.push(I)),I.push(j)))))}}return p}ui(tc,"Anchor");const Jd=1e20;function wp(n,e,i,a,u,p,_,w,I){for(let S=e;S-1);I++,p[I]=w,_[I]=S,_[I+1]=Jd}for(let w=0,I=0;w{let w=this.entries[u];w||(w=this.entries[u]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let I=w.glyphs[p];if(void 0!==I)return void _(null,{stack:u,id:p,glyph:I});if(I=this._tinySDF(w,u,p),I)return w.glyphs[p]=I,void _(null,{stack:u,id:p,glyph:I});const S=Math.floor(p/256);if(256*S>65535)return void _(new Error("glyphs > 65535 not supported"));if(w.ranges[S])return void _(null,{stack:u,id:p,glyph:I});let B=w.requests[S];B||(B=w.requests[S]=[],id.loadGlyphRange(u,S,this.url,this.requestManager,(j,H)=>{if(H){w.ascender=H.ascender,w.descender=H.descender;for(const X in H.glyphs)this._doesCharSupportLocalGlyph(+X)||(w.glyphs[+X]=H.glyphs[+X]);w.ranges[S]=!0}for(const X of B)X(j,H);delete w.requests[S]})),B.push((j,H)=>{j?_(j):H&&_(null,{stack:u,id:p,glyph:H.glyphs[p]||null})})},(u,p)=>{if(u)i(u);else if(p){const _={};for(const{stack:w,id:I,glyph:S}of p)void 0===_[w]&&(_[w]={}),void 0===_[w].glyphs&&(_[w].glyphs={}),_[w].glyphs[I]=S&&{id:S.id,bitmap:S.bitmap.clone(),metrics:S.metrics},_[w].ascender=this.entries[w].ascender,_[w].descender=this.entries[w].descender;i(null,_)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Lc.none&&(this.localGlyphMode===Lc.all?!!this.localFontFamily:!!this.localFontFamily&&(R["CJK Unified Ideographs"](e)||R["Hangul Syllables"](e)||R.Hiragana(e)||R.Katakana(e)||R["CJK Symbols and Punctuation"](e)))}_tinySDF(e,i,a){const u=this.localFontFamily;if(!u||!this._doesCharSupportLocalGlyph(a))return;let p=e.tinySDF;if(!p){let de="400";/bold/i.test(i)?de="900":/medium/i.test(i)?de="500":/light/i.test(i)&&(de="200"),p=e.tinySDF=new id.TinySDF({fontFamily:u,fontWeight:de,fontSize:24*As,buffer:3*As,radius:8*As}),p.fontWeight=de}if(this.localGlyphs[p.fontWeight][a])return this.localGlyphs[p.fontWeight][a];const _=String.fromCharCode(a),{data:w,width:I,height:S,glyphWidth:B,glyphHeight:j,glyphLeft:H,glyphTop:X,glyphAdvance:te}=p.draw(_);return this.localGlyphs[p.fontWeight][a]={id:a,bitmap:new hl({width:I,height:S},w),metrics:{width:B/As,height:j/As,left:H/As,top:X/As-27,advance:te/As,localGlyph:!0}}}}id.loadGlyphRange=function(n,e,i,a,u){const p=256*e,_=p+255,w=a.transformRequest(a.normalizeGlyphsURL(i).replace("{fontstack}",n).replace("{range}",`${p}-${_}`),Cn.Glyphs);_n(w,(I,S)=>{if(I)u(I);else if(S){const B={},j=new Wd(S).readFields(og,{});for(const H of j.glyphs)B[H.id]=H;u(null,{glyphs:B,ascender:j.ascender,descender:j.descender})}})},id.TinySDF=class{constructor({fontSize:n=24,buffer:e=3,radius:i=8,cutoff:a=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:_="normal"}={}){this.buffer=e,this.cutoff=a,this.radius=i;const w=this.size=n+4*e,I=this._createCanvas(w),S=this.ctx=I.getContext("2d",{willReadFrequently:!0});S.font=`${_} ${p} ${n}px ${u}`,S.textBaseline="alphabetic",S.textAlign="left",S.fillStyle="black",this.gridOuter=new Float64Array(w*w),this.gridInner=new Float64Array(w*w),this.f=new Float64Array(w),this.z=new Float64Array(w+1),this.v=new Uint16Array(w)}_createCanvas(n){const e=document.createElement("canvas");return e.width=e.height=n,e}draw(n){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:a,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(n),_=Math.ceil(i),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-u))),I=Math.min(this.size-this.buffer,_+Math.ceil(a)),S=w+2*this.buffer,B=I+2*this.buffer,j=Math.max(S*B,0),H=new Uint8ClampedArray(j),X={data:H,width:S,height:B,glyphWidth:w,glyphHeight:I,glyphTop:_,glyphLeft:0,glyphAdvance:e};if(0===w||0===I)return X;const{ctx:te,buffer:de,gridInner:ke,gridOuter:tt}=this;te.clearRect(de,de,w,I),te.fillText(n,de,de+_);const mt=te.getImageData(de,de,w,I);tt.fill(Jd,0,j),ke.fill(0,0,j);for(let Qe=0;Qe0?tn*tn:0,ke[bt]=tn<0?tn*tn:0}}wp(tt,0,0,S,B,S,this.f,this.v,this.z),wp(ke,de,de,w,I,S,this.f,this.v,this.z);for(let Qe=0;Qefn+Pn[1]-Pn[0],te=j.reduce(X,0),de=H.reduce(X,0),ke=w-te,tt=I-de;let mt=0,Qe=te,ut=0,xt=de,bt=0,tn=ke,nn=0,Tn=tt;if(p.content&&a){const fn=p.content;mt=od(j,0,fn[0]),ut=od(H,0,fn[1]),Qe=od(j,fn[0],fn[2]),xt=od(H,fn[1],fn[3]),bt=fn[0]-mt,nn=fn[1]-ut,tn=fn[2]-fn[0]-Qe,Tn=fn[3]-fn[1]-xt}const Un=(fn,Pn,On,Bn)=>{const Hn=Kd(fn.stretch-mt,Qe,S,n.left),wn=Ep(fn.fixed-bt,tn,fn.stretch,te),si=Kd(Pn.stretch-ut,xt,B,n.top),fi=Ep(Pn.fixed-nn,Tn,Pn.stretch,de),ci=Kd(On.stretch-mt,Qe,S,n.left),Yi=Ep(On.fixed-bt,tn,On.stretch,te),Qn=Kd(Bn.stretch-ut,xt,B,n.top),Mi=Ep(Bn.fixed-nn,Tn,Bn.stretch,de),Ji=new ue(Hn,si),Ir=new ue(ci,si),Ki=new ue(ci,Qn),Ri=new ue(Hn,Qn),Xr=new ue(wn/_,fi/_),Qi=new ue(Yi/_,Mi/_),nr=e*Math.PI/180;if(nr){const ro=Math.sin(nr),oo=Math.cos(nr),wo=[oo,-ro,ro,oo];Ji._matMult(wo),Ir._matMult(wo),Ri._matMult(wo),Ki._matMult(wo)}const no=fn.stretch+fn.fixed,io=Pn.stretch+Pn.fixed;return{tl:Ji,tr:Ir,bl:Ri,br:Ki,tex:{x:p.paddedRect.x+rd+no,y:p.paddedRect.y+rd+io,w:On.stretch+On.fixed-no,h:Bn.stretch+Bn.fixed-io},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Xr,pixelOffsetBR:Qi,minFontScaleX:tn/_/S,minFontScaleY:Tn/_/B,isSDF:i}};if(a&&(p.stretchX||p.stretchY)){const fn=sd(j,ke,te),Pn=sd(H,tt,de);for(let On=0;On0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:a}=this,u=i[e];for(;e>0;){const p=e-1>>1,_=i[p];if(a(u,_)>=0)break;i[e]=_,e=p}i[e]=u}_down(e){const{data:i,compare:a}=this,u=this.length>>1,p=i[e];for(;e=0)break;i[e]=w,e=_}i[e]=p}}function lf(n,e){return ne?1:0}function mg(n,e=1,i=!1){let a=1/0,u=1/0,p=-1/0,_=-1/0;const w=n[0];for(let X=0;Xp)&&(p=te.x),(!X||te.y>_)&&(_=te.y)}const I=Math.min(p-a,_-u);let S=I/2;const B=new ad([],gg);if(0===I)return new ue(a,u);for(let X=a;Xj.d||!j.d)&&(j=X,i&&console.log("found best %d after %d probes",Math.round(1e4*X.d)/1e4,H)),X.max-j.d<=e||(S=X.h/2,B.push(new ld(X.p.x-S,X.p.y-S,S,n)),B.push(new ld(X.p.x+S,X.p.y-S,S,n)),B.push(new ld(X.p.x-S,X.p.y+S,S,n)),B.push(new ld(X.p.x+S,X.p.y+S,S,n)),H+=4)}return i&&(console.log(`num probes: ${H}`),console.log(`best distance: ${j.d}`)),j.p}function gg(n,e){return e.max-n.max}class ld{constructor(e,i,a,u){this.p=new ue(e,i),this.h=a,this.d=function(p,_){let w=!1,I=1/0;for(let S=0;S<_.length;S++){const B=_[S];for(let j=0,H=B.length,X=H-1;jp.y!=de.y>p.y&&p.x<(de.x-te.x)*(p.y-te.y)/(de.y-te.y)+te.x&&(w=!w),I=Math.min(I,Kf(p,te,de))}}return(w?1:-1)*Math.sqrt(I)}(this.p,u),this.max=this.d+this.h*Math.SQRT2}}const cd=7,Dp=Number.POSITIVE_INFINITY,ty=Math.sqrt(2);function Ip(n,[e,i]){let a=0,u=0;if(i===Dp){e<0&&(e=0);const p=e/ty;switch(n){case"top-right":case"top-left":u=p-cd;break;case"bottom-right":case"bottom-left":u=-p+cd;break;case"bottom":u=-e+cd;break;case"top":u=e-cd}switch(n){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=e;break;case"right":a=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),n){case"top-right":case"top-left":case"top":u=i-cd;break;case"bottom-right":case"bottom-left":case"bottom":u=-i+cd}switch(n){case"top-right":case"bottom-right":case"right":a=-e;break;case"top-left":case"bottom-left":case"left":a=e}}return[a,u]}function Bv(n,e,i,a,u,p,_,w,I,S){n.createArrays(),n.tilePixelRatio=Ii/(512*n.overscaling),n.compareText={},n.iconsNeedLinear=!1;const B=n.layers[0].layout,j=n.layers[0]._unevaluatedLayout._values,H={};if("composite"===n.textSizeData.kind){const{minZoom:de,maxZoom:ke}=n.textSizeData;H.compositeTextSizes=[j["text-size"].possiblyEvaluate(new Z(de),w),j["text-size"].possiblyEvaluate(new Z(ke),w)]}if("composite"===n.iconSizeData.kind){const{minZoom:de,maxZoom:ke}=n.iconSizeData;H.compositeIconSizes=[j["icon-size"].possiblyEvaluate(new Z(de),w),j["icon-size"].possiblyEvaluate(new Z(ke),w)]}H.layoutTextSize=j["text-size"].possiblyEvaluate(new Z(I+1),w),H.layoutIconSize=j["icon-size"].possiblyEvaluate(new Z(I+1),w),H.textMaxSize=j["text-size"].possiblyEvaluate(new Z(18),w);const X="map"===B.get("text-rotation-alignment")&&"point"!==B.get("symbol-placement"),te=B.get("text-size");for(const de of n.features){const ke=B.get("text-font").evaluate(de,{},w).join(","),tt=te.evaluate(de,{},w),mt=H.layoutTextSize.evaluate(de,{},w),Qe=(H.layoutIconSize.evaluate(de,{},w),{horizontal:{},vertical:void 0}),ut=de.text;let xt,bt=[0,0];if(ut){const Tn=ut.toString(),Un=B.get("text-letter-spacing").evaluate(de,{},w)*Ms,fn=B.get("text-line-height").evaluate(de,{},w)*Ms,Pn=$(Tn)?Un:0,On=B.get("text-anchor").evaluate(de,{},w),Bn=B.get("text-variable-anchor");if(!Bn){const ci=B.get("text-radial-offset").evaluate(de,{},w);bt=ci?Ip(On,[ci*Ms,Dp]):B.get("text-offset").evaluate(de,{},w).map(Yi=>Yi*Ms)}let Hn=X?"center":B.get("text-justify").evaluate(de,{},w);const wn="point"===B.get("symbol-placement"),si=wn?B.get("text-max-width").evaluate(de,{},w)*Ms:1/0,fi=ci=>{n.allowVerticalPlacement&&U(Tn)&&(Qe.vertical=nf(ut,e,i,u,ke,si,fn,On,ci,Pn,bt,va.vertical,!0,mt,tt))};if(!X&&Bn){const ci="auto"===Hn?Bn.map(Qn=>Mp(Qn)):[Hn];let Yi=!1;for(let Qn=0;Qn=0||!U(Tn)){const ci=nf(ut,e,i,u,ke,si,fn,On,Hn,Pn,bt,va.horizontal,!1,mt,tt);ci&&(Qe.horizontal[Hn]=ci)}fi(wn?"left":Hn)}}let tn=!1;if(de.icon&&de.icon.name){const Tn=a[de.icon.name];Tn&&(xt=hg(u[de.icon.name],B.get("icon-offset").evaluate(de,{},w),B.get("icon-anchor").evaluate(de,{},w)),tn=Tn.sdf,void 0===n.sdfIcons?n.sdfIcons=Tn.sdf:n.sdfIcons!==Tn.sdf&&dt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Tn.pixelRatio!==n.pixelRatio||0!==B.get("icon-rotate").constantOr(1))&&(n.iconsNeedLinear=!0))}const nn=ny(Qe.horizontal)||Qe.vertical;n.iconsInText||(n.iconsInText=!!nn&&nn.iconsInText),(nn||xt)&&Nv(n,de,Qe,xt,a,H,mt,0,bt,tn,_,w,S)}p&&n.generateCollisionDebugBuffers(I,n.collisionBoxArray)}function Mp(n){switch(n){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nv(n,e,i,a,u,p,_,w,I,S,B,j,H){let X=p.textMaxSize.evaluate(e,{},j);void 0===X&&(X=_);const te=n.layers[0].layout,de=te.get("icon-offset").evaluate(e,{},j),ke=ny(i.horizontal)||i.vertical,tt="globe"===H.name,mt=Ms,Qe=_/mt,ut=n.tilePixelRatio*X/mt,xt=(On=n.overscaling,n.zoom>18&&On>2&&(On>>=1),Math.max(Ii/(512*On),1)*te.get("symbol-spacing")),bt=te.get("text-padding")*n.tilePixelRatio,tn=te.get("icon-padding")*n.tilePixelRatio,nn=Le(te.get("text-max-angle")),Tn="map"===te.get("text-rotation-alignment")&&"point"!==te.get("symbol-placement"),Un="map"===te.get("icon-rotation-alignment")&&"point"!==te.get("symbol-placement"),fn=te.get("symbol-placement"),Pn=xt/2;var On;const Bn=te.get("icon-text-fit");let Hn;a&&"none"!==Bn&&(n.allowVerticalPlacement&&i.vertical&&(Hn=fg(a,i.vertical,Bn,te.get("icon-text-fit-padding"),de,Qe)),ke&&(a=fg(a,ke,Bn,te.get("icon-text-fit-padding"),de,Qe)));const wn=(si,fi,ci)=>{if(fi.x<0||fi.x>=Ii||fi.y<0||fi.y>=Ii)return;let Yi=null;if(tt){const{x:Qn,y:Mi,z:Ji}=H.projectTilePoint(fi.x,fi.y,ci);Yi={anchor:new tc(Qn,Mi,Ji,0,void 0),up:H.upVector(ci,fi.x,fi.y)}}!function(Qn,Mi,Ji,Ir,Ki,Ri,Xr,Qi,nr,no,io,ro,oo,wo,jo,Ko,Qr,is,Lo,lo,Mr,So,eo,vs,Vo){const Ss=Qn.addToLineVertexArray(Mi,Ir);let $o,na,xs,gl,gd,Cu,Zc,uh=0,yy=0,Zg=0,jg=0,dh=-1,Wp=-1;const _l={};let Vg=bc("");const Eu=Ji?Ji.anchor:Mi;let yf=0,vf=0;if(void 0===nr._unevaluatedLayout.getValue("text-radial-offset")?[yf,vf]=nr.layout.get("text-offset").evaluate(Mr,{},Vo).map(xa=>xa*Ms):(yf=nr.layout.get("text-radial-offset").evaluate(Mr,{},Vo)*Ms,vf=Dp),Qn.allowVerticalPlacement&&Ki.vertical){const xa=Ki.vertical;if(jo)Cu=ud(xa),Qi&&(Zc=ud(Qi));else{const ua=nr.layout.get("text-rotate").evaluate(Mr,{},Vo)+90;xs=Xd(no,Eu,Mi,io,ro,oo,xa,wo,ua,Ko),Qi&&(gl=Xd(no,Eu,Mi,io,ro,oo,Qi,is,ua))}}if(Ri){const xa=nr.layout.get("icon-rotate").evaluate(Mr,{},Vo),ua="none"!==nr.layout.get("icon-text-fit"),Tu=Cp(Ri,xa,eo,ua),hh=Qi?Cp(Qi,xa,eo,ua):void 0;na=Xd(no,Eu,Mi,io,ro,oo,Ri,is,xa),uh=4*Tu.length;const $g=Qn.iconSizeData;let jl=null;"source"===$g.kind?(jl=[La*nr.layout.get("icon-size").evaluate(Mr,{},Vo)],jl[0]>nc&&dt(`${Qn.layerIds[0]}: Value for "icon-size" is >= ${cf}. Reduce your "icon-size".`)):"composite"===$g.kind&&(jl=[La*So.compositeIconSizes[0].evaluate(Mr,{},Vo),La*So.compositeIconSizes[1].evaluate(Mr,{},Vo)],(jl[0]>nc||jl[1]>nc)&&dt(`${Qn.layerIds[0]}: Value for "icon-size" is >= ${cf}. Reduce your "icon-size".`)),Qn.addSymbols(Qn.icon,Tu,jl,lo,Lo,Mr,!1,Ji,Mi,Ss.lineStartIndex,Ss.lineLength,-1,vs,Vo),dh=Qn.icon.placedSymbolArray.length-1,hh&&(yy=4*hh.length,Qn.addSymbols(Qn.icon,hh,jl,lo,Lo,Mr,va.vertical,Ji,Mi,Ss.lineStartIndex,Ss.lineLength,-1,vs,Vo),Wp=Qn.icon.placedSymbolArray.length-1)}for(const xa in Ki.horizontal){const ua=Ki.horizontal[xa];$o||(Vg=bc(ua.text),jo?gd=ud(ua):$o=Xd(no,Eu,Mi,io,ro,oo,ua,wo,nr.layout.get("text-rotate").evaluate(Mr,{},Vo),Ko));const Tu=1===ua.positionedLines.length;if(Zg+=Ap(Qn,Ji,Mi,ua,Xr,nr,jo,Mr,Ko,Ss,Ki.vertical?va.horizontal:va.horizontalOnly,Tu?Object.keys(Ki.horizontal):[xa],_l,dh,So,vs,Vo),Tu)break}Ki.vertical&&(jg+=Ap(Qn,Ji,Mi,Ki.vertical,Xr,nr,jo,Mr,Ko,Ss,va.vertical,["vertical"],_l,Wp,So,vs,Vo));let sc=-1;const qp=(xa,ua)=>xa?Math.max(xa,ua):ua;sc=qp(gd,sc),sc=qp(Cu,sc),sc=qp(Zc,sc);const vy=sc>-1?1:0;Qn.glyphOffsetArray.length>=Bc.MAX_GLYPHS&&dt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Mr.sortKey&&Qn.addToSortKeyRanges(Qn.symbolInstances.length,Mr.sortKey),Qn.symbolInstances.emplaceBack(Eu.x,Eu.y,Eu.z,Mi.x,Mi.y,_l.right>=0?_l.right:-1,_l.center>=0?_l.center:-1,_l.left>=0?_l.left:-1,_l.vertical>=0?_l.vertical:-1,dh,Wp,Vg,void 0!==$o?$o:Qn.collisionBoxArray.length,void 0!==$o?$o+1:Qn.collisionBoxArray.length,void 0!==xs?xs:Qn.collisionBoxArray.length,void 0!==xs?xs+1:Qn.collisionBoxArray.length,void 0!==na?na:Qn.collisionBoxArray.length,void 0!==na?na+1:Qn.collisionBoxArray.length,gl||Qn.collisionBoxArray.length,gl?gl+1:Qn.collisionBoxArray.length,io,Zg,jg,uh,yy,vy,0,yf,vf,sc)}(n,fi,Yi,si,i,a,u,Hn,n.layers[0],n.collisionBoxArray,e.index,e.sourceLayerIndex,n.index,bt,Tn,I,0,tn,Un,de,e,p,S,B,j)};if("line"===fn)for(const si of pg(e.geometry,0,0,Ii,Ii)){const fi=Q_(si,xt,nn,i.vertical||ke,a,mt,ut,n.overscaling,Ii);for(const ci of fi)ke&&_g(n,ke.text,Pn,ci)||wn(si,ci,j)}else if("line-center"===fn){for(const si of e.geometry)if(si.length>1){const fi=bp(si,nn,i.vertical||ke,a,mt,ut);fi&&wn(si,fi,j)}}else if("Polygon"===e.type)for(const si of Bm(e.geometry,0)){const fi=mg(si,16);wn(si[0],new tc(fi.x,fi.y,0,0,void 0),j)}else if("LineString"===e.type)for(const si of e.geometry)wn(si,new tc(si[0].x,si[0].y,0,0,void 0),j);else if("Point"===e.type)for(const si of e.geometry)for(const fi of si)wn([fi],new tc(fi.x,fi.y,0,0,void 0),j)}const cf=255,nc=cf*La;function Ap(n,e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke){const tt=function(ut,xt,bt,tn,nn,Tn,Un,fn){const Pn=[];if(0===xt.positionedLines.length)return Pn;const On=tn.layout.get("text-rotate").evaluate(Tn,{})*Math.PI/180,Bn=function(ci){const Yi=ci[0],Qn=ci[1],Mi=Yi*Qn;return Mi>0?[Yi,-Qn]:Mi<0?[-Yi,Qn]:0===Yi?[Qn,Yi]:[Qn,-Yi]}(bt);let Hn=Math.abs(xt.top-xt.bottom);for(const ci of xt.positionedLines)Hn-=ci.lineOffset;const wn=xt.positionedLines.length,si=Hn/wn;let fi=xt.top-bt[1];for(let ci=0;cinc&&dt(`${n.layerIds[0]}: Value for "text-size" is >= ${cf}. Reduce your "text-size".`)):"composite"===mt.kind&&(Qe=[La*te.compositeTextSizes[0].evaluate(w,{},ke),La*te.compositeTextSizes[1].evaluate(w,{},ke)],(Qe[0]>nc||Qe[1]>nc)&&dt(`${n.layerIds[0]}: Value for "text-size" is >= ${cf}. Reduce your "text-size".`)),n.addSymbols(n.text,tt,Qe,I,_,w,B,e,i,S.lineStartIndex,S.lineLength,X,de,ke);for(const ut of j)H[ut]=n.text.placedSymbolArray.length-1;return 4*tt.length}function ny(n){for(const e in n)return n[e];return null}function Xd(n,e,i,a,u,p,_,w,I,S){let B=_.top,j=_.bottom,H=_.left,X=_.right;const te=_.collisionPadding;if(te&&(H-=te[0],B-=te[1],X+=te[2],j+=te[3]),I){const de=new ue(H,B),ke=new ue(X,B),tt=new ue(H,j),mt=new ue(X,j),Qe=Le(I);let ut=new ue(0,0);S&&(ut=new ue(S[0],S[1])),de._rotateAround(Qe,ut),ke._rotateAround(Qe,ut),tt._rotateAround(Qe,ut),mt._rotateAround(Qe,ut),H=Math.min(de.x,ke.x,tt.x,mt.x),X=Math.max(de.x,ke.x,tt.x,mt.x),B=Math.min(de.y,ke.y,tt.y,mt.y),j=Math.max(de.y,ke.y,tt.y,mt.y)}return n.emplaceBack(e.x,e.y,e.z,i.x,i.y,H,B,X,j,w,a,u,p),n.length-1}function ud(n){n.collisionPadding&&(n.top-=n.collisionPadding[1],n.bottom+=n.collisionPadding[3]);const e=n.bottom-n.top;return e>0?Math.max(10,e):null}function _g(n,e,i,a){const u=n.compareText;if(e in u){const p=u[e];for(let _=p.length-1;_>=0;_--)if(a.dist(p[_])Qe&&(ut(bt,Bn,nn,Tn,Pn,On),ut(Bn,tn,Pn,On,Un,fn))}ut(j,H,a,p,u,p),ut(H,X,u,p,u,_),ut(X,te,u,_,a,_),ut(te,j,a,_,a,p),de-=Qe,ke-=Qe,tt+=Qe,mt+=Qe;const xt=1/Math.max(tt-de,mt-ke);return{scale:xt,x:de*xt,y:ke*xt,x2:tt*xt,y2:mt*xt,projection:e}}const _r=ga(new Float32Array(16));class ic{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new $r(0,0)}projectTilePoint(e,i,a){return{x:e,y:i,z:0}}locationPoint(e,i,a=!0){return e._coordinatePoint(e.locationCoordinate(i),a)}pixelsPerMeter(e,i){return dl(1,e)*i}pixelSpaceConversion(e,i,a){return 1}farthestPixelDistance(e){return Sp(e,e.pixelsPerMeter)}pointCoordinate(e,i,a,u){const p=e.horizonLineFromTop(!1),_=new ue(i,Math.max(p,a));return e.rayIntersectionCoordinate(e.pointRayIntersection(_,u))}pointCoordinate3D(e,i,a){const u=new ue(i,a);if(e.elevation)return e.elevation.pointCoordinate(u);{const p=this.pointCoordinate(e,u.x,u.y,0);return[p.x,p.y,p.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const a=e.horizonLineFromTop();return i.y0?i<-xu+a&&(i=-xu+a):i>xu-a&&(i=xu-a);const _=p/Math.pow(hd(i),u);let w=_*Math.sin(u*e),I=p-_*Math.cos(u*e);return w=.5*(w/Math.PI+.5),I=.5*(I/Math.PI+.5),{x:w,y:this.southernCenter?I:1-I,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:a,f:u}=this,p=u-i,_=Math.sign(p),w=Math.sign(a)*Math.sqrt(e*e+p*p);let I=Math.atan2(e,Math.abs(p))*_;p*a<0&&(I-=Math.PI*Math.sign(e)*_);const S=Ye(ye(I/a)+this.center[0],-180,180),B=Ye(ye(2*Math.atan(Math.pow(u/w,1/a))-xu),-Is,Is);return new $r(S,this.southernCenter?-B:B)}}class uf extends ic{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:Ll(e),y:kl(i),z:0}}unproject(e,i){const a=Oa(e),u=Fs(i);return new $r(a,u)}}const Rp=Le(Is);class Lp extends ic{project(e,i){const a=(i=Le(i))*i,u=a*a;return{x:.5*((e=Le(e))*(.8707-.131979*a+u*(u*(.003971*a-.001529*u)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let a=i=(2*(1-i)-1)*Math.PI,u=25,p=0,_=a*a;do{_=a*a;const S=_*_;p=(a*(1.007226+_*(.015085+S*(.028874*_-.044475-.005916*S)))-i)/(1.007226+_*(.045255+S*(.259866*_-.311325-.005916*11*S))),a=Ye(a-p,-Rp,Rp)}while(Math.abs(p)>1e-6&&--u>0);_=a*a;const w=Ye(ye(e/(.8707+_*(_*(_*_*_*(.003971-.001529*_)-.013791)-.131979))),-180,180),I=ye(a);return new $r(w,I)}}const vg=Le(Is);class iy extends ic{project(e,i){i=Le(i),e=Le(e);const a=Math.cos(i),u=2/Math.PI,p=Math.acos(a*Math.cos(e/2)),_=Math.sin(p)/p,w=.5*(e*u+2*a*Math.sin(e/2)/_)||0,I=.5*(i+Math.sin(i)/_)||0;return{x:.5*(w/Math.PI+.5),y:1-.5*(I/Math.PI+1),z:0}}unproject(e,i){let a=e=(2*e-.5)*Math.PI,u=i=(2*(1-i)-1)*Math.PI,p=25;const _=1e-6;let w=0,I=0;do{const S=Math.cos(u),B=Math.sin(u),j=2*B*S,H=B*B,X=S*S,te=Math.cos(a/2),de=Math.sin(a/2),ke=2*te*de,tt=de*de,mt=1-X*te*te,Qe=mt?1/mt:0,ut=mt?Math.acos(S*te)*Math.sqrt(1/mt):0,xt=.5*(2*ut*S*de+2*a/Math.PI)-e,bt=.5*(ut*B+u)-i,tn=.5*Qe*(X*tt+ut*S*te*H)+1/Math.PI,nn=Qe*(ke*j/4-ut*B*de),Tn=.125*Qe*(j*de-ut*B*X*ke),Un=.5*Qe*(H*te+ut*tt*S)+.5,fn=nn*Tn-Un*tn;w=(bt*nn-xt*Un)/fn,I=(xt*Tn-bt*tn)/fn,a=Ye(a-w,-Math.PI,Math.PI),u=Ye(u-I,-vg,vg)}while((Math.abs(w)>_||Math.abs(I)>_)&&--p>0);return new $r(ye(a),ye(u))}}class xg extends ic{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Le(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:a,cosPhi:u}=this;return{x:Le(e)*u*a+.5,y:-Math.sin(Le(i))/u*a+.5,z:0}}unproject(e,i){const{scale:a,cosPhi:u}=this,p=-(i-.5)/a,_=Ye(ye((e-.5)/a)/u,-180,180),w=Math.asin(Ye(p*u,-1,1)),I=Ye(ye(w),-Is,Is);return new $r(_,I)}}class bg extends uf{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,a){const u=Vu(e,i,a);return Yo(u,u,su(Ro(a))),{x:u[0],y:u[1],z:u[2]}}locationPoint(e,i){const a=ju(i.lat,i.lng),u=ea([],a),p=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;Ph(a,a,u,dl(1,0)*Ii*p);const _=ga(new Float64Array(16));return eu(_,e.pixelMatrix,e.globeMatrix),Yo(a,a,_),new ue(a[0],a[1])}pixelsPerMeter(e,i){return dl(1,0)*i}pixelSpaceConversion(e,i,a){const u=dl(1,e)*i,p=ki(dl(1,45)*i,u,a);return this.pixelsPerMeter(e,i)/p}createTileMatrix(e,i,a){const u=Ld(Ro(a.canonical));return eu(new Float64Array(16),e.globeMatrix,u)}createInversionMatrix(e,i){const{center:a}=e,u=su(Ro(i));return Mh(u,u,Le(a.lng)),tu(u,u,Le(a.lat)),Va(u,u,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(u)}pointCoordinate(e,i,a,u){return Oh(e,i,a,!0)||new Tc(0,0)}pointCoordinate3D(e,i,a){const u=this.pointCoordinate(e,i,a,0);return[u.x,u.y,u.z]}isPointAboveHorizon(e,i){return!Oh(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(u,p){const _=u.cameraToCenterDistance,w=u._centerAltitude*p,I=u._camera,S=u._camera.forward(),B=$a([],_a([],S,-_),[0,0,w]),j=u.worldSize/(2*Math.PI),H=[0,0,-j],X=u.width/u.height,te=Math.tan(u.fovAboveCenter),de=_a([],I.up(),te),ke=_a([],I.right(),te*X),tt=ea([],$a([],$a([],S,de),ke)),mt=[];let Qe;if(new Uu(B,tt).closestPointOnSphere(H,j,mt)){const ut=$a([],mt,H),xt=Pl([],ut,B);Qe=Math.cos(u.fovAboveCenter)*Id(xt)}else{const ut=Pl([],B,H),xt=Pl([],H,B);ea(xt,xt);const bt=Id(ut)-j;Qe=Math.sqrt(bt*(bt+2*j));const tn=Math.acos(Qe/(j+bt))-Math.acos(Ga(S,xt));Qe*=Math.cos(tn)}return 1.01*Qe}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),a=Ol(e.zoom);if(a>0){const u=Sp(e,dl(1,e.center.lat)*e.worldSize),p=e.worldSize/(2*Math.PI),_=Math.max(e.width,e.height)/e.worldSize*Math.PI;return ki(i,u+p*(1-Math.cos(_)),Math.pow(a,10))}return i}upVector(e,i,a){return Vu(i,a,e,1)}upVectorScale(e){return{metersToTile:Vs(Rh(Ro(e)))}}}function wg(n){const e=n.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(n.name){case"mercator":return new uf(n);case"equirectangular":return new eh(n);case"naturalEarth":return new Lp(n);case"equalEarth":return new Pp(n);case"winkelTripel":return new iy(n);case"albers":return i?new xg(n):new yg(n);case"lambertConformalConic":return i?new xg(n):new Op(n);case"globe":return new bg(n)}throw new Error(`Invalid projection name: ${n.name}`)}const ry=Gr.types,oy=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function df(n,e,i,a,u,p,_,w,I,S,B,j,H){const X=w?Math.min(nc,Math.round(w[0])):0,te=w?Math.min(nc,Math.round(w[1])):0;n.emplaceBack(e,i,Math.round(32*a),Math.round(32*u),p,_,(X<<1)+(I?1:0),te,16*S,16*B,256*j,256*H)}function th(n,e,i,a,u,p,_){n.emplaceBack(e,i,a,u,p,_)}function nh(n,e,i,a,u){n.emplaceBack(e,i,a,u),n.emplaceBack(e,i,a,u),n.emplaceBack(e,i,a,u),n.emplaceBack(e,i,a,u)}function sy(n){for(const e of n.sections)if($n(e.text))return!0;return!1}class kp{constructor(e){this.layoutVertexArray=new Ln,this.indexArray=new xi,this.programConfigurations=e,this.segments=new qo,this.dynamicLayoutVertexArray=new Zn,this.opacityVertexArray=new Di,this.placedSymbolArray=new Zo,this.globeExtVertexArray=new Wn}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,i,a,u){this.isEmpty()||(a&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ov.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,j_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,oy,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Rv.members,!0)),this.opacityVertexBuffer.itemSize=1),(a||u)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}ui(kp,"SymbolBuffers");class ca{constructor(e,i,a){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new a,this.segments=new qo,this.collisionVertexArray=new ur,this.collisionVertexArrayExt=new dr}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,V_.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Lv.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}ui(ca,"CollisionBuffers");class Bc{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(_=>_.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ga([]),this.placementViewportMatrix=ga([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Vd(this.zoom,i["text-size"]),this.iconSizeData=Vd(this.zoom,i["icon-size"]);const a=this.layers[0].layout,u=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=a.get("text-allow-overlap")||a.get("icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==p&&void 0!==u.constantOr(1),this.sortFeaturesByY=("viewport-y"===p||"auto"===p&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=a.get("text-writing-mode").map(_=>va[_]),this.stateDependentLayerIds=this.layers.filter(_=>_.isStateDependent()).map(_=>_.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new kp(new Fu(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new kp(new Fu(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ls,this.lineVertexArray=new ll,this.symbolInstances=new Vr}calculateGlyphDependencies(e,i,a,u,p){for(let _=0;_0)&&("constant"!==I.value.kind||I.value.value.length>0),H="constant"!==B.value.kind||!!B.value.value||Object.keys(B.parameters).length>0,X=_.get("symbol-sort-key");if(this.features=[],!j&&!H)return;const te=i.iconDependencies,de=i.glyphDependencies,ke=i.availableImages,tt=new Z(this.zoom);for(const{feature:mt,id:Qe,index:ut,sourceLayerIndex:xt}of e){const bt=p._featureFilter.needGeometry,tn=au(mt,bt);if(!p._featureFilter.filter(tt,tn,a))continue;if(bt||(tn.geometry=Fl(mt,a,u)),w&&1!==mt.type&&a.z<=5){const fn=tn.geometry,Pn=.98078528056,On=(Bn,Hn)=>Ga(Vu(Bn.x,Bn.y,a,1),Vu(Hn.x,Hn.y,a,1))=0;for(const On of nn.sections)if(On.image)te[On.image.name]=!0;else{const Bn=U(nn.toString()),Hn=On.fontStack||fn,wn=de[Hn]=de[Hn]||{};this.calculateGlyphDependencies(On.text,wn,Pn,this.allowVerticalPlacement,Bn)}}}"line"===_.get("symbol-placement")&&(this.features=function(mt){const Qe={},ut={},xt=[];let bt=0;function tn(fn){xt.push(mt[fn]),bt++}function nn(fn,Pn,On){const Bn=ut[fn];return delete ut[fn],ut[Pn]=Bn,xt[Bn].geometry[0].pop(),xt[Bn].geometry[0]=xt[Bn].geometry[0].concat(On[0]),Bn}function Tn(fn,Pn,On){const Bn=Qe[Pn];return delete Qe[Pn],Qe[fn]=Bn,xt[Bn].geometry[0].shift(),xt[Bn].geometry[0]=On[0].concat(xt[Bn].geometry[0]),Bn}function Un(fn,Pn,On){const Bn=On?Pn[0][Pn[0].length-1]:Pn[0][0];return`${fn}:${Bn.x}:${Bn.y}`}for(let fn=0;fnfn.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((mt,Qe)=>mt.sortKey-Qe.sortKey)}update(e,i,a,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,a,u),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,a,u))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=wg(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const a=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:u,y:p}of i)this.lineVertexArray.emplaceBack(u,p);return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(e,i,a,u,p,_,w,I,S,B,j,H,X,te){const de=e.indexArray,ke=e.layoutVertexArray,tt=e.globeExtVertexArray,mt=e.segments.prepareSegment(4*i.length,ke,de,this.canOverlap?_.sortKey:void 0),Qe=this.glyphOffsetArray.length,ut=mt.vertexLength,xt=this.allowVerticalPlacement&&w===va.vertical?Math.PI/2:0,bt=_.text&&_.text.sections;for(let nn=0;nn=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:u),_=Xl(this.textSizeData,e,p)/Ms;return this.tilePixelRatio*_}getSymbolInstanceIconSize(e,i,a){const u=this.icon.placedSymbolArray.get(a),p=Xl(this.iconSizeData,e,u);return this.tilePixelRatio*p}_commitDebugCollisionVertexUpdate(e,i,a){e.emplaceBack(i,-a,-a),e.emplaceBack(i,a,-a),e.emplaceBack(i,a,a),e.emplaceBack(i,-a,a)}_updateTextDebugCollisionBoxes(e,i,a,u,p,_){for(let w=u;w0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){const a=e.placedSymbolArray.get(i),u=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;pu[w]-u[I]||p[I]-p[w]),_}addToSortKeyRanges(e,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex);const{rightJustifiedTextSymbolIndex:u,centerJustifiedTextSymbolIndex:p,leftJustifiedTextSymbolIndex:_,verticalPlacedTextSymbolIndex:w,placedIconSymbolIndex:I,verticalPlacedIconSymbolIndex:S}=a;u>=0&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&p!==u&&this.addIndicesForPlacedSymbol(this.text,p),_>=0&&_!==p&&_!==u&&this.addIndicesForPlacedSymbol(this.text,_),w>=0&&this.addIndicesForPlacedSymbol(this.text,w),I>=0&&this.addIndicesForPlacedSymbol(this.icon,I),S>=0&&this.addIndicesForPlacedSymbol(this.icon,S)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ui(Bc,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Bc.MAX_GLYPHS=65535,Bc.addDynamicAttributes=nh;const ay=new ot({"symbol-placement":new ce(Kt.layout_symbol["symbol-placement"]),"symbol-spacing":new ce(Kt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ce(Kt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ve(Kt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ce(Kt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ce(Kt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ce(Kt.layout_symbol["icon-ignore-placement"]),"icon-optional":new ce(Kt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ce(Kt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ve(Kt.layout_symbol["icon-size"]),"icon-text-fit":new ce(Kt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ce(Kt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ve(Kt.layout_symbol["icon-image"]),"icon-rotate":new Ve(Kt.layout_symbol["icon-rotate"]),"icon-padding":new ce(Kt.layout_symbol["icon-padding"]),"icon-keep-upright":new ce(Kt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ve(Kt.layout_symbol["icon-offset"]),"icon-anchor":new Ve(Kt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ce(Kt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ce(Kt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ce(Kt.layout_symbol["text-rotation-alignment"]),"text-field":new Ve(Kt.layout_symbol["text-field"]),"text-font":new Ve(Kt.layout_symbol["text-font"]),"text-size":new Ve(Kt.layout_symbol["text-size"]),"text-max-width":new Ve(Kt.layout_symbol["text-max-width"]),"text-line-height":new Ve(Kt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ve(Kt.layout_symbol["text-letter-spacing"]),"text-justify":new Ve(Kt.layout_symbol["text-justify"]),"text-radial-offset":new Ve(Kt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ce(Kt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ve(Kt.layout_symbol["text-anchor"]),"text-max-angle":new ce(Kt.layout_symbol["text-max-angle"]),"text-writing-mode":new ce(Kt.layout_symbol["text-writing-mode"]),"text-rotate":new Ve(Kt.layout_symbol["text-rotate"]),"text-padding":new ce(Kt.layout_symbol["text-padding"]),"text-keep-upright":new ce(Kt.layout_symbol["text-keep-upright"]),"text-transform":new Ve(Kt.layout_symbol["text-transform"]),"text-offset":new Ve(Kt.layout_symbol["text-offset"]),"text-allow-overlap":new ce(Kt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ce(Kt.layout_symbol["text-ignore-placement"]),"text-optional":new ce(Kt.layout_symbol["text-optional"])});var Cg={paint:new ot({"icon-opacity":new Ve(Kt.paint_symbol["icon-opacity"]),"icon-color":new Ve(Kt.paint_symbol["icon-color"]),"icon-halo-color":new Ve(Kt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ve(Kt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ve(Kt.paint_symbol["icon-halo-blur"]),"icon-translate":new ce(Kt.paint_symbol["icon-translate"]),"icon-translate-anchor":new ce(Kt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ve(Kt.paint_symbol["text-opacity"]),"text-color":new Ve(Kt.paint_symbol["text-color"],{runtimeType:we,getOverride:n=>n.textColor,hasOverride:n=>!!n.textColor}),"text-halo-color":new Ve(Kt.paint_symbol["text-halo-color"]),"text-halo-width":new Ve(Kt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ve(Kt.paint_symbol["text-halo-blur"]),"text-translate":new ce(Kt.paint_symbol["text-translate"]),"text-translate-anchor":new ce(Kt.paint_symbol["text-translate-anchor"])}),layout:ay};class hf{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:to,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ui(hf,"FormatSectionOverride",{omit:["defaultValue"]});class ih extends cl{constructor(e){super(e,Cg)}recalculate(e,i){super.recalculate(e,i),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const a=this.layout.get("text-writing-mode");if(a){const u=[];for(const p of a)u.indexOf(p)<0&&u.push(p);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,a,u){const p=this.layout.get(e).evaluate(i,{},a,u),_=this._unevaluatedLayout._values[e];return _.isDataDriven()||ps(_.value)||!p?p:(w=i.properties,p.replace(/{([^{}]+)}/g,(S,B)=>B in w?String(w[B]):""));var w}createBucket(e){return new Bc(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Cg.paint.overridableProperties){if(!ih.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),a=new hf(i),u=new ao(a,i.property.specification);let p=null;p="constant"===i.value.kind||"source"===i.value.kind?new No("source",u):new fo("composite",u,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new qe(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&ih.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const a=e.get("text-field"),u=Cg.paint.properties[i];let p=!1;const _=w=>{for(const I of w)if(u.overrides&&u.overrides.hasOverride(I))return void(p=!0)};if("constant"===a.value.kind&&a.value.value instanceof xo)_(a.value.value.sections);else if("source"===a.value.kind){const w=S=>{p||(S instanceof Po&&Er(S.value)===an?_(S.value.sections):S instanceof li?_(S.sections):S.eachChild(w))},I=a.value;I._styleExpression&&w(I._styleExpression.expression)}return p}getProgramConfiguration(e){return new Sa(this,e)}}var ly={paint:new ot({"background-color":new ce(Kt.paint_background["background-color"]),"background-pattern":new ce(Kt.paint_background["background-pattern"]),"background-opacity":new ce(Kt.paint_background["background-opacity"])})},cy={paint:new ot({"raster-opacity":new ce(Kt.paint_raster["raster-opacity"]),"raster-hue-rotate":new ce(Kt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ce(Kt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ce(Kt.paint_raster["raster-brightness-max"]),"raster-saturation":new ce(Kt.paint_raster["raster-saturation"]),"raster-contrast":new ce(Kt.paint_raster["raster-contrast"]),"raster-resampling":new ce(Kt.paint_raster["raster-resampling"]),"raster-fade-duration":new ce(Kt.paint_raster["raster-fade-duration"])})};class uy extends cl{constructor(e){super(e,{}),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isLayerDraped(){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var Eg={paint:new ot({"sky-type":new ce(Kt.paint_sky["sky-type"]),"sky-atmosphere-sun":new ce(Kt.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new ce(Kt.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new ce(Kt.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new ce(Kt.paint_sky["sky-gradient-radius"]),"sky-gradient":new rt(Kt.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new ce(Kt.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new ce(Kt.paint_sky["sky-atmosphere-color"]),"sky-opacity":new ce(Kt.paint_sky["sky-opacity"])})};function Fp(n,e,i){const a=[0,0,1],u=Sd([]);return Rf(u,u,i?-Le(n)+Math.PI:Le(n)),Of(u,u,-Le(e)),y_(a,a,u),ea(a,a)}const dy={circle:class extends cl{constructor(n){super(n,T_)}createBucket(n){return new Wf(n)}queryRadius(n){const e=n;return Nl("circle-radius",this,e)+Nl("circle-stroke-width",this,e)+Nh(this.paint.get("circle-translate"))}queryIntersectsFeature(n,e,i,a,u,p,_,w){const I=Tm(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,n.pixelToTileUnitsFactor),S=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return tp(n,a,p,_,w,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),I,S)}getProgramIds(){return["circle"]}getProgramConfiguration(n){return new Sa(this,n)}},heatmap:class extends cl{createBucket(n){return new Im(n)}constructor(n){super(n,Hu),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(n){"heatmap-color"===n&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Wu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(n){return Nl("heatmap-radius",this,n)}queryIntersectsFeature(n,e,i,a,u,p,_,w){const I=this.paint.get("heatmap-radius").evaluate(e,i);return tp(n,a,p,_,w,!0,!0,new ue(0,0),I)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(n){return new Sa(this,n)}},hillshade:class extends cl{constructor(n){super(n,rp)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends cl{constructor(n){super(n,zm)}getProgramIds(){const n=this.paint.get("fill-pattern"),e=n&&n.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(n){return new Sa(this,n)}recalculate(n,e){super.recalculate(n,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(n){return new $h(n)}queryRadius(){return Nh(this.paint.get("fill-translate"))}queryIntersectsFeature(n,e,i,a,u,p){return!n.queryGeometry.isAboveHorizon&&Yf(ep(n.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,n.pixelToTileUnitsFactor),a)}isTileClipped(){return!0}},"fill-extrusion":class extends cl{constructor(n){super(n,B_)}createBucket(n){return new Ku(n)}queryRadius(){return Nh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(n){return new Sa(this,n)}queryIntersectsFeature(n,e,i,a,u,p,_,w,I){const S=Tm(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,n.pixelToTileUnitsFactor),B=this.paint.get("fill-extrusion-height").evaluate(e,i),j=this.paint.get("fill-extrusion-base").evaluate(e,i),H=[0,0],X=w&&p.elevation,te=p.elevation?p.elevation.exaggeration():1,de=n.tile.getBucket(this);if(X&&de instanceof Ku){const ut=de.centroidVertexArray,xt=I+1;xtut.polygon).flat());const ke=X?w:null,[tt,mt]=(xt=a,bt=j,tn=B,nn=S,Tn=_,Un=ke,fn=H,Pn=te,On=p.center.lat,"globe"===(ut=p).projection.name?function(Hn,wn,si,fi,ci,Yi,Qn,Mi,Ji,Ir,Ki){const Ri=[],Xr=[],Qi=Hn.projection.upVectorScale(Ki,Hn.center.lat,Hn.worldSize).metersToTile,nr=[0,0,0,1],no=[0,0,0,1],io=(oo,wo,jo,Ko)=>{oo[0]=wo,oo[1]=jo,oo[2]=Ko,oo[3]=1},ro=up();si>0&&(si+=ro),fi+=ro;for(const oo of wn){const wo=[],jo=[];for(const Ko of oo){const Qr=Ko.x+ci.x,is=Ko.y+ci.y,Lo=Hn.projection.projectTilePoint(Qr,is,Ki),lo=Hn.projection.upVector(Ki,Ko.x,Ko.y);let Mr=si,So=fi;if(Qn){const eo=Jm(Qr,is,si,fi,Qn,Mi,Ji,Ir);Mr+=eo.base,So+=eo.top}0!==si?io(nr,Lo.x+lo[0]*Qi*Mr,Lo.y+lo[1]*Qi*Mr,Lo.z+lo[2]*Qi*Mr):io(nr,Lo.x,Lo.y,Lo.z),io(no,Lo.x+lo[0]*Qi*So,Lo.y+lo[1]*Qi*So,Lo.z+lo[2]*Qi*So),Yo(nr,nr,Yi),Yo(no,no,Yi),wo.push(new la(nr[0],nr[1],nr[2])),jo.push(new la(no[0],no[1],no[2]))}Ri.push(wo),Xr.push(jo)}return[Ri,Xr]}(ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,n.tileID.canonical):Un?function(Hn,wn,si,fi,ci,Yi,Qn,Mi,Ji){const Ir=[],Ki=[],Ri=[0,0,0,1];for(const Xr of Hn){const Qi=[],nr=[];for(const no of Xr){const io=no.x+fi.x,ro=no.y+fi.y,oo=Jm(io,ro,wn,si,Yi,Qn,Mi,Ji);Ri[0]=io,Ri[1]=ro,Ri[2]=oo.base,Ri[3]=1,iu(Ri,Ri,ci),Ri[3]=Math.max(Ri[3],1e-5);const wo=new la(Ri[0]/Ri[3],Ri[1]/Ri[3],Ri[2]/Ri[3]);Ri[0]=io,Ri[1]=ro,Ri[2]=oo.top,Ri[3]=1,iu(Ri,Ri,ci),Ri[3]=Math.max(Ri[3],1e-5);const jo=new la(Ri[0]/Ri[3],Ri[1]/Ri[3],Ri[2]/Ri[3]);Qi.push(wo),nr.push(jo)}Ir.push(Qi),Ki.push(nr)}return[Ir,Ki]}(xt,bt,tn,nn,Tn,Un,fn,Pn,On):function(Hn,wn,si,fi,ci){const Yi=[],Qn=[],Mi=ci[8]*wn,Ji=ci[9]*wn,Ir=ci[10]*wn,Ki=ci[11]*wn,Ri=ci[8]*si,Xr=ci[9]*si,Qi=ci[10]*si,nr=ci[11]*si;for(const no of Hn){const io=[],ro=[];for(const oo of no){const wo=oo.x+fi.x,jo=oo.y+fi.y,Ko=ci[0]*wo+ci[4]*jo+ci[12],Qr=ci[1]*wo+ci[5]*jo+ci[13],is=ci[2]*wo+ci[6]*jo+ci[14],Lo=ci[3]*wo+ci[7]*jo+ci[15],lo=Ko+Mi,Mr=Qr+Ji,So=is+Ir,eo=Math.max(Lo+Ki,1e-5),vs=Ko+Ri,Vo=Qr+Xr,Ss=is+Qi,$o=Math.max(Lo+nr,1e-5);io.push(new la(lo/eo,Mr/eo,So/eo)),ro.push(new la(vs/$o,Vo/$o,Ss/$o))}Yi.push(io),Qn.push(ro)}return[Yi,Qn]}(xt,bt,tn,nn,Tn)),Qe=n.queryGeometry;var ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On;return function(ut,xt,bt){let tn=1/0;Yf(bt,xt)&&(tn=Jh(bt,xt[0]));for(let nn=0;nn=3)for(let te=0;te{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class fy{constructor(){this.tasks={},this.taskQueue=[],Rt(["process"],this),this.invoker=new hy(this.process),this.nextId=0}add(e,i){const a=this.nextId++,u=function({type:p,isSymbolTile:_,zoom:w}){return w=w||0,"message"===p?0:"maybePrepare"!==p||_?"parseTile"!==p||_?"parseTile"===p&&_?300-w:"maybePrepare"===p&&_?400-w:500:200-w:100-w}(i);if(0===u){Yt();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[a]={fn:e,metadata:i,priority:u,id:a},this.taskQueue.push(a),this.invoker.trigger(),{cancel:()=>{delete this.tasks[a]}}}process(){Yt();try{if(this.taskQueue=this.taskQueue.filter(a=>!!this.tasks[a]),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let u=0;u>=1)>1;){const S=i+u>>1,B=a+p>>1;1&e?(u=i,p=a,i=_,a=w):(i=u,a=p,u=_,p=w),_=S,w=B}const I=4*n;Nc[I+0]=i,Nc[I+1]=a,Nc[I+2]=u,Nc[I+3]=p}const fl=new Uint16Array(2178),zc=new Uint8Array(1089),rh=new Uint16Array(1089);function Bp(n){return 0===n?-.03125:32===n?.03125:0}var oh=zt([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const ff={type:2,extent:Ii,loadGeometry:()=>[[new ue(0,0),new ue(Ii+1,0),new ue(Ii+1,Ii+1),new ue(0,Ii+1),new ue(0,0)]]};class Ig{constructor(e,i,a,u,p){this.tileID=e,this.uid=Re(),this.uses=0,this.tileSize=i,this.tileZoom=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=p,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;ip.getLayer(S)).filter(Boolean);if(0!==I.length){w.layers=I,w.stateDependentLayerIds&&(w.stateDependentLayers=w.stateDependentLayerIds.map(S=>I.filter(B=>B.id===S)[0]));for(const S of I)_[S.id]=w}}return _}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Bc){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Bc&&p.hasRTLText){this.hasRTLText=!0,L.isLoading()||L.isLoaded()||"deferred"!==T()||O();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(u).queryRadius(p))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new jr}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const a in this.buckets){const u=this.buckets[a];u.uploadPending()&&u.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new bu(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new bu(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new bu(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,a,u,p,_,w,I){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:u,pixelPosMatrix:w,transform:_,params:p,tileTransform:this.tileTransform},e,i,a):{}}querySourceFeatures(e,i){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const u=a.loadVTLayers(),p=i?i.sourceLayer:"",_=u._geojsonTileLayer||u[p];if(!_)return;const w=_c(i&&i.filter),{z:I,x:S,y:B}=this.tileID.canonical,j={z:I,x:S,y:B};for(let H=0;H<_.length;H++){const X=_.feature(H);if(w.needGeometry){const ke=au(X,!0);if(!w.filter(new Z(this.tileID.overscaledZ),ke,this.tileID.canonical))continue}else if(!w.filter(new Z(this.tileID.overscaledZ),X))continue;const te=a.getId(X,p),de=new Dg(X,I,S,B,te);de.tile=j,e.push(de)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const i=this.expirationTime;if(e.cacheControl){const a=Ut(e.cacheControl);a["max-age"]&&(this.expirationTime=Date.now()+1e3*a["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const a=Date.now();let u=!1;if(this.expirationTime>a)u=!1;else if(i)if(this.expirationTime=0;ke--){const tt=4*ke,mt=Nc[tt+0],Qe=Nc[tt+1],ut=Nc[tt+2],xt=Nc[tt+3],bt=mt+ut>>1,tn=Qe+xt>>1,nn=bt+tn-Qe,Tn=tn+mt-bt,Un=33*Qe+mt,fn=33*xt+ut,Pn=33*tn+bt,On=Math.hypot((fl[2*Un+0]+fl[2*fn+0])/2-fl[2*Pn+0],(fl[2*Un+1]+fl[2*fn+1])/2-fl[2*Pn+1])>=16;zc[Pn]=zc[Pn]||(On?1:0),ke<1022&&(zc[Pn]=zc[Pn]||zc[33*(Qe+Tn>>1)+(mt+nn>>1)]||zc[33*(xt+Tn>>1)+(ut+nn>>1)])}const j=new Rn,H=new xi;let X=0;function te(ke,tt){const mt=33*tt+ke;return 0===rh[mt]&&(j.emplaceBack(fl[2*mt+0],fl[2*mt+1],ke*Ii/32,tt*Ii/32),rh[mt]=++X),rh[mt]-1}function de(ke,tt,mt,Qe,ut,xt){const bt=ke+mt>>1,tn=tt+Qe>>1;if(Math.abs(ke-ut)+Math.abs(tt-xt)>1&&zc[33*tn+bt])de(ut,xt,ke,tt,bt,tn),de(mt,Qe,ut,xt,bt,tn);else{const nn=te(ke,tt),Tn=te(mt,Qe),Un=te(ut,xt);H.emplaceBack(nn,Tn,Un)}}return de(0,0,32,32,32,0),de(32,32,0,0,0,32),{vertices:j,indices:H}}(this.tileID.canonical,i);u=_.vertices,p=_.indices}else{u=new Rn,p=new xi;for(const{x:w,y:I}of a)u.emplaceBack(w,I,0,0);const _=Fm(u.int16,void 0,4);for(let w=0;w<_.length;w+=3)p.emplaceBack(_[w],_[w+1],_[w+2])}this._tileBoundsBuffer=e.createVertexBuffer(u,oh.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(p),this._tileBoundsSegments=qo.simpleSegment(0,0,u.length,p.length)}_makeGlobeTileDebugBuffers(e,i){const a=i.projection;if(!a||"globe"!==a.name||i.freezeTileCoverage)return;const u=this.tileID.canonical,p=su(zf(u,i)),_=Ol(i.zoom);let w;_>0&&(w=Ih(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,u,i,p,w,_),this._makeGlobeTileDebugTextBuffer(e,u,i,p,w,_)}_globePoint(e,i,a,u,p,_,w){let I=Vu(e,i,a);if(_){const S=1<.5?X=-1:H<-.5&&(X=1);let te=(e/Ii+a.x)/S+X,de=(i/Ii+a.y)/S;te=(te-B)*u._pixelsPerMercatorPixel+B,de=(de-j)*u._pixelsPerMercatorPixel+j;const ke=[te*u.worldSize,de*u.worldSize,0];Yo(ke,ke,_),I=ul(I,ke,w)}return Yo(I,I,p)}_makeGlobeTileDebugBorderBuffer(e,i,a,u,p,_){const w=new Vn,I=new vo,S=new on,B=(H,X,te,de,ke)=>{const tt=(te-H)/(ke-1),mt=(de-X)/(ke-1),Qe=w.length;for(let ut=0;utj*X+te;for(let X=0;Xe[_])return null}else{const w=1/a[_];let I=(n[_]-i[_])*w,S=(e[_]-i[_])*w;if(I>S){const B=I;I=S,S=B}if(I>u&&(u=I),Sp)return null}return u}function Up(n,e,i,a,u,p,_,w,I,S,B){const j=a-n,H=u-e,X=p-i,te=_-n,de=w-e,ke=I-i,tt=B[1]*ke-B[2]*de,mt=B[2]*te-B[0]*ke,Qe=B[0]*de-B[1]*te,ut=j*tt+H*mt+X*Qe;if(Math.abs(ut)<1e-15)return null;const xt=1/ut,bt=S[0]-n,tn=S[1]-e,nn=S[2]-i,Tn=(bt*tt+tn*mt+nn*Qe)*xt;if(Tn<0||Tn>1)return null;const Un=tn*X-nn*H,fn=nn*j-bt*X,Pn=bt*H-tn*j,On=(B[0]*Un+B[1]*fn+B[2]*Pn)*xt;return On<0||Tn+On>1?null:(te*Un+de*fn+ke*Pn)*xt}function pf(n,e,i){return(n-e)/(i-e)}function Ul(n,e,i,a,u,p,_,w,I){const S=1<{const mt=ke?1:0,Qe=(X+1)*de-mt,ut=te*de,xt=(te+1)*de-mt;tt[0]=X*de,tt[1]=ut,tt[2]=Qe,tt[3]=xt};let j=new Np(I);const H=[];for(let X=0;X=1;I/=2){const X=w[w.length-1];j=new Np(I);for(let te=0;te0;){const{idx:te,t:de,nodex:ke,nodey:tt,depth:mt}=X.pop();if(this.leaves[te]){Ul(ke,tt,mt,e,i,a,u,j,H);const ut=1<=wn[2])return de}continue}let Qe=0;for(let ut=0;ut=S[B[nn]]&&(B.splice(nn,0,ut),tn=!0);tn||(B[Qe]=ut),Qe++}}for(let ut=0;ut=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const a=[0,0,0,0],u=wu.getUnpackVector(i);let p=Math.floor((e+u[3])/u[2]);return a[2]=p%256,p=Math.floor(p/256),a[1]=p%256,p=Math.floor(p/256),a[0]=p,a}getPixels(){return new ya({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let u=i*this.dim,p=i*this.dim+this.dim,_=a*this.dim,w=a*this.dim+this.dim;switch(i){case-1:u=p-1;break;case 1:p=u+1}switch(a){case-1:_=w-1;break;case 1:w=_+1}const I=-i*this.dim,S=-a*this.dim;for(let B=_;B{this.remove(e,p)},a)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const _=this._getAndRemoveByKey(this.order[0]);_&&this.onRemove(_)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const a=e.wrapped().key,u=void 0===i?0:this.data[a].indexOf(i),p=this.data[a][u];return this.data[a].splice(u,1),p.timeout&&clearTimeout(p.timeout),0===this.data[a].length&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const a in this.data)for(const u of this.data[a])e(u.value)||i.push(u);for(const a of i)this.remove(a.value.tileID,a)}}class oc{constructor(e,i,a){this.func=e,this.mask=i,this.range=a}}oc.ReadOnly=!1,oc.ReadWrite=!0,oc.disabled=new oc(519,oc.ReadOnly,[0,1]);class Zp{constructor(e,i,a,u,p,_){this.test=e,this.ref=i,this.mask=a,this.fail=u,this.depthFail=p,this.pass=_}}Zp.disabled=new Zp({func:519,mask:0},0,0,7680,7680,7680);class pl{constructor(e,i,a){this.blendFunction=e,this.blendColor=i,this.mask=a}}pl.Replace=[1,0],pl.disabled=new pl(pl.Replace,kr.transparent,[!1,!1,!1,!1]),pl.unblended=new pl(pl.Replace,kr.transparent,[!0,!0,!0,!0]),pl.alphaBlended=new pl([1,771],kr.transparent,[!0,!0,!0,!0]);class ml{constructor(e,i,a){this.enable=e,this.mode=i,this.frontFace=a}}ml.disabled=new ml(!1,1029,2305),ml.backCCW=new ml(!0,1029,2305),ml.backCW=new ml(!0,1029,2304),ml.frontCW=new ml(!0,1028,2304),ml.frontCCW=new ml(!0,1028,2305);class Uc extends Bi{constructor(e,i,a){super(),this.id=e,this._onlySymbols=a,i.on("data",u=>{"source"===u.dataType&&"metadata"===u.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===u.dataType&&"content"===u.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new sh(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new Mg,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if("loaded"!==i.state&&"errored"!==i.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const i in this._tiles){const a=this._tiles[i];a.upload(e),a.prepare(this.map.style.imageManager)}}getIds(){return Ht(this._tiles).map(e=>e.tileID).sort(Vp).map(e=>e.key)}getRenderableIds(e){const i=[];for(const a in this._tiles)this._isIdRenderable(+a,e)&&i.push(this._tiles[a]);return e?i.sort((a,u)=>{const p=a.tileID,_=u.tileID,w=new ue(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),I=new ue(_.canonical.x,_.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-_.overscaledZ||I.y-w.y||I.x-w.x}).map(a=>a.tileID.key):i.map(a=>a.tileID).sort(Vp).map(a=>a.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const a=this._tiles[e];a&&("loading"!==a.state&&(a.state=i),this._loadTile(a,this._tileLoaded.bind(this,a,e,i)))}_tileLoaded(e,i,a,u){if(u)if(e.state="errored",404!==u.status)this._source.fire(new qi(u,{tile:e}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const p=this.map.painter.terrain;this.update(this.transform,p.getScaledDemTileSize(),!0),p.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=ir.now(),"expired"===a&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this._source.type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new Ar("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let u=0;u1||(Math.abs(_)>1&&(1===Math.abs(_+I)?_+=I:1===Math.abs(_-I)&&(_-=I)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,_,w),u.neighboringTiles&&u.neighboringTiles[S]&&(u.neighboringTiles[S].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,a,u){for(const p in this._tiles){let _=this._tiles[p];if(u[p]||!_.hasData()||_.tileID.overscaledZ<=i||_.tileID.overscaledZ>a)continue;let w=_.tileID;for(;_&&_.tileID.overscaledZ>i+1;){const S=_.tileID.scaledTo(_.tileID.overscaledZ-1);_=this._tiles[S.key],_&&_.hasData()&&(w=S)}let I=w;for(;I.overscaledZ>i;)if(I=I.scaledTo(I.overscaledZ-1),e[I.key]){u[w.key]=w;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const a=this._loadedParentTiles[e.key];return a&&a.tileID.overscaledZ>=i?a:null}for(let a=e.overscaledZ-1;a>=i;a--){const u=e.scaledTo(a),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const a=Math.ceil(e.width/i)+1,u=Math.ceil(e.height/i)+1,p=Math.floor(a*u*5),_="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,p):p,w="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,_):_;this._cache.setMaxSize(w)}handleWrapJump(e){const i=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,i){const a={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+i),a[p.tileID.key]=p}this._tiles=a;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(+u,this._tiles[u])}}update(e,i,a){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;let u;this.updateCacheSize(e,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(w=>new Bs(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y)):(u=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(u=u.filter(w=>this._source.hasTile(w)))):u=[];const p=this._updateRetainedTiles(u);if(fd(this._source.type)&&0!==u.length){const w={},I={},S=Object.keys(p);for(const j of S){const H=p[j],X=this._tiles[j];if(!X||X.fadeEndTime&&X.fadeEndTime<=ir.now())continue;const te=this.findLoadedParent(H,Math.max(H.overscaledZ-Uc.maxOverzooming,this._source.minzoom));te&&(this._addTile(te.tileID),w[te.tileID.key]=te.tileID),I[j]=H}const B=u[u.length-1].overscaledZ;for(const j in this._tiles){const H=this._tiles[j];if(p[j]||!H.hasData())continue;let X=H.tileID;for(;X.overscaledZ>B;){X=X.scaledTo(X.overscaledZ-1);const te=this._tiles[X.key];if(te&&te.hasData()&&I[X.key]){p[j]=H.tileID;break}}}for(const j in w)p[j]||(this._coveredTiles[j]=!0,p[j]=w[j])}for(const w in p)this._tiles[w].clearFadeHold();const _=function(w,I){const S=[];for(const B in w)B in I||S.push(B);return S}(this._tiles,p);for(const w of _){const I=this._tiles[w];I.hasSymbolBuckets&&!I.holdingForFade()?I.setHoldDuration(this.map._fadeDuration):I.hasSymbolBuckets&&!I.symbolFadeFinished()||this._removeTile(+w)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(0===e.length)return i;const a={},u=e.reduce((S,B)=>Math.min(S,B.overscaledZ),1/0),p=e[0].overscaledZ,_=Math.max(p-Uc.maxOverzooming,this._source.minzoom),w=Math.max(p+Uc.maxUnderzooming,this._source.minzoom),I={};for(const S of e){const B=this._addTile(S);i[S.key]=S,B.hasData()||u=this._source.maxzoom){const H=S.children(this._source.maxzoom)[0],X=this.getTile(H);if(X&&X.hasData()){i[H.key]=H;continue}}else{const H=S.children(this._source.maxzoom);if(i[H[0].key]&&i[H[1].key]&&i[H[2].key]&&i[H[3].key])continue}let j=B.wasRequested();for(let H=S.overscaledZ-1;H>=_;--H){const X=S.scaledTo(H);if(a[X.key]||(a[X.key]=!0,B=this.getTile(X),!B&&j&&(B=this._addTile(X)),B&&(i[X.key]=X,j=B.wasRequested(),B.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let a,u=this._tiles[e].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){a=this._loadedParentTiles[u.key];break}i.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;u=p}for(const p of i)this._loadedParentTiles[p]=a}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const a=!!i;if(!a){const u=this.map?this.map.painter:null;i=new Ig(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,u,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,a||this._source.fire(new Ar("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const a=i.getExpiryTimeout();a&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},a))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&"reloading"!==i.state?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,a){const u=[],p=this.transform;if(!p)return u;const _="globe"===p.projection.name,w=Ll(p.center.lng);for(const I in this._tiles){const S=this._tiles[I];if(a&&S.clearQueryDebugViz(),S.holdingForFade())continue;let B;if(_){const j=S.tileID.canonical;if(0===j.z){const H=[Math.abs(Ye(w,...ah(j,-1))-w),Math.abs(Ye(w,...ah(j,1))-w)];B=[0,2*H.indexOf(Math.min(...H))-1]}else{const H=[Math.abs(Ye(w,...ah(j,-1))-w),Math.abs(Ye(w,...ah(j,0))-w),Math.abs(Ye(w,...ah(j,1))-w)];B=[H.indexOf(Math.min(...H))-1]}}else B=[0];for(const j of B){const H=e.containsTile(S,p,i,j);H&&u.push(H)}}return u}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(a=>this._tiles[a].tileID);for(const a of i)a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(fd(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=ir.now())return!0}return!1}setFeatureState(e,i,a){this._state.updateState(e=e||"_geojsonTileLayer",i,a)}removeFeatureState(e,i,a){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,a)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,a){const u=this._tiles[e];u&&u.setDependencies(i,a)}reloadTilesForDependencies(e,i){for(const a in this._tiles)this._tiles[a].hasDependency(e,i)&&this._reloadTile(+a,"reloading");this._cache.filter(a=>!a.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const w=()=>{this._sourceLoaded&&(this._source.off("data",w),this._preloadTiles(e,i))};return void this._source.on("data",w)}const a=new Map,u=Array.isArray(e)?e:[e],p=this.map.painter.terrain,_=this.usedForTerrain&&p?p.getScaledDemTileSize():this._source.tileSize;for(const w of u){const I=w.coveringTiles({tileSize:_,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const S of I)a.set(S.key,S);this.usedForTerrain&&w.updateElevation(!1)}qt(Array.from(a.values()),(w,I)=>{const S=new Ig(w,this._source.tileSize*w.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(S,B=>{"raster-dem"===this._source.type&&S.dem&&this._backfillDEM(S),I(B,S)})},i)}}function Vp(n,e){const i=Math.abs(2*n.wrap)-+(n.wrap<0),a=Math.abs(2*e.wrap)-+(e.wrap<0);return n.overscaledZ-e.overscaledZ||a-i||e.canonical.y-n.canonical.y||e.canonical.x-n.canonical.x}function fd(n){return"raster"===n||"image"===n||"video"===n||"custom"===n}function ah(n,e){const i=1<=0&&j[3]>=0&&I.insert(w,j[0],j[1],j[2],j[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new hu(new Wd(this.rawTileData)).layers,this.sourceLayerCoder=new Tg(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,a,u){this.loadVTLayers();const p=e.params||{},_=_c(p.filter),w=e.tileResult,I=e.transform,S=w.bufferedTilespaceBounds,B=this.grid.query(S.min.x,S.min.y,S.max.x,S.max.y,(te,de,ke,tt)=>Xf(w.bufferedTilespaceGeometry,te,de,ke,tt));B.sort(gy);let j=null;I.elevation&&B.length>0&&(j=lh.create(I.elevation,this.tileID));const H={};let X;for(let te=0;te(tt||(tt=Fl(mt,this.tileID.canonical,e.tileTransform)),Qe.queryIntersectsFeature(w,mt,ut,tt,this.z,e.transform,e.pixelPosMatrix,j,xt)))}return H}loadMatchingFeature(e,i,a,u,p,_,w,I,S){const{featureIndex:B,bucketIndex:j,sourceLayerIndex:H,layoutVertexArrayOffset:X}=i,te=this.bucketLayerIDs[j];if(u&&!function(mt,Qe){for(let ut=0;ut=0)return!0;return!1}(u,te))return;const de=this.sourceLayerCoder.decode(H),ke=this.vtLayers[de].feature(B);if(a.needGeometry){const mt=au(ke,!0);if(!a.filter(new Z(this.tileID.overscaledZ),mt,this.tileID.canonical))return}else if(!a.filter(new Z(this.tileID.overscaledZ),ke))return;const tt=this.getId(ke,de);for(let mt=0;mt{const w=e instanceof Ke?e.get(_):null;return w&&w.evaluate?w.evaluate(i,a,u):w})}function gy(n,e){return e-n}ui($p,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class pd{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new hl({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const a=this.getKey(e,i);return this.positions[a]}trim(){const e=this.width,i=this.height=St(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,a){const u=[];let p=e.length%2==1?-e[e.length-1]*a:0,_=e[0]*a,w=!0;u.push({left:p,right:_,isDash:w,zeroLength:0===e[0]});let I=e[0];for(let S=1;S1&&(I=e[++w]);const B=Math.abs(S-I.left),j=Math.abs(S-I.right),H=Math.min(B,j);let X;const te=p/a*(u+1);if(I.isDash){const de=u-Math.abs(te);X=Math.sqrt(H*H+de*de)}else X=u-Math.sqrt(H*H+te*te);this.image.data[_+S]=Math.max(0,Math.min(255,X+128))}}}addRegularDash(e,i){for(let I=e.length-1;I>=0;--I){const S=e[I],B=e[I+1];S.zeroLength?e.splice(I,1):B&&B.isDash===S.isDash&&(B.left=S.left,e.splice(I,1))}const a=e[0],u=e[e.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const p=this.width*this.nextRow;let _=0,w=e[_];for(let I=0;I1&&(w=e[++_]);const S=Math.abs(I-w.left),B=Math.abs(I-w.right),j=Math.min(S,B);this.image.data[p+I]=Math.max(0,Math.min(255,(w.isDash?j:-j)+i+128))}}addDash(e,i){const a=this.getKey(e,i);if(this.positions[a])return this.positions[a];const u="round"===i,p=u?7:0,_=2*p+1;if(this.nextRow+_>this.height)return dt("LineAtlas out of space"),null;0===e.length&&e.push(1);let w=0;for(let B=0;B=Pn.maxzoom||"none"!==Pn.visibility&&(Gp(fn,this.zoom,a),(I[Pn.id]=Pn.createBucket({index:w.bucketLayerIDs.length,layers:fn,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Tn,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:a})).populate(Un,B,this.tileID.canonical,this.tileTransform),w.bucketLayerIDs.push(fn.map(On=>On.id)))}}let H,X,te,de;S.trim();const ke={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},tt=()=>{if(H)return p(H);if(X&&te&&de){const xt=new Fg(X),bt=new sg(te,de);for(const tn in I){const nn=I[tn];nn instanceof Bc?(Gp(nn.layers,this.zoom,a),Bv(nn,X,xt.positions,te,bt.iconPositions,this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection)):nn.hasPattern&&(nn instanceof Qu||nn instanceof $h||nn instanceof Ku)&&(Gp(nn.layers,this.zoom,a),nn.addFeatures(B,this.tileID.canonical,bt.patternPositions,a,this.tileTransform))}this.status="done",p(null,{buckets:Ht(I).filter(tn=>!tn.isEmpty()),featureIndex:w,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:xt.image,lineAtlas:S,imageAtlas:bt,glyphMap:this.returnDependencies?X:null,iconMap:this.returnDependencies?te:null,glyphPositions:this.returnDependencies?xt.positions:null})}},mt=Gt(B.glyphDependencies,xt=>Object.keys(xt).map(Number));Object.keys(mt).length?u.send("getGlyphs",{uid:this.uid,stacks:mt},(xt,bt)=>{H||(H=xt,X=bt,tt())},void 0,!1,ke):X={};const Qe=Object.keys(B.iconDependencies);Qe.length?u.send("getImages",{icons:Qe,source:this.source,tileID:this.tileID,type:"icons"},(xt,bt)=>{H||(H=xt,te=bt,tt())},void 0,!1,ke):te={};const ut=Object.keys(B.patternDependencies);ut.length?u.send("getImages",{icons:ut,source:this.source,tileID:this.tileID,type:"patterns"},(xt,bt)=>{H||(H=xt,de=bt,tt())},void 0,!1,ke):de={},tt()}}function Gp(n,e,i){const a=new Z(e);for(const u of n)u.recalculate(a,i)}class Bg{constructor(e){this.entries={},this.scheduler=e}request(e,i,a,u){const p=this.entries[e]=this.entries[e]||{callbacks:[]};if(p.result){const[_,w]=p.result;return this.scheduler?this.scheduler.add(()=>{u(_,w)},i):u(_,w),()=>{}}return p.callbacks.push(u),p.cancel||(p.cancel=a((_,w)=>{p.result=[_,w];for(const I of p.callbacks)this.scheduler?this.scheduler.add(()=>{I(_,w)},i):I(_,w);setTimeout(()=>delete this.entries[e],3e3)})),()=>{p.result||(p.callbacks=p.callbacks.filter(_=>_!==u),p.callbacks.length||(p.cancel(),delete this.entries[e]))}}}function Ng(n,e,i){const a=JSON.stringify(n.request);return n.data&&(this.deduped.entries[a]={result:[null,n.data]}),this.deduped.request(a,{type:"parseTile",isSymbolTile:n.isSymbolTile,zoom:n.tileZoom},u=>{const p=_n(n.request,(_,w,I,S)=>{_?u(_):w&&u(null,{vectorTile:i?void 0:new hu(new Wd(w)),rawData:w,cacheControl:I,expires:S})});return()=>{p.cancel(),u()}},e)}const zg=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Hp{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(e,0,2);if(219!==i)throw new Error("Data does not appear to be in a KDBush format.");const u=a>>4;if(1!==u)throw new Error(`Got v${u} data when expected v1.`);const p=zg[15&a];if(!p)throw new Error("Unrecognized array type.");const[_]=new Uint16Array(e,2,1),[w]=new Uint32Array(e,4,1);return new Hp(w,_,p,e)}constructor(e,i=64,a=Float64Array,u){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const p=zg.indexOf(this.ArrayType),_=2*e*this.ArrayType.BYTES_PER_ELEMENT,w=e*this.IndexArrayType.BYTES_PER_ELEMENT,I=(8-w%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+w+I,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+_+w+I),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+w+I,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=i,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return gf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,a,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:_,nodeSize:w}=this,I=[0,p.length-1,0],S=[];for(;I.length;){const B=I.pop()||0,j=I.pop()||0,H=I.pop()||0;if(j-H<=w){for(let ke=H;ke<=j;ke++){const tt=_[2*ke],mt=_[2*ke+1];tt>=e&&tt<=a&&mt>=i&&mt<=u&&S.push(p[ke])}continue}const X=H+j>>1,te=_[2*X],de=_[2*X+1];te>=e&&te<=a&&de>=i&&de<=u&&S.push(p[X]),(0===B?e<=te:i<=de)&&(I.push(H),I.push(X-1),I.push(1-B)),(0===B?a>=te:u>=de)&&(I.push(X+1),I.push(j),I.push(1-B))}return S}within(e,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:_}=this,w=[0,u.length-1,0],I=[],S=a*a;for(;w.length;){const B=w.pop()||0,j=w.pop()||0,H=w.pop()||0;if(j-H<=_){for(let ke=H;ke<=j;ke++)Ug(p[2*ke],p[2*ke+1],e,i)<=S&&I.push(u[ke]);continue}const X=H+j>>1,te=p[2*X],de=p[2*X+1];Ug(te,de,e,i)<=S&&I.push(u[X]),(0===B?e-a<=te:i-a<=de)&&(w.push(H),w.push(X-1),w.push(1-B)),(0===B?e+a>=te:i+a>=de)&&(w.push(X+1),w.push(j),w.push(1-B))}return I}}function gf(n,e,i,a,u,p){if(u-a<=i)return;const _=a+u>>1;_f(n,e,_,a,u,p),gf(n,e,i,a,_-1,1-p),gf(n,e,i,_+1,u,1-p)}function _f(n,e,i,a,u,p){for(;u>a;){if(u-a>600){const S=u-a+1,B=i-a+1,j=Math.log(S),H=.5*Math.exp(2*j/3),X=.5*Math.sqrt(j*H*(S-H)/S)*(B-S/2<0?-1:1);_f(n,e,i,Math.max(a,Math.floor(i-B*H/S+X)),Math.min(u,Math.floor(i+(S-B)*H/S+X)),p)}const _=e[2*i+p];let w=a,I=u;for(ch(n,e,a,i),e[2*u+p]>_&&ch(n,e,a,u);w_;)I--}e[2*a+p]===_?ch(n,e,a,I):(I++,ch(n,e,I,u)),I<=i&&(a=I+1),i<=I&&(u=I-1)}}function ch(n,e,i,a){md(n,i,a),md(e,2*i,2*a),md(e,2*i+1,2*a+1)}function md(n,e,i){const a=n[e];n[e]=n[i],n[i]=a}function Ug(n,e,i,a){const u=n-i,p=e-a;return u*u+p*p}s.ARRAY_TYPE=ma,s.AUTH_ERR_MSG=ft,s.Aabb=ta,s.Actor=class{constructor(n,e,i){this.target=n,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Rt(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Yt()?n:J,this.scheduler=new fy}send(n,e,i,a,u=!1,p){const _=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=p,this.callbacks[_]=i);const w=gn(this.globalScope)?void 0:[];return this.target.postMessage({id:_,type:n,hasCallback:!!i,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ml(e,w)},w),{cancel:()=>{i&&delete this.callbacks[_],this.target.postMessage({id:_,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(n){const e=n.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){const a=this.cancelCallbacks[i];delete this.cancelCallbacks[i],a&&a.cancel()}else if(e.mustQueue||Yt()){const a=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),a&&a.metadata||{type:"message"})}else this.processTask(i,e)}processTask(n,e){if(""===e.type){const i=this.callbacks[n];delete this.callbacks[n],i&&(e.error?i(al(e.error)):i(null,al(e.data)))}else{const i=gn(this.globalScope)?void 0:[],a=e.hasCallback?(p,_)=>{delete this.cancelCallbacks[n],this.target.postMessage({id:n,type:"",sourceMapId:this.mapId,error:p?Ml(p):null,data:Ml(_,i)},i)}:p=>{},u=al(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){const p=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,p[0],u.source)[p[1]](u,a)}else a(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=gu,s.Color=kr,s.ColorMode=pl,s.CullFaceMode=ml,s.DEMData=wu,s.DataConstantProperty=ce,s.DedupedRequest=Bg,s.DepthMode=oc,s.EXTENT=Ii,s.Elevation=class{isDataAvailableAtPoint(n){const e=this._source();if(this.isUsingMockSource()||!e||n.y<0||n.y>1)return!1;const i=e.getSource().maxzoom,a=1<1)return e;const u=a.getSource().maxzoom,p=1<{const p=this.getAtTileOffset(n,u.x,u.y),_=a.upVector(n.canonical,u.x,u.y);return _a(_,_,p*a.upVectorScale(n.canonical,e,i).metersToTile),_}}getForTilePoints(n,e,i,a){if(this.isUsingMockSource())return!1;const u=lh.create(this,n,a);return!!u&&(e.forEach(p=>{p[2]=this.exaggeration()*u.getElevationAt(p[0],p[1],i)}),!0)}getMinMaxForTile(n){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(n);if(!e||!e.dem)return null;const i=e.dem.tree,a=e.tileID,u=1<{let H=S===p-1?S-2:0===S?S:S-1;return H+=j?24575:0,[H,B]};for(let S=0;Sthis._skuTokenExpiresAt}transformRequest(n,e){return this._transformRequestFn&&this._transformRequestFn(n,e)||{url:n}}normalizeStyleURL(n,e){if(!Ct(n))return n;const i=zn(n);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(n,e){if(!Ct(n))return n;const i=zn(n);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(n,e,i,a){if(!Ct(n))return n;const u=zn(n);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),i&&u.params.push(`language=${i}`),a&&u.params.push(`worldview=${a}`),this._makeAPIURL(u,this._customAccessToken||e)}normalizeSpriteURL(n,e,i,a){const u=zn(n);return Ct(n)?(u.path=`/styles/v1${u.path}/sprite${e}${i}`,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=`${e}${i}`,pe(u))}normalizeTileURL(n,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),n&&!Ct(n))return n;const a=zn(n);a.path=a.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&"raster"!==a.authority&&512===i?"@2x":""}${Ne.supported?".webp":"$1"}`),"raster"===a.authority?a.path=`/${E.RASTER_URL_PREFIX}${a.path}`:(a.path=a.path.replace(/^.+\/v4\//,"/"),a.path=`/${E.TILE_URL_VERSION}${a.path}`);const u=this._customAccessToken||function(p){for(const _ of p){const w=_.match(/^access_token=(.*)$/);if(w)return w[1]}return null}(a.params)||E.ACCESS_TOKEN;return E.REQUIRE_ACCESS_TOKEN&&u&&this._skuToken&&a.params.push(`sku=${this._skuToken}`),this._makeAPIURL(a,u)}canonicalizeTileURL(n,e){const i=zn(n);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return n;let a="mapbox://";i.path.match(/^\/raster\/v1\//)?a+=`raster/${i.path.replace(`/${E.RASTER_URL_PREFIX}/`,"")}`:a+=`tiles/${i.path.replace(`/${E.TILE_URL_VERSION}/`,"")}`;let u=i.params;return e&&(u=u.filter(p=>!p.match(/^access_token=/))),u.length&&(a+=`?${u.join("&")}`),a}canonicalizeTileset(n,e){const i=!!e&&Ct(e),a=[];for(const u of n.tiles||[])Bt(u)?a.push(this.canonicalizeTileURL(u,i)):a.push(u);return a}_makeAPIURL(n,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",a=zn(E.API_URL);if(n.protocol=a.protocol,n.authority=a.authority,"http"===n.protocol){const u=n.params.indexOf("secure");u>=0&&n.params.splice(u,1)}if("/"!==a.path&&(n.path=`${a.path}${n.path}`),!E.REQUIRE_ACCESS_TOKEN)return pe(n);if(e=e||E.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===e[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return n.params=n.params.filter(u=>-1===u.indexOf("access_token")),n.params.push(`access_token=${e||""}`),pe(n)}},s.ResourceType=Cn,s.SegmentVector=qo,s.SourceCache=Uc,s.StencilMode=Zp,s.StructArrayLayout1ui2=vo,s.StructArrayLayout2f1f2i16=Pi,s.StructArrayLayout2i4=Vn,s.StructArrayLayout2ui4=_s,s.StructArrayLayout3f12=dr,s.StructArrayLayout3ui6=xi,s.StructArrayLayout4i8=Rn,s.StructArrayLayout5f20=qr,s.Texture=bu,s.Tile=Ig,s.Transitionable=se,s.Uniform1f=wh,s.Uniform1i=class extends Ma{constructor(n){super(n),this.current=0}set(n,e,i){this.fetchUniformLocation(n,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Ma{constructor(n){super(n),this.current=[0,0]}set(n,e,i){this.fetchUniformLocation(n,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Ma{constructor(n){super(n),this.current=[0,0,0]}set(n,e,i){this.fetchUniformLocation(n,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},s.Uniform4f=Aa,s.UniformColor=Xc,s.UniformMatrix2f=class extends Ma{constructor(n){super(n),this.current=Td}set(n,e,i){if(this.fetchUniformLocation(n,e))for(let a=0;a<4;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}},s.UniformMatrix3f=class extends Ma{constructor(n){super(n),this.current=Ch}set(n,e,i){if(this.fetchUniformLocation(n,e))for(let a=0;a<9;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}},s.UniformMatrix4f=class extends Ma{constructor(n){super(n),this.current=am}set(n,e,i){if(this.fetchUniformLocation(n,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let a=1;a<16;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=Ym,s.ValidationError=ai,s.VectorTileFeature=Gr,s.VectorTileWorkerSource=class extends Bi{constructor(n,e,i,a,u){super(),this.actor=n,this.layerIndex=e,this.availableImages=i,this.loadVectorData=u||Ng,this.loading={},this.loaded={},this.deduped=new Bg(n.scheduler),this.isSpriteLoaded=a,this.scheduler=n.scheduler}loadTile(n,e){const i=n.uid,a=n&&n.request,u=a&&a.collectResourceTiming,p=this.loading[i]=new _y(n);p.abort=this.loadVectorData(n,(_,w)=>{const I=!this.loading[i];if(delete this.loading[i],I||_||!w)return p.status="done",I||(this.loaded[i]=p),e(_);const S=w.rawData,B={};w.expires&&(B.expires=w.expires),w.cacheControl&&(B.cacheControl=w.cacheControl),p.vectorTile=w.vectorTile||new hu(new Wd(S));const j=()=>{p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,(H,X)=>{if(H||!X)return e(H);const te={};if(u){const de=ti(a);de.length>0&&(te.resourceTiming=JSON.parse(JSON.stringify(de)))}e(null,De({rawTileData:S.slice(0)},X,B,te))})};this.isSpriteLoaded?j():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(j,{type:"parseTile",isSymbolTile:n.isSymbolTile,zoom:n.tileZoom}):j()}),this.loaded=this.loaded||{},this.loaded[i]=p})}reloadTile(n,e){const i=this.loaded,a=n.uid,u=this;if(i&&i[a]){const p=i[a];p.showCollisionBoxes=n.showCollisionBoxes,p.enableTerrain=!!n.enableTerrain,p.projection=n.projection,p.tileTransform=kc(n.tileID.canonical,n.projection);const _=(w,I)=>{const S=p.reloadCallback;S&&(delete p.reloadCallback,p.parse(p.vectorTile,u.layerIndex,this.availableImages,u.actor,S)),e(w,I)};"parsing"===p.status?p.reloadCallback=_:"done"===p.status&&(p.vectorTile?p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,_):_())}}abortTile(n,e){const i=n.uid,a=this.loading[i];a&&(a.abort&&a.abort(),delete this.loading[i]),e()}removeTile(n,e){const i=this.loaded,a=n.uid;i&&i[a]&&delete i[a],e()}},s.WritingMode=va,s.ZoomDependentExpression=fo,s.add=$a,s.addDynamicAttributes=nh,s.adjoint=function(n,e){var i=e[0],a=e[1],u=e[2],p=e[3],_=e[4],w=e[5],I=e[6],S=e[7],B=e[8];return n[0]=_*B-w*S,n[1]=u*S-a*B,n[2]=a*w-u*_,n[3]=w*I-p*B,n[4]=i*B-u*I,n[5]=u*p-i*w,n[6]=p*S-_*I,n[7]=a*I-i*S,n[8]=i*_-a*p,n},s.asyncAll=qt,s.bezier=Pe,s.bindAll=Rt,s.boundsAttributes=oh,s.bufferConvexPolygon=function(n,e){const i=[];for(let a=0;avt&&(n.getActor().send("enforceCacheSizeLimit",wt),Fi=0)},s.calculateGlobeLabelMatrix=function(n,e){const{x:i,y:a}=n.point,u=_m(i,a,n.worldSize/n._pixelsPerMercatorPixel,0,0);return eu(u,u,Ld(Ro(e)))},s.calculateGlobeMatrix=function(n){const{x:e,y:i}=n.point,{lng:a,lat:u}=n._center;return _m(e,i,n.worldSize,a,u)},s.calculateGlobeMercatorMatrix=function(n){const e=n.pixelsPerMeter,i=e/dl(1,n.center.lat),a=ga(new Float64Array(16));return Dd(a,a,[n.point.x,n.point.y,0]),Va(a,a,[i,i,e]),Float32Array.from(a)},s.circumferenceAtLatitude=$u,s.clamp=Ye,s.clearTileCache=function(n){if(!er())return;const e=J.caches.delete(Wt);n&&e.catch(n).then(()=>n())},s.clipLine=pg,s.clone=function(n){var e=new ma(16);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],e},s.clone$1=Jt,s.collisionCircleLayout=Xh,s.config=E,s.conjugate=function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n},s.create=function(){var n=new ma(16);return ma!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n},s.create$1=Sf,s.createExpression=ss,s.createLayout=zt,s.createStyleLayer=function(n){return"custom"===n.type?new uy(n):new dy[n.type](n)},s.cross=Md,s.degToRad=Le,s.distance=function(n,e){return Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2])},s.div=function(n,e,i){return n[0]=e[0]/i[0],n[1]=e[1]/i[1],n[2]=e[2]/i[2],n},s.dot=Ga,s.earthRadius=Rl,s.ease=Ae,s.easeCubicInOut=Te,s.ecefToLatLng=function([n,e,i]){const a=Math.hypot(n,e,i),u=Math.atan2(n,i),p=.5*Math.PI-Math.acos(-e/a);return new $r(ye(u),ye(p))},s.emitValidationErrors=Ru,s.endsWith=Qt,s.enforceCacheSizeLimit=function(n){lr(),ln&&ln.then(e=>{e.keys().then(i=>{for(let a=0;ap&&(a+=(n[u]-p)*(n[u]-p)),e[u]0){const te=180/a;Dh(X,X,[te/S+1,0,0,0,te/B+1,0,-.5*te/j,.5*te/H,1])}return X[2]=I,X[5]=n.x,X[8]=n.y,X},s.getImage=Xe,s.getJSON=function(n,e){return yn(De(n,{type:"json"}),e)},s.getLatitudinalLod=function(n){const e=Is-5;n=Ye(n,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(Le(n))),3);return Math.round(i*(Pd.length-1))},s.getMapSessionAPI=Ui,s.getPerformanceMeasurement=ti,s.getProjection=wg,s.getRTLTextPluginStatus=T,s.getReferrer=qn,s.getTilePoint=function(n,{x:e,y:i},a=0){return new ue(((e-a)*n.scale-n.x)*Ii,(i*n.scale-n.y)*Ii)},s.getTileVec3=function(n,e,i=0){return Bu(((e.x-i)*n.scale-n.x)*Ii,(e.y*n.scale-n.y)*Ii,bm(e.z,e.y))},s.getVideo=function(n,e){const i=J.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let a=0;a{}}},s.globeCenterToScreenPoint=function(n){const e=[0,0,0],i=ga(new Float64Array(16));return eu(i,n.pixelMatrix,n.globeMatrix),Yo(e,e,i),new ue(e[0],e[1])},s.globeDenormalizeECEF=Ld,s.globeECEFOrigin=function(n,e){const i=[0,0,0];return Yo(i,i,su(Ro(e.canonical))),Yo(i,i,n),i},s.globeMetersToEcef=Vs,s.globeNormalizeECEF=su,s.globePixelsToTileUnits=function(n,e){return Ii/(512*Math.pow(2,n))*Rh(Ro(e))},s.globePoleMatrixForTile=function(n,e,i){const a=ga(new Float64Array(16)),u=(e/(1<0;return 0===a&&!u&&!_&&p},s.identity=ga,s.identity$1=Sd,s.invert=Ih,s.isFullscreen=function(){return!!J.document.fullscreenElement||!!J.document.webkitFullscreenElement},s.isLngLatBehindGlobe=jf,s.isMapAuthenticated=function(n){return Lt.has(n)},s.isMapboxURL=Ct,s.isSafariWithAntialiasingBug=function(n){const e=n.navigator?n.navigator.userAgent:null;return!!gn(n)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=Fs,s.latLngToECEF=ju,s.len=Ev,s.length=Id,s.length$1=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},s.lngFromMercatorX=Oa,s.loadVectorTile=Ng,s.makeRequest=yn,s.mapValue=function(n,e,i,a,u){return Ye((n-e)/(i-e)*(u-a)+a,a,u)},s.mercatorScale=Fd,s.mercatorXfromLng=Ll,s.mercatorYfromLat=kl,s.mercatorZfromAltitude=dl,s.mul=__,s.mul$1=Cv,s.multiply=eu,s.multiply$1=Dh,s.multiply$2=fm,s.nextPowerOfTwo=St,s.normalize=ea,s.normalize$1=pm,s.normalize$2=x_,s.number=ki,s.ortho=function(n,e,i,a,u,p,_){var w=1/(e-i),I=1/(a-u),S=1/(p-_);return n[0]=-2*w,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*I,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*S,n[11]=0,n[12]=(e+i)*w,n[13]=(u+a)*I,n[14]=(_+p)*S,n[15]=1,n},s.pbf=Qh,s.perspective=function(n,e,i,a,u){var p,_=1/Math.tan(e/2);return n[0]=_/i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=_,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=u&&u!==1/0?(n[10]=(u+a)*(p=1/(a-u)),n[14]=2*u*a*p):(n[10]=-1,n[14]=-2*a),n},s.pick=function(n,e){const i={};for(let a=0;a0&&i[0]<=n.width&&i[1]>0&&i[1]<=n.height&&!jf(n,new $r(n.center.lat,90)),a[0]>0&&a[0]<=n.width&&a[1]>0&&a[1]<=n.height&&!jf(n,new $r(n.center.lat,-90))]},s.polygonContainsPoint=Bl,s.polygonIntersectsBox=Xf,s.polygonIntersectsPolygon=qf,s.polygonizeBounds=function(n,e,i=0,a=!0){const u=new ue(i,i),p=n.sub(u),_=e.add(u),w=[p,new ue(_.x,p.y),_,new ue(p.x,_.y)];return a&&w.push(p.clone()),w},s.posAttributes=Ec,s.postMapLoadEvent=Kn,s.postPerformanceEvent=wi,s.postTurnstileEvent=Pt,s.potpack=_p,s.prevPowerOfTwo=function(n){return n<=1?1:Math.pow(2,Math.floor(Math.log(n)/Math.LN2))},s.radToDeg=ye,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(n){return n({pluginStatus:f,pluginURL:r}),b.on("pluginStateChange",n),n},s.removeAuthState=function(n){Lt.delete(n)},s.renderColorRamp=Wu,s.resample=wm,s.rotateX=tu,s.rotateX$1=Of,s.rotateY=Mh,s.rotateY$1=Rf,s.rotateZ=function(n,e,i){var a=Math.sin(i),u=Math.cos(i),p=e[0],_=e[1],w=e[2],I=e[3],S=e[4],B=e[5],j=e[6],H=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=p*u+S*a,n[1]=_*u+B*a,n[2]=w*u+j*a,n[3]=I*u+H*a,n[4]=S*u-p*a,n[5]=B*u-_*a,n[6]=j*u-w*a,n[7]=H*u-I*a,n},s.rotateZ$1=function(n,e,i){i*=.5;var a=e[0],u=e[1],p=e[2],_=e[3],w=Math.sin(i),I=Math.cos(i);return n[0]=a*I+u*w,n[1]=u*I-a*w,n[2]=p*I+_*w,n[3]=_*I-p*w,n},s.scale=Va,s.scale$1=v_,s.scale$2=_a,s.scaleAndAdd=Ph,s.set=function(n,e,i,a){return n[0]=e,n[1]=i,n[2]=a,n},s.setCacheLimits=function(n,e){wt=n,vt=e},s.setColumn=function(n,e,i){n[4*e+0]=i[0],n[4*e+1]=i[1],n[4*e+2]=i[2],n[4*e+3]=i[3]},s.setRTLTextPlugin=function(n,e,i=!1){if(f===xn||f===Oi||f===ar)throw new Error("setRTLTextPlugin cannot be called multiple times.");r=ir.resolveURL(n),f=xn,po=e,m(),i||O()},s.smoothstep=_t,s.spec=Kt,s.squaredLength=function(n){var e=n[0],i=n[1],a=n[2];return e*e+i*i+a*a},s.storeAuthState=function(n,e){e?Lt.add(n):Lt.delete(n)},s.sub=Pl,s.subtract=Ah,s.symbolSize=fp,s.tileAABB=function(n,e,i,a,u,p,_,w,I){if("globe"===I.name)return function C_(n,e,i){const a=e/n.worldSize,u=n.globeMatrix;if(i.z<=1){const nn=Ro(i).getCorners();return Uf(nn,u,a),ta.fromPoints(nn)}const p=Rd(i),_=Zf(p);Uf(_,u,a);const w=Number.MAX_VALUE,I=[-w,-w,-w],S=[w,w,w];if(p.contains(n.center)){for(const Un of _)Nu(S,S,Un),Sh(I,I,Un);I[2]=0;const nn=n.point,Tn=[nn.x*a,nn.y*a,0];return Nu(S,S,Tn),Sh(I,I,Tn),new ta(S,I)}const B=[u[12]*a,u[13]*a,u[14]*a],j=p.getCenter(),H=Ye(n.center.lat,-Is,Is),X=Ye(j.lat,-Is,Is),te=Ll(n.center.lng),de=kl(H);let ke=te-Ll(j.lng);const tt=de-kl(X);ke>.5?ke-=1:ke<-.5&&(ke+=1);let mt=0;Math.abs(ke)>Math.abs(tt)?mt=ke>=0?1:3:(mt=tt>=0?0:2,Ph(B,B,[u[4]*a,u[5]*a,u[6]*a],-Math.sin(Le(tt>=0?p.getSouth():p.getNorth()))*Ha));const Qe=_[mt],ut=_[(mt+1)%4],xt=new mm(Qe,ut,B),bt=[Od(xt,0)||Qe[0],Od(xt,1)||Qe[1],Od(xt,2)||Qe[2]],tn=Ol(n.zoom);if(tn>0){const nn=function({x:Un,y:fn,z:Pn},On,Bn,Hn,wn){const si=1/(1<.5?Mi=-1:Ji<-.5&&(Mi=1),fi=((fi+Mi)*On-(Hn*=On))*Bn+Hn,ci=((ci+Mi)*On-Hn)*Bn+Hn,Yi=(Yi*On-(wn*=On))*Bn+wn,Qn=(Qn*On-wn)*Bn+wn,[[fi,Qn,0],[ci,Qn,0],[ci,Yi,0],[fi,Yi,0]]}(i,e,n._pixelsPerMercatorPixel,te,de);for(let Un=0;Un<_.length;Un++)ul(_[Un],nn[Un],tn);const Tn=$a([],nn[mt],nn[(mt+1)%4]);_a(Tn,Tn,.5),ul(bt,Tn,tn)}for(const nn of _)Nu(S,S,nn),Sh(I,I,nn);return S[2]=Math.min(Qe[2],ut[2]),Nu(S,S,bt),Sh(I,I,bt),new ta(S,I)}(n,e,new gu(i,a,u));const S=kc({z:i,x:a,y:u},I);return new ta([(p+S.x/S.scale)*e,e*(S.y/S.scale),_],[(p+S.x2/S.scale)*e,e*(S.y2/S.scale),w])},s.tileCornersToBounds=Rd,s.tileTransform=kc,s.transformMat3=function(n,e,i){var a=e[0],u=e[1],p=e[2];return n[0]=a*i[0]+u*i[3]+p*i[6],n[1]=a*i[1]+u*i[4]+p*i[7],n[2]=a*i[2]+u*i[5]+p*i[8],n},s.transformMat4=Yo,s.transformMat4$1=iu,s.transformQuat=y_,s.transitionTileAABBinECEF=zf,s.translate=Dd,s.transpose=function(n,e){if(n===e){var i=e[1],a=e[2],u=e[5];n[1]=e[3],n[2]=e[6],n[3]=i,n[5]=e[7],n[6]=a,n[7]=u}else n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8];return n},s.triggerPluginCompletionEvent=c,s.uniqueId=Re,s.updateGlobeVertexNormal=function(n,e,i,a,u){const p=5*e+2;n.float32[p+0]=i,n.float32[p+1]=a,n.float32[p+2]=u},s.validateCustomStyleLayer=function(n){const e=[],i=n.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===n.render&&e.push({message:`layers.${i}: missing required method "render"`}),n.renderingMode&&"2d"!==n.renderingMode&&"3d"!==n.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},s.validateFilter=n=>Ks(wr(n)),s.validateFog=n=>Ks(gs(n)),s.validateLayer=n=>Ks(Dl(n)),s.validateLight=n=>Ks(yh(n)),s.validateSource=n=>Ks(vc(n)),s.validateStyle=pa,s.validateTerrain=n=>Ks(qc(n)),s.values=Ht,s.vectorTile=Kl,s.version=ie,s.warnOnce=dt,s.window=J,s.wrap=hn}),h(0,function(s){function J(nt){if("number"==typeof nt||"boolean"==typeof nt||"string"==typeof nt||null==nt)return JSON.stringify(nt);if(Array.isArray(nt)){let ve="[";for(const Xe of nt)ve+=`${J(Xe)},`;return`${ve}]`}let ge="{";for(const ve of Object.keys(nt).sort())ge+=`${ve}:${J(nt[ve])},`;return`${ge}}`}function ie(nt){let ge="";for(const ve of s.refProperties)ge+=`/${J(nt[ve])}`;return ge}class Y{constructor(ge){this.keyCache={},ge&&this.replace(ge)}replace(ge){this._layerConfigs={},this._layers={},this.update(ge,[])}update(ge,ve){for(const ft of ge)this._layerConfigs[ft.id]=ft,(this._layers[ft.id]=s.createStyleLayer(ft)).compileFilter(),this.keyCache[ft.id]&&delete this.keyCache[ft.id];for(const ft of ve)delete this.keyCache[ft],delete this._layerConfigs[ft],delete this._layers[ft];this.familiesBySource={};const Xe=function(ft,Ct){const Bt={};for(let Et=0;Etthis._layers[zn.id]),Bt=Ct[0];if("none"===Bt.visibility)continue;const jt=Bt.source||"";let Et=this.familiesBySource[jt];Et||(Et=this.familiesBySource[jt]={});const Xt=Bt.sourceLayer||"_geojsonTileLayer";let Sn=Et[Xt];Sn||(Sn=Et[Xt]=[]),Sn.push(Ct)}}}class E{loadTile(ge,ve){const{uid:Xe,encoding:ft,rawImageData:Ct,padding:Bt,buildQuadTree:jt}=ge,Et=s.window.ImageBitmap&&Ct instanceof s.window.ImageBitmap?this.getImageData(Ct,Bt):Ct;ve(null,new s.DEMData(Xe,Et,ft,Bt<1,jt))}getImageData(ge,ve){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(ge.width,ge.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=ge.width,this.offscreenCanvas.height=ge.height,this.offscreenCanvasContext.drawImage(ge,0,0,ge.width,ge.height);const Xe=this.offscreenCanvasContext.getImageData(-ve,-ve,ge.width+2*ve,ge.height+2*ve);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),Xe}}function Ne(nt,ge){if(0!==nt.length){me(nt[0],ge);for(var ve=1;ve=Math.abs(jt)?ve-Et+jt:jt-Et+ve,ve=Et}ve+Xe>=0!=!!ge&&nt.reverse()}var he=s.getDefaultExportFromCjs(function nt(ge,ve){var Xe,ft=ge&&ge.type;if("FeatureCollection"===ft)for(Xe=0;Xe>31}function gt(nt,ge){for(var ve=nt.loadGeometry(),Xe=nt.type,ft=0,Ct=0,Bt=ve.length,jt=0;jtnt},Ye=Math.fround||(_t=new Float32Array(1),nt=>(_t[0]=+nt,_t[0]));var _t;const hn=3,qt=5,Ht=6;class De{constructor(ge){this.options=Object.assign(Object.create(Ae),ge),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ge){const{log:ve,minZoom:Xe,maxZoom:ft}=this.options;ve&&console.time("total time");const Ct=`prepare ${ge.length} points`;ve&&console.time(Ct),this.points=ge;const Bt=[];for(let Et=0;Et=Xe;Et--){const Xt=+Date.now();jt=this.trees[Et]=this._createTree(this._cluster(jt,Et)),ve&&console.log("z%d: %d clusters in %dms",Et,jt.numItems,+Date.now()-Xt)}return ve&&console.timeEnd("total time"),this}getClusters(ge,ve){let Xe=((ge[0]+180)%360+360)%360-180;const ft=Math.max(-90,Math.min(90,ge[1]));let Ct=180===ge[2]?180:((ge[2]+180)%360+360)%360-180;const Bt=Math.max(-90,Math.min(90,ge[3]));if(ge[2]-ge[0]>=360)Xe=-180,Ct=180;else if(Xe>Ct){const zn=this.getClusters([Xe,ft,180,Bt],ve),pe=this.getClusters([-180,ft,Ct,Bt],ve);return zn.concat(pe)}const jt=this.trees[this._limitZoom(ve)],Et=jt.range(Fe(Xe),St(Bt),Fe(Ct),St(ft)),Xt=jt.data,Sn=[];for(const zn of Et){const pe=this.stride*zn;Sn.push(Xt[pe+qt]>1?Je(Xt,pe,this.clusterProps):this.points[Xt[pe+hn]])}return Sn}getChildren(ge){const ve=this._getOriginId(ge),Xe=this._getOriginZoom(ge),ft="No cluster with the specified id.",Ct=this.trees[Xe];if(!Ct)throw new Error(ft);const Bt=Ct.data;if(ve*this.stride>=Bt.length)throw new Error(ft);const jt=this.options.radius/(this.options.extent*Math.pow(2,Xe-1)),Et=Ct.within(Bt[ve*this.stride],Bt[ve*this.stride+1],jt),Xt=[];for(const Sn of Et){const zn=Sn*this.stride;Bt[zn+4]===ge&&Xt.push(Bt[zn+qt]>1?Je(Bt,zn,this.clusterProps):this.points[Bt[zn+hn]])}if(0===Xt.length)throw new Error(ft);return Xt}getLeaves(ge,ve,Xe){const ft=[];return this._appendLeaves(ft,ge,ve=ve||10,Xe=Xe||0,0),ft}getTile(ge,ve,Xe){const ft=this.trees[this._limitZoom(ge)],Ct=Math.pow(2,ge),{extent:Bt,radius:jt}=this.options,Et=jt/Bt,Xt=(Xe-Et)/Ct,Sn=(Xe+1+Et)/Ct,zn={features:[]};return this._addTileFeatures(ft.range((ve-Et)/Ct,Xt,(ve+1+Et)/Ct,Sn),ft.data,ve,Xe,Ct,zn),0===ve&&this._addTileFeatures(ft.range(1-Et/Ct,Xt,1,Sn),ft.data,Ct,Xe,Ct,zn),ve===Ct-1&&this._addTileFeatures(ft.range(0,Xt,Et/Ct,Sn),ft.data,-1,Xe,Ct,zn),zn.features.length?zn:null}getClusterExpansionZoom(ge){let ve=this._getOriginZoom(ge)-1;for(;ve<=this.options.maxZoom;){const Xe=this.getChildren(ge);if(ve++,1!==Xe.length)break;ge=Xe[0].properties.cluster_id}return ve}_appendLeaves(ge,ve,Xe,ft,Ct){const Bt=this.getChildren(ve);for(const jt of Bt){const Et=jt.properties;if(Et&&Et.cluster?Ct+Et.point_count<=ft?Ct+=Et.point_count:Ct=this._appendLeaves(ge,Et.cluster_id,Xe,ft,Ct):Ct1;let Sn,zn,pe;if(Xt)Sn=Re(ve,Et,this.clusterProps),zn=ve[Et],pe=ve[Et+1];else{const be=this.points[ve[Et+hn]];Sn=be.properties;const[Ze,Pt]=be.geometry.coordinates;zn=Fe(Ze),pe=St(Pt)}const ze={type:1,geometry:[[Math.round(this.options.extent*(zn*Ct-Xe)),Math.round(this.options.extent*(pe*Ct-ft))]],tags:Sn};let xe;xe=Xt||this.options.generateId?ve[Et+hn]:this.points[ve[Et+hn]].id,void 0!==xe&&(ze.id=xe),Bt.features.push(ze)}}_limitZoom(ge){return Math.max(this.options.minZoom,Math.min(Math.floor(+ge),this.options.maxZoom+1))}_cluster(ge,ve){const{radius:Xe,extent:ft,reduce:Ct,minPoints:Bt}=this.options,jt=Xe/(ft*Math.pow(2,ve)),Et=ge.data,Xt=[],Sn=this.stride;for(let zn=0;znve&&(Ze+=Et[bn+qt])}if(Ze>be&&Ze>=Bt){let Pt,bn=pe*be,Kn=ze*be,Ci=-1;const wi=((zn/Sn|0)<<5)+(ve+1)+this.points.length;for(const cr of xe){const Ui=cr*Sn;if(Et[Ui+2]<=ve)continue;Et[Ui+2]=ve;const Lt=Et[Ui+qt];bn+=Et[Ui]*Lt,Kn+=Et[Ui+1]*Lt,Et[Ui+4]=wi,Ct&&(Pt||(Pt=this._map(Et,zn,!0),Ci=this.clusterProps.length,this.clusterProps.push(Pt)),Ct(Pt,this._map(Et,Ui)))}Et[zn+4]=wi,Xt.push(bn/Ze,Kn/Ze,1/0,wi,-1,Ze),Ct&&Xt.push(Ci)}else{for(let Pt=0;Pt1)for(const Pt of xe){const bn=Pt*Sn;if(!(Et[bn+2]<=ve)){Et[bn+2]=ve;for(let Kn=0;Kn>5}_getOriginZoom(ge){return(ge-this.points.length)%32}_map(ge,ve,Xe){if(ge[ve+qt]>1){const Bt=this.clusterProps[ge[ve+Ht]];return Xe?Object.assign({},Bt):Bt}const ft=this.points[ge[ve+hn]].properties,Ct=this.options.map(ft);return Xe&&Ct===ft?Object.assign({},Ct):Ct}}function Je(nt,ge,ve){return{type:"Feature",id:nt[ge+hn],properties:Re(nt,ge,ve),geometry:{type:"Point",coordinates:[(Xe=nt[ge],360*(Xe-.5)),Ce(nt[ge+1])]}};var Xe}function Re(nt,ge,ve){const Xe=nt[ge+qt],ft=Xe>=1e4?`${Math.round(Xe/1e3)}k`:Xe>=1e3?Math.round(Xe/100)/10+"k":Xe,Ct=nt[ge+Ht],Bt=-1===Ct?{}:Object.assign({},ve[Ct]);return Object.assign(Bt,{cluster:!0,cluster_id:nt[ge+hn],point_count:Xe,point_count_abbreviated:ft})}function Fe(nt){return nt/360+.5}function St(nt){const ge=Math.sin(nt*Math.PI/180),ve=.5-.25*Math.log((1+ge)/(1-ge))/Math.PI;return ve<0?0:ve>1?1:ve}function Ce(nt){const ge=(180-360*nt)*Math.PI/180;return 360*Math.atan(Math.exp(ge))/Math.PI-90}function Rt(nt,ge,ve,Xe){for(var ft,Ct=Xe,Bt=ve-ge>>1,jt=ve-ge,Et=nt[ge],Xt=nt[ge+1],Sn=nt[ve],zn=nt[ve+1],pe=ge+3;peCt)ft=pe,Ct=ze;else if(ze===Ct){var xe=Math.abs(pe-Bt);xeXe&&(ft-ge>3&&Rt(nt,ge,ft,Xe),nt[ft+2]=Ct,ve-ft>3&&Rt(nt,ft,ve,Xe))}function Qt(nt,ge,ve,Xe,ft,Ct){var Bt=ft-ve,jt=Ct-Xe;if(0!==Bt||0!==jt){var Et=((nt-ve)*Bt+(ge-Xe)*jt)/(Bt*Bt+jt*jt);Et>1?(ve=ft,Xe=Ct):Et>0&&(ve+=Bt*Et,Xe+=jt*Et)}return(Bt=nt-ve)*Bt+(jt=ge-Xe)*jt}function Gt(nt,ge,ve,Xe){var ft={id:void 0===nt?null:nt,type:ge,geometry:ve,tags:Xe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Ct){var Bt=Ct.geometry,jt=Ct.type;if("Point"===jt||"MultiPoint"===jt||"LineString"===jt)Zt(Ct,Bt);else if("Polygon"===jt||"MultiLineString"===jt)for(var Et=0;Et0&&(Bt+=Xe?(ft*Xt-Et*Ct)/2:Math.sqrt(Math.pow(Et-ft,2)+Math.pow(Xt-Ct,2))),ft=Et,Ct=Xt}var Sn=ge.length-3;ge[2]=1,Rt(ge,0,Sn,ve),ge[Sn+2]=1,ge.size=Math.abs(Bt),ge.start=0,ge.end=ge.size}function Ot(nt,ge,ve,Xe){for(var ft=0;ft1?1:ve}function Ut(nt,ge,ve,Xe,ft,Ct,Bt,jt){if(Xe/=ge,Ct>=(ve/=ge)&&Bt=Xe)return null;for(var Et=[],Xt=0;Xt=ve&&xe=Xe)){var be=[];if("Point"===pe||"MultiPoint"===pe)ii(zn,be,ve,Xe,ft);else if("LineString"===pe)gn(zn,be,ve,Xe,ft,!1,jt.lineMetrics);else if("MultiLineString"===pe)Jn(zn,be,ve,Xe,ft,!1);else if("Polygon"===pe)Jn(zn,be,ve,Xe,ft,!0);else if("MultiPolygon"===pe)for(var Ze=0;Ze=ve&&Bt<=Xe&&(ge.push(nt[Ct]),ge.push(nt[Ct+1]),ge.push(nt[Ct+2]))}}function gn(nt,ge,ve,Xe,ft,Ct,Bt){for(var jt,Et,Xt=Ft(nt),Sn=0===ft?wt:vt,zn=nt.start,pe=0;peve&&(Et=Sn(Xt,ze,xe,Ze,Pt,ve),Bt&&(Xt.start=zn+jt*Et)):bn>Xe?Kn=ve&&(Et=Sn(Xt,ze,xe,Ze,Pt,ve),Ci=!0),Kn>Xe&&bn<=Xe&&(Et=Sn(Xt,ze,xe,Ze,Pt,Xe),Ci=!0),!Ct&&Ci&&(Bt&&(Xt.end=zn+jt*Et),ge.push(Xt),Xt=Ft(nt)),Bt&&(zn+=jt)}var wi=nt.length-3;ze=nt[wi],xe=nt[wi+1],be=nt[wi+2],(bn=0===ft?ze:xe)>=ve&&bn<=Xe&&Wt(Xt,ze,xe,be),wi=Xt.length-3,Ct&&wi>=3&&(Xt[wi]!==Xt[0]||Xt[wi+1]!==Xt[1])&&Wt(Xt,Xt[0],Xt[1],Xt[2]),Xt.length&&ge.push(Xt)}function Ft(nt){var ge=[];return ge.size=nt.size,ge.start=nt.start,ge.end=nt.end,ge}function Jn(nt,ge,ve,Xe,ft,Ct){for(var Bt=0;BtBt.maxX&&(Bt.maxX=Sn),zn>Bt.maxY&&(Bt.maxY=zn)}return Bt}function Fi(nt,ge,ve,Xe){var ft=ge.geometry,Ct=ge.type,Bt=[];if("Point"===Ct||"MultiPoint"===Ct)for(var jt=0;jt0&&ge.size<(ft?Bt:Xe))ve.numPoints+=ge.length/3;else{for(var jt=[],Et=0;EtBt)&&(ve.numSimplified++,jt.push(ge[Et]),jt.push(ge[Et+1])),ve.numPoints++;ft&&function(Xt,Sn){for(var zn=0,pe=0,ze=Xt.length,xe=ze-2;pe0===Sn)for(pe=0,ze=Xt.length;pe24)throw new Error("maxZoom should be in the 0-24 range");if(ge.promoteId&&ge.generateId)throw new Error("promoteId and generateId cannot be used together.");var ft,Ct,Bt,jt,Et,Xt,Xe=function(ft,Ct){var Bt=[];if("FeatureCollection"===ft.type)for(var jt=0;jt1&&console.time("creation"),pe=this.tiles[zn]=mi(nt,ge,ve,Xe,Et),this.tileCoords.push({z:ge,x:ve,y:Xe}),Xt)){Xt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ge,ve,Xe,pe.numFeatures,pe.numPoints,pe.numSimplified),console.timeEnd("creation"));var ze="z"+ge;this.stats[ze]=(this.stats[ze]||0)+1,this.total++}if(pe.source=nt,ft){if(ge===Et.maxZoom||ge===ft)continue;var xe=1<1&&console.time("clipping");var be,Ze,Pt,bn,Kn,Ci,wi=.5*Et.buffer/Et.extent,cr=.5-wi,Ui=.5+wi,Lt=1+wi;be=Ze=Pt=bn=null,Kn=Ut(nt,Sn,ve-wi,ve+Ui,0,pe.minX,pe.maxX,Et),Ci=Ut(nt,Sn,ve+cr,ve+Lt,0,pe.minX,pe.maxX,Et),nt=null,Kn&&(be=Ut(Kn,Sn,Xe-wi,Xe+Ui,1,pe.minY,pe.maxY,Et),Ze=Ut(Kn,Sn,Xe+cr,Xe+Lt,1,pe.minY,pe.maxY,Et),Kn=null),Ci&&(Pt=Ut(Ci,Sn,Xe-wi,Xe+Ui,1,pe.minY,pe.maxY,Et),bn=Ut(Ci,Sn,Xe+cr,Xe+Lt,1,pe.minY,pe.maxY,Et),Ci=null),Xt>1&&console.timeEnd("clipping"),jt.push(be||[],ge+1,2*ve,2*Xe),jt.push(Ze||[],ge+1,2*ve,2*Xe+1),jt.push(Pt||[],ge+1,2*ve+1,2*Xe),jt.push(bn||[],ge+1,2*ve+1,2*Xe+1)}}},Mn.prototype.getTile=function(nt,ge,ve){var Xe=this.options,ft=Xe.extent,Ct=Xe.debug;if(nt<0||nt>24)return null;var Bt=1<1&&console.log("drilling down to z%d-%d-%d",nt,ge,ve);for(var Et,Xt=nt,Sn=ge,zn=ve;!Et&&Xt>0;)Xt--,Sn=Math.floor(Sn/2),zn=Math.floor(zn/2),Et=this.tiles[qn(Xt,Sn,zn)];return Et&&Et.source?(Ct>1&&console.log("found parent tile z%d-%d-%d",Xt,Sn,zn),Ct>1&&console.time("drilling down"),this.splitTile(Et.source,Xt,Sn,zn,nt,ge,ve),Ct>1&&console.timeEnd("drilling down"),this.tiles[jt]?er(this.tiles[jt],ft):null):null};class _n extends s.VectorTileWorkerSource{constructor(ge,ve,Xe,ft,Ct){super(ge,ve,Xe,ft,yn),Ct&&(this.loadGeoJSON=Ct)}loadData(ge,ve){const Xe=ge&&ge.request,ft=Xe&&Xe.collectResourceTiming;this.loadGeoJSON(ge,(Ct,Bt)=>{if(Ct||!Bt)return ve(Ct);if("object"!=typeof Bt)return ve(new Error(`Input data given to '${ge.source}' is not a valid GeoJSON object.`));{he(Bt,!0);try{if(ge.filter){const Et=s.createExpression(ge.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===Et.result)throw new Error(Et.value.map(Sn=>`${Sn.key}: ${Sn.message}`).join(", "));Bt={type:"FeatureCollection",features:Bt.features.filter(Sn=>Et.value.evaluate({zoom:0},Sn))}}this._geoJSONIndex=ge.cluster?new De(function({superclusterOptions:Et,clusterProperties:Xt}){if(!Xt||!Et)return Et;const Sn={},zn={},pe={accumulated:null,zoom:0},ze={properties:null},xe=Object.keys(Xt);for(const be of xe){const[Ze,Pt]=Xt[be],bn=s.createExpression(Pt),Kn=s.createExpression("string"==typeof Ze?[Ze,["accumulated"],["get",be]]:Ze);Sn[be]=bn.value,zn[be]=Kn.value}return Et.map=be=>{ze.properties=be;const Ze={};for(const Pt of xe)Ze[Pt]=Sn[Pt].evaluate(pe,ze);return Ze},Et.reduce=(be,Ze)=>{ze.properties=Ze;for(const Pt of xe)pe.accumulated=be[Pt],be[Pt]=zn[Pt].evaluate(pe,ze)},Et}(ge)).load(Bt.features):new Mn(Et=Bt,ge.geojsonVtOptions)}catch(Et){return ve(Et)}this.loaded={};const jt={};if(ft){const Et=s.getPerformanceMeasurement(Xe);Et&&(jt.resourceTiming={},jt.resourceTiming[ge.source]=JSON.parse(JSON.stringify(Et)))}ve(null,jt)}var Et})}reloadTile(ge,ve){const Xe=this.loaded;return Xe&&Xe[ge.uid]?super.reloadTile(ge,ve):this.loadTile(ge,ve)}loadGeoJSON(ge,ve){if(ge.request)s.getJSON(ge.request,ve);else{if("string"!=typeof ge.data)return ve(new Error(`Input data given to '${ge.source}' is not a valid GeoJSON object.`));try{return ve(null,JSON.parse(ge.data))}catch{return ve(new Error(`Input data given to '${ge.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(ge,ve){try{ve(null,this._geoJSONIndex.getClusterExpansionZoom(ge.clusterId))}catch(Xe){ve(Xe)}}getClusterChildren(ge,ve){try{ve(null,this._geoJSONIndex.getChildren(ge.clusterId))}catch(Xe){ve(Xe)}}getClusterLeaves(ge,ve){try{ve(null,this._geoJSONIndex.getLeaves(ge.clusterId,ge.limit,ge.offset))}catch(Xe){ve(Xe)}}}class Hi{constructor(ge){this.self=ge,this.actor=new s.Actor(ge,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:_n},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(ve,Xe)=>{if(this.workerSourceTypes[ve])throw new Error(`Worker source with name "${ve}" already registered.`);this.workerSourceTypes[ve]=Xe},this.self.registerRTLTextPlugin=ve=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=ve.applyArabicShaping,s.plugin.processBidirectionalText=ve.processBidirectionalText,s.plugin.processStyledBidirectionalText=ve.processStyledBidirectionalText}}clearCaches(ge,ve,Xe){delete this.layerIndexes[ge],delete this.availableImages[ge],delete this.workerSources[ge],delete this.demWorkerSources[ge],Xe()}checkIfReady(ge,ve,Xe){Xe()}setReferrer(ge,ve){this.referrer=ve}spriteLoaded(ge,ve){this.isSpriteLoaded[ge]=ve;for(const Xe in this.workerSources[ge]){const ft=this.workerSources[ge][Xe];for(const Ct in ft)ft[Ct]instanceof s.VectorTileWorkerSource&&(ft[Ct].isSpriteLoaded=ve,ft[Ct].fire(new s.Event("isSpriteLoaded")))}}setImages(ge,ve,Xe){this.availableImages[ge]=ve;for(const ft in this.workerSources[ge]){const Ct=this.workerSources[ge][ft];for(const Bt in Ct)Ct[Bt].availableImages=ve}Xe()}enableTerrain(ge,ve,Xe){this.terrain=ve,Xe()}setProjection(ge,ve){this.projections[ge]=s.getProjection(ve)}setLayers(ge,ve,Xe){this.getLayerIndex(ge).replace(ve),Xe()}updateLayers(ge,ve,Xe){this.getLayerIndex(ge).update(ve.layers,ve.removedIds),Xe()}loadTile(ge,ve,Xe){const ft=this.enableTerrain?s.extend({enableTerrain:this.terrain},ve):ve;ft.projection=this.projections[ge]||this.defaultProjection,this.getWorkerSource(ge,ve.type,ve.source).loadTile(ft,Xe)}loadDEMTile(ge,ve,Xe){const ft=this.enableTerrain?s.extend({buildQuadTree:this.terrain},ve):ve;this.getDEMWorkerSource(ge,ve.source).loadTile(ft,Xe)}reloadTile(ge,ve,Xe){const ft=this.enableTerrain?s.extend({enableTerrain:this.terrain},ve):ve;ft.projection=this.projections[ge]||this.defaultProjection,this.getWorkerSource(ge,ve.type,ve.source).reloadTile(ft,Xe)}abortTile(ge,ve,Xe){this.getWorkerSource(ge,ve.type,ve.source).abortTile(ve,Xe)}removeTile(ge,ve,Xe){this.getWorkerSource(ge,ve.type,ve.source).removeTile(ve,Xe)}removeSource(ge,ve,Xe){if(!this.workerSources[ge]||!this.workerSources[ge][ve.type]||!this.workerSources[ge][ve.type][ve.source])return;const ft=this.workerSources[ge][ve.type][ve.source];delete this.workerSources[ge][ve.type][ve.source],void 0!==ft.removeSource?ft.removeSource(ve,Xe):Xe()}loadWorkerSource(ge,ve,Xe){try{this.self.importScripts(ve.url),Xe()}catch(ft){Xe(ft.toString())}}syncRTLPluginState(ge,ve,Xe){try{s.plugin.setState(ve);const ft=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&null!=ft){this.self.importScripts(ft);const Ct=s.plugin.isParsed();Xe(Ct?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ft}`),Ct)}}catch(ft){Xe(ft.toString())}}getAvailableImages(ge){let ve=this.availableImages[ge];return ve||(ve=[]),ve}getLayerIndex(ge){let ve=this.layerIndexes[ge];return ve||(ve=this.layerIndexes[ge]=new Y),ve}getWorkerSource(ge,ve,Xe){return this.workerSources[ge]||(this.workerSources[ge]={}),this.workerSources[ge][ve]||(this.workerSources[ge][ve]={}),this.workerSources[ge][ve][Xe]||(this.workerSources[ge][ve][Xe]=new this.workerSourceTypes[ve]({send:(Ct,Bt,jt,Et,Xt,Sn)=>{this.actor.send(Ct,Bt,jt,ge,Xt,Sn)},scheduler:this.actor.scheduler},this.getLayerIndex(ge),this.getAvailableImages(ge),this.isSpriteLoaded[ge])),this.workerSources[ge][ve][Xe]}getDEMWorkerSource(ge,ve){return this.demWorkerSources[ge]||(this.demWorkerSources[ge]={}),this.demWorkerSources[ge][ve]||(this.demWorkerSources[ge][ve]=new E),this.demWorkerSources[ge][ve]}enforceCacheSizeLimit(ge,ve){s.enforceCacheSizeLimit(ve)}getWorkerPerformanceMetrics(ge,ve,Xe){Xe(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Hi(self)),Hi}),h(0,function(s){function J(f,r){if(Array.isArray(f)){if(!Array.isArray(r)||f.length!==r.length)return!1;for(let c=0;c"u"||typeof document>"u"||!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)||!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var m,b,T=new Blob([""],{type:"text/javascript"}),O=URL.createObjectURL(T);try{b=new Worker(O),m=!0}catch{m=!1}return b&&b.terminate(),URL.revokeObjectURL(O),m}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var m=document.createElement("canvas");m.width=m.height=1;var b=m.getContext("2d");if(!b)return!1;var T=b.getImageData(0,0,1,1);return T&&T.width===m.width}()||(void 0===E[c=r&&r.failIfMajorPerformanceCaveat]&&(E[c]=function(m){var b,O,L,Z,T=(O=m,L=document.createElement("canvas"),(Z=Object.create(Y.webGLContextAttributes)).failIfMajorPerformanceCaveat=O,L.getContext("webgl",Z)||L.getContext("experimental-webgl",Z));if(!T)return!1;try{b=T.createShader(T.VERTEX_SHADER)}catch{return!1}return!(!b||T.isContextLost())&&(T.shaderSource(b,"void main() {}"),T.compileShader(b),!0===T.getShaderParameter(b,T.COMPILE_STATUS))}(c)),!E[c]||document.documentMode));var r,c}var E={};function Ne(f,r,c){const m=s.window.document.createElement(f);return void 0!==r&&(m.className=r),c&&c.appendChild(m),m}function me(f,r,c){const m=s.window.document.createElementNS("http://www.w3.org/2000/svg",f);for(const b of Object.keys(r))m.setAttributeNS(null,b,r[b]);return c&&c.appendChild(m),m}Y.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const he=s.window.document&&s.window.document.documentElement.style,_e=he&&void 0!==he.userSelect?"userSelect":"WebkitUserSelect";let ee;function ae(){he&&_e&&(ee=he[_e],he[_e]="none")}function oe(){he&&_e&&(he[_e]=ee)}function Be(f){f.preventDefault(),f.stopPropagation(),s.window.removeEventListener("click",Be,!0)}function Ie(){s.window.addEventListener("click",Be,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",Be,!0)},0)}function Ee(f,r){const c=f.getBoundingClientRect();return le(f,c,r)}function Ue(f,r){const c=f.getBoundingClientRect(),m=[];for(let b=0;b=0?0:f.button}function le(f,r,c){const m=f.offsetWidth===r.width?1:f.offsetWidth/r.width;return new s.Point((c.clientX-r.left)*m,(c.clientY-r.top)*m)}function ue(f,r){var c=r[0],m=r[1],b=r[2],T=r[3],O=c*T-b*m;return O?(f[0]=T*(O=1/O),f[1]=-m*O,f[2]=-b*O,f[3]=c*O,f):null}function ct(f){const{userImage:r}=f;return!!(r&&r.render&&r.render())&&(f.data.replace(new Uint8Array(r.data.buffer)),!0)}class ht extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(r){if(this.loaded!==r&&(this.loaded=r,r)){for(const{ids:c,callback:m}of this.requestors)this._notify(c,m);this.requestors=[]}}hasImage(r){return!!this.getImage(r)}getImage(r){return this.images[r]}addImage(r,c){this._validate(r,c)&&(this.images[r]=c)}_validate(r,c){let m=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${r}" has invalid "stretchX" value`))),m=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${r}" has invalid "stretchY" value`))),m=!1),this._validateContent(c.content,c)||(this.fire(new s.ErrorEvent(new Error(`Image "${r}" has invalid "content" value`))),m=!1),m}_validateStretch(r,c){if(!r)return!0;let m=0;for(const b of r){if(b[0]{this.ready=!0})}broadcast(r,c,m){s.asyncAll(this.actors,(b,T)=>{b.send(r,c,T)},m=m||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(r=>{r.remove()}),this.actors=[],this.workerPool.release(this.id)}}function qt(f,r,c){return r*(s.EXTENT/(f.tileSize*Math.pow(2,c-f.tileID.overscaledZ)))}hn.Actor=s.Actor;class Ht{constructor(r,c,m,b){this.screenBounds=r,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=m,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,b)}static createFromScreenPoints(r,c){let m,b;if(r instanceof s.Point||"number"==typeof r[0]){const T=s.Point.convert(r);m=[T],b=c.isPointAboveHorizon(T)}else{const T=s.Point.convert(r[0]),O=s.Point.convert(r[1]);m=[T,O],b=s.polygonizeBounds(T,O).every(L=>c.isPointAboveHorizon(L))}return new Ht(m,c.getCameraPoint(),b,c)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(r){return s.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){const c=this.screenBounds[0],m=1===this.screenBounds.length?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],b=s.polygonizeBounds(c,m,0,!1);return this.cameraPoint.y>m.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x=m.x?b[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(b[3]=this.cameraPoint)),s.bufferConvexPolygon(b,r)}bufferedCameraGeometryGlobe(r){const c=this.screenBounds[0],m=1===this.screenBounds.length?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],b=s.polygonizeBounds(c,m,r),T=this.cameraPoint.clone();switch(3*((T.y>c.y)+(T.y>m.y))+((T.x>c.x)+(T.x>m.x))){case 0:b[0]=T,b[4]=T.clone();break;case 1:b.splice(1,0,T);break;case 2:b[1]=T;break;case 3:b.splice(4,0,T);break;case 5:b.splice(2,0,T);break;case 6:b[3]=T;break;case 7:b.splice(3,0,T);break;case 8:b[2]=T}return b}containsTile(r,c,m,b=0){const T=r.queryPadding/c._pixelsPerMercatorPixel+1,O=m?this._bufferedCameraMercator(T,c):this._bufferedScreenMercator(T,c);let L=r.tileID.wrap+(O.unwrapped?b:0);const Z=O.polygon.map(Ke=>s.getTilePoint(r.tileTransform,Ke,L));if(!s.polygonIntersectsBox(Z,0,0,s.EXTENT,s.EXTENT))return;L=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?b:0);const q=this.screenGeometryMercator.polygon.map(Ke=>s.getTileVec3(r.tileTransform,Ke,L)),W=q.map(Ke=>new s.Point(Ke[0],Ke[1])),se=c.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),Oe=s.getTileVec3(r.tileTransform,se,L),$e=q.map(Ke=>{const ce=s.sub(Ke,Ke,Oe);return s.normalize(ce,ce),new s.Ray(Oe,ce)}),We=qt(r,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:W,tilespaceRays:$e,bufferedTilespaceGeometry:Z,bufferedTilespaceBounds:(qe=s.getBounds(Z),qe.min.x=s.clamp(qe.min.x,0,s.EXTENT),qe.min.y=s.clamp(qe.min.y,0,s.EXTENT),qe.max.x=s.clamp(qe.max.x,0,s.EXTENT),qe.max.y=s.clamp(qe.max.y,0,s.EXTENT),qe),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:We};var qe}_bufferedScreenMercator(r,c){const m=Re(r);if(this._screenRaycastCache[m])return this._screenRaycastCache[m];{let b;return b="globe"===c.projection.name?this._projectAndResample(this.bufferedScreenGeometry(r),c):{polygon:this.bufferedScreenGeometry(r).map(T=>c.pointCoordinate3D(T)),unwrapped:!0},this._screenRaycastCache[m]=b,b}}_bufferedCameraMercator(r,c){const m=Re(r);if(this._cameraRaycastCache[m])return this._cameraRaycastCache[m];{let b;return b="globe"===c.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(r),c):{polygon:this.bufferedCameraGeometry(r).map(T=>c.pointCoordinate3D(T)),unwrapped:!0},this._cameraRaycastCache[m]=b,b}}_projectAndResample(r,c){const m=function(T,O){const L=s.multiply([],O.pixelMatrix,O.globeMatrix),Z=[0,-s.GLOBE_RADIUS,0,1],q=[0,s.GLOBE_RADIUS,0,1],W=[0,0,0,1];s.transformMat4$1(Z,Z,L),s.transformMat4$1(q,q,L),s.transformMat4$1(W,W,L);const se=new s.Point(Z[0]/Z[3],Z[1]/Z[3]),Oe=new s.Point(q[0]/q[3],q[1]/q[3]),$e=s.polygonContainsPoint(T,se)&&Z[3]1?De(T.slice(0,Ke),O):[],rt=Kenew s.Point(Je(Dt.x),Dt.y)),rt=rt.map(Dt=>new s.Point(Je(Dt.x),Dt.y));const ot=[...Ve];0===ot.length&&ot.push(rt[rt.length-1]);const Tt=s.number(ot[ot.length-1].y,(0===rt.length?Ve[0]:rt[0]).y,ce);let Mt;return Mt=$e?[new s.Point(0,Tt),new s.Point(0,0),new s.Point(1,0),new s.Point(1,Tt)]:[new s.Point(1,Tt),new s.Point(1,1),new s.Point(0,1),new s.Point(0,Tt)],ot.push(...Mt),0===rt.length?ot.push(Ve[0]):ot.push(...rt),{polygon:ot.map(Dt=>new s.MercatorCoordinate(Dt.x,Dt.y)),unwrapped:!1}}(r,c);if(m)return m;const b=function(T,O){let L=!1,Z=-1/0,q=0;for(let se=0;seZ&&(Z=T[se].x,q=se);for(let se=0;se.5&&($e.x{se.x-=1}),{polygon:T,unwrapped:L}}(De(r,c).map(T=>new s.Point(Je(T.x),T.y)),c);return{polygon:b.polygon.map(T=>new s.MercatorCoordinate(T.x,T.y)),unwrapped:b.unwrapped}}}function De(f,r){return s.resample(f,c=>{const m=r.pointCoordinate3D(c);c.x=m.x,c.y=m.y},1/256)}function Je(f){return f<0?1+f%1:f%1}function Re(f){return 100*f|0}function Fe(f,r,c,m,b){const T=function(O,L){if(O)return b(O);if(L){f.url&&L.tiles&&f.tiles&&delete f.tiles;const Z=s.pick(s.extend(L,f),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);L.vector_layers&&(Z.vectorLayers=L.vector_layers,Z.vectorLayerIds=Z.vectorLayers.map(q=>q.id)),Z.tiles=r.canonicalizeTileset(Z,f.url),b(null,Z)}};return f.url?s.getJSON(r.transformRequest(r.normalizeSourceURL(f.url,null,c,m),s.ResourceType.Source),T):s.exported.frame(()=>T(null,f))}class St{constructor(r,c,m){this.bounds=s.LngLatBounds.convert(this.validateBounds(r)),this.minzoom=c||0,this.maxzoom=m||24}validateBounds(r){return Array.isArray(r)&&4===r.length?[Math.max(-180,r[0]),Math.max(-90,r[1]),Math.min(180,r[2]),Math.min(90,r[3])]:[-180,-90,180,90]}contains(r){const c=Math.pow(2,r.z),m=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*c),b=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*c),T=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*c),O=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*c);return r.x>=m&&r.x=b&&r.y{this._tileJSONRequest=null,this._loaded=!0,b?(c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),m&&2!==m.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${m}`),this.fire(new s.ErrorEvent(b))):T&&(s.extend(this,T),T.bounds&&(this.tileBounds=new St(T.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(T.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(b)})}loaded(){return this._loaded}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(r,c){const m=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),b={request:this.map._requestManager.transformRequest(m,s.ResourceType.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:r.isSymbolTile};if(b.request.collectResourceTiming=this._collectResourceTiming,r.actor&&"expired"!==r.state)"loading"===r.state?r.reloadCallback=c:r.request=r.actor.send("reloadTile",b,T.bind(this));else if(r.actor=this._tileWorkers[m]=this._tileWorkers[m]||this.dispatcher.getActor(),this.dispatcher.ready)r.request=r.actor.send("loadTile",b,T.bind(this),void 0,!0);else{const O=s.loadVectorTile.call({deduped:this._deduped},b,(L,Z)=>{L||!Z?T.call(this,L):(b.data={cacheControl:Z.cacheControl,expires:Z.expires,rawData:Z.rawData.slice(0)},r.actor&&r.actor.send("loadTile",b,T.bind(this),void 0,!0))},!0);r.request={cancel:O}}function T(O,L){return delete r.request,r.aborted?c(null):O&&404!==O.status?c(O):(L&&L.resourceTiming&&(r.resourceTiming=L.resourceTiming),this.map._refreshExpiredTiles&&L&&r.setExpiryData(L),r.loadVectorData(L,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)))}}abortTile(r){r.request&&(r.request.cancel(),delete r.request),r.actor&&r.actor.send("abortTile",{uid:r.uid,type:this.type,source:this.id})}unloadTile(r){r.unloadVectorData(),r.actor&&r.actor.send("removeTile",{uid:r.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class pe extends s.Evented{constructor(r,c,m,b){super(),this.id=r,this.dispatcher=m,this.setEventedParent(b),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},c),s.extend(this,s.pick(c,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Fe(this._options,this.map._requestManager,null,null,(c,m)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new s.ErrorEvent(c)):m&&(s.extend(this,m),m.bounds&&(this.tileBounds=new St(m.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(m.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(c)})}loaded(){return this._loaded}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}loadTile(r,c){const m=s.exported.devicePixelRatio>=2,b=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),m,this.tileSize);r.request=s.getImage(this.map._requestManager.transformRequest(b,s.ResourceType.Tile),(T,O,L,Z)=>(delete r.request,r.aborted?(r.state="unloaded",c(null)):T?(r.state="errored",c(T)):O?(this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:L,expires:Z}),r.setTexture(O,this.map.painter),r.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void c(null)):c(null)))}static loadTileData(r,c,m){r.setTexture(c,m)}static unloadTileData(r,c){r.texture&&c.saveTileTexture(r.texture)}abortTile(r,c){r.request&&(r.request.cancel(),delete r.request),c()}unloadTile(r,c){r.texture&&this.map.painter.saveTileTexture(r.texture),c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function ze(f,r,c,m,b,T,O,L){const Z=[f,c,b,r,m,T,1,1,1],q=[O,L,1],W=s.adjoint([],Z),[se,Oe,$e]=s.transformMat3(q,q,s.transpose(W,W));return s.multiply$1(Z,[se,0,0,0,Oe,0,0,0,$e],Z)}class xe extends s.Evented{constructor(r,c,m,b){super(),this.id=r,this.dispatcher=m,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(b),this.options=c,this._dirty=!1}load(r,c){this._loaded=c||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(m,b)=>{if(this._imageRequest=null,this._loaded=!0,m)this.fire(new s.ErrorEvent(m));else if(b){const{HTMLImageElement:T}=s.window;this.image=b instanceof T?s.exported.getImageData(b):b,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,r&&(this.coordinates=r),this._finishLoading()}})}loaded(){return this._loaded}updateImage(r){return this.image&&r.url?(this._imageRequest&&r.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=r.url,this.load(r.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(r){this.coordinates=r,this._boundsArray=void 0;const c=r.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(m){let b=1/0,T=1/0,O=-1/0,L=-1/0;for(const se of m)b=Math.min(b,se.x),T=Math.min(T,se.y),O=Math.max(O,se.x),L=Math.max(L,se.y);const Z=Math.max(O-b,L-T),q=Math.max(0,Math.floor(-Math.log(Z)/Math.LN2)),W=Math.pow(2,q);return new s.CanonicalTileID(q,Math.floor((b+O)/2*W),Math.floor((T+L)/2*W))}(c),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(r){for(const Z in this.tiles){const q=this.tiles[Z];"loaded"!==q.state&&(q.state="loaded",q.texture=this.texture)}if(this._boundsArray)return;const c=s.tileTransform(this.tileID,this.map.transform.projection),[m,b,T,O]=this.coordinates.map(Z=>{const q=c.projection.project(Z[0],Z[1]);return s.getTilePoint(c,q)._round()});this.perspectiveTransform=function(Z,q,W,se,Oe,$e,We,qe,Ke,ce){const Ve=ze(0,0,Z,0,0,q,Z,q),rt=ze(W,se,Oe,$e,We,qe,Ke,ce);return s.multiply$1(rt,s.adjoint(Ve,Ve),rt),[rt[6]/rt[8]*Z/s.EXTENT,rt[7]/rt[8]*q/s.EXTENT]}(this.width,this.height,m.x,m.y,b.x,b.y,O.x,O.y,T.x,T.y);const L=this._boundsArray=new s.StructArrayLayout4i8;L.emplaceBack(m.x,m.y,0,0),L.emplaceBack(b.x,b.y,s.EXTENT,0),L.emplaceBack(O.x,O.y,0,s.EXTENT),L.emplaceBack(T.x,T.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=r.createVertexBuffer(L,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const r=this.map.painter.context,c=r.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(r,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(r)}loadTile(r,c){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={},c(null)):(r.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const be={vector:zn,raster:pe,"raster-dem":class extends pe{constructor(f,r,c,m){super(f,r,c,m),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTile(f,r){const c=this.map._requestManager.normalizeTileURL(f.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function m(b,T){b&&(f.state="errored",r(b)),T&&(f.dem=T,f.dem.onDeserialize(),f.needsHillshadePrepare=!0,f.needsDEMTextureUpload=!0,f.state="loaded",r(null))}f.request=s.getImage(this.map._requestManager.transformRequest(c,s.ResourceType.Tile),function(b,T,O,L){if(delete f.request,f.aborted)f.state="unloaded",r(null);else if(b)f.state="errored",r(b);else if(T){this.map._refreshExpiredTiles&&f.setExpiryData({cacheControl:O,expires:L});const Z=s.window.ImageBitmap&&T instanceof s.window.ImageBitmap&&(null==mi&&(mi=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.window.createImageBitmap),mi),q=1-(T.width-s.prevPowerOfTwo(T.width))/2;q<1||f.neighboringTiles||(f.neighboringTiles=this._getNeighboringTiles(f.tileID));const W=Z?T:s.exported.getImageData(T,q),se={uid:f.uid,coord:f.tileID,source:this.id,rawImageData:W,encoding:this.encoding,padding:q};f.actor&&"expired"!==f.state||(f.actor=this.dispatcher.getActor(),f.actor.send("loadDEMTile",se,m.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(f){const r=f.canonical,c=Math.pow(2,r.z),m=(r.x-1+c)%c,b=0===r.x?f.wrap-1:f.wrap,T=(r.x+1+c)%c,O=r.x+1===c?f.wrap+1:f.wrap,L={};return L[new s.OverscaledTileID(f.overscaledZ,b,r.z,m,r.y).key]={backfilled:!1},L[new s.OverscaledTileID(f.overscaledZ,O,r.z,T,r.y).key]={backfilled:!1},r.y>0&&(L[new s.OverscaledTileID(f.overscaledZ,b,r.z,m,r.y-1).key]={backfilled:!1},L[new s.OverscaledTileID(f.overscaledZ,f.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},L[new s.OverscaledTileID(f.overscaledZ,O,r.z,T,r.y-1).key]={backfilled:!1}),r.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.ErrorEvent(c));else{const b={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&m&&m.resourceTiming&&m.resourceTiming[this.id]&&(b.resourceTiming=m.resourceTiming[this.id]),this.fire(new s.Event("data",b)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(f,r){const c=f.actor?"reloadTile":"loadTile";f.actor=this.actor,f.request=this.actor.send(c,{type:this.type,uid:f.uid,tileID:f.tileID,tileZoom:f.tileZoom,zoom:f.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(m,b)=>(delete f.request,f.unloadVectorData(),f.aborted?r(null):m?r(m):(f.loadVectorData(b,this.map.painter,"reloadTile"===c),r(null))),void 0,"loadTile"===c)}abortTile(f){f.request&&(f.request.cancel(),delete f.request),f.aborted=!0}unloadTile(f){f.unloadVectorData(),this.actor.send("removeTile",{uid:f.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends xe{constructor(f,r,c,m){super(f,r,c,m),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;const f=this.options;this.urls=[];for(const r of f.urls)this.urls.push(this.map._requestManager.transformRequest(r,s.ResourceType.Source).url);s.getVideo(this.urls,(r,c)=>{this._loaded=!0,r?this.fire(new s.ErrorEvent(r)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(f){if(this.video){const r=this.video.seekable;fr.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=f}}getVideo(){return this.video}onAdd(f){this.map||(this.map=f,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const f=this.map.painter.context,r=f.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(f,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(f)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:xe,canvas:class extends xe{constructor(f,r,c,m){super(f,r,c,m),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some(b=>!Array.isArray(b)||2!==b.length||b.some(T=>"number"!=typeof T))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(f){this.map=f,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let f=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,f=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,f=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const r=this.map.painter.context;this.texture?(f||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(r,this.canvas,r.gl.RGBA,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const f of[this.canvas.width,this.canvas.height])if(isNaN(f)||f<=0)return!0;return!1}},custom:class extends s.Evented{constructor(f,r,c,m){super(),this.id=f,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=r,this.setEventedParent(m),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new St(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(f){this._map=f,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(f),this.load()}onRemove(f){this._implementation.onRemove&&this._implementation.onRemove(f)}hasTile(f){if(this._implementation.hasTile){const{x:r,y:c,z:m}=f.canonical;return this._implementation.hasTile({x:r,y:c,z:m})}return!this.tileBounds||this.tileBounds.contains(f.canonical)}loadTile(f,r){const{x:c,y:m,z:b}=f.tileID.canonical,T=new s.window.AbortController;f.request=Promise.resolve(this._implementation.loadTile({x:c,y:m,z:b},{signal:T.signal})).then(function(O){return delete f.request,f.aborted?(f.state="unloaded",r(null)):void 0===O?(f.state="errored",r(null)):null===O?(this.loadTileData(f,{width:this.tileSize,height:this.tileSize,data:null}),f.state="loaded",r(null)):(L=O)instanceof s.window.ImageData||L instanceof s.window.HTMLCanvasElement||L instanceof s.window.ImageBitmap||L instanceof s.window.HTMLImageElement?(this.loadTileData(f,O),f.state="loaded",void r(null)):(f.state="errored",r(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)));var L}.bind(this)).catch(O=>{20!==O.code&&(f.state="errored",r(O))}),f.request.cancel=()=>T.abort()}loadTileData(f,r){pe.loadTileData(f,r,this._map.painter)}unloadTileData(f){pe.unloadTileData(f,this._map.painter)}unloadTile(f,r){if(this.unloadTileData(f),this._implementation.unloadTile){const{x:c,y:m,z:b}=f.tileID.canonical;this._implementation.unloadTile({x:c,y:m,z:b})}r()}abortTile(f,r){f.request&&f.request.cancel&&(f.request.cancel(),delete f.request),r()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(f=>({x:f.canonical.x,y:f.canonical.y,z:f.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Ze=function(f,r,c,m){const b=new be[r.type](f,r,c,m);if(b.id!==f)throw new Error(`Expected Source id to be ${f} instead of ${b.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],b),b};function Pt(f,r){const c=s.identity([]);return s.scale(c,c,[.5*f.width,.5*-f.height,1]),s.translate(c,c,[1,-1,0]),s.multiply(c,c,f.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(c)}function bn(f,r,c,m,b,T,O,L=!1){const Z=f.tilesIn(m,O,L);Z.sort(Ci);const q=[];for(const se of Z)q.push({wrappedTileID:se.tile.tileID.wrapped().key,queryResults:se.tile.queryRenderedFeatures(r,c,f._state,se,b,T,Pt(f.transform,se.tile.tileID),L)});const W=function(se){const Oe={},$e={};for(const We of se){const qe=We.queryResults,Ke=We.wrappedTileID,ce=$e[Ke]=$e[Ke]||{};for(const Ve in qe){const rt=qe[Ve],ot=ce[Ve]=ce[Ve]||{},Tt=Oe[Ve]=Oe[Ve]||[];for(const Mt of rt)ot[Mt.featureIndex]||(ot[Mt.featureIndex]=!0,Tt.push(Mt))}}return Oe}(q);for(const se in W)W[se].forEach(Oe=>{const $e=Oe.feature,We=$e.layer;We&&"background"!==We.type&&"sky"!==We.type&&($e.source=We.source,We["source-layer"]&&($e.sourceLayer=We["source-layer"]),$e.state=void 0!==$e.id?f.getFeatureState(We["source-layer"],$e.id):{})});return W}function Kn(f,r){const c=f.getRenderableIds().map(T=>f.getTileByID(T)),m=[],b={};for(let T=0;T{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[cr]}numActive(){return Object.keys(this.active).length}}let Lt;function st(){return Lt||(Lt=new Ui),Lt}function pn(f,r){const c={};for(const m in f)"ref"!==m&&(c[m]=f[m]);return s.refProperties.forEach(m=>{m in r&&(c[m]=r[m])}),c}function mn(f){f=f.slice();const r=Object.create(null);for(let c=0;c0?(b-O)/L:0;return this.points[T].mult(1-Z).add(this.points[c].mult(Z))}}class Ar{constructor(r,c,m){const b=this.boxCells=[],T=this.circleCells=[];this.xCellCount=Math.ceil(r/m),this.yCellCount=Math.ceil(c/m);for(let O=0;Othis.width||b<0||c>this.height)return!T&&[];const L=[];if(r<=0&&c<=0&&this.width<=m&&this.height<=b){if(T)return!0;for(let Z=0;Z0:L}_queryCircle(r,c,m,b,T){const O=r-m,L=r+m,Z=c-m,q=c+m;if(L<0||O>this.width||q<0||Z>this.height)return!b&&[];const W=[];return this._forEachCell(O,Z,L,q,this._queryCellCircle,W,{hitTest:b,circle:{x:r,y:c,radius:m},seenUids:{box:{},circle:{}}},T),b?W.length>0:W}query(r,c,m,b,T){return this._query(r,c,m,b,!1,T)}hitTest(r,c,m,b,T){return this._query(r,c,m,b,!0,T)}hitTestCircle(r,c,m,b){return this._queryCircle(r,c,m,!0,b)}_queryCell(r,c,m,b,T,O,L,Z){const q=L.seenUids,W=this.boxCells[T];if(null!==W){const Oe=this.bboxes;for(const $e of W)if(!q.box[$e]){q.box[$e]=!0;const We=4*$e;if(r<=Oe[We+2]&&c<=Oe[We+3]&&m>=Oe[We+0]&&b>=Oe[We+1]&&(!Z||Z(this.boxKeys[$e]))){if(L.hitTest)return O.push(!0),!0;O.push({key:this.boxKeys[$e],x1:Oe[We],y1:Oe[We+1],x2:Oe[We+2],y2:Oe[We+3]})}}}const se=this.circleCells[T];if(null!==se){const Oe=this.circles;for(const $e of se)if(!q.circle[$e]){q.circle[$e]=!0;const We=3*$e;if(this._circleAndRectCollide(Oe[We],Oe[We+1],Oe[We+2],r,c,m,b)&&(!Z||Z(this.circleKeys[$e]))){if(L.hitTest)return O.push(!0),!0;{const qe=Oe[We],Ke=Oe[We+1],ce=Oe[We+2];O.push({key:this.circleKeys[$e],x1:qe-ce,y1:Ke-ce,x2:qe+ce,y2:Ke+ce})}}}}}_queryCellCircle(r,c,m,b,T,O,L,Z){const q=L.circle,W=L.seenUids,se=this.boxCells[T];if(null!==se){const $e=this.bboxes;for(const We of se)if(!W.box[We]){W.box[We]=!0;const qe=4*We;if(this._circleAndRectCollide(q.x,q.y,q.radius,$e[qe+0],$e[qe+1],$e[qe+2],$e[qe+3])&&(!Z||Z(this.boxKeys[We])))return O.push(!0),!0}}const Oe=this.circleCells[T];if(null!==Oe){const $e=this.circles;for(const We of Oe)if(!W.circle[We]){W.circle[We]=!0;const qe=3*We;if(this._circlesCollide($e[qe],$e[qe+1],$e[qe+2],q.x,q.y,q.radius)&&(!Z||Z(this.circleKeys[We])))return O.push(!0),!0}}}_forEachCell(r,c,m,b,T,O,L,Z){const q=this._convertToXCellCoord(r),W=this._convertToYCellCoord(c),se=this._convertToXCellCoord(m),Oe=this._convertToYCellCoord(b);for(let $e=q;$e<=se;$e++)for(let We=W;We<=Oe;We++)if(T.call(this,r,c,m,b,this.xCellCount*We+$e,O,L,Z))return}_convertToXCellCoord(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_convertToYCellCoord(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_circlesCollide(r,c,m,b,T,O){const L=b-r,Z=T-c,q=m+O;return q*q>L*L+Z*Z}_circleAndRectCollide(r,c,m,b,T,O,L){const Z=(O-b)/2,q=Math.abs(r-(b+Z));if(q>Z+m)return!1;const W=(L-T)/2,se=Math.abs(c-(T+W));if(se>W+m)return!1;if(q<=Z||se<=W)return!0;const Oe=q-Z,$e=se-W;return Oe*Oe+$e*$e<=m*m}}const qi={unknown:0,flipRequired:1,flipNotRequired:2},Bi=Math.tan(85*Math.PI/180);function Kt(f,r,c,m,b,T,O){const L=s.create();if(c)if("globe"===T.name){const Z=s.calculateGlobeLabelMatrix(b,r);s.multiply(L,L,Z)}else{const Z=ue([],O);L[0]=Z[0],L[1]=Z[1],L[4]=Z[2],L[5]=Z[3],m||s.rotateZ(L,L,b.angle)}else s.multiply(L,b.labelPlaneMatrix,f);return L}function Wi(f,r,c,m,b,T,O){const L=Kt(f,r,c,m,b,T,O);return"globe"===T.name&&c||(L[2]=L[6]=L[10]=L[14]=0),L}function rr(f,r,c,m,b,T,O){if(c){if("globe"===T.name){const L=Kt(f,r,c,m,b,T,O);return s.invert(L,L),s.multiply(L,f,L),L}{const L=s.clone(f),Z=s.identity([]);return Z[0]=O[0],Z[1]=O[1],Z[4]=O[2],Z[5]=O[3],s.multiply(L,L,Z),m||s.rotateZ(L,L,-b.angle),L}}return b.glCoordMatrix}function yr(f,r,c,m){const b=[f,r,c,1];c?s.transformMat4$1(b,b,m):je(b,b,m);const T=b[3];return b[0]/=T,b[1]/=T,b[2]/=T,b}function xr(f,r){return Math.min(.5+f/r*.5,1.5)}function Sr(f,r){const c=f[0]/f[3],m=f[1]/f[3];return c>=-r[0]&&c<=r[0]&&m>=-r[1]&&m<=r[1]}function Go(f,r,c,m,b,T,O,L,Z,q){const W=c.transform,se=m?f.textSizeData:f.iconSizeData,Oe=s.evaluateSizeForZoom(se,c.transform.zoom),$e="globe"===W.projection.name,We=[256/c.width*2+1,256/c.height*2+1],qe=m?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;qe.clear();let Ke=null;$e&&(Ke=m?f.text.globeExtVertexArray:f.icon.globeExtVertexArray);const ce=f.lineVertexArray,Ve=m?f.text.placedSymbolArray:f.icon.placedSymbolArray,rt=c.transform.width/c.transform.height;let ot,Tt=!1;for(let Mt=0;MtMath.abs(c)?{useVertical:!0}:f===s.WritingMode.vertical?m>0?{needsFlipping:!0}:null:r!==qi.unknown&&(0===(b=c)||Math.abs(m/b)>Bi)?r===qi.flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null;var b}function Xn(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe,Ke,ce,Ve){const rt=r/24,ot=f.lineOffsetX*rt,Tt=f.lineOffsetY*rt,{lineStartIndex:Mt,glyphStartIndex:Dt,numGlyphs:$t,segment:zt,writingMode:dn,flipState:Vn}=f,on=Mt+f.lineLength,Rn=un=>{if(W){const[Gn,Ln,Wn]=un.up,Di=q.length;s.updateGlobeVertexNormal(W,Di+0,Gn,Ln,Wn),s.updateGlobeVertexNormal(W,Di+1,Gn,Ln,Wn),s.updateGlobeVertexNormal(W,Di+2,Gn,Ln,Wn),s.updateGlobeVertexNormal(W,Di+3,Gn,Ln,Wn)}const[Zn,sn,An]=un.point;s.addDynamicAttributes(q,Zn,sn,An,un.angle)};if($t>1){const un=Eo(rt,L,ot,Tt,c,se,Oe,f,Z,T,$e,qe,!1,Ke,ce,Ve);if(!un)return{notEnoughRoom:!0};if(m&&!c){let[Zn,sn,An]=un.first.point,[Gn,Ln,Wn]=un.last.point;[Zn,sn]=yr(Zn,sn,An,O),[Gn,Ln]=yr(Gn,Ln,Wn,O);const Di=to(dn,Vn,(Gn-Zn)*We,Ln-sn);if(f.flipState=Di&&Di.needsFlipping?qi.flipRequired:qi.flipNotRequired,Di)return Di}Rn(un.first);for(let Zn=Dt+1;Zn0?Gn:Si(Oe,An,Zn,1,b,void 0,Ke,ce.canonical),Wn=to(dn,Vn,(Ln[0]-Zn[0])*We,Ln[1]-Zn[1]);if(f.flipState=Wn&&Wn.needsFlipping?qi.flipRequired:qi.flipNotRequired,Wn)return Wn}const un=we(rt*L.getoffsetX(Dt),ot,Tt,c,se,Oe,zt,Mt,on,Z,T,$e,qe,!1,!1,Ke,ce,Ve);if(!un)return{notEnoughRoom:!0};Rn(un)}return{}}function Ei(f,r,c,m,b){const{x:T,y:O,z:L}=m.projectTilePoint(f.x,f.y,r);if(!b)return yr(T,O,L,c);const[Z,q,W]=b(f);return yr(T+Z,O+q,L+W,c)}function Si(f,r,c,m,b,T,O,L){const Z=Ei(f.sub(r)._unit()._add(f),L,b,O,T);return s.sub(Z,c,Z),s.normalize(Z,Z),s.scaleAndAdd(Z,c,Z,m)}function we(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe,Ke,ce){const Ve=m?f-r:f+r;let rt=Ve>0?1:-1,ot=0;m&&(rt*=-1,ot=Math.PI),rt<0&&(ot+=Math.PI);let Tt=L+O+(rt>0?0:1)|0,Mt=b,Dt=b,$t=0,zt=0;const dn=Math.abs(Ve),Vn=[],on=[];let Rn=T,un=Rn;const Zn=()=>Si(un,Rn,Dt,dn-$t+1,W,Oe,qe,Ke.canonical);for(;$t+zt<=dn;){if(Tt+=rt,Tt=Z)return null;if(Dt=Mt,un=Rn,Vn.push(Dt),$e&&on.push(un),Rn=new s.Point(q.getx(Tt),q.gety(Tt)),Mt=se[Tt],!Mt){const Pi=Ei(Rn,Ke.canonical,W,qe,Oe);Mt=Pi[3]>0?se[Tt]=Pi:Zn()}$t+=zt,zt=s.distance(Dt,Mt)}We&&Oe&&(se[Tt]&&(Mt=Zn(),zt=s.distance(Dt,Mt)),se[Tt]=Mt);const sn=(dn-$t)/zt,An=Rn.sub(un)._mult(sn)._add(un),Gn=s.sub([],Mt,Dt),Ln=s.scaleAndAdd([],Dt,Gn,sn);let Wn=[0,0,1],Di=Gn[0],Gi=Gn[1];if(ce&&(Wn=qe.upVector(Ke.canonical,An.x,An.y),0!==Wn[0]||0!==Wn[1]||1!==Wn[2])){const Pi=[Wn[2],0,-Wn[0]],ur=s.cross([],Wn,Pi);s.normalize(Pi,Pi),s.normalize(ur,ur),Di=s.dot(Gn,Pi),Gi=s.dot(Gn,ur)}if(c){const Pi=s.cross([],Wn,Gn);s.normalize(Pi,Pi),s.scaleAndAdd(Ln,Ln,Pi,c*rt)}const hi=ot+Math.atan2(Gi,Di);return Vn.push(Ln),$e&&on.push(An),{point:Ln,angle:hi,path:Vn,tilePath:on,up:Wn}}function fe(f,r){const c=r.length,m=c+4*f;r.resize(m),r.float32.fill(-1/0,4*c,4*m)}function je(f,r,c){const m=r[0],b=r[1];return f[0]=c[0]*m+c[4]*b+c[12],f[1]=c[1]*m+c[5]*b+c[13],f[3]=c[3]*m+c[7]*b+c[15],f}const lt=100;class an{constructor(r,c,m=new Ar(r.width+200,r.height+200,25),b=new Ar(r.width+200,r.height+200,25)){this.transform=r,this.grid=m,this.ignoredGrid=b,this.pitchfactor=Math.cos(r._pitch)*r.cameraToCenterDistance,this.screenRightBoundary=r.width+lt,this.screenBottomBoundary=r.height+lt,this.gridRightBoundary=r.width+200,this.gridBottomBoundary=r.height+200,this.fogState=c}placeCollisionBox(r,c,m,b,T,O,L,Z){let q=m.projectedAnchorX,W=m.projectedAnchorY,se=m.projectedAnchorZ;const Oe=m.elevation,$e=m.tileID,We=r.getProjection();if(Oe&&$e){const[Mt,Dt,$t]=We.upVector($e.canonical,m.tileAnchorX,m.tileAnchorY),zt=We.upVectorScale($e.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;q+=Mt*Oe*zt,W+=Dt*Oe*zt,se+=$t*Oe*zt}const qe=this.projectAndGetPerspectiveRatio(L,q,W,se,m.tileID,"globe"===We.name||!!Oe||this.transform.pitch>0,We),Ke=O*qe.perspectiveRatio,ce=(m.x1*c+b.x-m.padding)*Ke+qe.point.x,Ve=(m.y1*c+b.y-m.padding)*Ke+qe.point.y,rt=(m.x2*c+b.x+m.padding)*Ke+qe.point.x,ot=(m.y2*c+b.y+m.padding)*Ke+qe.point.y,Tt=qe.perspectiveRatio<=.55||qe.occluded;return!this.isInsideGrid(ce,Ve,rt,ot)||!T&&this.grid.hitTest(ce,Ve,rt,ot,Z)||Tt?{box:[],offscreen:!1,occluded:qe.occluded}:{box:[ce,Ve,rt,ot],offscreen:this.isOffscreen(ce,Ve,rt,ot),occluded:!1}}placeCollisionCircles(r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe){const Ke=[],ce=this.transform.elevation,Ve=r.getProjection(),rt=ce?ce.getAtTileOffsetFunc(qe,this.transform.center.lat,this.transform.worldSize,Ve):null,ot=new s.Point(m.tileAnchorX,m.tileAnchorY);let{x:Tt,y:Mt,z:Dt}=Ve.projectTilePoint(ot.x,ot.y,qe.canonical);if(rt){const[An,Gn,Ln]=rt(ot);Tt+=An,Mt+=Gn,Dt+=Ln}const $t="globe"===Ve.name,zt=this.projectAndGetPerspectiveRatio(L,Tt,Mt,Dt,qe,$t||!!ce||this.transform.pitch>0,Ve),{perspectiveRatio:dn}=zt,Vn=(se?O/dn:O*dn)/s.ONE_EM,on=yr(Tt,Mt,Dt,Z),Rn=zt.signedDistanceFromCamera>0?Eo(Vn,T,m.lineOffsetX*Vn,m.lineOffsetY*Vn,!1,on,ot,m,b,Z,{},ce&&!se?rt:null,se&&!!ce,Ve,qe,se):null;let un=!1,Zn=!1,sn=!0;if(Rn&&!zt.occluded){const An=.5*$e*dn+We,Gn=new s.Point(-100,-100),Ln=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Wn=new vi,{first:Di,last:Gi}=Rn,hi=Di.path.length;let Pi=[];for(let xi=hi-1;xi>=1;xi--)Pi.push(Di.path[xi]);for(let xi=1;xi(rt&&!$t&&(Kr=rt(Wrxi[3]<=0)&&(Pi=[]));let dr=[];if(Pi.length>0){let xi=1/0,Cr=-1/0,Kr=1/0,Wr=-1/0;for(const qr of Pi)xi=Math.min(xi,qr[0]),Kr=Math.min(Kr,qr[1]),Cr=Math.max(Cr,qr[0]),Wr=Math.max(Wr,qr[1]);Cr>=Gn.x&&xi<=Ln.x&&Wr>=Gn.y&&Kr<=Ln.y&&(dr=[Pi.map(qr=>new s.Point(qr[0],qr[1]))],(xiLn.x||KrLn.y)&&(dr=s.clipLine(dr,Gn.x,Gn.y,Ln.x,Ln.y)))}for(const xi of dr){Wn.reset(xi,.25*An);let Cr=0;Cr=Wn.length<=.5*An?1:Math.ceil(Wn.paddedLength/ur)+1;for(let Kr=0;Kr0?(s.transformMat4$1(Z,Z,r),this.fogState&&T&&"globe"!==L.name&&(q=function(Oe,$e,We,qe,Ke,ce){const Ve=ce.calculateFogTileMatrix(Ke),rt=[$e,We,qe];return s.transformMat4(rt,rt,Ve),Pe(Oe,rt,ce.pitch,ce._fov)}(this.fogState,c,m,b,T.toUnwrapped(),this.transform)>.9)):je(Z,Z,r);const W=Z[3];return{point:new s.Point((Z[0]/W+1)/2*this.transform.width+lt,(-Z[1]/W+1)/2*this.transform.height+lt),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(L)/W*.5,1.5),signedDistanceFromCamera:W,occluded:O&&Z[2]>W||q}}isOffscreen(r,c,m,b){return m=this.screenRightBoundary||bthis.screenBottomBoundary}isInsideGrid(r,c,m,b){return m>=0&&r=0&&cm.collisionGroupID===c}}return this.collisionGroups[r]}}function go(f,r,c,m,b){const{horizontalAlign:T,verticalAlign:O}=s.getAnchorAlignment(f),L=-(T-.5)*r,Z=-(O-.5)*c,q=s.evaluateVariableOffset(f,m);return new s.Point(L+q[0]*b,Z+q[1]*b)}function Nr(f,r,c,m,b){const T=new s.Point(f,r);return c&&T._rotate(m?b:-b),T}class co{constructor(r,c,m,b,T){this.transform=r.clone(),this.projection=r.projection.name,this.collisionIndex=new an(this.transform,T),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new vr(m),this.collisionCircleArrays={},this.prevPlacement=b,b&&(b.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(r,c,m,b){const T=m.getBucket(c),O=m.latestFeatureIndex;if(!T||!O||c.id!==T.layerIds[0])return;const L=T.layers[0].layout,Z=m.collisionBoxArray,q=Math.pow(2,this.transform.zoom-m.tileID.overscaledZ),W=m.tileSize/s.EXTENT,se=m.tileID.toUnwrapped();this.transform.setProjection(T.projection);const Oe=($e=m.tileID,We=T.getProjection(),qe=this.transform,We.name===this.projection?qe.calculateProjMatrix($e.toUnwrapped()):Vt(qe,We,$e));var $e,We,qe;const Ke="map"===L.get("text-pitch-alignment"),ce="map"===L.get("text-rotation-alignment");c.compileFilter();const Ve=c.dynamicFilter(),rt=c.dynamicFilterNeedsFeature(),ot=this.transform.calculatePixelsToTileUnitsMatrix(m),Tt=Wi(Oe,m.tileID.canonical,Ke,ce,this.transform,T.getProjection(),ot);let Mt=null;if(Ke){const zt=rr(Oe,m.tileID.canonical,Ke,ce,this.transform,T.getProjection(),ot);Mt=s.multiply([],this.transform.labelPlaneMatrix,zt)}let Dt=null;Ve&&m.latestFeatureIndex&&(Dt={unwrappedTileID:se,dynamicFilter:Ve,dynamicFilterNeedsFeature:rt,featureIndex:m.latestFeatureIndex}),this.retainedQueryData[T.bucketInstanceId]=new Ni(T.bucketInstanceId,O,T.sourceLayerIndex,T.index,m.tileID);const $t={bucket:T,layout:L,posMatrix:Oe,textLabelPlaneMatrix:Tt,labelToScreenMatrix:Mt,clippingData:Dt,scale:q,textPixelRatio:W,holdingForFade:m.holdingForFade(),collisionBoxArray:Z,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(T.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(T.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(T.sourceID)};if(b)for(const zt of T.sortKeyRanges){const{sortKey:dn,symbolInstanceStart:Vn,symbolInstanceEnd:on}=zt;r.push({sortKey:dn,symbolInstanceStart:Vn,symbolInstanceEnd:on,parameters:$t})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:T.symbolInstances.length,parameters:$t})}attemptAnchorPlacement(r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe,Ke,ce,Ve){const{textOffset0:rt,textOffset1:ot,crossTileID:Tt}=Oe,Mt=[rt,ot],Dt=go(r,m,b,Mt,T),$t=this.collisionIndex.placeCollisionBox(We,T,c,Nr(Dt.x,Dt.y,O,L,this.transform.angle),se,Z,q,W.predicate);if(Ke){const zt=We.getSymbolInstanceIconSize(Ve,this.transform.zoom,Oe.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(We,zt,Ke,Nr(Dt.x,Dt.y,O,L,this.transform.angle),se,Z,q,W.predicate).box.length)return}if($t.box.length>0){let zt;return this.prevPlacement&&this.prevPlacement.variableOffsets[Tt]&&this.prevPlacement.placements[Tt]&&this.prevPlacement.placements[Tt].text&&(zt=this.prevPlacement.variableOffsets[Tt].anchor),this.variableOffsets[Tt]={textOffset:Mt,width:m,height:b,anchor:r,textScale:T,prevAnchor:zt},this.markUsedJustification(We,r,Oe,qe),We.allowVerticalPlacement&&(this.markUsedOrientation(We,qe,Oe),this.placedOrientations[Tt]=qe),{shift:Dt,placedGlyphBoxes:$t}}}placeLayerBucketPart(r,c,m,b){const{bucket:T,layout:O,posMatrix:L,textLabelPlaneMatrix:Z,labelToScreenMatrix:q,clippingData:W,textPixelRatio:se,holdingForFade:Oe,collisionBoxArray:$e,partiallyEvaluatedTextSize:We,partiallyEvaluatedIconSize:qe,collisionGroup:Ke}=r.parameters,ce=O.get("text-optional"),Ve=O.get("icon-optional"),rt=O.get("text-allow-overlap"),ot=O.get("icon-allow-overlap"),Tt="map"===O.get("text-rotation-alignment"),Mt="map"===O.get("text-pitch-alignment"),Dt="none"!==O.get("icon-text-fit"),$t="viewport-y"===O.get("symbol-z-order");this.transform.setProjection(T.projection);let zt=rt&&(ot||!T.hasIconData()||Ve),dn=ot&&(rt||!T.hasTextData()||ce);!T.collisionArrays&&$e&&T.deserializeCollisionBoxes($e),m&&b&&T.updateCollisionDebugBuffers(this.transform.zoom,$e);const Vn=(on,Rn,un)=>{const{crossTileID:Zn,numVerticalGlyphVertices:sn}=on;if(W){const mo={zoom:this.transform.zoom,pitch:this.transform.pitch};let jr=null;if(W.dynamicFilterNeedsFeature){const Lr=this.retainedQueryData[T.bucketInstanceId];jr=W.featureIndex.loadFeature({featureIndex:on.featureIndex,bucketIndex:Lr.bucketIndex,sourceLayerIndex:Lr.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,W.dynamicFilter)(mo,jr,this.retainedQueryData[T.bucketInstanceId].tileID.canonical,new s.Point(on.tileAnchorX,on.tileAnchorY),this.transform.calculateDistanceTileData(W.unwrappedTileID)))return this.placements[Zn]=new di(!1,!1,!1,!0),void c.add(Zn)}if(c.has(Zn))return;if(Oe)return void(this.placements[Zn]=new di(!1,!1,!1));let An=!1,Gn=!1,Ln=!0,Wn=!1,Di=!1,Gi=null,hi={box:null,offscreen:null,occluded:null},Pi={box:null,offscreen:null,occluded:null},ur=null,dr=null,xi=null,Cr=0,Kr=0,Wr=0;un.textFeatureIndex?Cr=un.textFeatureIndex:on.useRuntimeCollisionCircles&&(Cr=on.featureIndex),un.verticalTextFeatureIndex&&(Kr=un.verticalTextFeatureIndex);const qr=mo=>{mo.tileID=this.retainedQueryData[T.bucketInstanceId].tileID;const jr=this.transform.elevation;(jr||mo.elevation)&&(mo.elevation=jr?jr.getAtTileOffset(mo.tileID,mo.tileAnchorX,mo.tileAnchorY):0)},ns=un.textBox;if(ns){qr(ns);const mo=Lr=>{let Zo=s.WritingMode.horizontal;if(T.allowVerticalPlacement&&!Lr&&this.prevPlacement){const Ds=this.prevPlacement.placedOrientations[Zn];Ds&&(this.placedOrientations[Zn]=Ds,Zo=Ds,this.markUsedOrientation(T,Zo,on))}return Zo},jr=(Lr,Zo)=>{if(T.allowVerticalPlacement&&sn>0&&un.verticalTextBox){for(const Ds of T.writingModes)if(Ds===s.WritingMode.vertical?(hi=Zo(),Pi=hi):hi=Lr(),hi&&hi.box&&hi.box.length)break}else hi=Lr()};if(O.get("text-variable-anchor")){let Lr=O.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Zn]){const Vr=this.prevPlacement.variableOffsets[Zn];Lr.indexOf(Vr.anchor)>0&&(Lr=Lr.filter(ls=>ls!==Vr.anchor),Lr.unshift(Vr.anchor))}const Zo=(Vr,ls,ll)=>{const Al=T.getSymbolInstanceTextSize(We,on,this.transform.zoom,Rn),Wl=(Vr.x2-Vr.x1)*Al+2*Vr.padding,Qs=(Vr.y2-Vr.y1)*Al+2*Vr.padding,ql=Dt&&!ot?ls:null;ql&&qr(ql);let Yl={box:[],offscreen:!1,occluded:!1};const Ed=rt?2*Lr.length:Lr.length;for(let Lu=0;Lu=Lr.length,on,Rn,T,ll,ql,We,qe);if(vh&&(Yl=vh.placedGlyphBoxes,Yl&&Yl.box&&Yl.box.length)){An=!0,Gi=vh.shift;break}}return Yl};jr(()=>Zo(ns,un.iconBox,s.WritingMode.horizontal),()=>{const Vr=un.verticalTextBox;return Vr&&qr(Vr),T.allowVerticalPlacement&&!(hi&&hi.box&&hi.box.length)&&sn>0&&Vr?Zo(Vr,un.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),hi&&(An=hi.box,Ln=hi.offscreen,Wn=hi.occluded);const Ds=mo(!(!hi||!hi.box));if(!An&&this.prevPlacement){const Vr=this.prevPlacement.variableOffsets[Zn];Vr&&(this.variableOffsets[Zn]=Vr,this.markUsedJustification(T,Vr.anchor,on,Ds))}}else{const Lr=(Zo,Ds)=>{const Vr=T.getSymbolInstanceTextSize(We,on,this.transform.zoom,Rn),ls=this.collisionIndex.placeCollisionBox(T,Vr,Zo,new s.Point(0,0),rt,se,L,Ke.predicate);return ls&&ls.box&&ls.box.length&&(this.markUsedOrientation(T,Ds,on),this.placedOrientations[Zn]=Ds),ls};jr(()=>Lr(ns,s.WritingMode.horizontal),()=>{const Zo=un.verticalTextBox;return T.allowVerticalPlacement&&sn>0&&Zo?(qr(Zo),Lr(Zo,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),mo(!!(hi&&hi.box&&hi.box.length))}}if(ur=hi,An=ur&&ur.box&&ur.box.length>0,Ln=ur&&ur.offscreen,Wn=ur&&ur.occluded,on.useRuntimeCollisionCircles){const mo=T.text.placedSymbolArray.get(on.centerJustifiedTextSymbolIndex>=0?on.centerJustifiedTextSymbolIndex:on.verticalPlacedTextSymbolIndex),jr=s.evaluateSizeForFeature(T.textSizeData,We,mo),Lr=O.get("text-padding");dr=this.collisionIndex.placeCollisionCircles(T,rt,mo,T.lineVertexArray,T.glyphOffsetArray,jr,L,Z,q,m,Mt,Ke.predicate,on.collisionCircleDiameter*jr/s.ONE_EM,Lr,this.retainedQueryData[T.bucketInstanceId].tileID),An=rt||dr.circles.length>0&&!dr.collisionDetected,Ln=Ln&&dr.offscreen,Wn=dr.occluded}if(un.iconFeatureIndex&&(Wr=un.iconFeatureIndex),un.iconBox){const mo=jr=>{qr(jr);const Lr=Dt&&Gi?Nr(Gi.x,Gi.y,Tt,Mt,this.transform.angle):new s.Point(0,0),Zo=T.getSymbolInstanceIconSize(qe,this.transform.zoom,on.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(T,Zo,jr,Lr,ot,se,L,Ke.predicate)};Pi&&Pi.box&&Pi.box.length&&un.verticalIconBox?(xi=mo(un.verticalIconBox),Gn=xi.box.length>0):(xi=mo(un.iconBox),Gn=xi.box.length>0),Ln=Ln&&xi.offscreen,Di=xi.occluded}const _s=ce||0===on.numHorizontalGlyphVertices&&0===sn,vo=Ve||0===on.numIconVertices;if(_s||vo?vo?_s||(Gn=Gn&&An):An=Gn&&An:Gn=An=Gn&&An,An&&ur&&ur.box&&this.collisionIndex.insertCollisionBox(ur.box,O.get("text-ignore-placement"),T.bucketInstanceId,Pi&&Pi.box&&Kr?Kr:Cr,Ke.ID),Gn&&xi&&this.collisionIndex.insertCollisionBox(xi.box,O.get("icon-ignore-placement"),T.bucketInstanceId,Wr,Ke.ID),dr&&(An&&this.collisionIndex.insertCollisionCircles(dr.circles,O.get("text-ignore-placement"),T.bucketInstanceId,Cr,Ke.ID),m)){const mo=T.bucketInstanceId;let jr=this.collisionCircleArrays[mo];void 0===jr&&(jr=this.collisionCircleArrays[mo]=new Ai);for(let Lr=0;Lr=0;--Rn){const un=on[Rn];Vn(T.symbolInstances.get(un),un,T.collisionArrays[un])}}else for(let on=r.symbolInstanceStart;on=0&&(r.text.placedSymbolArray.get(T).crossTileID=se>=0&&T!==se?0:q),O>=0&&(r.text.placedSymbolArray.get(O).crossTileID=se>=0&&O!==se?0:q),L>=0&&(r.text.placedSymbolArray.get(L).crossTileID=se>=0&&L!==se?0:q),Z>=0&&(r.text.placedSymbolArray.get(Z).crossTileID=se>=0&&Z!==se?0:q)}markUsedOrientation(r,c,m){const b=c===s.WritingMode.horizontal||c===s.WritingMode.horizontalOnly?c:0,T=c===s.WritingMode.vertical?c:0,{leftJustifiedTextSymbolIndex:O,centerJustifiedTextSymbolIndex:L,rightJustifiedTextSymbolIndex:Z,verticalPlacedTextSymbolIndex:q}=m,W=r.text.placedSymbolArray;O>=0&&(W.get(O).placedOrientation=b),L>=0&&(W.get(L).placedOrientation=b),Z>=0&&(W.get(Z).placedOrientation=b),q>=0&&(W.get(q).placedOrientation=T)}commit(r){this.commitTime=r,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let m=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const b=c?c.symbolFadeChange(r):1,T=c?c.opacities:{},O=c?c.variableOffsets:{},L=c?c.placedOrientations:{};for(const Z in this.placements){const q=this.placements[Z],W=T[Z];W?(this.opacities[Z]=new Fn(W,b,q.text,q.icon,null,q.clipped),m=m||q.text!==W.text.placed||q.icon!==W.icon.placed):(this.opacities[Z]=new Fn(null,b,q.text,q.icon,q.skipFade,q.clipped),m=m||q.text||q.icon)}for(const Z in T){const q=T[Z];if(!this.opacities[Z]){const W=new Fn(q,b,!1,!1);W.isHidden()||(this.opacities[Z]=W,m=m||q.text.placed||q.icon.placed)}}for(const Z in O)this.variableOffsets[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.variableOffsets[Z]=O[Z]);for(const Z in L)this.placedOrientations[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.placedOrientations[Z]=L[Z]);m?this.lastPlacementChangeTime=r:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:r)}updateLayerOpacities(r,c){const m=new Set;for(const b of c){const T=b.getBucket(r);T&&b.latestFeatureIndex&&r.id===T.layerIds[0]&&this.updateBucketOpacities(T,m,b.collisionBoxArray)}}updateBucketOpacities(r,c,m){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();const b=r.layers[0].layout,T=!!r.layers[0].dynamicFilter(),O=new Fn(null,0,!1,!1,!0),L=b.get("text-allow-overlap"),Z=b.get("icon-allow-overlap"),q=b.get("text-variable-anchor"),W="map"===b.get("text-rotation-alignment"),se="map"===b.get("text-pitch-alignment"),Oe="none"!==b.get("icon-text-fit"),$e=new Fn(null,0,L&&(Z||!r.hasIconData()||b.get("icon-optional")),Z&&(L||!r.hasTextData()||b.get("text-optional")),!0);!r.collisionArrays&&m&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(m);const We=(Ke,ce,Ve)=>{for(let rt=0;rt0||rt>0,zt=Tt>0,dn=this.placedOrientations[ot],Vn=dn===s.WritingMode.vertical,on=dn===s.WritingMode.horizontal||dn===s.WritingMode.horizontalOnly;if(!$t&&!zt||Dt.isHidden()||qe++,$t){const Rn=Or(Dt.text);We(r.text,Ve,Vn?Er:Rn),We(r.text,rt,on?Er:Rn);const un=Dt.text.isHidden(),{leftJustifiedTextSymbolIndex:Zn,centerJustifiedTextSymbolIndex:sn,rightJustifiedTextSymbolIndex:An,verticalPlacedTextSymbolIndex:Gn}=ce,Ln=r.text.placedSymbolArray,Wn=un||Vn?1:0;Zn>=0&&(Ln.get(Zn).hidden=Wn),sn>=0&&(Ln.get(sn).hidden=Wn),An>=0&&(Ln.get(An).hidden=Wn),Gn>=0&&(Ln.get(Gn).hidden=un||on?1:0);const Di=this.variableOffsets[ot];Di&&this.markUsedJustification(r,Di.anchor,ce,dn);const Gi=this.placedOrientations[ot];Gi&&(this.markUsedJustification(r,"left",ce,Gi),this.markUsedOrientation(r,Gi,ce))}if(zt){const Rn=Or(Dt.icon),{placedIconSymbolIndex:un,verticalPlacedIconSymbolIndex:Zn}=ce,sn=r.icon.placedSymbolArray,An=Dt.icon.isHidden()?1:0;un>=0&&(We(r.icon,Tt,Vn?Er:Rn),sn.get(un).hidden=An),Zn>=0&&(We(r.icon,ce.numVerticalIconVertices,on?Er:Rn),sn.get(Zn).hidden=An)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){const Rn=r.collisionArrays[Ke];if(Rn){let un=new s.Point(0,0),Zn=!0;if(Rn.textBox||Rn.verticalTextBox){if(q){const An=this.variableOffsets[ot];An?(un=go(An.anchor,An.width,An.height,An.textOffset,An.textScale),W&&un._rotate(se?this.transform.angle:-this.transform.angle)):Zn=!1}T&&(Zn=!Dt.clipped),Rn.textBox&&uo(r.textCollisionBox.collisionVertexArray,Dt.text.placed,!Zn||Vn,un.x,un.y),Rn.verticalTextBox&&uo(r.textCollisionBox.collisionVertexArray,Dt.text.placed,!Zn||on,un.x,un.y)}const sn=Zn&&!(on||!Rn.verticalIconBox);Rn.iconBox&&uo(r.iconCollisionBox.collisionVertexArray,Dt.icon.placed,sn,Oe?un.x:0,Oe?un.y:0),Rn.verticalIconBox&&uo(r.iconCollisionBox.collisionVertexArray,Dt.icon.placed,!sn,Oe?un.x:0,Oe?un.y:0)}}}if(r.fullyClipped=0===qe,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){const Ke=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=Ke.invProjMatrix,r.placementViewportMatrix=Ke.viewportMatrix,r.collisionCircleArray=Ke.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(r){return 0===this.fadeDuration?1:(r-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(r){return Math.max(0,(this.transform.zoom-r)/1.5)}hasTransitions(r){return this.stale||r-this.lastPlacementChangeTimer}setStale(){this.stale=!0}}function uo(f,r,c,m,b){f.emplaceBack(r?1:0,c?1:0,m||0,b||0),f.emplaceBack(r?1:0,c?1:0,m||0,b||0),f.emplaceBack(r?1:0,c?1:0,m||0,b||0),f.emplaceBack(r?1:0,c?1:0,m||0,b||0)}const Jr=Math.pow(2,25),kr=Math.pow(2,24),To=Math.pow(2,17),ds=Math.pow(2,16),xo=Math.pow(2,9),zi=Math.pow(2,8),Fr=Math.pow(2,1);function Or(f){if(0===f.opacity&&!f.placed)return 0;if(1===f.opacity&&f.placed)return 4294967295;const r=f.placed?1:0,c=Math.floor(127*f.opacity);return c*Jr+r*kr+c*To+r*ds+c*xo+r*zi+c*Fr+r}const Er=0;class so{constructor(r){this._sortAcrossTiles="viewport-y"!==r.layout.get("symbol-z-order")&&void 0!==r.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(r,c,m,b,T){const O=this._bucketParts;for(;this._currentTileIndexL.sortKey-Z.sortKey));this._currentPartIndex{const O=s.exported.now()-b;return!this._forceFullPlacement&&O>2};for(;this._currentPlacementIndex>=0;){const O=c[r[this._currentPlacementIndex]],L=this.placement.collisionIndex.transform.zoom;if("symbol"===O.type&&(!O.minzoom||O.minzoom<=L)&&(!O.maxzoom||O.maxzoom>L)){if(this._inProgressLayer||(this._inProgressLayer=new so(O)),this._inProgressLayer.continuePlacement(m[O.source],this.placement,this._showCollisionBoxes,O,T))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(r){return this.placement.commit(r),this.placement}}const Po=512/s.EXTENT/2;class Hr{constructor(r,c,m){this.tileID=r,this.bucketInstanceId=m,this.index=new s.KDBush(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const b=r.canonical.x*s.EXTENT,T=r.canonical.y*s.EXTENT;for(let O=0;Or.overscaledZ)for(const L in O){const Z=O[L];Z.tileID.isChildOf(r)&&Z.findMatches(c.symbolInstances,r,b)}else{const L=O[r.scaledTo(Number(T)).key];L&&L.findMatches(c.symbolInstances,r,b)}}for(let T=0;T{c[m]=!0});for(const m in this.layerIndexes)c[m]||delete this.layerIndexes[m]}}const li=(f,r)=>s.emitValidationErrors(f,r&&r.filter(c=>"source.canvas"!==c.identifier)),Zi=s.pick(En,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Rr=s.pick(En,["setCenter","setZoom","setBearing","setPitch"]),_o={version:8,layers:[],sources:{}},rs={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class zr extends s.Evented{constructor(r,c={}){super(),this.map=r,this.dispatcher=new hn(st(),this),this.imageManager=new ht,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(r._requestManager,c.localFontFamily?s.LocalGlyphMode.all:c.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,c.localFontFamily||c.localIdeographFontFamily),this.crossTileSymbolIndex=new gr,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const m=this;this._rtlTextPluginCallback=zr.registerForPluginStateChange(b=>{m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:b.pluginStatus,pluginURL:b.pluginURL},(T,O)=>{if(s.triggerPluginCompletionEvent(T),O&&O.every(L=>L))for(const L in m._sourceCaches){const Z=m._sourceCaches[L],q=Z.getSource().type;"vector"!==q&&"geojson"!==q||Z.reload()}})}),this.on("data",b=>{if("source"!==b.dataType||"metadata"!==b.sourceDataType)return;const T=this.getSource(b.sourceId);if(T&&T.vectorLayerIds)for(const O in this._layers){const L=this._layers[O];L.source===T.id&&this._validateLayer(L)}})}loadURL(r,c={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const m="boolean"==typeof c.validate?c.validate:!s.isMapboxURL(r);r=this.map._requestManager.normalizeStyleURL(r,c.accessToken);const b=this.map._requestManager.transformRequest(r,s.ResourceType.Style);this._request=s.getJSON(b,(T,O)=>{this._request=null,T?this.fire(new s.ErrorEvent(T)):O&&this._load(O,m)})}loadJSON(r,c={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(r,!1!==c.validate)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(_o,!1)}_updateLayerCount(r,c){const m=c?1:-1;r.is3D()&&(this._num3DLayers+=m),"circle"===r.type&&(this._numCircleLayers+=m),"symbol"===r.type&&(this._numSymbolLayers+=m)}_load(r,c){if(c&&li(this,s.validateStyle(r)))return;this._loaded=!0,this.stylesheet=s.clone$1(r),this._updateMapProjection();for(const b in r.sources)this.addSource(b,r.sources[b],{validate:!1});this._changed=!1,r.sprite?this._loadSprite(r.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(r.glyphs);const m=mn(this.stylesheet.layers);this._order=m.map(b=>b.id),this._layers={},this._serializedLayers={};for(const b of m){const T=s.createStyleLayer(b);T.setEventedParent(this,{layer:{id:T.id}}),this._layers[T.id]=T,this._serializedLayers[T.id]=T.serialize(),this._updateLayerCount(T,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ye(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}setProjection(r){r?this.stylesheet.projection=r:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(r){this._spriteRequest=function(c,m,b){let T,O,L;const Z=s.exported.devicePixelRatio>1?"@2x":"";let q=s.getJSON(m.transformRequest(m.normalizeSpriteURL(c,Z,".json"),s.ResourceType.SpriteJSON),(Oe,$e)=>{q=null,L||(L=Oe,T=$e,se())}),W=s.getImage(m.transformRequest(m.normalizeSpriteURL(c,Z,".png"),s.ResourceType.SpriteImage),(Oe,$e)=>{W=null,L||(L=Oe,O=$e,se())});function se(){if(L)b(L);else if(T&&O){const Oe=s.exported.getImageData(O),$e={};for(const We in T){const{width:qe,height:Ke,x:ce,y:Ve,sdf:rt,pixelRatio:ot,stretchX:Tt,stretchY:Mt,content:Dt}=T[We],$t=new s.RGBAImage({width:qe,height:Ke});s.RGBAImage.copy(Oe,$t,{x:ce,y:Ve},{x:0,y:0},{width:qe,height:Ke}),$e[We]={data:$t,pixelRatio:ot,sdf:rt,stretchX:Tt,stretchY:Mt,content:Dt}}b(null,$e)}}return{cancel(){q&&(q.cancel(),q=null),W&&(W.cancel(),W=null)}}}(r,this.map._requestManager,(c,m)=>{if(this._spriteRequest=null,c)this.fire(new s.ErrorEvent(c));else if(m)for(const b in m)this.imageManager.addImage(b,m[b]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(r){const c=this.getSource(r.source);if(!c)return;const m=r.sourceLayer;m&&("geojson"===c.type||c.vectorLayerIds&&-1===c.vectorLayerIds.indexOf(m))&&this.fire(new s.ErrorEvent(new Error(`Source layer "${m}" does not exist on source "${c.id}" as specified by style layer "${r.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const r in this._sourceCaches)if(!this._sourceCaches[r].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(r){const c=[];for(const m of r){const b=this._layers[m];"custom"!==b.type&&c.push(b.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const r in this._sourceCaches)if(this._sourceCaches[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(r){return!!this.terrain&&("function"==typeof r.isLayerDraped?r.isLayerDraped():rs[r.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(r){if(!this._loaded)return;const c=this._changed;if(this._changed){const b=Object.keys(this._updatedLayers),T=Object.keys(this._removedLayers);(b.length||T.length)&&this._updateWorkerLayers(b,T);for(const O in this._updatedSources){const L=this._updatedSources[O];"reload"===L?this._reloadSource(O):"clear"===L&&this._clearSource(O)}this._updateTilesForChangedImages();for(const O in this._updatedPaintProps)this._layers[O].updateTransitions(r);this.light.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this._resetUpdates()}const m={};for(const b in this._sourceCaches){const T=this._sourceCaches[b];m[b]=T.used,T.used=!1}for(const b of this._order){const T=this._layers[b];if(T.recalculate(r,this._availableImages),!T.isHidden(r.zoom)){const L=this._getLayerSourceCache(T);L&&(L.used=!0)}const O=this.map.painter;if(O){const L=T.getProgramIds();if(!L)continue;const Z=T.getProgramConfiguration(r.zoom);for(const q of L)O.useProgram(q,Z)}}for(const b in m){const T=this._sourceCaches[b];m[b]!==T.used&&T.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:T.getSource().id}))}this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.z=r.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),c&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const r=Object.keys(this._changedImages);if(r.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],r);this._changedImages={}}}_updateWorkerLayers(r,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(r),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(r){if(this._checkLoaded(),li(this,s.validateStyle(r)))return!1;(r=s.clone$1(r)).layers=mn(r.layers);const c=function(b,T){if(!b)return[{command:En.setStyle,args:[T]}];let O=[];try{if(!J(b.version,T.version))return[{command:En.setStyle,args:[T]}];J(b.center,T.center)||O.push({command:En.setCenter,args:[T.center]}),J(b.zoom,T.zoom)||O.push({command:En.setZoom,args:[T.zoom]}),J(b.bearing,T.bearing)||O.push({command:En.setBearing,args:[T.bearing]}),J(b.pitch,T.pitch)||O.push({command:En.setPitch,args:[T.pitch]}),J(b.sprite,T.sprite)||O.push({command:En.setSprite,args:[T.sprite]}),J(b.glyphs,T.glyphs)||O.push({command:En.setGlyphs,args:[T.glyphs]}),J(b.transition,T.transition)||O.push({command:En.setTransition,args:[T.transition]}),J(b.light,T.light)||O.push({command:En.setLight,args:[T.light]}),J(b.fog,T.fog)||O.push({command:En.setFog,args:[T.fog]}),J(b.projection,T.projection)||O.push({command:En.setProjection,args:[T.projection]});const L={},Z=[];!function(se,Oe,$e,We){let qe;for(qe in Oe=Oe||{},se=se||{})se.hasOwnProperty(qe)&&(Oe.hasOwnProperty(qe)||gi(qe,$e,We));for(qe in Oe){if(!Oe.hasOwnProperty(qe))continue;const Ke=Oe[qe];se.hasOwnProperty(qe)?J(se[qe],Ke)||("geojson"===se[qe].type&&"geojson"===Ke.type&&Li(se,Oe,qe)?$e.push({command:En.setGeoJSONSourceData,args:[qe,Ke.data]}):_i(qe,Oe,$e,We)):ti(qe,Oe,$e)}}(b.sources,T.sources,Z,L);const q=[];b.layers&&b.layers.forEach(se=>{se.source&&L[se.source]?O.push({command:En.removeLayer,args:[se.id]}):q.push(se)});let W=b.terrain;W&&L[W.source]&&(O.push({command:En.setTerrain,args:[void 0]}),W=void 0),O=O.concat(Z),J(W,T.terrain)||O.push({command:En.setTerrain,args:[T.terrain]}),function(se,Oe,$e){Oe=Oe||[];const We=(se=se||[]).map(ir),qe=Oe.map(ir),Ke=se.reduce(Dr,{}),ce=Oe.reduce(Dr,{}),Ve=We.slice(),rt=Object.create(null);let ot,Tt,Mt,Dt,$t,zt,dn;for(ot=0,Tt=0;ot!(b.command in Rr));if(0===c.length)return!1;const m=c.filter(b=>!(b.command in Zi));if(m.length>0)throw new Error(`Unimplemented: ${m.map(b=>b.command).join(", ")}.`);return c.forEach(b=>{"setTransition"!==b.command&&"setProjection"!==b.command&&this[b.command].apply(this,b.args)}),this.stylesheet=r,this._updateMapProjection(),!0}addImage(r,c){return this.getImage(r)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(r,c),this._afterImageUpdated(r),this)}updateImage(r,c){this.imageManager.updateImage(r,c)}getImage(r){return this.imageManager.getImage(r)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r),this._afterImageUpdated(r),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(),this._changedImages[r]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(r,c,m={}){if(this._checkLoaded(),void 0!==this.getSource(r))throw new Error("There is already a source with this ID");if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(s.validateSource,`sources.${r}`,c,null,m))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const b=Ze(r,c,this.dispatcher,this);b.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r),source:b.serialize(),sourceId:r}));const T=O=>{const L=(O?"symbol:":"other:")+r,Z=this._sourceCaches[L]=new s.SourceCache(L,b,O);(O?this._symbolSourceCaches:this._otherSourceCaches)[r]=Z,Z.style=this,Z.onAdd(this.map)};T(!1),"vector"!==c.type&&"geojson"!==c.type||T(!0),b.onAdd&&b.onAdd(this.map),this._changed=!0}removeSource(r){this._checkLoaded();const c=this.getSource(r);if(!c)throw new Error("There is no source with this ID");for(const b in this._layers)if(this._layers[b].source===r)return this.fire(new s.ErrorEvent(new Error(`Source "${r}" cannot be removed while layer "${b}" is using it.`)));if(this.terrain&&this.terrain.get().source===r)return this.fire(new s.ErrorEvent(new Error(`Source "${r}" cannot be removed while terrain is using it.`)));const m=this._getSourceCaches(r);for(const b of m)delete this._sourceCaches[b.id],delete this._updatedSources[b.id],b.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:b.getSource().id})),b.setEventedParent(null),b.clearTiles();return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(r,c){this._checkLoaded(),this.getSource(r).setData(c),this._changed=!0}getSource(r){const c=this._getSourceCache(r);return c&&c.getSource()}_getSources(){const r=[];for(const c in this._otherSourceCaches){const m=this._getSourceCache(c);m&&r.push(m.getSource())}return r}addLayer(r,c,m={}){this._checkLoaded();const b=r.id;if(this.getLayer(b))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${b}" already exists on this map`)));let T;if("custom"===r.type){if(li(this,s.validateCustomStyleLayer(r)))return;T=s.createStyleLayer(r)}else{if("object"==typeof r.source&&(this.addSource(b,r.source),r=s.clone$1(r),r=s.extend(r,{source:b})),this._validate(s.validateLayer,`layers.${b}`,r,{arrayIndex:-1},m))return;T=s.createStyleLayer(r),this._validateLayer(T),T.setEventedParent(this,{layer:{id:b}}),this._serializedLayers[T.id]=T.serialize(),this._updateLayerCount(T,!0)}const O=c?this._order.indexOf(c):this._order.length;if(c&&-1===O)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`)));this._order.splice(O,0,b),this._layerOrderChanged=!0,this._layers[b]=T;const L=this._getLayerSourceCache(T);if(this._removedLayers[b]&&T.source&&L&&"custom"!==T.type){const Z=this._removedLayers[b];delete this._removedLayers[b],Z.type!==T.type?this._updatedSources[T.source]="clear":(this._updatedSources[T.source]="reload",L.pause())}this._updateLayer(T),T.onAdd&&T.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(r,c){if(this._checkLoaded(),this._changed=!0,!this._layers[r])return void this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be moved.`)));if(r===c)return;const m=this._order.indexOf(r);this._order.splice(m,1);const b=c?this._order.indexOf(c):this._order.length;c&&-1===b?this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`))):(this._order.splice(b,0,r),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(r){this._checkLoaded();const c=this._layers[r];if(!c)return void this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be removed.`)));c.setEventedParent(null),this._updateLayerCount(c,!1);const m=this._order.indexOf(r);this._order.splice(m,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[r]=c,delete this._layers[r],delete this._serializedLayers[r],delete this._updatedLayers[r],delete this._updatedPaintProps[r],c.onRemove&&c.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(r){return this._layers[r]}hasLayer(r){return r in this._layers}hasLayerType(r){for(const c in this._layers)if(this._layers[c].type===r)return!0;return!1}setLayerZoomRange(r,c,m){this._checkLoaded();const b=this.getLayer(r);b?b.minzoom===c&&b.maxzoom===m||(null!=c&&(b.minzoom=c),null!=m&&(b.maxzoom=m),this._updateLayer(b)):this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(r,c,m={}){this._checkLoaded();const b=this.getLayer(r);if(b){if(!J(b.filter,c))return null==c?(b.filter=void 0,void this._updateLayer(b)):void(this._validate(s.validateFilter,`layers.${b.id}.filter`,c,{layerType:b.type},m)||(b.filter=s.clone$1(c),this._updateLayer(b)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be filtered.`)))}getFilter(r){const c=this.getLayer(r);return c&&s.clone$1(c.filter)}setLayoutProperty(r,c,m,b={}){this._checkLoaded();const T=this.getLayer(r);T?J(T.getLayoutProperty(c),m)||(T.setLayoutProperty(c,m,b),this._updateLayer(T)):this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(r,c){const m=this.getLayer(r);if(m)return m.getLayoutProperty(c);this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style.`)))}setPaintProperty(r,c,m,b={}){this._checkLoaded();const T=this.getLayer(r);T?J(T.getPaintProperty(c),m)||(T.setPaintProperty(c,m,b)&&this._updateLayer(T),this._changed=!0,this._updatedPaintProps[r]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(r,c){const m=this.getLayer(r);return m&&m.getPaintProperty(c)}setFeatureState(r,c){this._checkLoaded();const m=r.source,b=r.sourceLayer,T=this.getSource(m);if(!T)return void this.fire(new s.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const O=T.type;if("geojson"===O&&b)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===O&&!b)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===r.id&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const L=this._getSourceCaches(m);for(const Z of L)Z.setFeatureState(b,r.id,c)}removeFeatureState(r,c){this._checkLoaded();const m=r.source,b=this.getSource(m);if(!b)return void this.fire(new s.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const T=b.type,O="vector"===T?r.sourceLayer:void 0;if("vector"===T&&!O)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&"string"!=typeof r.id&&"number"!=typeof r.id)return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const L=this._getSourceCaches(m);for(const Z of L)Z.removeFeatureState(O,r.id,c)}getFeatureState(r){this._checkLoaded();const c=r.source,m=r.sourceLayer,b=this.getSource(c);if(b){if("vector"!==b.type||m)return void 0===r.id&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(c)[0].getFeatureState(m,r.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const r={};for(const c in this._sourceCaches){const m=this._sourceCaches[c].getSource();r[m.id]||(r[m.id]=m.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:r,layers:this._serializeLayers(this._order)},c=>void 0!==c)}_updateLayer(r){this._updatedLayers[r.id]=!0;const c=this._getLayerSourceCache(r);r.source&&!this._updatedSources[r.source]&&c&&"raster"!==c.getSource().type&&(this._updatedSources[r.source]="reload",c.pause()),this._changed=!0,r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(r){const c=O=>"fill-extrusion"===this._layers[O].type,m={},b=[];for(let O=this._order.length-1;O>=0;O--){const L=this._order[O];if(c(L)){m[L]=O;for(const Z of r){const q=Z[L];if(q)for(const W of q)b.push(W)}}}b.sort((O,L)=>L.intersectionZ-O.intersectionZ);const T=[];for(let O=this._order.length-1;O>=0;O--){const L=this._order[O];if(c(L))for(let Z=b.length-1;Z>=0;Z--){const q=b[Z].feature;if(m[q.layer.id]{const q=this.getLayer(Z);return q&&q.is3D()}):this.has3DLayers(),L=Ht.createFromScreenPoints(r,m);for(const Z in this._sourceCaches){const q=this._sourceCaches[Z].getSource().id;c.layers&&!b[q]||T.push(bn(this._sourceCaches[Z],this._layers,this._serializedLayers,L,c,m,O,!!this.map._showQueryGeometry))}return this.placement&&T.push(function(Z,q,W,se,Oe,$e,We){const qe={},Ke=$e.queryRenderedSymbols(se),ce=[];for(const Ve of Object.keys(Ke).map(Number))ce.push(We[Ve]);ce.sort(Ci);for(const Ve of ce){const rt=Ve.featureIndex.lookupSymbolFeatures(Ke[Ve.bucketInstanceId],q,Ve.bucketIndex,Ve.sourceLayerIndex,Oe.filter,Oe.layers,Oe.availableImages,Z);for(const ot in rt){const Tt=qe[ot]=qe[ot]||[],Mt=rt[ot];Mt.sort((Dt,$t)=>{const zt=Ve.featureSortOrder;if(zt){const dn=zt.indexOf(Dt.featureIndex);return zt.indexOf($t.featureIndex)-dn}return $t.featureIndex-Dt.featureIndex});for(const Dt of Mt)Tt.push(Dt)}}for(const Ve in qe)qe[Ve].forEach(rt=>{const ot=rt.feature,Tt=W(Z[Ve]);if(!Tt)return;const Mt=Tt.getFeatureState(ot.layer["source-layer"],ot.id);ot.source=ot.layer.source,ot.layer["source-layer"]&&(ot.sourceLayer=ot.layer["source-layer"]),ot.state=Mt});return qe}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),L.screenGeometry,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(T)}querySourceFeatures(r,c){c&&c.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",c.filter,null,c);const m=this._getSourceCaches(r);let b=[];for(const T of m)b=b.concat(Kn(T,c));return b}addSourceType(r,c,m){return zr.getSourceType(r)?m(new Error(`A source type called "${r}" already exists.`)):(zr.setSourceType(r,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:r,url:c.workerSourceURL},m):m(null,null))}getLight(){return this.light.getLight()}setLight(r,c={}){this._checkLoaded();const m=this.light.getLight();let b=!1;for(const O in r)if(!J(r[O],m[O])){b=!0;break}if(!b)return;const T=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(r,c),this.light.updateTransitions(T)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,c=1){if(this._checkLoaded(),!r)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let m=r;if(1===c){if("object"==typeof m.source){const b="terrain-dem-src";this.addSource(b,m.source),m=s.clone$1(m),m=s.extend(m,{source:b})}if(this._validate(s.validateTerrain,"terrain",m))return}if(!this.terrain||this.terrain&&c!==this.terrain.drapeRenderMode){if(!m)return;this._createTerrain(m,c)}else{const b=this.terrain,T=b.get();for(const O of Object.keys(s.spec.terrain))!m.hasOwnProperty(O)&&s.spec.terrain[O].default&&(m[O]=s.spec.terrain[O].default);for(const O in m)if(!J(m[O],T[O])){b.set(m),this.stylesheet.terrain=m;const L=this._setTransitionParameters({duration:0});b.updateTransitions(L);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(r){const c=this.fog=new _t(r,this.map.transform);this.stylesheet.fog=r;const m=this._setTransitionParameters({duration:0});c.updateTransitions(m)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const r of this.map._markers)r._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(r){if(this._checkLoaded(),!r)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog,m=c.get();0===Object.keys(r).length&&c.set(r);for(const b in r)if(!J(r[b],m[b])){c.set(r),this.stylesheet.fog=r;const T=this._setTransitionParameters({duration:0});c.updateTransitions(T);break}}else this._createFog(r);this._markersNeedUpdate=!0}_setTransitionParameters(r){return{now:s.exported.now(),transition:s.extend(r,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const r=this._order.filter(m=>this.isLayerDraped(this._layers[m])),c=this._order.filter(m=>!this.isLayerDraped(this._layers[m]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...r),this._drapedFirstOrder.push(...c)}_createTerrain(r,c){const m=this.terrain=new Te(r,c);this.stylesheet.terrain=r,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const b=this._setTransitionParameters({duration:0});m.updateTransitions(b)}_force3DLayerUpdate(){for(const r in this._layers){const c=this._layers[r];"fill-extrusion"===c.type&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const r in this._layers){const c=this._layers[r];"symbol"===c.type&&this._updateLayer(c)}}_validate(r,c,m,b,T={}){return(!T||!1!==T.validate)&&li(this,r.call(s.validateStyle,s.extend({key:c,style:this.serialize(),value:m,styleSpec:s.spec},b)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this._sourceCaches)this._sourceCaches[r].clearTiles(),this._sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(r){const c=this._getSourceCaches(r);for(const m of c)m.clearTiles()}_reloadSource(r){const c=this._getSourceCaches(r);for(const m of c)m.resume(),m.reload()}_reloadSources(){for(const r of this._getSources())r.reload&&r.reload()}_updateSources(r){for(const c in this._sourceCaches)this._sourceCaches[c].update(r)}_generateCollisionBoxes(){for(const r in this._sourceCaches){const c=this._sourceCaches[r];c.resume(),c.reload()}}_updatePlacement(r,c,m,b,T=!1){let O=!1,L=!1;const Z={};for(const q of this._order){const W=this._layers[q];if("symbol"!==W.type)continue;if(!Z[W.source]){const Oe=this._getLayerSourceCache(W);if(!Oe)continue;Z[W.source]=Oe.getRenderableIds(!0).map($e=>Oe.getTileByID($e)).sort(($e,We)=>We.tileID.overscaledZ-$e.tileID.overscaledZ||($e.tileID.isLessThan(We.tileID)?-1:1))}const se=this.crossTileSymbolIndex.addLayer(W,Z[W.source],r.center.lng,r.projection);O=O||se}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),T=T||this._layerOrderChanged||0===m,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(T||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),r.zoom))&&(this.pauseablePlacement=new Gs(r,this._order,T,c,m,b,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Z),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),L=!0),O&&this.pauseablePlacement.placement.setStale()),L||O)for(const q of this._order){const W=this._layers[q];"symbol"===W.type&&this.placement.updateLayerOpacities(W,Z[W.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const r in this._sourceCaches)this._sourceCaches[r].releaseSymbolFadeTiles()}getImages(r,c,m){this.imageManager.getImages(c.icons,m),this._updateTilesForChangedImages();const b=T=>{T&&T.setDependencies(c.tileID.key,c.type,c.icons)};b(this._otherSourceCaches[c.source]),b(this._symbolSourceCaches[c.source])}getGlyphs(r,c,m){this.glyphManager.getGlyphs(c.stacks,m)}getResource(r,c,m){return s.makeRequest(c,m)}_getSourceCache(r){return this._otherSourceCaches[r]}_getLayerSourceCache(r){return"symbol"===r.type?this._symbolSourceCaches[r.source]:this._otherSourceCaches[r.source]}_getSourceCaches(r){const c=[];return this._otherSourceCaches[r]&&c.push(this._otherSourceCaches[r]),this._symbolSourceCaches[r]&&c.push(this._symbolSourceCaches[r]),c}_isSourceCacheLoaded(r){const c=this._getSourceCaches(r);return 0===c.length?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${r}'`))),!1):c.every(m=>m.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}zr.getSourceType=function(f){return be[f]},zr.setSourceType=function(f,r){be[f]=r},zr.registerForPluginStateChange=s.registerForPluginStateChange;var ko="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#define HALF_PI PI/2.0\n#define QUARTER_PI PI/4.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0",br="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",bo="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\nconst float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",Oo="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",Ti="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif";let Ns={},Xo={};const os=[];Ho(ko,os),Ho(bo,os),Ho(Oo,os),Ho(Ti,os),Ns=hr("",bo),Xo=hr(Ti,Oo);const Br=hr("\n#if __VERSION__ >=300\n#define varying in\n#define gl_FragColor glFragColor\n#define texture2D texture\n#define textureCube texture\nout vec4 glFragColor;\n#endif\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}","\n#if __VERSION__ >=300\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),zs=ko,ws="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif";var Fo={background:hr("uniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nvarying vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform vec4 u_color;varying vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(u_color);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:hr("uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:hr("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:hr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:hr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:hr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:hr("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:hr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:hr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:hr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:hr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:hr("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:hr("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:hr("varying vec4 v_color;\n#ifdef RENDER_SHADOWS\nvarying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\nvoid main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvec3 normal=v_normal;\n#endif\nfloat z;vec4 color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);\n#else\ncolor=v_color;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef ZERO_ROOF_RADIUS\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#endif\ncolor.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nv_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(color,NdotL);\n#else\nv_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_color*=u_opacity;\n#ifdef ZERO_ROOF_RADIUS\nv_roof_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef LIGHTING_3D_MODE\nv_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));\n#else\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:hr("uniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,v_NdotL)*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_NdotL=NdotL;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:hr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:hr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\ngl_FragColor=apply_lighting(gl_FragColor);\n#endif\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:hr("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nuniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture2D(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);\n#ifdef RENDER_LINE_BORDER_AUTO\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}\n#else\nout_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);\n#endif\n}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nattribute highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:hr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:hr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:hr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:hr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:hr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}"),terrainRaster:hr("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef RENDER_SHADOWS\ncolor.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nconst float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=wireframeOffset;\n#endif\nv_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}"),terrainDepth:hr("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:hr("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",br),skyboxGradient:hr("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",br),skyboxCapture:hr("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:hr("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#else\ncolor=texture2D(u_image0,v_pos0);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nattribute vec3 a_globe_pos;attribute vec2 a_uv;\n#else\nattribute vec2 a_pos;\n#endif\nvarying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nglobe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}"),globeAtmosphere:hr("uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:\n(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:\nuv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}","attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}")};function Ho(f,r){const c=f.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let m of c)if(m=m.trim(),"#"===m[0]&&m.includes("if")&&!m.includes("endif")){m=m.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const b=m.split(" ");for(const T of b)r.includes(T)||r.push(T)}}function hr(f,r){const c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,m=r.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),b={},T=[...os];return Ho(f,T),Ho(r,T),{fragmentSource:f=f.replace(c,(O,L,Z,q,W)=>(b[W]=!0,"define"===L?`\n#ifndef HAS_UNIFORM_u_${W}\nvarying ${Z} ${q} ${W};\n#else\nuniform ${Z} ${q} u_${W};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${W}\n ${Z} ${q} ${W} = u_${W};\n#endif\n`)),vertexSource:r=r.replace(c,(O,L,Z,q,W)=>{const se="float"===q?"vec2":"vec4",Oe=W.match(/color/)?"color":se;return b[W]?"define"===L?`\n#ifndef HAS_UNIFORM_u_${W}\nuniform lowp float u_${W}_t;\nattribute ${Z} ${se} a_${W};\nvarying ${Z} ${q} ${W};\n#else\nuniform ${Z} ${q} u_${W};\n#endif\n`:"vec4"===Oe?`\n#ifndef HAS_UNIFORM_u_${W}\n ${W} = a_${W};\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${W}\n ${W} = unpack_mix_${Oe}(a_${W}, u_${W}_t);\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`:"define"===L?`\n#ifndef HAS_UNIFORM_u_${W}\nuniform lowp float u_${W}_t;\nattribute ${Z} ${se} a_${W};\n#else\nuniform ${Z} ${q} u_${W};\n#endif\n`:"vec4"===Oe?`\n#ifndef HAS_UNIFORM_u_${W}\n ${Z} ${q} ${W} = a_${W};\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${W}\n ${Z} ${q} ${W} = unpack_mix_${Oe}(a_${W}, u_${W}_t);\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`}),staticAttributes:m,usedDefines:T}}class Ps{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(r,c,m,b,T,O,L){this.context=r;let Z=this.boundPaintVertexBuffers.length!==b.length;for(let W=0;!Z&&W{const rt=ce.paint.get("hillshade-shadow-color"),ot=ce.paint.get("hillshade-highlight-color"),Tt=ce.paint.get("hillshade-accent-color");let Mt=ce.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===ce.paint.get("hillshade-illumination-anchor")&&(Mt-=qe.transform.angle);const Dt=!qe.options.moving;return{u_matrix:Ve||qe.transform.calculateProjMatrix(Ke.tileID.toUnwrapped(),Dt),u_image:0,u_latrange:Qo(0,Ke.tileID),u_light:[ce.paint.get("hillshade-exaggeration"),Mt],u_shadow:rt,u_highlight:ot,u_accent:Tt}})(f,c,m,f.terrain?r.projMatrix:null);f.prepareDrawProgram(L,W,r.toUnwrapped());const{tileBoundsBuffer:Oe,tileBoundsIndexBuffer:$e,tileBoundsSegments:We}=f.getTileBoundsBuffers(c);W.draw(L,Z.TRIANGLES,b,T,O,s.CullFaceMode.disabled,se,m.id,Oe,$e,We)}function Cs(f,r,c){if(!r.needsDEMTextureUpload)return;const m=f.context,b=m.gl;m.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||f.getTileTexture(c.stride);const T=c.getPixels();r.demTexture?r.demTexture.update(T,{premultiply:!1}):r.demTexture=new s.Texture(m,T,b.RGBA,{premultiply:!1}),r.needsDEMTextureUpload=!1}function or(f,r,c,m,b,T){const O=f.context,L=O.gl;if(!r.dem)return;const Z=r.dem;if(O.activeTexture.set(L.TEXTURE1),Cs(f,r,Z),!r.demTexture)return;r.demTexture.bind(L.NEAREST,L.CLAMP_TO_EDGE);const q=Z.dim;O.activeTexture.set(L.TEXTURE0);let W=r.fbo;if(!W){const We=new s.Texture(O,{width:q,height:q,data:null},L.RGBA);We.bind(L.LINEAR,L.CLAMP_TO_EDGE),W=r.fbo=O.createFramebuffer(q,q,!0),W.colorAttachment.set(We.texture)}O.bindFramebuffer.set(W.framebuffer),O.viewport.set([0,0,q,q]);const{tileBoundsBuffer:se,tileBoundsIndexBuffer:Oe,tileBoundsSegments:$e}=f.getMercatorTileBoundsBuffers();f.useProgram("hillshadePrepare").draw(O,L.TRIANGLES,m,b,T,s.CullFaceMode.disabled,((We,qe)=>{const Ke=qe.stride,ce=s.create();return s.ortho(ce,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(ce,ce,[0,-s.EXTENT,0]),{u_matrix:ce,u_image:1,u_dimension:[Ke,Ke],u_zoom:We.overscaledZ,u_unpack:qe.unpackVector}})(r.tileID,Z),c.id,se,Oe,$e),r.needsHillshadePrepare=!1}const Qa=f=>({u_matrix:new s.UniformMatrix4f(f),u_image0:new s.Uniform1i(f),u_skirt_height:new s.Uniform1f(f)}),Os=(f,r)=>({u_matrix:f,u_image0:0,u_skirt_height:r}),ia=(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We)=>({u_proj_matrix:Float32Array.from(f),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(m),u_merc_matrix:c,u_zoom_transition:b,u_merc_center:T,u_image0:0,u_frustum_tl:O,u_frustum_tr:L,u_frustum_br:Z,u_frustum_bl:q,u_globe_pos:W,u_globe_radius:se,u_viewport:Oe,u_grid_matrix:We?Float32Array.from(We):new Float32Array(9),u_skirt_height:$e});function Ur(f,r){return null!=f&&null!=r&&!(!f.hasData()||!r.hasData())&&null!=f.demTexture&&null!=r.demTexture&&f.tileID.key!==r.tileID.key}const fs=new class{constructor(){this.operations={}}newMorphing(f,r,c,m,b){if(f in this.operations){const T=this.operations[f];T.to.tileID.key!==c.tileID.key&&(T.queued=c)}else this.operations[f]={startTime:m,phase:0,duration:b,from:r,to:c,queued:null}}getMorphValuesForProxy(f){if(!(f in this.operations))return null;const r=this.operations[f];return{from:r.from,to:r.to,phase:r.phase}}update(f){for(const r in this.operations){const c=this.operations[r];for(c.phase=(f-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,f)){delete this.operations[r];break}}}_nextOp(f,r){return!!f.queued&&(f.from=f.to,f.to=f.queued,f.queued=null,f.phase=0,f.startTime=r,!0)}_validOp(f){return f.from.hasData()&&f.to.hasData()}},Do={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Hs(f){return 6*Math.pow(1.5,22-f)}function Io(f,r){const c=1<({u_matrix:f});function Bo(f,r,c,m,b){if(b>0){const T=s.exported.now(),O=(T-f.timeAdded)/b,L=r?(T-r.timeAdded)/b:-1,Z=c.getSource(),q=m.coveringZoomLevel({tileSize:Z.tileSize,roundZoom:Z.roundZoom}),W=!r||Math.abs(r.tileID.overscaledZ-q)>Math.abs(f.tileID.overscaledZ-q),se=W&&f.refreshedUponExpiration?1:s.clamp(W?O:1-L,0,1);return f.refreshedUponExpiration&&O>=1&&(f.refreshedUponExpiration=!1),r?{opacity:1,mix:1-se}:{opacity:se,mix:0}}return{opacity:1,mix:0}}class yo extends s.SourceCache{constructor(r){const c={type:"raster-dem",maxzoom:r.transform.maxZoom},m=new hn(st(),null),b=Ze("mock-dem",c,m,r.style);super("mock-dem",b,!1),b.setEventedParent(this),this._sourceLoaded=!0}_loadTile(r,c){r.state="loaded",c(null)}}class ra extends s.SourceCache{constructor(r){const c=Ze("proxy",{type:"geojson",maxzoom:r.transform.maxZoom},new hn(st(),null),r.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=r,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(r,c,m){if(r.freezeTileCoverage)return;this.transform=r;const b=r.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((T,O)=>{if(T[O.key]="",!this._tiles[O.key]){const L=new s.Tile(O,this._source.tileSize*O.overscaleFactor(),r.tileZoom);L.state="loaded",this._tiles[O.key]=L}return T},{});for(const T in this._tiles)T in b||(this.freeFBO(T),this._tiles[T].unloadVectorData(),delete this._tiles[T])}freeFBO(r){const c=this.proxyCachedFBO[r];if(void 0!==c){const m=Object.values(c);this.renderCachePool.push(...m),delete this.proxyCachedFBO[r]}}deallocRenderCache(){this.renderCache.forEach(r=>r.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Rs extends s.OverscaledTileID{constructor(r,c,m){super(r.overscaledZ,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y),this.proxyTileKey=c,this.projMatrix=m}}class Ls extends s.Elevation{constructor(r,c){super(),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[m,b,T]=function(Z){const q=new s.StructArrayLayout2i4,W=new s.StructArrayLayout3ui6;q.reserve(17161),W.reserve(33800);const Oe=s.EXTENT/128,$e=s.EXTENT+Oe/2,We=$e+Oe;for(let Ke=-Oe;Ke$e||Ke<0||Ke>$e?24575:0,rt=s.clamp(Math.round(ce),0,s.EXTENT),ot=s.clamp(Math.round(Ke),0,s.EXTENT);q.emplaceBack(rt+Ve,ot)}const qe=(Ke,ce)=>{const Ve=131*ce+Ke;W.emplaceBack(Ve+1,Ve,Ve+131),W.emplaceBack(Ve+131,Ve+131+1,Ve+1)};for(let Ke=1;Ke<129;Ke++)for(let ce=1;ce<129;ce++)qe(ce,Ke);return[0,129].forEach(Ke=>{for(let ce=0;ce<130;ce++)qe(ce,Ke),qe(Ke,ce)}),[q,W,32768]}(),O=r.context;this.gridBuffer=O.createVertexBuffer(m,s.posAttributes.members),this.gridIndexBuffer=O.createIndexBuffer(b),this.gridSegments=s.SegmentVector.simpleSegment(0,0,m.length,b.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,m.length,T),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new ra(c.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,s.EXTENT,0,s.EXTENT,0,1);const L=O.gl;this._overlapStencilMode=new s.StencilMode({func:L.GEQUAL,mask:255},0,255,L.KEEP,L.KEEP,L.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new yo(c.map)}set style(r){r.on("data",this._onStyleDataEvent.bind(this)),r.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=r,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,c,m){if(r&&r.terrain){this._style!==r&&(this.style=r),this.enabled=!0;const b=r.terrain.properties;this.sourceCache=0===r.terrain.drapeRenderMode?this._mockSourceCache:r._getSourceCache(b.get("source")),this._exaggeration=b.get("exaggeration");const T=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const O=this.getScaledDemTileSize();this.sourceCache.update(c,O,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,T(),this._initializing=!0),T(),c.updateElevation(!0,m),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(r){this._findCoveringTileCache[r]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const r=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==r.efficiency&&s.warnOnce(`Terrain render cache efficiency is not optimal (${r.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${r.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(r){r.coord&&"source"===r.dataType?this._clearRenderCacheForTile(r.sourceCacheId,r.coord):"style"===r.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const r in this._style._sourceCaches)this._style._sourceCaches[r].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(r=>r.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const r=2*this.proxySourceCache.getSource().tileSize;return[r,r]}set useVertexMorphing(r){this._useVertexMorphing=r}updateTileBinding(r){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,m=this.painter.transform;this._initializing&&(this._initializing=0===m._centerAltitude&&-1===this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(m.center),-1),this._emptyDEMTextureDirty=!this._initializing);const b=this.proxyCoords=c.getIds().map(Z=>{const q=c.getTileByID(Z).tileID;return q.projMatrix=m.calculateProjMatrix(q.toUnwrapped()),q});(function(Z,q){const W=q.transform.pointCoordinate(q.transform.getCameraPoint()),se=new s.Point(W.x,W.y);Z.sort((Oe,$e)=>{if($e.overscaledZ-Oe.overscaledZ)return $e.overscaledZ-Oe.overscaledZ;const We=new s.Point(Oe.canonical.x+(1<{this.proxyToSource[Z.key]={}}),this.terrainTileForTile={};const O=this._style._sourceCaches;for(const Z in O){const q=O[Z];if(!q.used||(q!==this.sourceCache&&this.resetTileLookupCache(q.id),this._setupProxiedCoordsForOrtho(q,r[Z],T),q.usedForTerrain))continue;const W=r[Z];q.getSource().reparseOverscaled&&this._assignTerrainTiles(W)}this.proxiedCoords[c.id]=b.map(Z=>new Rs(Z,Z.key,this.orthoMatrix)),this._assignTerrainTiles(b),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(T),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const L={};this._visibleDemTiles=[];for(const Z of this.proxyCoords){const q=this.terrainTileForTile[Z.key];if(!q)continue;const W=q.tileID.key;W in L||(this._visibleDemTiles.push(q),L[W]=W)}}_assignTerrainTiles(r){this._initializing||r.forEach(c=>{if(this.terrainTileForTile[c.key])return;const m=this._findTileCoveringTileID(c,this.sourceCache);m&&(this.terrainTileForTile[c.key]=m)})}_prepareDEMTextures(){const r=this.painter.context,c=r.gl;for(const m in this.terrainTileForTile){const b=this.terrainTileForTile[m],T=b.dem;!T||b.demTexture&&!b.needsDEMTextureUpload||(r.activeTexture.set(c.TEXTURE1),Cs(this.painter,b,T))}}_prepareDemTileUniforms(r,c,m,b){if(!c||null==c.demTexture)return!1;const T=r.tileID.canonical,O=Math.pow(2,c.tileID.canonical.z-T.z),L=b||"";return m[`u_dem_tl${L}`]=[T.x*O%1,T.y*O%1],m[`u_dem_scale${L}`]=O,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const r=this.painter.context,c=r.gl;if(!this._emptyDepthBufferTexture){const m=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(r,m,c.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let r=0;const c=this._visibleDemTiles.reduce((m,b)=>{if(!b.dem)return m;const T=b.dem.tree.minimums[0];return T>0&&r++,m+T},0);return r?c/r:0}_updateEmptyDEMTexture(){const r=this.painter.context,c=r.gl;r.activeTexture.set(c.TEXTURE2);const m=this._getLoadedAreaMinimum(),b=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(m,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let T=this._emptyDEMTexture;return T?T.update(b,{premultiply:!1}):T=this._emptyDEMTexture=new s.Texture(r,b,c.RGBA,{premultiply:!1}),T}setupElevationDraw(r,c,m){const b=this.painter.context,T=b.gl,O=(L=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(L),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var L;O.u_dem_size=this.sourceCache.getSource().tileSize,O.u_exaggeration=this.exaggeration();let Z=null,q=null,W=1;if(m&&m.morphing&&this._useVertexMorphing){const se=m.morphing.srcDemTile,Oe=m.morphing.dstDemTile;W=m.morphing.phase,se&&Oe&&(this._prepareDemTileUniforms(r,se,O,"_prev")&&(q=se),this._prepareDemTileUniforms(r,Oe,O)&&(Z=Oe))}if(q&&Z?(b.activeTexture.set(T.TEXTURE2),Z.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE,T.NEAREST),b.activeTexture.set(T.TEXTURE4),q.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE,T.NEAREST),O.u_dem_lerp=W):(Z=this.terrainTileForTile[r.tileID.key],b.activeTexture.set(T.TEXTURE2),(this._prepareDemTileUniforms(r,Z,O)?Z.demTexture:this.emptyDEMTexture).bind(T.NEAREST,T.CLAMP_TO_EDGE)),b.activeTexture.set(T.TEXTURE3),m&&m.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE),this._depthFBO&&(O.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE),O.u_depth_size_inv=[1,1]),m&&m.useMeterToDem&&Z){const se=(1<{if(ce===Zn)return;const An=[Do[Zn],"PROJECTION_GLOBE_VIEW"];ot&&An.push("CUSTOM_ANTIALIASING"),sn&&An.push(Do[Ve]),Ke=q.useProgram("globeRaster",null,An),ce=Zn},Mt=q.colorModeForRenderPass(),Dt=new s.DepthMode(qe.LEQUAL,s.DepthMode.ReadWrite,q.depthRangeFor3D);fs.update($e);const $t=s.calculateGlobeMercatorMatrix(rt),zt=[s.mercatorXfromLng(rt.center.lng),s.mercatorYfromLat(rt.center.lat)],dn=Ve?[!1,!0]:[!1],Vn=q.globeSharedBuffers,on=[rt.width*s.exported.devicePixelRatio,rt.height*s.exported.devicePixelRatio],Rn=Float32Array.from(rt.globeMatrix),un={useDenormalizedUpVectorScale:!0};if(dn.forEach(Zn=>{const sn=q.transform,An=Hs(sn.zoom)*W.exaggeration();ce=-1;const Gn=Zn?qe.LINES:qe.TRIANGLES;for(const Ln of Oe){const Wn=se.getTile(Ln),Di=s.StencilMode.disabled,Gi=W.prevTerrainTileForTile[Ln.key],hi=W.terrainTileForTile[Ln.key];Ur(Gi,hi)&&fs.newMorphing(Ln.key,Gi,hi,$e,250),We.activeTexture.set(qe.TEXTURE0),Wn.texture.bind(qe.LINEAR,qe.CLAMP_TO_EDGE);const Pi=fs.getMorphValuesForProxy(Ln.key),ur=Pi?1:0;Pi&&s.extend$1(un,{morphing:{srcDemTile:Pi.from,dstDemTile:Pi.to,phase:s.easeCubicInOut(Pi.phase)}});const dr=s.tileCornersToBounds(Ln.canonical),xi=s.getLatitudinalLod(dr.getCenter().lat),Cr=s.getGridMatrix(Ln.canonical,dr,xi,sn.worldSize/sn._pixelsPerMercatorPixel),Kr=s.globeNormalizeECEF(s.globeTileBounds(Ln.canonical)),Wr=ia(sn.projMatrix,Rn,$t,Kr,s.globeToMercatorTransition(sn.zoom),zt,sn.frustumCorners.TL,sn.frustumCorners.TR,sn.frustumCorners.BR,sn.frustumCorners.BL,sn.globeCenterInViewSpace,sn.globeRadius,on,An,Cr);if(Tt(ur,Zn),W.setupElevationDraw(Wn,Ke,un),q.prepareDrawProgram(We,Ke,Ln.toUnwrapped()),Vn){const[qr,ns,_s]=Zn?Vn.getWirefameBuffers(q.context,xi):Vn.getGridBuffers(xi,0!==An);Ke.draw(We,Gn,Dt,Di,Mt,s.CullFaceMode.backCCW,Wr,"globe_raster",qr,ns,_s)}}}),Vn){const Zn=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ot&&Zn.push("CUSTOM_ANTIALIASING"),Ke=q.useProgram("globeRaster",null,Zn);for(const sn of Oe){const{x:An,y:Gn,z:Ln}=sn.canonical,Wn=0===Gn,Di=Gn===(1<Wr.draw(We,qe.TRIANGLES,Dt,s.StencilMode.disabled,Mt,s.CullFaceMode.disabled,ia(rt.projMatrix,xi,xi,Cr,0,zt,rt.frustumCorners.TL,rt.frustumCorners.TR,rt.frustumCorners.BR,rt.frustumCorners.BL,rt.globeCenterInViewSpace,rt.globeRadius,on,0),"globe_pole_raster",qr,Pi,ur);W.setupElevationDraw(dr,Ke,un),q.prepareDrawProgram(We,Ke,sn.toUnwrapped()),Wn&&Kr(Ke,Gi),Di&&(xi=s.scale(s.create(),xi,[1,-1,1]),Kr(Ke,hi))}}}}(b,T,O,L,Z);else{const q=b.context,W=q.gl;let se,Oe;const $e=b.options.showTerrainWireframe?2:0,We=(rt,ot)=>{if(Oe===rt)return;const Tt=[Do[rt]];ot&&Tt.push(Do[$e]),se=b.useProgram("terrainRaster",null,Tt),Oe=rt},qe=b.colorModeForRenderPass(),Ke=new s.DepthMode(W.LEQUAL,s.DepthMode.ReadWrite,b.depthRangeFor3D);fs.update(Z);const ce=b.transform,Ve=Hs(ce.zoom)*T.exaggeration();($e?[!1,!0]:[!1]).forEach(rt=>{Oe=-1;const ot=rt?W.LINES:W.TRIANGLES,[Tt,Mt]=rt?T.getWirefameBuffer():[T.gridIndexBuffer,T.gridSegments];for(const Dt of L){const $t=O.getTile(Dt),zt=s.StencilMode.disabled,dn=T.prevTerrainTileForTile[Dt.key],Vn=T.terrainTileForTile[Dt.key];Ur(dn,Vn)&&fs.newMorphing(Dt.key,dn,Vn,Z,250),q.activeTexture.set(W.TEXTURE0),$t.texture.bind(W.LINEAR,W.CLAMP_TO_EDGE,W.LINEAR_MIPMAP_NEAREST);const on=fs.getMorphValuesForProxy(Dt.key),Rn=on?1:0;let un;on&&(un={morphing:{srcDemTile:on.from,dstDemTile:on.to,phase:s.easeCubicInOut(on.phase)}});const Zn=Os(Dt.projMatrix,Io(Dt.canonical,ce.renderWorldCopies)?Ve/10:Ve);We(Rn,rt),T.setupElevationDraw($t,se,un),b.prepareDrawProgram(q,se,Dt.toUnwrapped()),se.draw(q,ot,Ke,zt,qe,s.CullFaceMode.backCCW,Zn,"terrain_raster",T.gridBuffer,Tt,Mt)}})}}(c,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(0===this._drapedRenderBatches.length)return r+1;this.renderingToTexture=!0;const c=this.painter,m=this.painter.context,b=this.proxySourceCache,T=this.proxiedCoords[b.id],O=this._drapedRenderBatches.shift(),L=[],Z=c.style.order;let q=0;for(const W of T){const se=b.getTileByID(W.proxyTileKey),Oe=b.proxyCachedFBO[W.key]?b.proxyCachedFBO[W.key][r]:void 0,$e=void 0!==Oe?b.renderCache[Oe]:this.pool[q++],We=void 0!==Oe;if(se.texture=$e.tex,We&&!$e.dirty){L.push(se.tileID);continue}let qe;m.bindFramebuffer.set($e.fb.framebuffer),this.renderedToTile=!1,$e.dirty&&(m.clear({color:s.Color.transparent,stencil:0}),$e.dirty=!1);for(let Ke=O.start;Ke<=O.end;++Ke){const ce=c.style._layers[Z[Ke]];if(ce.isHidden(c.transform.zoom))continue;const Ve=c.style._getLayerSourceCache(ce),rt=Ve?this.proxyToSource[W.key][Ve.id]:[W];if(!rt)continue;const ot=rt;m.viewport.set([0,0,$e.fb.width,$e.fb.height]),qe!==(Ve?Ve.id:null)&&(this._setupStencil($e,rt,ce,Ve),qe=Ve?Ve.id:null),c.renderLayer(c,Ve,ce,ot)}this.renderedToTile?($e.dirty=!0,L.push(se.tileID)):We||--q,5===q&&(q=0,this.renderToBackBuffer(L))}return this.renderToBackBuffer(L),this.renderingToTexture=!1,m.bindFramebuffer.set(null),m.viewport.set([0,0,c.width,c.height]),O.end+1}postRender(){}renderCacheEfficiency(r){const c=r.order.length;if(0===c)return{efficiency:100};let m,b=0,T=0,O=!1;for(let L=0;Lc.dem).forEach(c=>{r=Math.min(r,c.dem.tree.minimums[0])}),0===r?r:(r-30)*this._exaggeration}raycast(r,c,m){if(!this._visibleDemTiles)return null;const b=this._visibleDemTiles.filter(T=>T.dem).map(T=>{const O=T.tileID,L=1<(null!==T.t?T.t:Number.MAX_VALUE)-(null!==O.t?O.t:Number.MAX_VALUE));for(const T of b){if(null==T.t)return null;const O=T.tile.dem.tree.raycast(T.minx,T.miny,T.maxx,T.maxy,r,c,m);if(null!=O)return O}return null}_createFBO(){const r=this.painter.context,c=r.gl,m=this.drapeBufferSize;r.activeTexture.set(c.TEXTURE0);const b=new s.Texture(r,{width:m[0],height:m[1],data:null},c.RGBA);b.bind(c.LINEAR,c.CLAMP_TO_EDGE);const T=r.createFramebuffer(m[0],m[1],!1);return T.colorAttachment.set(b.texture),T.depthAttachment=new Et(r,T.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=r.createRenderbuffer(r.gl.DEPTH_STENCIL,m[0],m[1]),this._stencilRef=0,T.depthAttachment.set(this._sharedDepthStencil),r.clear({stencil:0})):T.depthAttachment.set(this._sharedDepthStencil),r.extTextureFilterAnisotropic&&!r.extTextureFilterAnisotropicForceOff&&c.texParameterf(c.TEXTURE_2D,r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.extTextureFilterAnisotropicMax),{fb:T,tex:b,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._layers[r],m=c.isHidden(this.painter.transform.zoom);return"custom"===c.type?!m&&c.shouldRedrape():!m&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(const m of this._style._getSources())if(m instanceof zn){r=!0;break}if(!r)return;const c={};for(let m=0;mc.renderCachePool.length){const O=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let L=0;L=0;O--){const L=m[O];if(c.getTileByID(L.key),void 0!==c.proxyCachedFBO[L.key]){const Z=r[L.key],q=this.proxyToSource[L.key];let W=0;for(const se in q){const Oe=q[se],$e=Z[se];if(!$e||$e.length!==Oe.length||Oe.some((We,qe)=>We!==$e[qe]||b[se]&&b[se].hasOwnProperty(We.key))){W=-1;break}++W}for(const se in c.proxyCachedFBO[L.key])c.renderCache[c.proxyCachedFBO[L.key][se]].dirty=W<0||W!==Object.values(Z).length}}const T=[...this._drapedRenderBatches];T.sort((O,L)=>L.end-L.start-(O.end-O.start));for(const O of T)for(const L of m){if(c.proxyCachedFBO[L.key])continue;let Z=c.renderCachePool.pop();void 0===Z&&c.renderCache.length<50&&(Z=c.renderCache.length,c.renderCache.push(this._createFBO())),void 0!==Z&&(c.proxyCachedFBO[L.key]={},c.proxyCachedFBO[L.key][O.start]=Z,c.renderCache[Z].dirty=!0)}this._tilesDirty={}}_setupStencil(r,c,m,b){if(!b||!this._sourceTilesOverlap[b.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const T=this.painter.context,O=T.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let L;if(m.isTileClipped())L=c.length,this._overlapStencilMode.test={func:O.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);L=1,this._overlapStencilMode.test={func:O.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+L>255&&(T.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=L,this._overlapStencilMode.ref=this._stencilRef,m.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(r){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[r.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(r,c){const m=this.painter,b=this.painter.context,T=b.gl;m._tileClippingMaskIDs={},b.setColorMode(s.ColorMode.disabled),b.setDepthMode(s.DepthMode.disabled);const O=m.useProgram("clippingMask");for(const L of r){const Z=m._tileClippingMaskIDs[L.key]=--c;O.draw(b,T.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:T.ALWAYS,mask:0},Z,255,T.KEEP,T.KEEP,T.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,el(L.projMatrix),"$clipping",m.tileExtentBuffer,m.quadTriangleIndexBuffer,m.tileExtentSegments)}}pointCoordinate(r){const c=this.painter.transform;if(r.x<0||r.x>c.width||r.y<0||r.y>c.height)return null;const m=[r.x,r.y,1,1];s.transformMat4$1(m,m,c.pixelMatrixInverse),s.scale$1(m,m,1/m[3]),m[0]/=c.worldSize,m[1]/=c.worldSize;const b=c._camera.position,T=s.mercatorZfromAltitude(1,c.center.lat),O=[b[0],b[1],b[2]/T,0],L=s.subtract([],m.slice(0,3),O);s.normalize(L,L);const Z=this.raycast(O,L,this._exaggeration);return null!==Z&&Z?(s.scaleAndAdd(O,O,L,Z),O[3]=O[2],O[2]*=T,O):null}drawDepth(){const r=this.painter,c=r.context,m=this.proxySourceCache,b=Math.ceil(r.width),T=Math.ceil(r.height);if(!this._depthFBO||this._depthFBO.width===b&&this._depthFBO.height===T||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const O=c.gl,L=c.createFramebuffer(b,T,!0);c.activeTexture.set(O.TEXTURE0);const Z=new s.Texture(c,{width:b,height:T,data:null},O.RGBA);Z.bind(O.NEAREST,O.CLAMP_TO_EDGE),L.colorAttachment.set(Z.texture);const q=c.createRenderbuffer(c.gl.DEPTH_COMPONENT16,b,T);L.depthAttachment.set(q),this._depthFBO=L,this._depthTexture=Z}c.bindFramebuffer.set(this._depthFBO.framebuffer),c.viewport.set([0,0,b,T]),function(O,L,Z,q){if("globe"===O.transform.projection.name)return;const W=O.context,se=W.gl;W.clear({depth:1});const Oe=O.useProgram("terrainDepth"),$e=new s.DepthMode(se.LESS,s.DepthMode.ReadWrite,O.depthRangeFor3D);for(const We of q){const qe=Z.getTile(We),Ke=Os(We.projMatrix,0);L.setupElevationDraw(qe,Oe),Oe.draw(W,se.TRIANGLES,$e,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,Ke,"terrain_depth",L.gridBuffer,L.gridIndexBuffer,L.gridNoSkirtSegments)}}(r,this,m,this.proxyCoords)}_setupProxiedCoordsForOrtho(r,c,m){if(r.getSource()instanceof xe)return this._setupProxiedCoordsForImageSource(r,c,m);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};const b=this.proxiedCoords[r.id]=[],T=this.proxyCoords;for(let L=0;L(W.min.x=Math.min(W.min.x,se.x-L.x),W.min.y=Math.min(W.min.y,se.y-L.y),W.max.x=Math.max(W.max.x,se.x-L.x),W.max.y=Math.max(W.max.y,se.y-L.y),W),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),q=(W,se)=>{const Oe=W.wrap+W.canonical.x/(1<qe+Z.max.x||$e+WeKe+Z.max.y};for(let W=0;WO.key===c.tileID.key);if(T)return T}if(c.tileID.key!==r.key){const T=r.canonical.z-c.tileID.canonical.z;let O,L,Z;b=s.create();const q=c.tileID.wrap-r.wrap<0?(O=s.EXTENT>>T,L=O*((c.tileID.canonical.x<=se){const Oe=r.canonical.z-se;c.getSource().reparseOverscaled?(L=Math.max(r.canonical.z+2,c.transform.tileZoom),O=new s.OverscaledTileID(L,r.wrap,se,r.canonical.x>>Oe,r.canonical.y>>Oe)):0!==Oe&&(L=se,O=new s.OverscaledTileID(L,r.wrap,se,r.canonical.x>>Oe,r.canonical.y>>Oe))}O.key!==r.key&&(q.push(O.key),m=c.getTile(O))}const W=se=>{q.forEach(Oe=>{b[Oe]=se}),q.length=0};for(L-=1;L>=Z&&(!m||!m.hasData());L--){m&&W(m.tileID.key);const se=O.calculateScaledKey(L);if(m=c.getTileByID(se),m&&m.hasData())break;const Oe=b[se];if(null===Oe)break;void 0===Oe?q.push(se):m=c.getTileByID(Oe)}return W(m?m.tileID.key:null),m&&m.hasData()?m:null}findDEMTileFor(r){return this.enabled?this._findTileCoveringTileID(r,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(r,c){let m=this._tilesDirty[r];m||(m=this._tilesDirty[r]={}),m[c.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const r=function(c){let m=0;const b=new s.StructArrayLayout2ui4,T=131;for(let O=1;O<129;O++){for(let L=1;L<129;L++)m=O*T+L,b.emplaceBack(m,m+1),b.emplaceBack(m,m+T),b.emplaceBack(m+1,m+T),128===O&&b.emplaceBack(m+T,m+T+1);b.emplaceBack(m+1,m+1+T)}return b}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(r),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,r.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class ki{static cacheKey(r,c,m,b){let T=`${c}${b?b.cacheKey:""}`;for(const O of m)r.usedDefines.includes(O)&&(T+=`/${O}`);return T}constructor(r,c,m,b,T,O){const L=r.gl;this.program=L.createProgram();const Z=function(ce){const Ve=[];for(let rt=0;rt`#define ${ce}`));const Oe=r.isWebGL2?"#version 300 es\n":"",$e=Oe+se.concat(r.extStandardDerivatives&&0===Oe.length?"#extension GL_OES_standard_derivatives : enable\n".concat(ws):ws,ws,zs,Br.fragmentSource,Xo.fragmentSource,m.fragmentSource).join("\n"),We=Oe+se.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",zs,Br.vertexSource,Xo.vertexSource,Ns.vertexSource,m.vertexSource).join("\n"),qe=L.createShader(L.FRAGMENT_SHADER);if(L.isContextLost())return void(this.failedToCreate=!0);L.shaderSource(qe,$e),L.compileShader(qe),L.attachShader(this.program,qe);const Ke=L.createShader(L.VERTEX_SHADER);if(L.isContextLost())this.failedToCreate=!0;else{L.shaderSource(Ke,We),L.compileShader(Ke),L.attachShader(this.program,Ke),this.attributes={},this.numAttributes=W.length;for(let ce=0;ce({u_tile_tl_up:new s.Uniform3f(ce),u_tile_tr_up:new s.Uniform3f(ce),u_tile_br_up:new s.Uniform3f(ce),u_tile_bl_up:new s.Uniform3f(ce),u_tile_up_scale:new s.Uniform1f(ce)}))(r)),O.includes("FOG")&&(this.fogUniforms=(ce=>({u_fog_matrix:new s.UniformMatrix4f(ce),u_fog_range:new s.Uniform2f(ce),u_fog_color:new s.Uniform4f(ce),u_fog_horizon_blend:new s.Uniform1f(ce),u_fog_temporal_offset:new s.Uniform1f(ce),u_frustum_tl:new s.Uniform3f(ce),u_frustum_tr:new s.Uniform3f(ce),u_frustum_br:new s.Uniform3f(ce),u_frustum_bl:new s.Uniform3f(ce),u_globe_pos:new s.Uniform3f(ce),u_globe_radius:new s.Uniform1f(ce),u_globe_transition:new s.Uniform1f(ce),u_is_globe:new s.Uniform1i(ce),u_viewport:new s.Uniform2f(ce)}))(r))}var ce}setTerrainUniformValues(r,c){if(!this.terrainUniforms)return;const m=this.terrainUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const b in c)m[b]&&m[b].set(this.program,b,c[b])}}setGlobeUniformValues(r,c){if(!this.globeUniforms)return;const m=this.globeUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const b in c)m[b]&&m[b].set(this.program,b,c[b])}}setFogUniformValues(r,c){if(!this.fogUniforms)return;const m=this.fogUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const b in c)m[b].set(this.program,b,c[b])}}draw(r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe){const Ke=r.gl;if(this.failedToCreate)return;r.program.set(this.program),r.setDepthMode(m),r.setStencilMode(b),r.setColorMode(T),r.setCullFace(O);for(const Ve of Object.keys(this.fixedUniforms))this.fixedUniforms[Ve].set(this.program,Ve,L[Ve]);We&&We.setUniforms(this.program,r,this.binderUniforms,Oe,{zoom:$e});const ce={[Ke.LINES]:2,[Ke.TRIANGLES]:3,[Ke.LINE_STRIP]:1}[c];for(const Ve of se.get()){const rt=Ve.vaos||(Ve.vaos={});(rt[Z]||(rt[Z]=new Ps)).bind(r,this,q,We?We.getPaintVertexBuffers():[],W,Ve.vertexOffset,qe||[]),Ke.drawElements(c,Ve.primitiveLength*ce,Ke.UNSIGNED_SHORT,Ve.primitiveOffset*ce*2)}}}function Ws(f,r){const c=Math.pow(2,r.tileID.overscaledZ),m=r.tileSize*Math.pow(2,f.transform.tileZoom)/c,b=m*(r.tileID.canonical.x+r.tileID.wrap*c),T=m*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_tile_units_to_pixels:1/qt(r,1,f.transform.tileZoom),u_pixel_coord_upper:[b>>16,T>>16],u_pixel_coord_lower:[65535&b,65535&T]}}const v=s.create(),M=(f,r,c,m,b,T,O,L,Z,q,W)=>{const se=r.style.light,Oe=se.properties.get("position"),$e=[Oe.x,Oe.y,Oe.z],We=s.create$1();"viewport"===se.properties.get("anchor")&&(s.fromRotation(We,-r.transform.angle),s.transformMat3($e,$e,We));const qe=se.properties.get("color"),Ke=r.transform,ce={u_matrix:f,u_lightpos:$e,u_lightintensity:se.properties.get("intensity"),u_lightcolor:[qe.r,qe.g,qe.b],u_vertical_gradient:+c,u_opacity:m,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:v,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:b,u_edge_radius:T};return"globe"===Ke.projection.name&&(ce.u_tile_id=[O.canonical.x,O.canonical.y,1<{const Oe=M(f,r,c,m,b,T,O,Z,q,W,se),$e={u_height_factor:-Math.pow(2,O.overscaledZ)/L.tileSize/8};return s.extend(Oe,Ws(r,L),$e)},A=f=>({u_matrix:f}),G=(f,r,c)=>s.extend(A(f),Ws(r,c)),It=(f,r)=>({u_matrix:f,u_world:r}),Yn=(f,r,c,m)=>s.extend(G(f,r,c),{u_world:m}),pi=s.create(),tr=(f,r,c,m,b,T)=>{const O=f.transform,L="globe"===O.projection.name;let Z;if("map"===T.paint.get("circle-pitch-alignment"))if(L){const W=s.globePixelsToTileUnits(O.zoom,r.canonical)*O._pixelsPerMercatorPixel;Z=Float32Array.from([W,0,0,W])}else Z=O.calculatePixelsToTileUnitsMatrix(c);else Z=new Float32Array([O.pixelsToGLUnits[0],0,0,O.pixelsToGLUnits[1]]);const q={u_camera_to_center_distance:O.cameraToCenterDistance,u_matrix:f.translatePosMatrix(r.projMatrix,c,T.paint.get("circle-translate"),T.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:Z,u_inv_rot_matrix:pi,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(L){q.u_inv_rot_matrix=m,q.u_merc_center=b,q.u_tile_id=[r.canonical.x,r.canonical.y,1<{const r=[];return"map"===f.paint.get("circle-pitch-alignment")&&r.push("PITCH_WITH_MAP"),"map"===f.paint.get("circle-pitch-scale")&&r.push("SCALE_WITH_MAP"),r},Mo=(f,r,c,m)=>{const b=s.EXTENT/c.tileSize;return{u_matrix:f,u_camera_to_center_distance:r.getCameraToCenterDistance(m),u_extrude_scale:[r.pixelsToGLUnits[0]/b,r.pixelsToGLUnits[1]/b]}},oa=(f,r,c=1)=>({u_matrix:f,u_color:r,u_overlay:0,u_overlay_scale:c}),Es=s.create(),ks=(f,r,c,m,b,T,O)=>{const L=f.transform,Z="globe"===L.projection.name,q=Z?s.globePixelsToTileUnits(L.zoom,r.canonical)*L._pixelsPerMercatorPixel:qt(c,1,T),W={u_matrix:r.projMatrix,u_extrude_scale:q,u_intensity:O,u_inv_rot_matrix:Es,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(Z){W.u_inv_rot_matrix=m,W.u_merc_center=b,W.u_tile_id=[r.canonical.x,r.canonical.y,1<{const L=f.transform,Z=L.calculatePixelsToTileUnitsMatrix(r);return{u_matrix:yl(f,r,c,m),u_pixels_to_tile_units:Z,u_device_pixel_ratio:T,u_units_to_pixels:[1/L.pixelsToGLUnits[0],1/L.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:b,u_texsize:Ba(c)?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:da(r,f.transform),u_alpha_discard_threshold:0,u_trim_offset:O}},tl=(f,r,c,m,b)=>{const T=f.transform;return{u_matrix:yl(f,r,c,m),u_texsize:r.imageAtlasTexture.size,u_pixels_to_tile_units:T.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:b,u_image:0,u_tile_units_to_pixels:da(r,T),u_units_to_pixels:[1/T.pixelsToGLUnits[0],1/T.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function da(f,r){return 1/qt(f,1,r.tileZoom)}function yl(f,r,c,m){return f.translatePosMatrix(m||r.tileID.projMatrix,r,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}function Ba(f){const r=f.paint.get("line-dasharray").value;return r.value||"constant"!==r.kind}const vl=(f,r,c,m,b,T)=>{return{u_matrix:f,u_tl_parent:r,u_scale_parent:c,u_fade_t:m.mix,u_opacity:m.opacity*b.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:b.paint.get("raster-brightness-min"),u_brightness_high:b.paint.get("raster-brightness-max"),u_saturation_factor:(L=b.paint.get("raster-saturation"),L>0?1-1/(1.001-L):-L),u_contrast_factor:(O=b.paint.get("raster-contrast"),O>0?1/(1-O):1+O),u_spin_weights:Ts(b.paint.get("raster-hue-rotate")),u_perspective_transform:T};var O,L};function Ts(f){f*=Math.PI/180;const r=Math.sin(f),c=Math.cos(f);return[(2*c+1)/3,(-Math.sqrt(3)*r-c+1)/3,(Math.sqrt(3)*r-c+1)/3]}const cc=s.create(),ha=(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe)=>{const Ke=b.transform,ce={u_is_size_zoom_constant:+("constant"===f||"source"===f),u_is_size_feature_constant:+("constant"===f||"camera"===f),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:Ke.cameraToCenterDistance,u_rotate_symbol:+c,u_aspect_ratio:Ke.width/Ke.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:T,u_label_plane_matrix:O,u_coord_matrix:L,u_is_text:+Z,u_pitch_with_map:+m,u_texsize:q,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:cc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:cc,u_up_vector:[0,-1,0]};return"globe"===qe.name&&(ce.u_tile_id=[W.canonical.x,W.canonical.y,1<s.extend(ha(f,r,c,m,b,T,O,L,Z,q,se,Oe,$e,We,qe,Ke),{u_gamma_scale:m?b.transform.cameraToCenterDistance*Math.cos(b.terrain?0:b.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+W}),uc=(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe)=>s.extend(Ca(f,r,c,m,b,T,O,L,!0,Z,!0,W,se,Oe,$e,We,qe),{u_texsize_icon:q,u_texture_icon:1}),Ea=(f,r,c)=>({u_matrix:f,u_opacity:r,u_color:c}),dc=(f,r,c,m,b)=>s.extend(function(T,O,L){const Z=O.imageManager.getPattern(T.toString()),{width:q,height:W}=O.imageManager.getPixelSize(),se=Math.pow(2,L.tileID.overscaledZ),Oe=L.tileSize*Math.pow(2,O.transform.tileZoom)/se,$e=Oe*(L.tileID.canonical.x+L.tileID.wrap*se),We=Oe*L.tileID.canonical.y;return{u_image:0,u_pattern_tl:Z.tl,u_pattern_br:Z.br,u_texsize:[q,W],u_pattern_size:Z.displaySize,u_tile_units_to_pixels:1/qt(L,1,O.transform.tileZoom),u_pixel_coord_upper:[$e>>16,We>>16],u_pixel_coord_lower:[65535&$e,65535&We]}}(m,c,b),{u_matrix:f,u_opacity:r}),fa={fillExtrusion:f=>({u_matrix:new s.UniformMatrix4f(f),u_lightpos:new s.Uniform3f(f),u_lightintensity:new s.Uniform1f(f),u_lightcolor:new s.Uniform3f(f),u_vertical_gradient:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f),u_edge_radius:new s.Uniform1f(f),u_ao:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_up_dir:new s.Uniform3f(f),u_height_lift:new s.Uniform1f(f)}),fillExtrusionPattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_lightpos:new s.Uniform3f(f),u_lightintensity:new s.Uniform1f(f),u_lightcolor:new s.Uniform3f(f),u_vertical_gradient:new s.Uniform1f(f),u_height_factor:new s.Uniform1f(f),u_edge_radius:new s.Uniform1f(f),u_ao:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_up_dir:new s.Uniform3f(f),u_height_lift:new s.Uniform1f(f),u_image:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f)}),fill:f=>({u_matrix:new s.UniformMatrix4f(f)}),fillPattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_image:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f)}),fillOutline:f=>({u_matrix:new s.UniformMatrix4f(f),u_world:new s.Uniform2f(f)}),fillOutlinePattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_world:new s.Uniform2f(f),u_image:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f)}),circle:f=>({u_camera_to_center_distance:new s.Uniform1f(f),u_extrude_scale:new s.UniformMatrix2f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_up_dir:new s.Uniform3f(f)}),collisionBox:f=>({u_matrix:new s.UniformMatrix4f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_extrude_scale:new s.Uniform2f(f)}),collisionCircle:f=>({u_matrix:new s.UniformMatrix4f(f),u_inv_matrix:new s.UniformMatrix4f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_viewport_size:new s.Uniform2f(f)}),debug:f=>({u_color:new s.UniformColor(f),u_matrix:new s.UniformMatrix4f(f),u_overlay:new s.Uniform1i(f),u_overlay_scale:new s.Uniform1f(f)}),clippingMask:f=>({u_matrix:new s.UniformMatrix4f(f)}),heatmap:f=>({u_extrude_scale:new s.Uniform1f(f),u_intensity:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_up_dir:new s.Uniform3f(f)}),heatmapTexture:f=>({u_image:new s.Uniform1i(f),u_color_ramp:new s.Uniform1i(f),u_opacity:new s.Uniform1f(f)}),hillshade:f=>({u_matrix:new s.UniformMatrix4f(f),u_image:new s.Uniform1i(f),u_latrange:new s.Uniform2f(f),u_light:new s.Uniform2f(f),u_shadow:new s.UniformColor(f),u_highlight:new s.UniformColor(f),u_accent:new s.UniformColor(f)}),hillshadePrepare:f=>({u_matrix:new s.UniformMatrix4f(f),u_image:new s.Uniform1i(f),u_dimension:new s.Uniform2f(f),u_zoom:new s.Uniform1f(f),u_unpack:new s.Uniform4f(f)}),line:f=>({u_matrix:new s.UniformMatrix4f(f),u_pixels_to_tile_units:new s.UniformMatrix2f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_units_to_pixels:new s.Uniform2f(f),u_dash_image:new s.Uniform1i(f),u_gradient_image:new s.Uniform1i(f),u_image_height:new s.Uniform1f(f),u_texsize:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f),u_alpha_discard_threshold:new s.Uniform1f(f),u_trim_offset:new s.Uniform2f(f)}),linePattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_texsize:new s.Uniform2f(f),u_pixels_to_tile_units:new s.UniformMatrix2f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_image:new s.Uniform1i(f),u_units_to_pixels:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f),u_alpha_discard_threshold:new s.Uniform1f(f)}),raster:f=>({u_matrix:new s.UniformMatrix4f(f),u_tl_parent:new s.Uniform2f(f),u_scale_parent:new s.Uniform1f(f),u_fade_t:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f),u_image0:new s.Uniform1i(f),u_image1:new s.Uniform1i(f),u_brightness_low:new s.Uniform1f(f),u_brightness_high:new s.Uniform1f(f),u_saturation_factor:new s.Uniform1f(f),u_contrast_factor:new s.Uniform1f(f),u_spin_weights:new s.Uniform3f(f),u_perspective_transform:new s.Uniform2f(f)}),symbolIcon:f=>({u_is_size_zoom_constant:new s.Uniform1i(f),u_is_size_feature_constant:new s.Uniform1i(f),u_size_t:new s.Uniform1f(f),u_size:new s.Uniform1f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_rotate_symbol:new s.Uniform1i(f),u_aspect_ratio:new s.Uniform1f(f),u_fade_change:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_label_plane_matrix:new s.UniformMatrix4f(f),u_coord_matrix:new s.UniformMatrix4f(f),u_is_text:new s.Uniform1i(f),u_pitch_with_map:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_camera_forward:new s.Uniform3f(f),u_tile_matrix:new s.UniformMatrix4f(f),u_up_vector:new s.Uniform3f(f),u_ecef_origin:new s.Uniform3f(f),u_texture:new s.Uniform1i(f)}),symbolSDF:f=>({u_is_size_zoom_constant:new s.Uniform1i(f),u_is_size_feature_constant:new s.Uniform1i(f),u_size_t:new s.Uniform1f(f),u_size:new s.Uniform1f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_rotate_symbol:new s.Uniform1i(f),u_aspect_ratio:new s.Uniform1f(f),u_fade_change:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_label_plane_matrix:new s.UniformMatrix4f(f),u_coord_matrix:new s.UniformMatrix4f(f),u_is_text:new s.Uniform1i(f),u_pitch_with_map:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_texture:new s.Uniform1i(f),u_gamma_scale:new s.Uniform1f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_camera_forward:new s.Uniform3f(f),u_tile_matrix:new s.UniformMatrix4f(f),u_up_vector:new s.Uniform3f(f),u_ecef_origin:new s.Uniform3f(f),u_is_halo:new s.Uniform1i(f)}),symbolTextAndIcon:f=>({u_is_size_zoom_constant:new s.Uniform1i(f),u_is_size_feature_constant:new s.Uniform1i(f),u_size_t:new s.Uniform1f(f),u_size:new s.Uniform1f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_rotate_symbol:new s.Uniform1i(f),u_aspect_ratio:new s.Uniform1f(f),u_fade_change:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_label_plane_matrix:new s.UniformMatrix4f(f),u_coord_matrix:new s.UniformMatrix4f(f),u_is_text:new s.Uniform1i(f),u_pitch_with_map:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_texsize_icon:new s.Uniform2f(f),u_texture:new s.Uniform1i(f),u_texture_icon:new s.Uniform1i(f),u_gamma_scale:new s.Uniform1f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_is_halo:new s.Uniform1i(f)}),background:f=>({u_matrix:new s.UniformMatrix4f(f),u_opacity:new s.Uniform1f(f),u_color:new s.UniformColor(f)}),backgroundPattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_opacity:new s.Uniform1f(f),u_image:new s.Uniform1i(f),u_pattern_tl:new s.Uniform2f(f),u_pattern_br:new s.Uniform2f(f),u_texsize:new s.Uniform2f(f),u_pattern_size:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f)}),terrainRaster:Qa,terrainDepth:Qa,skybox:f=>({u_matrix:new s.UniformMatrix4f(f),u_sun_direction:new s.Uniform3f(f),u_cubemap:new s.Uniform1i(f),u_opacity:new s.Uniform1f(f),u_temporal_offset:new s.Uniform1f(f)}),skyboxGradient:f=>({u_matrix:new s.UniformMatrix4f(f),u_color_ramp:new s.Uniform1i(f),u_center_direction:new s.Uniform3f(f),u_radius:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f),u_temporal_offset:new s.Uniform1f(f)}),skyboxCapture:f=>({u_matrix_3f:new s.UniformMatrix3f(f),u_sun_direction:new s.Uniform3f(f),u_sun_intensity:new s.Uniform1f(f),u_color_tint_r:new s.Uniform4f(f),u_color_tint_m:new s.Uniform4f(f),u_luminance:new s.Uniform1f(f)}),globeRaster:f=>({u_proj_matrix:new s.UniformMatrix4f(f),u_globe_matrix:new s.UniformMatrix4f(f),u_normalize_matrix:new s.UniformMatrix4f(f),u_merc_matrix:new s.UniformMatrix4f(f),u_zoom_transition:new s.Uniform1f(f),u_merc_center:new s.Uniform2f(f),u_image0:new s.Uniform1i(f),u_grid_matrix:new s.UniformMatrix3f(f),u_skirt_height:new s.Uniform1f(f),u_frustum_tl:new s.Uniform3f(f),u_frustum_tr:new s.Uniform3f(f),u_frustum_br:new s.Uniform3f(f),u_frustum_bl:new s.Uniform3f(f),u_globe_pos:new s.Uniform3f(f),u_globe_radius:new s.Uniform1f(f),u_viewport:new s.Uniform2f(f)}),globeAtmosphere:f=>({u_frustum_tl:new s.Uniform3f(f),u_frustum_tr:new s.Uniform3f(f),u_frustum_br:new s.Uniform3f(f),u_frustum_bl:new s.Uniform3f(f),u_horizon:new s.Uniform1f(f),u_transition:new s.Uniform1f(f),u_fadeout_range:new s.Uniform1f(f),u_color:new s.Uniform4f(f),u_high_color:new s.Uniform4f(f),u_space_color:new s.Uniform4f(f),u_star_intensity:new s.Uniform1f(f),u_star_density:new s.Uniform1f(f),u_star_size:new s.Uniform1f(f),u_temporal_offset:new s.Uniform1f(f),u_horizon_angle:new s.Uniform1f(f),u_rotation_matrix:new s.UniformMatrix4f(f)})};let Na;function xl(f,r,c,m,b,T,O){const L=f.context,Z=L.gl,q=f.transform,W=f.useProgram("collisionBox"),se=[];let Oe=0,$e=0;for(let ot=0;ot0){const on=s.create(),Rn=zt;s.mul(on,Dt.placementInvProjMatrix,q.glCoordMatrix),s.mul(on,on,Dt.placementViewportMatrix),se.push({circleArray:Vn,circleOffset:$e,transform:Rn,invTransform:on,projection:Dt.getProjection()}),Oe+=Vn.length/4,$e=Oe}dn&&(f.terrain&&f.terrain.setupElevationDraw(Mt,W),W.draw(L,Z.LINES,s.DepthMode.disabled,s.StencilMode.disabled,f.colorModeForRenderPass(),s.CullFaceMode.disabled,Mo(zt,q,Mt,Dt.getProjection()),c.id,dn.layoutVertexBuffer,dn.indexBuffer,dn.segments,null,q.zoom,null,[dn.collisionVertexBuffer,dn.collisionVertexBufferExt]))}if(!O||!se.length)return;const We=f.useProgram("collisionCircle"),qe=new s.StructArrayLayout2f1f2i16;qe.resize(4*Oe),qe._trim();let Ke=0;for(const ot of se)for(let Tt=0;Tt=0&&(We[ot.associatedIconIndex]={x:on,y:Rn,z:un,angle:Ln})}else fe(Dt,Oe)}if(W){$e.clear();const rt=f.icon.placedSymbolArray;for(let ot=0;oton.sortKey-Rn.sortKey);for(const on of zt){const Rn=on.state;if(f.terrain&&f.terrain.setupElevationDraw(Rn.tile,Rn.program,{useDepthForOcclusion:!$t,labelPlaneMatrixInv:Rn.labelPlaneMatrixInv}),Oe.activeTexture.set($e.TEXTURE0),Rn.atlasTexture.bind(Rn.atlasInterpolation,$e.CLAMP_TO_EDGE),Rn.atlasTextureIcon&&(Oe.activeTexture.set($e.TEXTURE1),Rn.atlasTextureIcon&&Rn.atlasTextureIcon.bind(Rn.atlasInterpolationIcon,$e.CLAMP_TO_EDGE)),Rn.isSDF){const un=Rn.uniformValues;Rn.hasHalo&&(un.u_is_halo=1,za(Rn.buffers,on.segments,c,f,Rn.program,Tt,W,se,un)),un.u_is_halo=0}za(Rn.buffers,on.segments,c,f,Rn.program,Tt,W,se,Rn.uniformValues)}}function za(f,r,c,m,b,T,O,L,Z){const q=m.context,W=[f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer,f.globeExtVertexBuffer];b.draw(q,q.gl.TRIANGLES,T,O,L,s.CullFaceMode.disabled,Z,c.id,f.layoutVertexBuffer,f.indexBuffer,r,c.paint,m.transform.zoom,f.programConfigurations.get(c.id),W)}function Mu(f,r,c,m,b,T,O){const L=f.context.gl,Z=c.paint.get("fill-pattern"),q=Z&&Z.constantOr(1);let W,se,Oe,$e,We;O?(se=q&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",W=L.LINES):(se=q?"fillPattern":"fill",W=L.TRIANGLES);for(const qe of m){const Ke=r.getTile(qe);if(q&&!Ke.patternsLoaded())continue;const ce=Ke.getBucket(c);if(!ce)continue;f.prepareDrawTile();const Ve=ce.programConfigurations.get(c.id),rt=f.useProgram(se,Ve);q&&(f.context.activeTexture.set(L.TEXTURE0),Ke.imageAtlasTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE),Ve.updatePaintBuffers());const ot=Z.constantOr(null);if(ot&&Ke.imageAtlas){const Mt=Ke.imageAtlas.patternPositions[ot.toString()];Mt&&Ve.setConstantPatternPositions(Mt)}const Tt=f.translatePosMatrix(qe.projMatrix,Ke,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(O){$e=ce.indexBuffer2,We=ce.segments2;const Mt=f.terrain&&f.terrain.renderingToTexture?f.terrain.drapeBufferSize:[L.drawingBufferWidth,L.drawingBufferHeight];Oe="fillOutlinePattern"===se&&q?Yn(Tt,f,Ke,Mt):It(Tt,Mt)}else $e=ce.indexBuffer,We=ce.segments,Oe=q?G(Tt,f,Ke):A(Tt);f.prepareDrawProgram(f.context,rt,qe.toUnwrapped()),rt.draw(f.context,W,b,f.stencilModeForClipping(qe),T,s.CullFaceMode.disabled,Oe,c.id,ce.layoutVertexBuffer,$e,We,c.paint,f.transform.zoom,Ve)}}function Ua(f,r,c,m,b,T,O){const L=f.context,Z=L.gl,q=f.transform,W=c.paint.get("fill-extrusion-pattern"),se=W.constantOr(1),Oe=c.paint.get("fill-extrusion-opacity"),$e=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),c.paint.get("fill-extrusion-ambient-occlusion-radius")],We=c.layout.get("fill-extrusion-edge-radius"),qe=We>0&&!c.paint.get("fill-extrusion-rounded-roof"),Ke=qe?0:We,ce="globe"===q.projection.name?s.fillExtrusionHeightLift():0,Ve="globe"===q.projection.name,rt=Ve?s.globeToMercatorTransition(q.zoom):0,ot=[s.mercatorXfromLng(q.center.lng),s.mercatorYfromLat(q.center.lat)],Tt=[];Ve&&Tt.push("PROJECTION_GLOBE_VIEW"),$e[0]>0&&Tt.push("FAUX_AO"),qe&&Tt.push("ZERO_ROOF_RADIUS");for(const Mt of m){const Dt=r.getTile(Mt),$t=Dt.getBucket(c);if(!$t||$t.projection.name!==q.projection.name)continue;const zt=$t.programConfigurations.get(c.id),dn=f.useProgram(se?"fillExtrusionPattern":"fillExtrusion",zt,Tt);if(f.terrain){const An=f.terrain;if(f.style.terrainSetForDrapingOnly())An.setupElevationDraw(Dt,dn,{useMeterToDem:!0});else{if(!$t.enableTerrain)continue;if(An.setupElevationDraw(Dt,dn,{useMeterToDem:!0}),Vl(L,r,Mt,$t,c,An),!$t.centroidVertexBuffer){const Gn=dn.attributes.a_centroid_pos;void 0!==Gn&&Z.vertexAttrib2f(Gn,0,0)}}}se&&(f.context.activeTexture.set(Z.TEXTURE0),Dt.imageAtlasTexture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE),zt.updatePaintBuffers());const Vn=W.constantOr(null);if(Vn&&Dt.imageAtlas){const An=Dt.imageAtlas.patternPositions[Vn.toString()];An&&zt.setConstantPatternPositions(An)}const on=f.translatePosMatrix(Mt.projMatrix,Dt,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Rn=q.projection.createInversionMatrix(q,Mt.canonical),un=c.paint.get("fill-extrusion-vertical-gradient"),Zn=se?D(on,f,un,Oe,$e,Ke,Mt,Dt,ce,rt,ot,Rn):M(on,f,un,Oe,$e,Ke,Mt,ce,rt,ot,Rn);f.prepareDrawProgram(L,dn,Mt.toUnwrapped());const sn=[];f.terrain&&sn.push($t.centroidVertexBuffer),Ve&&sn.push($t.layoutVertexExtBuffer),dn.draw(L,L.gl.TRIANGLES,b,T,O,s.CullFaceMode.backCCW,Zn,c.id,$t.layoutVertexBuffer,$t.indexBuffer,$t.segments,c.paint,f.transform.zoom,zt,sn)}}function Vl(f,r,c,m,b,T){const O=[ce=>{let Ve=ce.canonical.x-1,rt=ce.wrap;return Ve<0&&(Ve=(1<{let Ve=ce.canonical.x+1,rt=ce.wrap;return Ve===1<new s.OverscaledTileID(ce.overscaledZ,ce.wrap,ce.canonical.z,ce.canonical.x,(0===ce.canonical.y?1<new s.OverscaledTileID(ce.overscaledZ,ce.wrap,ce.canonical.z,ce.canonical.x,ce.canonical.y===(1<{const Ve=r.getSource().minzoom,rt=Tt=>{const Mt=r.getTileByID(Tt);if(Mt&&Mt.hasData())return Mt.getBucket(b)},ot=[0,-1,1];for(const Tt of ot){if(ce.overscaledZ+Tt(Z[0]=Math.min(ce.min.y,Ve.min.y),Z[1]=Math.max(ce.max.y,Ve.max.y),Z[2]=s.EXTENT-Ve.min.x>ce.max.x?Ve.min.x-s.EXTENT:ce.max.x,Z),W=(ce,Ve)=>(Z[0]=Math.min(ce.min.x,Ve.min.x),Z[1]=Math.max(ce.max.x,Ve.max.x),Z[2]=s.EXTENT-Ve.min.y>ce.max.y?Ve.min.y-s.EXTENT:ce.max.y,Z),se=[(ce,Ve)=>q(ce,Ve),(ce,Ve)=>q(Ve,ce),(ce,Ve)=>W(ce,Ve),(ce,Ve)=>W(Ve,ce)],Oe=new s.Point(0,0);let $e,We,qe;const Ke=(ce,Ve,rt,ot,Tt)=>{const Mt=[[ot?rt:ce,ot?ce:rt,0],[ot?rt:Ve,ot?Ve:rt,0]],Dt=Tt<0?s.EXTENT+Tt:Tt,$t=[ot?Dt:(ce+Ve)/2,ot?(ce+Ve)/2:Dt,0];return 0===rt&&Tt<0||0!==rt&&Tt>0?T.getForTilePoints(qe,[$t],!0,We):Mt.push($t),T.getForTilePoints(c,Mt,!0,$e),Math.max(Mt[0][2],Mt[1][2],$t[2])/T.exaggeration()};for(let ce=0;ce<4;ce++){const Ve=(ce<2?1:5)-ce,rt=m.borders[ce];if(0===rt.length)continue;const ot=qe=O[ce](c),Tt=L(ot);if(!(Tt&&Tt instanceof s.FillExtrusionBucket&&Tt.enableTerrain)||m.borderDoneWithNeighborZ[ce]===Tt.canonical.z&&Tt.borderDoneWithNeighborZ[Ve]===m.canonical.z||(We=T.findDEMTileFor(ot),!We||!We.dem))continue;if(!$e){const zt=T.findDEMTileFor(c);if(!zt||!zt.dem)return;$e=zt}const Mt=Tt.borders[Ve];let Dt=0;const $t=Tt.borderDoneWithNeighborZ[Ve]!==m.canonical.z;if(m.canonical.z===Tt.canonical.z){for(let zt=0;ztVn[0]+3));)$t&&Tt.encodeCentroid(void 0,on,!1),Dt++;if(on&&DtVn[1]-3)&&(un++,++Dt!==Mt.length);)on=Tt.featuresOnBorder[Mt[Dt]];if(on=Tt.featuresOnBorder[Mt[Rn]],dn.intersectsCount()>1||on.intersectsCount()>1||1!==un){1!==un&&(Dt=Rn),m.encodeCentroid(void 0,dn,!1),$t&&Tt.encodeCentroid(void 0,on,!1);continue}const Zn=se[ce](dn,on),sn=ce%2?s.EXTENT-1:0;Oe.x=Ke(Zn[0],Math.min(s.EXTENT-1,Zn[1]),sn,ce<2,Zn[2]),Oe.y=0,m.encodeCentroid(Oe,dn,!1),$t&&Tt.encodeCentroid(Oe,on,!1)}else m.encodeCentroid(void 0,dn,!1)}m.borderDoneWithNeighborZ[ce]=Tt.canonical.z,m.needsCentroidUpdate=!0,$t&&(Tt.borderDoneWithNeighborZ[Ve]=m.canonical.z,Tt.needsCentroidUpdate=!0)}else{for(const zt of rt)m.encodeCentroid(void 0,m.featuresOnBorder[zt],!1);if($t){for(const zt of Mt)Tt.encodeCentroid(void 0,Tt.featuresOnBorder[zt],!1);Tt.borderDoneWithNeighborZ[Ve]=m.canonical.z,Tt.needsCentroidUpdate=!0}m.borderDoneWithNeighborZ[ce]=Tt.canonical.z,m.needsCentroidUpdate=!0}}(m.needsCentroidUpdate||!m.centroidVertexBuffer&&0!==m.centroidVertexArray.length)&&m.uploadCentroid(f)}const sa=new s.Color(1,0,0,1),bl=new s.Color(0,1,0,1),vd=new s.Color(0,0,1,1),Gc=new s.Color(1,0,1,1),fc=new s.Color(0,1,1,1);function Au(f,r,c){const m=f.context,b=f.transform,T=m.gl,O="globe"===b.projection.name,L=O?["PROJECTION_GLOBE_VIEW"]:null;let Z=c.projMatrix;if(O&&s.globeToMercatorTransition(b.zoom)>0){const dn=s.transitionTileAABBinECEF(c.canonical,b),Vn=s.globeDenormalizeECEF(dn);Z=s.multiply(new Float32Array(16),b.globeMatrix,Vn),s.multiply(Z,b.projMatrix,Z)}const q=f.useProgram("debug",null,L),W=r.getTileByID(c.key);f.terrain&&f.terrain.setupElevationDraw(W,q);const se=s.DepthMode.disabled,Oe=s.StencilMode.disabled,$e=f.colorModeForRenderPass();m.activeTexture.set(T.TEXTURE0),f.emptyTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),O?W._makeGlobeTileDebugBuffers(f.context,b):W._makeDebugTileBoundsBuffers(f.context,b.projection);const qe=W._tileDebugBuffer||f.debugBuffer,Ke=W._tileDebugIndexBuffer||f.debugIndexBuffer,ce=W._tileDebugSegments||f.debugSegments;q.draw(m,T.LINE_STRIP,se,Oe,$e,s.CullFaceMode.disabled,oa(Z,s.Color.red),"$debug",qe,Ke,ce,null,null,null,[W._globeTileDebugBorderBuffer]);const Ve=W.latestRawTileData,rt=Math.floor((Ve&&Ve.byteLength||0)/1024),ot=r.getTile(c).tileSize,Tt=512/Math.min(ot,512)*(c.overscaledZ/b.zoom)*.5;let Mt=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(Mt+=` => ${c.overscaledZ}`),Mt+=` ${rt}kb`,function(dn,Vn){dn.initDebugOverlayCanvas();const on=dn.debugOverlayCanvas,Rn=dn.context.gl,un=dn.debugOverlayCanvas.getContext("2d");un.clearRect(0,0,on.width,on.height),un.shadowColor="white",un.shadowBlur=2,un.lineWidth=1.5,un.strokeStyle="white",un.textBaseline="top",un.font="bold 36px Open Sans, sans-serif",un.fillText(Vn,5,5),un.strokeText(Vn,5,5),dn.debugOverlayTexture.update(on),dn.debugOverlayTexture.bind(Rn.LINEAR,Rn.CLAMP_TO_EDGE)}(f,Mt);const Dt=W._tileDebugTextBuffer||f.debugBuffer,$t=W._tileDebugTextIndexBuffer||f.quadTriangleIndexBuffer,zt=W._tileDebugTextSegments||f.debugSegments;q.draw(m,T.TRIANGLES,se,Oe,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,oa(Z,s.Color.transparent,Tt),"$debug",Dt,$t,zt,null,null,null,[W._globeTileDebugTextBuffer])}function wl(f,r,c,m){il(f,0,r+c/2,f.transform.width,c,m)}function $l(f,r,c,m){il(f,r-c/2,0,c,f.transform.height,m)}function il(f,r,c,m,b,T){const O=f.context,L=O.gl;L.enable(L.SCISSOR_TEST),L.scissor(r*s.exported.devicePixelRatio,c*s.exported.devicePixelRatio,m*s.exported.devicePixelRatio,b*s.exported.devicePixelRatio),O.clear({color:T}),L.disable(L.SCISSOR_TEST)}const xd=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:pc}=xd;function qs(f,r,c,m){f.emplaceBack(r,c,m)}class Ta{constructor(r){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,qs(this.vertexArray,-1,-1,1),qs(this.vertexArray,1,-1,1),qs(this.vertexArray,-1,1,1),qs(this.vertexArray,1,1,1),qs(this.vertexArray,-1,-1,-1),qs(this.vertexArray,1,-1,-1),qs(this.vertexArray,-1,1,-1),qs(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=r.createVertexBuffer(this.vertexArray,pc),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function Zs(f,r,c,m,b,T){const O=f.gl,L=r.paint.get("sky-atmosphere-color"),Z=r.paint.get("sky-atmosphere-halo-color"),q=r.paint.get("sky-atmosphere-sun-intensity"),W={u_matrix_3f:s.fromMat4(s.create$1(),m),u_sun_direction:b,u_sun_intensity:q,u_color_tint_r:[(We=L).r,We.g,We.b,We.a],u_color_tint_m:[(qe=Z).r,qe.g,qe.b,qe.a],u_luminance:5e-5};var We,qe;O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+T,r.skyboxTexture,0),c.draw(f,O.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,W,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const N=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class ne{constructor(r){const c=new s.StructArrayLayout5f20;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const m=new s.StructArrayLayout3ui6;m.emplaceBack(0,1,2),m.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(c,N.members),this.indexBuffer=r.createIndexBuffer(m),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const it={symbol:function(f,r,c,m,b){if("translucent"!==f.renderPass)return;const T=s.StencilMode.disabled,O=f.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(L,Z,q,W,se,Oe,$e){const We=Z.transform,qe="map"===se,Ke="map"===Oe;for(const ce of L){const Ve=W.getTile(ce),rt=Ve.getBucket(q);if(!rt||!rt.text||!rt.text.segments.get().length)continue;const ot=s.evaluateSizeForZoom(rt.textSizeData,We.zoom),Tt=Dn(ce,rt.getProjection(),We),Mt=We.calculatePixelsToTileUnitsMatrix(Ve),Dt=Kt(Tt,Ve.tileID.canonical,Ke,qe,We,rt.getProjection(),Mt),$t="none"!==q.layout.get("icon-text-fit")&&rt.hasIconData();if(ot){const zt=Math.pow(2,We.zoom-Ve.tileID.overscaledZ);Us(rt,qe,Ke,$e,s.symbolSize,We,Dt,ce,zt,ot,$t)}}}(m,f,c,r,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),b),0!==c.paint.get("icon-opacity").constantOr(1)&&Ao(f,r,c,m,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),T,O),0!==c.paint.get("text-opacity").constantOr(1)&&Ao(f,r,c,m,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),T,O),r.map.showCollisionBoxes&&(xl(f,r,c,m,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),xl(f,r,c,m,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(f,r,c,m){if("translucent"!==f.renderPass)return;const b=c.paint.get("circle-opacity"),T=c.paint.get("circle-stroke-width"),O=c.paint.get("circle-stroke-opacity"),L=void 0!==c.layout.get("circle-sort-key").constantOr(1);if(0===b.constantOr(1)&&(0===T.constantOr(1)||0===O.constantOr(1)))return;const Z=f.context,q=Z.gl,W=f.transform,se=f.depthModeForSublayer(0,s.DepthMode.ReadOnly),Oe=s.StencilMode.disabled,$e=f.colorModeForRenderPass(),We="globe"===W.projection.name,qe=[s.mercatorXfromLng(W.center.lng),s.mercatorYfromLat(W.center.lat)],Ke=[];for(let Ve=0;VeVe.sortKey-rt.sortKey);const ce={useDepthForOcclusion:!We};for(const Ve of Ke){const{programConfiguration:rt,program:ot,layoutVertexBuffer:Tt,globeExtVertexBuffer:Mt,indexBuffer:Dt,uniformValues:$t,tile:zt}=Ve.state,dn=Ve.segments;f.terrain&&f.terrain.setupElevationDraw(zt,ot,ce),f.prepareDrawProgram(Z,ot,zt.tileID.toUnwrapped()),ot.draw(Z,q.TRIANGLES,se,Oe,$e,s.CullFaceMode.disabled,$t,c.id,Tt,Dt,dn,c.paint,W.zoom,rt,[Mt])}},heatmap:function(f,r,c,m){if(0!==c.paint.get("heatmap-opacity"))if("offscreen"===f.renderPass){const b=f.context,T=b.gl,O=s.StencilMode.disabled,L=new s.ColorMode([T.ONE,T.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function($e,We,qe,Ke){const ce=$e.gl,Ve=We.width*Ke,rt=We.height*Ke;$e.activeTexture.set(ce.TEXTURE1),$e.viewport.set([0,0,Ve,rt]);let ot=qe.heatmapFbo;if(!ot||ot&&(ot.width!==Ve||ot.height!==rt)){ot&&ot.destroy();const Tt=ce.createTexture();ce.bindTexture(ce.TEXTURE_2D,Tt),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_WRAP_S,ce.CLAMP_TO_EDGE),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_WRAP_T,ce.CLAMP_TO_EDGE),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_MIN_FILTER,ce.LINEAR),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_MAG_FILTER,ce.LINEAR),ot=qe.heatmapFbo=$e.createFramebuffer(Ve,rt,!1),function(Mt,Dt,$t,zt,dn,Vn){const on=Mt.gl;on.texImage2D(on.TEXTURE_2D,0,Mt.isWebGL2&&Mt.extRenderToTextureHalfFloat?on.RGBA16F:on.RGBA,dn,Vn,0,on.RGBA,Mt.extRenderToTextureHalfFloat?Mt.isWebGL2?on.HALF_FLOAT:Mt.extTextureHalfFloat.HALF_FLOAT_OES:on.UNSIGNED_BYTE,null),zt.colorAttachment.set($t)}($e,0,Tt,ot,Ve,rt)}else ce.bindTexture(ce.TEXTURE_2D,ot.colorAttachment.get()),$e.bindFramebuffer.set(ot.framebuffer)})(b,f,c,"globe"===f.transform.projection.name?.5:.25),b.clear({color:s.Color.transparent});const Z=f.transform,q="globe"===Z.projection.name,W=q?["PROJECTION_GLOBE_VIEW"]:null,se=q?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,Oe=[s.mercatorXfromLng(Z.center.lng),s.mercatorYfromLat(Z.center.lat)];for(let $e=0;$e{const Tt=[];Ba(ot)&&Tt.push("RENDER_LINE_DASH"),ot.paint.get("line-gradient")&&Tt.push("RENDER_LINE_GRADIENT");const Mt=ot.paint.get("line-trim-offset");0===Mt[0]&&0===Mt[1]||Tt.push("RENDER_LINE_TRIM_OFFSET");const Dt=ot.paint.get("line-pattern").constantOr(1),$t=1!==ot.paint.get("line-opacity").constantOr(1);return!Dt&&$t&&Tt.push("RENDER_LINE_ALPHA_DISCARD"),Tt})(c);let rt=Ve.includes("RENDER_LINE_ALPHA_DISCARD");f.terrain&&f.terrain.clipOrMaskOverlapStencilType()&&(rt=!1);for(const ot of m){const Tt=r.getTile(ot);if($e&&!Tt.patternsLoaded())continue;const Mt=Tt.getBucket(c);if(!Mt)continue;f.prepareDrawTile();const Dt=Mt.programConfigurations.get(c.id),$t=f.useProgram(qe,Dt,Ve),zt=Oe.constantOr(null);if(zt&&Tt.imageAtlas){const An=Tt.imageAtlas.patternPositions[zt.toString()];An&&Dt.setConstantPatternPositions(An)}const dn=q.constantOr(null),Vn=se.constantOr(null);if(!$e&&dn&&Vn&&Tt.lineAtlas){const An=Tt.lineAtlas.getDash(dn,Vn);An&&Dt.setConstantPatternPositions(An)}let[on,Rn]=c.paint.get("line-trim-offset");("round"===Vn||"square"===Vn)&&on!==Rn&&(0===on&&(on-=1),1===Rn&&(Rn+=1));const un=f.terrain?ot.projMatrix:null,Zn=$e?tl(f,Tt,c,un,Z):Fa(f,Tt,c,un,Mt.lineClipsArray.length,Z,[on,Rn]);if(We){const An=Mt.gradients[c.id];let Gn=An.texture;if(c.gradientVersion!==An.version){let Ln=256;if(c.stepInterpolant){const Wn=r.getSource().maxzoom,Di=ot.canonical.z===Wn?Math.ceil(1<{$t.draw(Ke,ce.TRIANGLES,O,An,L,s.CullFaceMode.disabled,Zn,c.id,Mt.layoutVertexBuffer,Mt.indexBuffer,Mt.segments,c.paint,f.transform.zoom,Dt,[Mt.layoutVertexBuffer2])};if(rt){const An=f.stencilModeForClipping(ot).ref;0===An&&f.terrain&&Ke.clear({stencil:0});const Gn={func:ce.EQUAL,mask:255};Zn.u_alpha_discard_threshold=.8,sn(new s.StencilMode(Gn,An,255,ce.KEEP,ce.KEEP,ce.INVERT)),Zn.u_alpha_discard_threshold=0,sn(new s.StencilMode(Gn,An,255,ce.KEEP,ce.KEEP,ce.KEEP))}else sn(f.stencilModeForClipping(ot))}rt&&(f.resetStencilClippingMasks(),f.terrain&&Ke.clear({stencil:0}))},fill:function(f,r,c,m){const b=c.paint.get("fill-color"),T=c.paint.get("fill-opacity");if(0===T.constantOr(1))return;const O=f.colorModeForRenderPass(),L=c.paint.get("fill-pattern"),Z=f.opaquePassEnabledForLayer()&&!L.constantOr(1)&&1===b.constantOr(s.Color.transparent).a&&1===T.constantOr(0)?"opaque":"translucent";if(f.renderPass===Z){const q=f.depthModeForSublayer(1,"opaque"===f.renderPass?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Mu(f,r,c,m,q,O,!1)}if("translucent"===f.renderPass&&c.paint.get("fill-antialias")){const q=f.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Mu(f,r,c,m,q,O,!0)}},"fill-extrusion":function(f,r,c,m){const b=c.paint.get("fill-extrusion-opacity");if(0!==b&&"translucent"===f.renderPass){const T=new s.DepthMode(f.context.gl.LEQUAL,s.DepthMode.ReadWrite,f.depthRangeFor3D);if(1!==b||c.paint.get("fill-extrusion-pattern").constantOr(1))Ua(f,r,c,m,T,s.StencilMode.disabled,s.ColorMode.disabled),Ua(f,r,c,m,T,f.stencilModeFor3D(),f.colorModeForRenderPass()),f.resetStencilClippingMasks();else{const O=f.colorModeForRenderPass();Ua(f,r,c,m,T,s.StencilMode.disabled,O)}}},hillshade:function(f,r,c,m){if("offscreen"!==f.renderPass&&"translucent"!==f.renderPass)return;const b=f.context,T=f.depthModeForSublayer(0,s.DepthMode.ReadOnly),O=f.colorModeForRenderPass(),L=f.terrain&&f.terrain.renderingToTexture,[Z,q]="translucent"!==f.renderPass||L?[{},m]:f.stencilConfigForOverlap(m);for(const W of q){const se=r.getTile(W);if(se.needsHillshadePrepare&&"offscreen"===f.renderPass)or(f,se,c,T,s.StencilMode.disabled,O);else if("translucent"===f.renderPass){const Oe=L&&f.terrain?f.terrain.stencilModeForRTTOverlap(W):Z[W.overscaledZ];hs(f,W,se,c,T,Oe,O)}}b.viewport.set([0,0,f.width,f.height]),f.resetStencilClippingMasks()},raster:function(f,r,c,m,b,T){if("translucent"!==f.renderPass||0===c.paint.get("raster-opacity")||!m.length)return;const O=f.context,L=O.gl,Z=r.getSource(),q=f.useProgram("raster"),W=f.colorModeForRenderPass(),se=f.terrain&&f.terrain.renderingToTexture,[Oe,$e]=Z instanceof xe||se?[{},m]:f.stencilConfigForOverlap(m),We=$e[$e.length-1].overscaledZ,qe=!f.options.moving;for(const Ke of $e){const ce=se?s.DepthMode.disabled:f.depthModeForSublayer(Ke.overscaledZ-We,1===c.paint.get("raster-opacity")?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,L.LESS),Ve=Ke.toUnwrapped(),rt=r.getTile(Ke);if(se&&(!rt||!rt.hasData()))continue;const ot=se?Ke.projMatrix:f.transform.calculateProjMatrix(Ve,qe),Tt=f.terrain&&se?f.terrain.stencilModeForRTTOverlap(Ke):Oe[Ke.overscaledZ],Mt=T?0:c.paint.get("raster-fade-duration");rt.registerFadeDuration(Mt);const Dt=r.findLoadedParent(Ke,0),$t=Bo(rt,Dt,r,f.transform,Mt);let zt,dn;f.terrain&&f.terrain.prepareDrawTile();const Vn="nearest"===c.paint.get("raster-resampling")?L.NEAREST:L.LINEAR;O.activeTexture.set(L.TEXTURE0),rt.texture.bind(Vn,L.CLAMP_TO_EDGE),O.activeTexture.set(L.TEXTURE1),Dt?(Dt.texture.bind(Vn,L.CLAMP_TO_EDGE),zt=Math.pow(2,Dt.tileID.overscaledZ-rt.tileID.overscaledZ),dn=[rt.tileID.canonical.x*zt%1,rt.tileID.canonical.y*zt%1]):rt.texture.bind(Vn,L.CLAMP_TO_EDGE),rt.texture.useMipmap&&O.extTextureFilterAnisotropic&&f.transform.pitch>20&&L.texParameterf(L.TEXTURE_2D,O.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,O.extTextureFilterAnisotropicMax);const on=vl(ot,dn||[0,0],zt||1,$t,c,Z instanceof xe?Z.perspectiveTransform:[0,0]);if(f.prepareDrawProgram(O,q,Ve),Z instanceof xe)Z.boundsBuffer&&Z.boundsSegments&&q.draw(O,L.TRIANGLES,ce,s.StencilMode.disabled,W,s.CullFaceMode.disabled,on,c.id,Z.boundsBuffer,f.quadTriangleIndexBuffer,Z.boundsSegments);else{const{tileBoundsBuffer:Rn,tileBoundsIndexBuffer:un,tileBoundsSegments:Zn}=f.getTileBoundsBuffers(rt);q.draw(O,L.TRIANGLES,ce,Tt,W,s.CullFaceMode.disabled,on,c.id,Rn,un,Zn)}}f.resetStencilClippingMasks()},background:function(f,r,c,m){const b=c.paint.get("background-color"),T=c.paint.get("background-opacity");if(0===T)return;const O=f.context,L=O.gl,Z=f.transform,q=Z.tileSize,W=c.paint.get("background-pattern");if(f.isPatternMissing(W))return;const se=!W&&1===b.a&&1===T&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==se)return;const Oe=s.StencilMode.disabled,$e=f.depthModeForSublayer(0,"opaque"===se?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),We=f.colorModeForRenderPass(),qe=f.useProgram(W?"backgroundPattern":"background");let Ke,ce=m;ce||(Ke=f.getBackgroundTiles(),ce=Object.values(Ke).map(Ve=>Ve.tileID)),W&&(O.activeTexture.set(L.TEXTURE0),f.imageManager.bind(f.context));for(const Ve of ce){const rt=Ve.toUnwrapped(),ot=m?Ve.projMatrix:f.transform.calculateProjMatrix(rt);f.prepareDrawTile();const Tt=r?r.getTile(Ve):Ke?Ke[Ve.key]:new s.Tile(Ve,q,Z.zoom,f),Mt=W?dc(ot,T,f,W,{tileID:Ve,tileSize:q}):Ea(ot,T,b);f.prepareDrawProgram(O,qe,rt);const{tileBoundsBuffer:Dt,tileBoundsIndexBuffer:$t,tileBoundsSegments:zt}=f.getTileBoundsBuffers(Tt);qe.draw(O,L.TRIANGLES,$e,Oe,We,s.CullFaceMode.disabled,Mt,c.id,Dt,$t,zt)}},sky:function(f,r,c){const m=f.transform,b="mercator"===m.projection.name||"globe"===m.projection.name?1:s.smoothstep(7,8,m.zoom),T=c.paint.get("sky-opacity")*b;if(0===T)return;const O=f.context,L=c.paint.get("sky-type"),Z=new s.DepthMode(O.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),q=f.frameCounter/1e3%1;"atmosphere"===L?"offscreen"===f.renderPass?c.needsSkyboxCapture(f)&&(function(W,se,Oe,$e){const We=W.context,qe=We.gl;let Ke=se.skyboxFbo;if(!Ke){Ke=se.skyboxFbo=We.createFramebuffer(32,32,!1),se.skyboxGeometry=new Ta(We),se.skyboxTexture=We.gl.createTexture(),qe.bindTexture(qe.TEXTURE_CUBE_MAP,se.skyboxTexture),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_WRAP_S,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_WRAP_T,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_MIN_FILTER,qe.LINEAR),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_MAG_FILTER,qe.LINEAR);for(let ot=0;ot<6;++ot)qe.texImage2D(qe.TEXTURE_CUBE_MAP_POSITIVE_X+ot,0,qe.RGBA,32,32,0,qe.RGBA,qe.UNSIGNED_BYTE,null)}We.bindFramebuffer.set(Ke.framebuffer),We.viewport.set([0,0,32,32]);const ce=se.getCenter(W,!0),Ve=W.useProgram("skyboxCapture"),rt=new Float64Array(16);s.identity(rt),s.rotateY(rt,rt,.5*-Math.PI),Zs(We,se,Ve,rt,ce,0),s.identity(rt),s.rotateY(rt,rt,.5*Math.PI),Zs(We,se,Ve,rt,ce,1),s.identity(rt),s.rotateX(rt,rt,.5*-Math.PI),Zs(We,se,Ve,rt,ce,2),s.identity(rt),s.rotateX(rt,rt,.5*Math.PI),Zs(We,se,Ve,rt,ce,3),s.identity(rt),Zs(We,se,Ve,rt,ce,4),s.identity(rt),s.rotateY(rt,rt,Math.PI),Zs(We,se,Ve,rt,ce,5),We.viewport.set([0,0,W.width,W.height])}(f,c),c.markSkyboxValid(f)):"sky"===f.renderPass&&function(W,se,Oe,$e,We){const qe=W.context,Ke=qe.gl,ce=W.transform,Ve=W.useProgram("skybox");qe.activeTexture.set(Ke.TEXTURE0),Ke.bindTexture(Ke.TEXTURE_CUBE_MAP,se.skyboxTexture);const rt={u_matrix:ce.skyboxMatrix,u_sun_direction:se.getCenter(W,!1),u_cubemap:0,u_opacity:$e,u_temporal_offset:We};W.prepareDrawProgram(qe,Ve),Ve.draw(qe,Ke.TRIANGLES,Oe,s.StencilMode.disabled,W.colorModeForRenderPass(),s.CullFaceMode.backCW,rt,"skybox",se.skyboxGeometry.vertexBuffer,se.skyboxGeometry.indexBuffer,se.skyboxGeometry.segment)}(f,c,Z,T,q):"gradient"===L&&"sky"===f.renderPass&&function(W,se,Oe,$e,We){const qe=W.context,Ke=qe.gl,ce=W.transform,Ve=W.useProgram("skyboxGradient");se.skyboxGeometry||(se.skyboxGeometry=new Ta(qe)),qe.activeTexture.set(Ke.TEXTURE0);let rt=se.colorRampTexture;rt||(rt=se.colorRampTexture=new s.Texture(qe,se.colorRamp,Ke.RGBA)),rt.bind(Ke.LINEAR,Ke.CLAMP_TO_EDGE);const ot=(Tt=ce.skyboxMatrix,Mt=se.getCenter(W,!1),Dt=se.paint.get("sky-gradient-radius"),$t=$e,zt=We,{u_matrix:Tt,u_color_ramp:0,u_center_direction:Mt,u_radius:s.degToRad(Dt),u_opacity:$t,u_temporal_offset:zt});var Tt,Mt,Dt,$t,zt;W.prepareDrawProgram(qe,Ve),Ve.draw(qe,Ke.TRIANGLES,Oe,s.StencilMode.disabled,W.colorModeForRenderPass(),s.CullFaceMode.backCW,ot,"skyboxGradient",se.skyboxGeometry.vertexBuffer,se.skyboxGeometry.indexBuffer,se.skyboxGeometry.segment)}(f,c,Z,T,q)},debug:function(f,r,c){for(let m=0;mb)return void(this.transform.fogCullDistSq=null);const T=m+.78*(b-m);this.transform.fogCullDistSq=T*T}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(r,c){if(this.width=r*s.exported.devicePixelRatio,this.height=c*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const m of this.style.order)this.style._layers[m].resize()}setup(){const r=this.context,c=new s.StructArrayLayout2i4;c.emplaceBack(0,0),c.emplaceBack(s.EXTENT,0),c.emplaceBack(0,s.EXTENT),c.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=r.createVertexBuffer(c,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const m=new s.StructArrayLayout2i4;m.emplaceBack(0,0),m.emplaceBack(s.EXTENT,0),m.emplaceBack(0,s.EXTENT),m.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=r.createVertexBuffer(m,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const b=new s.StructArrayLayout2i4;b.emplaceBack(-1,-1),b.emplaceBack(1,-1),b.emplaceBack(-1,1),b.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(b,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const T=new s.StructArrayLayout4i8;T.emplaceBack(0,0,0,0),T.emplaceBack(s.EXTENT,0,s.EXTENT,0),T.emplaceBack(0,s.EXTENT,0,s.EXTENT),T.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=r.createVertexBuffer(T,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const O=new s.StructArrayLayout3ui6;O.emplaceBack(0,1,2),O.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(O);const L=new s.StructArrayLayout1ui2;for(const q of[0,1,3,2,0])L.emplaceBack(q);this.debugIndexBuffer=r.createIndexBuffer(L),this.emptyTexture=new s.Texture(r,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA),this.identityMat=s.create();const Z=this.context.gl;this.stencilClearMode=new s.StencilMode({func:Z.ALWAYS,mask:0},0,255,Z.ZERO,Z.ZERO,Z.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new ne(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(r){return r._makeTileBoundsBuffers(this.context,this.transform.projection),r._tileBoundsBuffer?{tileBoundsBuffer:r._tileBoundsBuffer,tileBoundsIndexBuffer:r._tileBoundsIndexBuffer,tileBoundsSegments:r._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const r=this.context,c=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(r,c.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,el(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(r,c,m){if(!c||this.currentStencilSource===c.id||!r.isTileClipped()||!m||0===m.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let L=!1;for(const Z of m)if(void 0===this._tileClippingMaskIDs[Z.key]){L=!0;break}if(!L)return}this.currentStencilSource=c.id;const b=this.context,T=b.gl;this.nextStencilID+m.length>256&&this.clearStencil(),b.setColorMode(s.ColorMode.disabled),b.setDepthMode(s.DepthMode.disabled);const O=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const L of m){const Z=c.getTile(L),q=this._tileClippingMaskIDs[L.key]=this.nextStencilID++,{tileBoundsBuffer:W,tileBoundsIndexBuffer:se,tileBoundsSegments:Oe}=this.getTileBoundsBuffers(Z);O.draw(b,T.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:T.ALWAYS,mask:0},q,255,T.KEEP,T.KEEP,T.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,el(L.projMatrix),"$clipping",W,se,Oe)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,c=this.context.gl;return new s.StencilMode({func:c.NOTEQUAL,mask:255},r,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(r){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(r);const c=this.context.gl;return new s.StencilMode({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(r){const c=this.context.gl,m=r.sort((O,L)=>L.overscaledZ-O.overscaledZ),b=m[m.length-1].overscaledZ,T=m[0].overscaledZ-b+1;if(T>1){this.currentStencilSource=void 0,this.nextStencilID+T>256&&this.clearStencil();const O={};for(let L=0;L=0;this.currentLayer--){const q=this.style._layers[m[this.currentLayer]],W=r._getLayerSourceCache(q);if(q.isSky())continue;const se=W?O[W.id]:void 0;this._renderTileClippingMasks(q,W,se),this.renderLayer(this,W,q,se)}if(this.style.fog&&this.transform.projection.supportsFog&&function(q,W){const se=q.context,Oe=se.gl,$e=q.transform,We=new s.DepthMode(Oe.LEQUAL,s.DepthMode.ReadOnly,[0,1]),qe=q.useProgram("globeAtmosphere",null,"globe"===$e.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),Ke=s.globeToMercatorTransition($e.zoom),ce=W.properties.get("color").toArray01(),Ve=W.properties.get("high-color").toArray01(),rt=W.properties.get("space-color").toArray01PremultipliedAlpha(),ot=s.identity$1([]);s.rotateY$1(ot,ot,-s.degToRad($e._center.lng)),s.rotateX$1(ot,ot,s.degToRad($e._center.lat)),s.rotateZ$1(ot,ot,$e.angle),s.rotateX$1(ot,ot,-$e._pitch);const Tt=s.fromQuat(new Float32Array(16),ot),Mt=s.mapValue(W.properties.get("star-intensity"),0,1,0,.25),$t=s.mapValue(W.properties.get("horizon-blend"),0,1,5e-4,.25),zt=s.globeUseCustomAntiAliasing(q,se,$e)&&5e-4===$t?$e.worldSize/(2*Math.PI*1.025)-1:$e.globeRadius,dn=q.frameCounter/1e3%1,Vn=s.length($e.globeCenterInViewSpace),on=Math.sqrt(Math.pow(Vn,2)-Math.pow(zt,2)),Rn=Math.acos(on/Vn),un={u_frustum_tl:$e.frustumCorners.TL,u_frustum_tr:$e.frustumCorners.TR,u_frustum_br:$e.frustumCorners.BR,u_frustum_bl:$e.frustumCorners.BL,u_horizon:$e.frustumCorners.horizon,u_transition:Ke,u_fadeout_range:$t,u_color:ce,u_high_color:Ve,u_space_color:rt,u_star_intensity:Mt,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:dn,u_horizon_angle:Rn,u_rotation_matrix:Tt};q.prepareDrawProgram(se,qe);const Zn=q.atmosphereBuffer;Zn&&qe.draw(se,Oe.TRIANGLES,We,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,un,"skybox",Zn.vertexBuffer,Zn.indexBuffer,Zn.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const se=r._getLayerSourceCache(W);se&&!W.isHidden(this.transform.zoom)&&(!q||q.getSource().maxzoom0?c.pop():null}isPatternMissing(r){return null===r||void 0!==r&&!this.imageManager.getPattern(r.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const r=this.terrain&&this.terrain.renderingToTexture,c=this.terrain&&0===this.terrain.exaggeration(),m=this.style&&this.style.fog,b=[];return this.terrainRenderModeElevated()&&b.push("TERRAIN"),"globe"===this.transform.projection.name&&b.push("GLOBE"),c&&b.push("ZERO_EXAGGERATION"),m&&!r&&0!==m.getOpacity(this.transform.pitch)&&b.push("FOG"),r&&b.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&b.push("OVERDRAW_INSPECTOR"),b}useProgram(r,c,m){this.cache=this.cache||{};const b=m||[],T=this.currentGlobalDefines().concat(b),O=ki.cacheKey(Fo[r],r,T,c);return this.cache[O]||(this.cache[O]=new ki(this.context,r,Fo[r],c,fa[r],T)),this.cache[O]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(r,c,m){if(this.terrain&&this.terrain.renderingToTexture)return;const b=this.style.fog;if(b){const T=b.getOpacity(this.transform.pitch),O=((L,Z,q,W,se,Oe,$e,We,qe,Ke,ce)=>{const Ve=L.transform,rt=Z.properties.get("color").toArray01();rt[3]=W;const ot=L.frameCounter/1e3%1;return{u_fog_matrix:q?Ve.calculateFogTileMatrix(q):L.identityMat,u_fog_range:Z.getFovAdjustedRange(Ve._fov),u_fog_color:rt,u_fog_horizon_blend:Z.properties.get("horizon-blend"),u_fog_temporal_offset:ot,u_frustum_tl:se,u_frustum_tr:Oe,u_frustum_br:$e,u_frustum_bl:We,u_globe_pos:qe,u_globe_radius:Ke,u_viewport:ce,u_globe_transition:s.globeToMercatorTransition(Ve.zoom),u_is_globe:+("globe"===Ve.projection.name)}})(this,b,m,T,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);c.setFogUniformValues(r,O)}}setTileLoadedFlag(r){this.tileLoaded=r}saveCanvasCopy(){const r=this.canvasCopy();r&&(this.frameCopies.push(r),this.tileLoaded=!1)}canvasCopy(){const r=this.context.gl,c=r.createTexture();return r.bindTexture(r.TEXTURE_2D,c),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,0,0,r.drawingBufferWidth,r.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const r=this.style&&this.style.fog;return!!r&&0!==r.getOpacity(this.transform.pitch)}getBackgroundTiles(){const r=this._backgroundTiles,c=this._backgroundTiles={},m=this.transform.coveringTiles({tileSize:512});for(const b of m)c[b.key]=r[b.key]||new s.Tile(b,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}}class He{constructor(r=0,c=0,m=0,b=0){if(isNaN(r)||r<0||isNaN(c)||c<0||isNaN(m)||m<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=c,this.left=m,this.right=b}interpolate(r,c,m){return null!=c.top&&null!=r.top&&(this.top=s.number(r.top,c.top,m)),null!=c.bottom&&null!=r.bottom&&(this.bottom=s.number(r.bottom,c.bottom,m)),null!=c.left&&null!=r.left&&(this.left=s.number(r.left,c.left,m)),null!=c.right&&null!=r.right&&(this.right=s.number(r.right,c.right,m)),this}getCenter(r,c){const m=s.clamp((this.left+r-this.right)/2,0,r),b=s.clamp((this.top+c-this.bottom)/2,0,c);return new s.Point(m,b)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new He(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function At(f,r){const c=s.getColumn(f,3);s.fromQuat(f,r),s.setColumn(f,3,c)}function cn(f,r){const c=s.identity$1([]);return s.rotateZ$1(c,c,-r),s.rotateX$1(c,c,-f),c}function ri(f,r){const c=[f[0],f[1],0],m=[r[0],r[1],0];if(s.length(c)>=1e-15){const O=s.normalize([],c);s.scale$2(m,O,s.dot(m,O)),r[0]=m[0],r[1]=m[1]}const b=s.cross([],r,f);if(s.len(b)<1e-15)return null;const T=Math.atan2(-b[1],b[0]);return cn(Math.atan2(Math.sqrt(f[0]*f[0]+f[1]*f[1]),-f[2]),T)}class fr{constructor(r,c){this.position=r,this.orientation=c}get position(){return this._position}set position(r){if(r){const c=r instanceof s.MercatorCoordinate?r:new s.MercatorCoordinate(r[0],r[1],r[2]);this._renderWorldCopies&&(c.x=s.wrap(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(r,c){if(this.orientation=null,!this.position)return;const m=this.position,b=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(r)):0,T=s.MercatorCoordinate.fromLngLat(r,b),O=[T.x-m.x,T.y-m.y,T.z-m.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=ri(O,c)}setPitchBearing(r,c){this.orientation=cn(s.degToRad(r),s.degToRad(-c))}}class Xi{constructor(r,c){this._transform=s.identity([]),this.orientation=c,this.position=r}get mercatorPosition(){const r=this.position;return new s.MercatorCoordinate(r[0],r[1],r[2])}get position(){const r=s.getColumn(this._transform,3);return[r[0],r[1],r[2]]}set position(r){var c;r&&s.setColumn(this._transform,3,[(c=r)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||s.identity$1([]),r&&At(this._transform,this._orientation)}getPitchBearing(){const r=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2])}}setPitchBearing(r,c){this._orientation=cn(r,c),At(this._transform,this._orientation)}forward(){const r=s.getColumn(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){const r=s.getColumn(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){const r=s.getColumn(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,c){const m=new Float64Array(16);return s.invert(m,this.getWorldToCamera(r,c)),m}getWorldToCameraPosition(r,c,m){const b=this.position;s.scale$2(b,b,-r);const T=new Float64Array(16);return s.fromScaling(T,[m,m,m]),s.translate(T,T,b),T[10]*=c,T}getWorldToCamera(r,c){const m=new Float64Array(16),b=new Float64Array(4),T=this.position;return s.conjugate(b,this._orientation),s.scale$2(T,T,-r),s.fromQuat(m,b),s.translate(m,m,T),m[1]*=-1,m[5]*=-1,m[9]*=-1,m[13]*=-1,m[8]*=c,m[9]*=c,m[10]*=c,m[11]*=c,m}getCameraToClipPerspective(r,c,m,b){const T=new Float64Array(16);return s.perspective(T,r,c,m,b),T}getDistanceToElevation(r,c=!1){const m=0===r?0:s.mercatorZfromAltitude(r,c?s.latFromMercatorY(this.position[1]):this.position[1]),b=this.forward();return(m-this.position[2])/b[2]}clone(){return new Xi([...this.position],[...this.orientation])}}function pr(f,r){const c=Vi(f.projection,f.zoom,f.width,f.height),m=function(T,O,L,Z,q){const W=new s.LngLat(L.lng-180*Tr,L.lat),se=new s.LngLat(L.lng+180*Tr,L.lat),Oe=T.project(W.lng,W.lat),$e=T.project(se.lng,se.lat),We=-Math.atan2($e.y-Oe.y,$e.x-Oe.x),qe=s.MercatorCoordinate.fromLngLat(L);qe.y=s.clamp(qe.y,-1+Tr,1-Tr);const Ke=qe.toLngLat(),ce=T.project(Ke.lng,Ke.lat),Ve=s.MercatorCoordinate.fromLngLat(Ke);Ve.x+=Tr;const rt=Ve.toLngLat(),ot=T.project(rt.lng,rt.lat),Tt=ao(ot.x-ce.x,ot.y-ce.y,We),Mt=s.MercatorCoordinate.fromLngLat(Ke);Mt.y+=Tr;const Dt=Mt.toLngLat(),$t=T.project(Dt.lng,Dt.lat),zt=ao($t.x-ce.x,$t.y-ce.y,We),dn=Math.abs(Tt.x)/Math.abs(zt.y),Vn=s.identity([]);s.rotateZ(Vn,Vn,-We*(1-(q?0:Z)));const on=s.identity([]);return s.scale(on,on,[1,1-(1-dn)*Z,1]),on[4]=-zt.x/zt.y*Z,s.rotateZ(on,on,We),s.multiply(on,Vn,on),on}(f.projection,0,f.center,c,r),b=sr(f);return s.scale(m,m,[b,b,1]),m}function sr(f){const r=f.projection,c=Vi(f.projection,f.zoom,f.width,f.height),m=ho(r,f.center),b=ho(r,s.LngLat.convert(r.center));return Math.pow(2,m*c+(1-c)*b)}function Vi(f,r,c,m,b=1/0){const T=f.range;if(!T)return 0;const O=Math.min(b,Math.max(c,m)),L=Math.log(O/1024)/Math.LN2;return s.smoothstep(T[0]+L,T[1]+L,r)}const Tr=1/4e4;function ho(f,r){const c=s.clamp(r.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),m=new s.LngLat(r.lng-180*Tr,c),b=new s.LngLat(r.lng+180*Tr,c),T=f.project(m.lng,c),O=f.project(b.lng,c),L=s.MercatorCoordinate.fromLngLat(m),Z=s.MercatorCoordinate.fromLngLat(b),q=O.x-T.x,W=O.y-T.y,se=Z.x-L.x,Oe=Z.y-L.y,$e=Math.sqrt((se*se+Oe*Oe)/(q*q+W*W));return Math.log($e)/Math.LN2}function ao(f,r,c){const m=Math.cos(c),b=Math.sin(c);return{x:f*m-r*b,y:f*b+r*m}}class ps{constructor(r,c,m,b,T,O,L){this.tileSize=512,this._renderWorldCopies=void 0===T||T,this._minZoom=r||0,this._maxZoom=c||22,this._minPitch=m??0,this._maxPitch=b??60,this.setProjection(O),this.setMaxBounds(L),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new He,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Xi,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const r=new ps(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return r._elevation=this._elevation,r._centerAltitude=this._centerAltitude,r._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,r.tileSize=this.tileSize,r.mercatorFromTransition=this.mercatorFromTransition,r.width=this.width,r.height=this.height,r.cameraElevationReference=this.cameraElevationReference,r._center=this._center,r._setZoom(this.zoom),r._seaLevelZoom=this._seaLevelZoom,r.angle=this.angle,r._fov=this._fov,r._pitch=this._pitch,r._nearZ=this._nearZ,r._farZ=this._farZ,r._averageElevation=this._averageElevation,r._unmodified=this._unmodified,r._edgeInsets=this._edgeInsets.clone(),r._camera=this._camera.clone(),r._calcMatrices(),r.freezeTileCoverage=this.freezeTileCoverage,r.frustumCorners=this.frustumCorners,r}get elevation(){return this._elevation}set elevation(r){this._elevation!==r&&(this._elevation=r,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(r,c=!1){const m=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||m)&&this._updateCameraOnTerrain(),(r||m)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const m=!J(c,this.getProjection());return m&&this._calcMatrices(),this.mercatorFromTransition=!1,m}setMercatorFromTransition(){const r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const c=r!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(r){this._minZoom!==r&&(this._minZoom=r,this.zoom=Math.max(this.zoom,r))}get maxZoom(){return this._maxZoom}set maxZoom(r){this._maxZoom!==r&&(this._maxZoom=r,this.zoom=Math.min(this.zoom,r))}get minPitch(){return this._minPitch}set minPitch(r){this._minPitch!==r&&(this._minPitch=r,this.pitch=Math.max(this.pitch,r))}get maxPitch(){return this._maxPitch}set maxPitch(r){this._maxPitch!==r&&(this._maxPitch=r,this.pitch=Math.min(this.pitch,r))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(r){void 0===r?r=!0:null===r&&(r=!1),this._renderWorldCopies=r}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get cameraWorldSize(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(r){this.rotation=r}get rotation(){return-this.angle/Math.PI*180}set rotation(r){const c=-r*Math.PI/180;var m,b,T,O,L,Z,q,W,se,Oe;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=(m=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m),b=this.rotationMatrix,O=this.angle,L=(T=this.rotationMatrix)[0],Z=T[1],q=T[2],W=T[3],se=Math.sin(O),Oe=Math.cos(O),b[0]=L*Oe+q*se,b[1]=Z*Oe+W*se,b[2]=L*-se+q*Oe,b[3]=Z*-se+W*Oe)}get pitch(){return this._pitch/Math.PI*180}set pitch(r){const c=s.clamp(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const r=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/r)}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=s.degToRad(r),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(r){this._averageElevation=r,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(r){const c=Math.min(Math.max(r,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(r){this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const r=this._elevation;this._centerAltitude=r.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=r.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const r=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],m=this.horizonLineFromTop();let b=0,T=0;for(let O=0;Or.maxzoom&&(c=r.maxzoom);const O=this.locationCoordinate(this.center),L=this.center.lat,Z=1<{const Gn=new s.MercatorCoordinate(sn.x+25e-6,sn.y,sn.z),Ln=new s.MercatorCoordinate(sn.x,sn.y+25e-6,sn.z),Wn=sn.toLngLat(),Di=Gn.toLngLat(),Gi=Ln.toLngLat(),hi=this.locationCoordinate(Wn),Pi=this.locationCoordinate(Di),ur=this.locationCoordinate(Gi),dr=Math.hypot(Pi.x-hi.x,Pi.y-hi.y),xi=Math.hypot(ur.x-hi.x,ur.y-hi.y);return Math.sqrt(dr*xi)*Tt/25e-6},Dt=sn=>{const An=rt,Gn=ot;return{aabb:s.tileAABB(this,Z,0,0,0,sn,Gn,An,this.projection),zoom:0,x:0,y:0,minZ:Gn,maxZ:An,wrap:sn,fullyVisible:!1}},$t=[];let zt=[];const dn=c,Vn=r.reparseOverscaled?m:c,on=sn=>sn*sn,Rn=on((qe-this._centerAltitude)*We),un=sn=>{if(!this._elevation||!sn.tileID||!T)return;const An=this._elevation.getMinMaxForTile(sn.tileID),Gn=sn.aabb;An?(Gn.min[2]=An.min,Gn.max[2]=An.max,Gn.center[2]=(Gn.min[2]+Gn.max[2])/2):(sn.shouldSplit=Zn(sn),sn.shouldSplit||(Gn.min[2]=Gn.max[2]=Gn.center[2]=this._centerAltitude))},Zn=sn=>{if(sn.zoom=.9)return!0}else if(b&&(Ln=on(sn.aabb.distanceZ(Ke)*We)),this.projection.isReprojectedInTileSpace&&m<=5){const hi=Math.pow(2,sn.zoom),Pi=Mt(new s.MercatorCoordinate((sn.x+.5)/hi,(sn.y+.5)/hi));Wn=Pi>.85?1:Pi}const Di=An*An+Gn*Gn+Ln;return Di{if(Pi*on(.707)0;){const sn=$t.pop(),An=sn.x,Gn=sn.y;let Ln=sn.fullyVisible;if(!Ln){const Wn=sn.aabb.intersects(Oe);if(0===Wn)continue;Ln=2===Wn}if(sn.zoom!==dn&&Zn(sn))for(let Wn=0;Wn<4;Wn++){const Di=(An<<1)+Wn%2,Gi=(Gn<<1)+(Wn>>1),hi={aabb:T?sn.aabb.quadrant(Wn):s.tileAABB(this,Z,sn.zoom+1,Di,Gi,sn.wrap,sn.minZ,sn.maxZ,this.projection),zoom:sn.zoom+1,x:Di,y:Gi,wrap:sn.wrap,fullyVisible:Ln,tileID:void 0,shouldSplit:void 0,minZ:sn.minZ,maxZ:sn.maxZ};b&&!W&&(hi.tileID=new s.OverscaledTileID(sn.zoom+1===dn?Vn:sn.zoom+1,sn.wrap,sn.zoom+1,Di,Gi),un(hi)),$t.push(hi)}else{const Wn=sn.zoom===dn?Vn:sn.zoom;if(r.minzoom&&r.minzoom>Wn)continue;const Di=q[0]-(.5+An+(sn.wrap<{const Ln=[0,0,0,1],Wn=[s.EXTENT,s.EXTENT,0,1],Di=this.calculateFogTileMatrix(Gn.tileID.toUnwrapped());s.transformMat4$1(Ln,Ln,Di),s.transformMat4$1(Wn,Wn,Di);const Gi=s.getAABBPointSquareDist(Ln,Wn);if(0===Gi)return!0;let hi=!1;const Pi=this._elevation;if(Pi&&Gi>sn&&0!==An){const ur=this.calculateProjMatrix(Gn.tileID.toUnwrapped());let dr;r.isTerrainDEM||(dr=Pi.getMinMaxForTile(Gn.tileID)),dr||(dr={min:ot,max:rt});const xi=s.furthestTileCorner(this.rotation),Cr=[xi[0]*s.EXTENT,xi[1]*s.EXTENT,dr.max];s.transformMat4(Cr,Cr,ur),hi=(1-Cr[1])*this.height*.5sn.distanceSq-An.distanceSq).map(sn=>sn.tileID)}resize(r,c){this.width=r,this.height=c,this.pixelsToGLUnits=[2/r,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(r){return Math.pow(2,r)}scaleZoom(r){return Math.log(r)/Math.LN2}project(r){const c=s.clamp(r.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),m=this.projection.project(r.lng,c);return new s.Point(m.x*this.worldSize,m.y*this.worldSize)}unproject(r){return this.projection.unproject(r.x/this.worldSize,r.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,c){let m,b;const T=this.centerPoint;if("globe"===this.projection.name){const L=this.worldSize;m=(c.x-T.x)/L,b=(c.y-T.y)/L}else{const L=this.pointCoordinate(c),Z=this.pointCoordinate(T);m=L.x-Z.x,b=L.y-Z.y}const O=this.locationCoordinate(r);this.setLocation(new s.MercatorCoordinate(O.x-m,O.y-b))}setLocation(r){this.center=this.coordinateLocation(r),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(r){return this.projection.locationPoint(this,r)}locationPoint3D(r){return this.projection.locationPoint(this,r,!0)}pointLocation(r){return this.coordinateLocation(this.pointCoordinate(r))}pointLocation3D(r){return this.coordinateLocation(this.pointCoordinate3D(r))}locationCoordinate(r,c){const m=c?s.mercatorZfromAltitude(c,r.lat):void 0,b=this.projection.project(r.lng,r.lat);return new s.MercatorCoordinate(b.x,b.y,m)}coordinateLocation(r){return this.projection.unproject(r.x,r.y)}pointRayIntersection(r,c){const m=c??this._centerAltitude,b=[r.x,r.y,0,1],T=[r.x,r.y,1,1];s.transformMat4$1(b,b,this.pixelMatrixInverse),s.transformMat4$1(T,T,this.pixelMatrixInverse);const O=T[3];s.scale$1(b,b,1/b[3]),s.scale$1(T,T,1/O);const L=b[2],Z=T[2];return{p0:b,p1:T,t:L===Z?0:(m-L)/(Z-L)}}screenPointToMercatorRay(r){const c=[r.x,r.y,0,1],m=[r.x,r.y,1,1];return s.transformMat4$1(c,c,this.pixelMatrixInverse),s.transformMat4$1(m,m,this.pixelMatrixInverse),s.scale$1(c,c,1/c[3]),s.scale$1(m,m,1/m[3]),c[2]=s.mercatorZfromAltitude(c[2],this._center.lat)*this.worldSize,m[2]=s.mercatorZfromAltitude(m[2],this._center.lat)*this.worldSize,s.scale$1(c,c,1/this.worldSize),s.scale$1(m,m,1/this.worldSize),new s.Ray([c[0],c[1],c[2]],s.normalize([],s.sub([],m,c)))}rayIntersectionCoordinate(r){const{p0:c,p1:m,t:b}=r,T=s.mercatorZfromAltitude(c[2],this._center.lat),O=s.mercatorZfromAltitude(m[2],this._center.lat);return new s.MercatorCoordinate(s.number(c[0],m[0],b)/this.worldSize,s.number(c[1],m[1],b)/this.worldSize,s.number(T,O,b))}pointCoordinate(r,c=this._centerAltitude){return this.projection.pointCoordinate(this,r.x,r.y,c)}pointCoordinate3D(r){if(!this.elevation)return this.pointCoordinate(r);let c=this.projection.pointCoordinate3D(this,r.x,r.y);if(c)return new s.MercatorCoordinate(c[0],c[1],c[2]);let m=0,b=this.horizonLineFromTop();if(r.y>b)return this.pointCoordinate(r);const T=.02*b,O=r.clone();for(let L=0;L<10&&b-m>T;L++){O.y=s.number(m,b,.66);const Z=this.projection.pointCoordinate3D(this,O.x,O.y);Z?(b=O.y,c=Z):m=O.y}return c?new s.MercatorCoordinate(c[0],c[1],c[2]):this.pointCoordinate(r)}isPointAboveHorizon(r){return this.projection.isPointAboveHorizon(this,r)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(r);const c=this.pointCoordinate(r);return c.y>=0&&c.y<=1}_coordinatePoint(r,c){const m=c&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,b=[r.x*this.worldSize,r.y*this.worldSize,m+r.toAltitude(),1];return s.transformMat4$1(b,b,this.pixelMatrix),b[3]>0?new s.Point(b[0]/b[3],b[1]/b[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:r,left:c}=this._edgeInsets,m=this.height-this._edgeInsets.bottom,b=this.width-this._edgeInsets.right,T=this.pointLocation3D(new s.Point(c,r)),O=this.pointLocation3D(new s.Point(b,r)),L=this.pointLocation3D(new s.Point(b,m)),Z=this.pointLocation3D(new s.Point(c,m));let q=Math.min(T.lng,O.lng,L.lng,Z.lng),W=Math.max(T.lng,O.lng,L.lng,Z.lng),se=Math.min(T.lat,O.lat,L.lat,Z.lat),Oe=Math.max(T.lat,O.lat,L.lat,Z.lat);const $e=Math.pow(2,-this.zoom)/16*270,We="globe"===this.projection.name?1:4,qe=(Ke,ce,Ve,rt,ot)=>{const Tt=(Ke+Ve)/2,Mt=(ce+rt)/2,Dt=new s.Point(Tt,Mt),{lng:$t,lat:zt}=this.pointLocation3D(Dt),dn=Math.max(0,q-$t,se-zt,$t-W,zt-Oe);q=Math.min(q,$t),W=Math.max(W,$t),se=Math.min(se,zt),Oe=Math.max(Oe,zt),(ot$e)&&(qe(Ke,ce,Tt,Mt,ot+1),qe(Tt,Mt,Ve,rt,ot+1))};if(qe(c,r,b,r,1),qe(b,r,b,m,1),qe(b,m,c,m,1),qe(c,m,c,r,1),"globe"===this.projection.name){const[Ke,ce]=s.polesInViewport(this);Ke?(Oe=90,W=180,q=-180):ce&&(se=-90,W=180,q=-180)}return new s.LngLatBounds(new s.LngLat(q,se),new s.LngLat(W,Oe))}_getBoundsRectangular(r,c){const{top:m,left:b}=this._edgeInsets,T=this.height-this._edgeInsets.bottom,O=this.width-this._edgeInsets.right,L=new s.Point(b,m),Z=new s.Point(O,m),q=new s.Point(O,T),W=new s.Point(b,T);let se=this.pointCoordinate(L,r),Oe=this.pointCoordinate(Z,r);const $e=this.pointCoordinate(q,c),We=this.pointCoordinate(W,c),qe=(Ke,ce)=>(ce.y-Ke.y)/(ce.x-Ke.x);return se.y>1&&Oe.y>=0?se=new s.MercatorCoordinate((1-We.y)/qe(We,se)+We.x,1):se.y<0&&Oe.y<=1&&(se=new s.MercatorCoordinate(-We.y/qe(We,se)+We.x,0)),Oe.y>1&&se.y>=0?Oe=new s.MercatorCoordinate((1-$e.y)/qe($e,Oe)+$e.x,1):Oe.y<0&&se.y<=1&&(Oe=new s.MercatorCoordinate(-$e.y/qe($e,Oe)+$e.x,0)),(new s.LngLatBounds).extend(this.coordinateLocation(se)).extend(this.coordinateLocation(Oe)).extend(this.coordinateLocation(We)).extend(this.coordinateLocation($e))}_getBoundsRectangularTerrain(){const r=this.elevation;if(!r.visibleDemTiles.length||r.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=r.visibleDemTiles.reduce((m,b)=>{if(b.dem){const T=b.dem.tree;m.min=Math.min(m.min,T.minimums[0]),m.max=Math.max(m.max,T.maximums[0])}return m},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*r.exaggeration(),c.max*r.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(r=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,m=this.height/2-c*(1-this._horizonShift);return r?Math.max(0,m):m}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLngse&&(L=se-q),se-W$e&&(O=$e-Z),$e-Oe.5?rt-1:rt,ot>.5?ot-1:ot,0]),this.alignedProjMatrix=Tt,L=s.create(),s.scale(L,L,[this.width/2,-this.height/2,1]),s.translate(L,L,[1,-1,0]),this.labelPlaneMatrix=L,L=s.create(),s.scale(L,L,[1,-1,1]),s.translate(L,L,[-1,-1,0]),s.scale(L,L,[2/this.width,2/this.height,1]),this.glCoordMatrix=L,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},L=s.invert(new Float64Array(16),this.pixelMatrix),!L)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=L,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const Mt=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(Mt,Mt,T),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=L;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const r=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,m=this._camera.position,b=1/this.height/this._pixelsPerMercatorPixel,T=[r,r,c];s.scale$2(T,T,b),s.scale$2(m,m,-1),s.multiply$2(m,m,T);const O=s.create();s.translate(O,O,m),s.scale(O,O,T),this.mercatorFogMatrix=O,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,c,b)}_computeCameraPosition(r){const c=(r=r||this.pixelsPerMeter)/this.pixelsPerMeter,m=this._camera.forward(),b=this.point,T=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-r/this.worldSize*this._centerAltitude;return[b.x/this.worldSize-m[0]*T,b.y/this.worldSize-m[1]*T,r/this.worldSize*this._centerAltitude-m[2]*T]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),m=this._camera.position[2],b=r[2];let T=1;this.projection.wrap&&(this.center=this.center.wrap()),b>0&&(T=Math.min((c-m)/b,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,r,T),this._updateStateFromCamera()}_updateStateFromCamera(){const r=this._camera.position,c=this._camera.forward(),{pitch:m,bearing:b}=this._camera.getPitchBearing(),T=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,O=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),L=Math.max((r[2]-T)/Math.cos(m),O),Z=this._zoomFromMercatorZ(L);s.scaleAndAdd(r,r,c,L),this._pitch=s.clamp(m,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(b,-Math.PI,Math.PI),this._setZoom(s.clamp(Z,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(r){return Math.pow(2,r)*this.tileSize}_mercatorZfromZoom(r){return this.cameraToCenterDistance/this._worldSizeFromZoom(r)}_minimumHeightOverTerrain(){const r=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(r)}_zoomFromMercatorZ(r){return this.scaleZoom(this.cameraToCenterDistance/(r*this.tileSize))}zoomFromMercatorZAdjusted(r){let c=0,m=s.GLOBE_ZOOM_THRESHOLD_MAX,b=0,T=1/0;for(;m-c>1e-6&&m>c;){const O=c+.5*(m-c),L=this.tileSize*Math.pow(2,O),Z=this.getCameraToCenterDistance(this.projection,O,L),q=this.scaleZoom(Z/(r*this.tileSize)),W=Math.abs(O-q);Wq||Oe.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(r,c){const m=s.length(s.sub([],this._camera.position,r)),b=this._zoomFromMercatorZ(m)+c;return m-this._mercatorZfromZoom(b)}getCameraPoint(){if("globe"===this.projection.name){const r=function([c,m,b],T){const O=[c,m,b,1];s.transformMat4$1(O,O,T);const L=O[3]=Math.max(O[3],1e-6);return O[0]/=L,O[1]/=L,O[2]/=L,O}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(r[0],r[1])}{const r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,r))}}getCameraToCenterDistance(r,c=this.zoom,m=this.worldSize){const b=Vi(r,c,this.width,this.height,1024),T=r.pixelSpaceConversion(this.center.lat,m,b);return.5/Math.tan(.5*this._fov)*this.height*T}getWorldToCameraMatrix(){const r=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&s.multiply(r,r,this.globeMatrix),r}}function ss(f,r){let c=!1,m=null;const b=()=>{m=null,c&&(f(),m=setTimeout(b,r),c=!1)};return()=>(c=!0,m||b(),m)}class No{constructor(r){this._hashName=r&&encodeURIComponent(r),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=ss(this._updateHashUnthrottled.bind(this),300)}addTo(r){return this._map=r,s.window.addEventListener("hashchange",this._onHashChange,!1),r.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const r=this._map;if(!r)return"";const c=fo(r);if(this._hashName){const m=this._hashName;let b=!1;const T=s.window.location.hash.slice(1).split("&").map(O=>{const L=O.split("=")[0];return L===m?(b=!0,`${L}=${c}`):O}).filter(O=>O);return b||T.push(`${m}=${c}`),`#${T.join("&")}`}return`#${c}`}_getCurrentHash(){const r=s.window.location.hash.replace("#","");if(this._hashName){let c;return r.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(c=m)}),(c&&c[1]||"").split("/")}return r.split("/")}_onHashChange(){const r=this._map;if(!r)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(m=>isNaN(m))){const m=r.dragRotate.isEnabled()&&r.touchZoomRotate.isEnabled()?+(c[3]||0):r.getBearing();return r.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:m,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const r=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,r)}}function fo(f,r){const c=f.getCenter(),m=Math.round(100*f.getZoom())/100,b=Math.ceil((m*Math.LN2+Math.log(512/360/.5))/Math.LN10),T=Math.pow(10,b),O=Math.round(c.lng*T)/T,L=Math.round(c.lat*T)/T,Z=f.getBearing(),q=f.getPitch();let W=r?`/${O}/${L}/${m}`:`${m}/${L}/${O}`;return(Z||q)&&(W+="/"+Math.round(10*Z)/10),q&&(W+=`/${Math.round(q)}`),W}const as={linearity:.3,easing:s.bezier(0,0,.3,1)},Ys=s.extend({deceleration:2500,maxSpeed:1400},as),mc=s.extend({deceleration:20,maxSpeed:1400},as),ai=s.extend({deceleration:1e3,maxSpeed:360},as),Js=s.extend({deceleration:1e3,maxSpeed:90},as);class Su{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,c=s.exported.now();for(;r.length>0&&c-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:T}of this._inertiaBuffer)c.zoom+=T.zoomDelta||0,c.bearing+=T.bearingDelta||0,c.pitch+=T.pitchDelta||0,T.panDelta&&c.pan._add(T.panDelta),T.around&&(c.around=T.around),T.pinchAround&&(c.pinchAround=T.pinchAround);const m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,b={};if(c.pan.mag()){const T=Cl(c.pan.mag(),m,s.extend({},Ys,r||{}));b.offset=c.pan.mult(T.amount/c.pan.mag()),b.center=this._map.transform.center,es(b,T)}if(c.zoom){const T=Cl(c.zoom,m,mc);b.zoom=this._map.transform.zoom+T.amount,es(b,T)}if(c.bearing){const T=Cl(c.bearing,m,ai);b.bearing=this._map.transform.bearing+s.clamp(T.amount,-179,179),es(b,T)}if(c.pitch){const T=Cl(c.pitch,m,Js);b.pitch=this._map.transform.pitch+T.amount,es(b,T)}if(b.zoom||b.bearing){const T=void 0===c.pinchAround?c.around:c.pinchAround;b.around=T?this._map.unproject(T):this._map.getCenter()}return this.clear(),b.noMoveStart=!0,b}}function es(f,r){(!f.duration||f.durationc.unproject(Z)),L=T.reduce((Z,q,W,se)=>Z.add(q.div(se.length)),new s.Point(0,0));super(r,{points:T,point:L,lngLats:O,lngLat:c.unproject(L),originalEvent:m}),this._defaultPrevented=!1}}class $i extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,c,m){super(r,{originalEvent:m}),this._defaultPrevented=!1}}class gc{constructor(r,c){this._map=r,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(r){return this._firePreventable(new $i(r.type,this._map,r))}mousedown(r,c){return this._mousedownPos=c,this._firePreventable(new zo(r.type,this._map,r))}mouseup(r){this._map.fire(new zo(r.type,this._map,r))}preclick(r){const c=s.extend({},r);c.type="preclick",this._map.fire(new zo(c.type,this._map,c))}click(r,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(r),this._map.fire(new zo(r.type,this._map,r)))}dblclick(r){return this._firePreventable(new zo(r.type,this._map,r))}mouseover(r){this._map.fire(new zo(r.type,this._map,r))}mouseout(r){this._map.fire(new zo(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Za(r.type,this._map,r))}touchmove(r){this._map.fire(new Za(r.type,this._map,r))}touchend(r){this._map.fire(new Za(r.type,this._map,r))}touchcancel(r){this._map.fire(new Za(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class _c{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(r){this._map.fire(new zo(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._map.fire(new zo(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class bd{constructor(r,c){this._map=r,this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,c){this.isEnabled()&&r.shiftKey&&0===r.button&&(ae(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(r,c){if(!this._active)return;const m=c,b=this._startPos,T=this._lastPos;if(!b||!T||T.equals(m)||!this._box&&m.dist(b){this._box&&(this._box.style.transform=`translate(${O}px,${Z}px)`,this._box.style.width=L-O+"px",this._box.style.height=q-Z+"px")})}mouseupWindow(r,c){if(!this._active)return;const m=this._startPos,b=c;if(m&&0===r.button){if(this.reset(),Ie(),m.x!==b.x||m.y!==b.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:r})),{cameraAnimation:T=>T.fitScreenCoordinates(m,b,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}keydown(r){this._active&&27===r.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",r))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),oe(),delete this._startPos,delete this._lastPos}_fireEvent(r,c){return this._map.fire(new s.Event(r,{originalEvent:c}))}}function Hc(f,r){const c={};for(let m=0;mthis.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=r.timeStamp),m.length===this.numTouches&&(this.centroid=function(b){const T=new s.Point(0,0);for(const O of b)T._add(O);return T.div(b.length)}(c),this.touches=Hc(m,c)))}touchmove(r,c,m){if(this.aborted||!this.centroid)return;const b=Hc(m,c);for(const T in this.touches){const O=b[T];(!O||O.dist(this.touches[T])>30)&&(this.aborted=!0)}}touchend(r,c,m){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),0===m.length){const b=!this.aborted&&this.centroid;if(this.reset(),b)return b}}}class Tl{constructor(r){this.singleTap=new El(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(r,c,m){this.singleTap.touchstart(r,c,m)}touchmove(r,c,m){this.singleTap.touchmove(r,c,m)}touchend(r,c,m){const b=this.singleTap.touchend(r,c,m);if(b){const T=r.timeStamp-this.lastTime<500,O=!this.lastTap||this.lastTap.dist(b)<30;if(T&&O||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}class rl{constructor(){this._zoomIn=new Tl({numTouches:1,numTaps:2}),this._zoomOut=new Tl({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,c,m){this._zoomIn.touchstart(r,c,m),this._zoomOut.touchstart(r,c,m)}touchmove(r,c,m){this._zoomIn.touchmove(r,c,m),this._zoomOut.touchmove(r,c,m)}touchend(r,c,m){const b=this._zoomIn.touchend(r,c,m),T=this._zoomOut.touchend(r,c,m);return b?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:O=>O.easeTo({duration:300,zoom:O.getZoom()+1,around:O.unproject(b)},{originalEvent:r})}):T?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:O=>O.easeTo({duration:300,zoom:O.getZoom()-1,around:O.unproject(T)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const wd={0:1,2:2};class ol{constructor(r){this.reset(),this._clickTolerance=r.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(r,c){return!1}_move(r,c){return{}}mousedown(r,c){if(this._lastPoint)return;const m=et(r);this._correctButton(r,m)&&(this._lastPoint=c,this._eventButton=m)}mousemoveWindow(r,c){const m=this._lastPoint;if(m)if(r.preventDefault(),null!=this._eventButton&&function(b,T){const O=wd[T];return void 0===b.buttons||(b.buttons&O)!==O}(r,this._eventButton))this.reset();else if(this._moved||!(c.dist(m)0&&(this._active=!0);const b=Hc(m,c),T=new s.Point(0,0),O=new s.Point(0,0);let L=0;for(const q in b){const W=b[q],se=this._touches[q];se&&(T._add(W),O._add(W.sub(se)),L++,b[q]=W)}if(this._touches=b,L{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class wr{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(r){}_move(r,c,m){return{}}touchstart(r,c,m){this._firstTwoTouches||m.length<2||(this._firstTwoTouches=[m[0].identifier,m[1].identifier],this._start([c[0],c[1]]))}touchmove(r,c,m){const b=this._firstTwoTouches;if(!b)return;r.preventDefault();const[T,O]=b,L=sl(m,c,T),Z=sl(m,c,O);if(!L||!Z)return;const q=this._aroundCenter?null:L.add(Z).div(2);return this._move([L,Z],q,r)}touchend(r,c,m){if(!this._firstTwoTouches)return;const[b,T]=this._firstTwoTouches,O=sl(m,c,b),L=sl(m,c,T);O&&L||(this._active&&Ie(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&"center"===r.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function sl(f,r,c){for(let m=0;mMath.abs(f.x)}class Hl extends wr{constructor(r){super(),this._map=r}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(r){this._lastPoints=r,ms(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,c,m){const b=this._lastPoints;if(!b)return;const T=r[0].sub(b[0]),O=r[1].sub(b[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&m.touches.length<3||(this._valid=this.gestureBeginsVertically(T,O,m.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:(T.y+O.y)/2*-.5})}gestureBeginsVertically(r,c,m){if(void 0!==this._valid)return this._valid;const b=r.mag()>=2,T=c.mag()>=2;if(!b&&!T)return;if(!b||!T)return null==this._firstMove&&(this._firstMove=m),m-this._firstMove<100&&void 0;const O=r.y>0==c.y>0;return ms(r)&&ms(c)&&O}}const vc={panStep:100,bearingStep:15,pitchStep:10};class _h{constructor(){const r=vc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let c=0,m=0,b=0,T=0,O=0;switch(r.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:r.shiftKey?m=-1:(r.preventDefault(),T=-1);break;case 39:r.shiftKey?m=1:(r.preventDefault(),T=1);break;case 38:r.shiftKey?b=1:(r.preventDefault(),O=-1);break;case 40:r.shiftKey?b=-1:(r.preventDefault(),O=1);break;default:return}return this._rotationDisabled&&(m=0,b=0),{cameraAnimation:L=>{const Z=L.getZoom();L.easeTo({duration:300,easeId:"keyboardHandler",easing:yh,zoom:c?Math.round(Z)+c*(r.shiftKey?2:1):Z,bearing:L.getBearing()+m*this._bearingStep,pitch:L.getPitch()+b*this._pitchStep,offset:[-T*this._panStep,-O*this._panStep],center:L.getCenter()},{originalEvent:r})}}}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 yh(f){return f*(2-f)}const qc=4.000244140625;class gs{constructor(r,c){this._map=r,this._el=r.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&"center"===r.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=r.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const m=s.exported.now(),b=m-(this._lastWheelEventTime||0);this._lastWheelEventTime=m,0!==c&&c%qc==0?this._type="wheel":0!==c&&Math.abs(c)<4?this._type="trackpad":b>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(b*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),r.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=r,this._delta-=c,this._active||this._start(r)),r.preventDefault()}_onTimeout(r){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)}_start(r){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 c=Ee(this._el,r);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._map.transform;"wheel"===this._type&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(0!==this._delta){const Z="wheel"===this._type&&Math.abs(this._delta)>qc?this._wheelZoomRate:this._defaultZoomRate;let q=2/(1+Math.exp(-Math.abs(this._delta*Z)));this._delta<0&&0!==q&&(q=1/q);const W=c(),se=Math.pow(2,W),Oe="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):se;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(Oe*q))),"wheel"===this._type&&(this._startZoom=W,this._easing=this._smoothOutEasing(200)),this._delta=0}const m="number"==typeof this._targetZoom?this._targetZoom:c(),b=this._startZoom,T=this._easing;let O,L=!1;if("wheel"===this._type&&b&&T){const Z=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),q=T(Z);O=s.number(b,m,q),Z<1?this._frameId||(this._frameId=!0):L=!0}else O=m,L=!0;return this._active=!0,L&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!L,zoomDelta:O-c(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let c=s.ease;if(this._prevEase){const m=this._prevEase,b=(s.exported.now()-m.start)/m.duration,T=m.easing(b+.01)-m.easing(b),O=.27/Math.sqrt(T*T+1e-4)*.01,L=Math.sqrt(.0729-O*O);c=s.bezier(O,L,.25,1)}return this._prevEase={start:s.exported.now(),duration:r,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=Ne("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Da{constructor(r,c){this._clickZoom=r,this._tapZoom=c}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 ts{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(r,c){return r.preventDefault(),{cameraAnimation:m=>{m.easeTo({duration:300,zoom:m.getZoom()+(r.shiftKey?-1:1),around:m.unproject(c)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Il{constructor(){this._tap=new Tl({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(r,c,m){this._swipePoint||(this._tapTime&&r.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?m.length>0&&(this._swipePoint=c[0],this._swipeTouch=m[0].identifier):this._tap.touchstart(r,c,m))}touchmove(r,c,m){if(this._tapTime){if(this._swipePoint){if(m[0].identifier!==this._swipeTouch)return;const b=c[0],T=b.y-this._swipePoint.y;return this._swipePoint=b,r.preventDefault(),this._active=!0,{zoomDelta:T/128}}}else this._tap.touchmove(r,c,m)}touchend(r,c,m){this._tapTime?this._swipePoint&&0===m.length&&this.reset():this._tap.touchend(r,c,m)&&(this._tapTime=r.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pa{constructor(r,c,m){this._el=r,this._mousePan=c,this._touchPan=m}enable(r){this._inertiaOptions=r||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Cd{constructor(r,c,m){this._pitchWithRotate=r.pitchWithRotate,this._mouseRotate=c,this._mousePitch=m}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ou{constructor(r,c,m,b){this._el=r,this._touchZoom=c,this._touchRotate=m,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const Ks=f=>f.zoom||f.drag||f.pitch||f.rotate;class Ru extends s.Event{}class Yc{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,c){const m=s.sub([],c,r);this.radius=s.length(m[2]<0?s.div([],m,this.constants):[m[0],m[1],0])}projectRay(r){s.div(r,r,this.constants),s.normalize(r,r),s.mul$1(r,r,this.constants);const c=s.scale$2([],r,this.radius);if(c[2]>0){const m=s.scale$2([],[0,0,1],s.dot(c,[0,0,1])),b=s.scale$2([],s.normalize([],[c[0],c[1],0]),this.radius),T=s.add([],c,s.scale$2([],s.sub([],s.add([],b,m),c),2));c[0]=T[0],c[1]=T[1]}return c}}function js(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class Xs{constructor(r,c){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Su(r),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Yc,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),s.bindAll(["handleEvent","handleWindowEvent"],this);const m=this._el;this._listeners=[[m,"touchstart",{passive:!0}],[m,"touchmove",{passive:!1}],[m,"touchend",void 0],[m,"touchcancel",void 0],[m,"mousedown",void 0],[m,"mousemove",void 0],[m,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[m,"mouseover",void 0],[m,"mouseout",void 0],[m,"dblclick",void 0],[m,"click",void 0],[m,"keydown",{capture:!1}],[m,"keyup",void 0],[m,"wheel",{passive:!1}],[m,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[b,T,O]of this._listeners)b.addEventListener(T,b===s.window.document?this.handleWindowEvent:this.handleEvent,O)}destroy(){for(const[r,c,m]of this._listeners)r.removeEventListener(c,r===s.window.document?this.handleWindowEvent:this.handleEvent,m)}_addDefaultHandlers(r){const c=this._map,m=c.getCanvasContainer();this._add("mapEvent",new gc(c,r));const b=c.boxZoom=new bd(c,r);this._add("boxZoom",b);const T=new rl,O=new ts;c.doubleClickZoom=new Da(O,T),this._add("tapZoom",T),this._add("clickZoom",O);const L=new Il;this._add("tapDragZoom",L);const Z=c.touchPitch=new Hl(c);this._add("touchPitch",Z);const q=new Wc(r),W=new Pu(r);c.dragRotate=new Cd(r,q,W),this._add("mouseRotate",q,["mousePitch"]),this._add("mousePitch",W,["mouseRotate"]);const se=new aa(r),Oe=new jn(c,r);c.dragPan=new pa(m,se,Oe),this._add("mousePan",se),this._add("touchPan",Oe,["touchZoom","touchRotate"]);const $e=new Dl,We=new Uo;c.touchZoomRotate=new Ou(m,We,$e,L),this._add("touchRotate",$e,["touchPan","touchZoom"]),this._add("touchZoom",We,["touchPan","touchRotate"]),this._add("blockableMapEvent",new _c(c));const qe=c.scrollZoom=new gs(c,this);this._add("scrollZoom",qe,["mousePan"]);const Ke=c.keyboard=new _h;this._add("keyboard",Ke);for(const ce of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])r.interactive&&r[ce]&&c[ce].enable(r[ce])}_add(r,c,m){this._handlers.push({handlerName:r,handler:c,allowed:m}),this._handlersById[r]=c}stop(r){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ks(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(r,c,m){for(const b in r)if(b!==m&&(!c||c.indexOf(b)<0))return!0;return!1}handleWindowEvent(r){this.handleEvent(r,`${r.type}Window`)}_getMapTouches(r){const c=[];for(const m of r)this._el.contains(m.target)&&c.push(m);return c}handleEvent(r,c){this._updatingCamera=!0;const m="renderFrame"===r.type,b=m?void 0:r,T={needsRenderFrame:!1},O={},L={},Z=r.touches?this._getMapTouches(r.touches):void 0,q=Z?Ue(this._el,Z):m?void 0:Ee(this._el,r);for(const{handlerName:Oe,handler:$e,allowed:We}of this._handlers){if(!$e.isEnabled())continue;let qe;this._blockedByActive(L,We,Oe)?$e.reset():$e[c||r.type]&&(qe=$e[c||r.type](r,q,Z),this.mergeHandlerResult(T,O,qe,Oe,b),qe&&qe.needsRenderFrame&&this._triggerRenderFrame()),(qe||$e.isActive())&&(L[Oe]=$e)}const W={};for(const Oe in this._previousActiveHandlers)L[Oe]||(W[Oe]=b);this._previousActiveHandlers=L,(Object.keys(W).length||js(T))&&(this._changes.push([T,O,W]),this._triggerRenderFrame()),(Object.keys(L).length||js(T))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:se}=T;se&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],se(this._map))}mergeHandlerResult(r,c,m,b,T){if(!m)return;s.extend(r,m);const O={handlerName:b,originalEvent:m.originalEvent||T};void 0!==m.zoomDelta&&(c.zoom=O),void 0!==m.panDelta&&(c.drag=O),void 0!==m.pitchDelta&&(c.pitch=O),void 0!==m.bearingDelta&&(c.rotate=O)}_applyChanges(){const r={},c={},m={};for(const[b,T,O]of this._changes)b.panDelta&&(r.panDelta=(r.panDelta||new s.Point(0,0))._add(b.panDelta)),b.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+b.zoomDelta),b.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+b.bearingDelta),b.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+b.pitchDelta),void 0!==b.around&&(r.around=b.around),void 0!==b.aroundCoord&&(r.aroundCoord=b.aroundCoord),void 0!==b.pinchAround&&(r.pinchAround=b.pinchAround),b.noInertia&&(r.noInertia=b.noInertia),s.extend(c,T),s.extend(m,O);this._updateMapTransform(r,c,m),this._changes=[]}_updateMapTransform(r,c,m){const b=this._map,T=b.transform,O=Ve=>[Ve.x,Ve.y,Ve.z];if((Ve=>{const rt=this._eventsInProgress.drag;return rt&&!this._handlersById[rt.handlerName].isActive()})()&&!js(r)){const Ve=T.zoom;T.cameraElevationReference="sea",T.recenterOnTerrain(),T.cameraElevationReference="ground",Ve!==T.zoom&&this._map._update(!0)}if(T._isCameraConstrained&&b._stop(!0),!js(r))return void this._fireEvents(c,m,!0);let{panDelta:L,zoomDelta:Z,bearingDelta:q,pitchDelta:W,around:se,aroundCoord:Oe,pinchAround:$e}=r;T._isCameraConstrained&&(Z>0&&(Z=0),T._isCameraConstrained=!1),void 0!==$e&&(se=$e),(Z||(Ve=>c.drag&&!this._eventsInProgress.drag)())&&se&&(this._dragOrigin=O(T.pointCoordinate3D(se)),this._trackingEllipsoid.setup(T._camera.position,this._dragOrigin)),T.cameraElevationReference="sea",b._stop(!0),se=se||b.transform.centerPoint,q&&(T.bearing+=q),W&&(T.pitch+=W),T._updateCameraState();const We=[0,0,0];if(L)if("mercator"===T.projection.name){const Ve=this._trackingEllipsoid.projectRay(T.screenPointToMercatorRay(se).dir),rt=this._trackingEllipsoid.projectRay(T.screenPointToMercatorRay(se.sub(L)).dir);We[0]=rt[0]-Ve[0],We[1]=rt[1]-Ve[1]}else{const Ve=T.pointCoordinate(se);if("globe"===T.projection.name){L=L.rotate(-T.angle);const rt=T._pixelsPerMercatorPixel/T.worldSize;We[0]=-L.x*s.mercatorScale(s.latFromMercatorY(Ve.y))*rt,We[1]=-L.y*s.mercatorScale(T.center.lat)*rt}else{const rt=T.pointCoordinate(se.sub(L));Ve&&rt&&(We[0]=rt.x-Ve.x,We[1]=rt.y-Ve.y)}}const qe=T.zoom,Ke=[0,0,0];if(Z){const Ve=O(Oe||T.pointCoordinate3D(se)),rt={dir:s.normalize([],s.sub([],Ve,T._camera.position))};if(rt.dir[2]<0){const ot=T.zoomDeltaToMovement(Ve,Z);s.scale$2(Ke,rt.dir,ot)}}const ce=s.add(We,We,Ke);T._translateCameraConstrained(ce),Z&&Math.abs(T.zoom-qe)>1e-4&&T.recenterOnTerrain(),T.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(c,m,!0)}_fireEvents(r,c,m){const b=Ks(this._eventsInProgress),T=Ks(r),O={};for(const W in r){const{originalEvent:se}=r[W];this._eventsInProgress[W]||(O[`${W}start`]=se),this._eventsInProgress[W]=r[W]}!b&&T&&this._fireEvent("movestart",T.originalEvent);for(const W in O)this._fireEvent(W,O[W]);T&&this._fireEvent("move",T.originalEvent);for(const W in r){const{originalEvent:se}=r[W];this._fireEvent(W,se)}const L={};let Z;for(const W in this._eventsInProgress){const{handlerName:se,originalEvent:Oe}=this._eventsInProgress[W];this._handlersById[se].isActive()||(delete this._eventsInProgress[W],Z=c[se]||Oe,L[`${W}end`]=Z)}for(const W in L)this._fireEvent(W,L[W]);const q=Ks(this._eventsInProgress);if(m&&(b||T)&&!q){this._updatingCamera=!0;const W=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),se=Oe=>0!==Oe&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new Ru("renderFrame",{timeStamp:r})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Ia="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Jc extends s.Evented{constructor(r,c){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=!1!==c.respectPrefersReducedMotion,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(r,c){return this.jumpTo({center:r},c)}panBy(r,c,m){return r=s.Point.convert(r).mult(-1),this.panTo(this.transform.center,s.extend({offset:r},c),m)}panTo(r,c,m){return this.easeTo(s.extend({center:r},c),m)}getZoom(){return this.transform.zoom}setZoom(r,c){return this.jumpTo({zoom:r},c),this}zoomTo(r,c,m){return this.easeTo(s.extend({zoom:r},c),m)}zoomIn(r,c){return this.zoomTo(this.getZoom()+1,r,c),this}zoomOut(r,c){return this.zoomTo(this.getZoom()-1,r,c),this}getBearing(){return this.transform.bearing}setBearing(r,c){return this.jumpTo({bearing:r},c),this}getPadding(){return this.transform.padding}setPadding(r,c){return this.jumpTo({padding:r},c),this}rotateTo(r,c,m){return this.easeTo(s.extend({bearing:r},c),m)}resetNorth(r,c){return this.rotateTo(0,s.extend({duration:1e3},r),c),this}resetNorthPitch(r,c){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},r),c),this}snapToNorth(r,c){return Math.abs(this.getBearing())r.aspect?m/(2*Math.tan(.5*r.fovX)*r.aspect):b/(2*Math.tan(.5*r.fovY)*r.aspect)}_cameraForBoundsOnGlobe(r,c,m,b,T,O){const L=r.clone(),Z=this._extendCameraOptions(O);L.bearing=b,L.pitch=T;const q=s.LngLat.convert(c),W=s.LngLat.convert(m),se=.5*(q.lat+W.lat),Oe=.5*(q.lng+W.lng),$e=s.latLngToECEF(se,Oe),We=s.normalize([],$e),qe=s.normalize([],s.cross([],We,[0,1,0])),Ke=s.cross([],qe,We),ce=[qe[0],qe[1],qe[2],0,Ke[0],Ke[1],Ke[2],0,We[0],We[1],We[2],0,0,0,0,1],Ve=[$e,s.latLngToECEF(q.lat,q.lng),s.latLngToECEF(W.lat,q.lng),s.latLngToECEF(W.lat,W.lng),s.latLngToECEF(q.lat,W.lng),s.latLngToECEF(se,q.lng),s.latLngToECEF(se,W.lng),s.latLngToECEF(q.lat,Oe),s.latLngToECEF(W.lat,Oe)];let rt=s.Aabb.fromPoints(Ve.map(Ln=>[s.dot(qe,Ln),s.dot(Ke,Ln),s.dot(We,Ln)]));const ot=s.transformMat4([],rt.center,ce);0===s.squaredLength(ot)&&s.set(ot,0,0,1),s.normalize(ot,ot),s.scale$2(ot,ot,s.GLOBE_RADIUS),L.center=s.ecefToLatLng(ot);const Tt=L.getWorldToCameraMatrix(),Mt=s.invert(new Float64Array(16),Tt);rt=s.Aabb.applyTransform(rt,s.multiply([],Tt,ce)),s.transformMat4(ot,ot,Tt);const Dt=.5*(rt.max[2]-rt.min[2]),$t=this._minimumAABBFrustumDistance(L,rt),zt=s.scale$2([],[0,0,1],Dt),dn=s.add(zt,ot,zt),Vn=$t+(0===L.pitch?0:s.distance(ot,dn)),on=L.globeCenterInViewSpace,Rn=s.sub([],ot,[on[0],on[1],on[2]]);s.normalize(Rn,Rn),s.scale$2(Rn,Rn,Vn);const un=s.add([],ot,Rn);s.transformMat4(un,un,Mt);const Zn=s.earthRadius/s.GLOBE_RADIUS,sn=s.length(un),An=s.mercatorZfromAltitude(Math.max(sn*Zn-s.earthRadius,Number.EPSILON),0),Gn=Math.min(L.zoomFromMercatorZAdjusted(An),Z.maxZoom);return Gn>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(L.setProjection({name:"mercator"}),L.zoom=Gn,this._cameraForBounds(L,c,m,b,T,O)):{center:L.center,zoom:Gn,bearing:b,pitch:T}}queryTerrainElevation(r,c){const m=this.transform.elevation;return m?(c=s.extend({},{exaggerated:!0},c),m.getAtPoint(s.MercatorCoordinate.fromLngLat(r),null,c.exaggerated)):null}_cameraForBounds(r,c,m,b,T,O){if("globe"===r.projection.name)return this._cameraForBoundsOnGlobe(r,c,m,b,T,O);const L=r.clone(),Z=this._extendCameraOptions(O),q=L.padding;L.bearing=b,L.pitch=T;const W=s.LngLat.convert(c),se=s.LngLat.convert(m),Oe=new s.LngLat(W.lng,se.lat),$e=new s.LngLat(se.lng,W.lat),We=L.project(W),qe=L.project(se),Ke=this.queryTerrainElevation(W),ce=this.queryTerrainElevation(se),Ve=this.queryTerrainElevation(Oe),rt=this.queryTerrainElevation($e),ot=[[We.x,We.y,Math.min(Ke||0,ce||0,Ve||0,rt||0)],[qe.x,qe.y,Math.max(Ke||0,ce||0,Ve||0,rt||0)]];let Tt=s.Aabb.fromPoints(ot);const Mt=L.getWorldToCameraMatrix(),Dt=s.invert(new Float64Array(16),Mt);Tt=s.Aabb.applyTransform(Tt,Mt);const $t=s.sub([],Tt.max,Tt.min),zt=q.left||0,dn=q.right||0,Vn=q.bottom||0,on=q.top||0,{left:Rn,right:un,top:Zn,bottom:sn}=Z.padding,An=.5*(zt+dn),Gn=.5*(on+Vn),Ln=Math.min(L.scaleZoom(L.scale*Math.min((L.width-(zt+dn+Rn+un))/$t[0],(L.height-(Vn+on+sn+Zn))/$t[1])),Z.maxZoom),Wn=L.scale/L.zoomScale(Ln);Tt=new s.Aabb([Tt.min[0]-(Rn+An)*Wn,Tt.min[1]-(sn+Gn)*Wn,Tt.min[2]],[Tt.max[0]+(un+An)*Wn,Tt.max[1]+(Zn+Gn)*Wn,Tt.max[2]]);const Di=.5*$t[2],Gi=this._minimumAABBFrustumDistance(L,Tt),hi=[0,0,1,0];s.transformMat4$1(hi,hi,Mt),s.normalize$2(hi,hi);const Pi=s.scale$2([],hi,Gi+Di),ur=s.add([],Tt.center,Pi),dr=("number"==typeof Z.offset.x&&"number"==typeof Z.offset.y?new s.Point(Z.offset.x,Z.offset.y):s.Point.convert(Z.offset)).rotate(-s.degToRad(b));Tt.center[0]-=dr.x*Wn,Tt.center[1]+=dr.y*Wn,s.transformMat4(Tt.center,Tt.center,Dt),s.transformMat4(ur,ur,Dt);const xi=[Tt.center[0],Tt.center[1],ur[2]*L.pixelsPerMeter];s.scale$2(xi,xi,1/L.worldSize);const Cr=s.lngFromMercatorX(xi[0]),Kr=s.latFromMercatorY(xi[1]),Wr=Math.min(L._zoomFromMercatorZ(xi[2]),Z.maxZoom),qr=new s.LngLat(Cr,Kr);return L.mercatorFromTransition&&Wr<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(L.setProjection({name:"globe"}),L.zoom=Wr,this._cameraForBounds(L,c,m,b,T,O)):{center:qr,zoom:Wr,bearing:b,pitch:T}}fitBounds(r,c,m){const b=this.cameraForBounds(r,c);return this._fitInternal(b,c,m)}fitScreenCoordinates(r,c,m,b,T){const O=s.Point.convert(r),L=s.Point.convert(c),Z=new s.Point(Math.min(O.x,L.x),Math.min(O.y,L.y)),q=new s.Point(Math.max(O.x,L.x),Math.max(O.y,L.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(O,L))return this;const W=this.transform.pointLocation3D(Z),se=this.transform.pointLocation3D(q),Oe=this.transform.pointLocation3D(new s.Point(Z.x,q.y)),$e=this.transform.pointLocation3D(new s.Point(q.x,Z.y)),We=[Math.min(W.lng,se.lng,Oe.lng,$e.lng),Math.min(W.lat,se.lat,Oe.lat,$e.lat)],qe=[Math.max(W.lng,se.lng,Oe.lng,$e.lng),Math.max(W.lat,se.lat,Oe.lat,$e.lat)],Ke=b&&b.pitch?b.pitch:this.getPitch(),ce=this._cameraForBounds(this.transform,We,qe,m,Ke,b);return this._fitInternal(ce,b,T)}_fitInternal(r,c,m){return r?(delete(c=s.extend(r,c)).padding,c.linear?this.easeTo(c,m):this.flyTo(c,m)):this}jumpTo(r,c){this.stop();const m=r.preloadOnly?this.transform.clone():this.transform;let b=!1,T=!1,O=!1;return"zoom"in r&&m.zoom!==+r.zoom&&(b=!0,m.zoom=+r.zoom),void 0!==r.center&&(m.center=s.LngLat.convert(r.center)),"bearing"in r&&m.bearing!==+r.bearing&&(T=!0,m.bearing=+r.bearing),"pitch"in r&&m.pitch!==+r.pitch&&(O=!0,m.pitch=+r.pitch),null==r.padding||m.isPaddingEqual(r.padding)||(m.padding=r.padding),r.preloadOnly?(this._preloadTiles(m),this):(this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),b&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),T&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),O&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(Ia),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,c){const m=this.transform;if(!m.projection.supportsFreeCamera)return s.warnOnce(Ia),this;this.stop();const b=m.zoom,T=m.pitch,O=m.bearing;m.setFreeCameraOptions(r);const L=b!==m.zoom,Z=T!==m.pitch,q=O!==m.bearing;return this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),L&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),q&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),Z&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)),this}easeTo(r,c){this._stop(!1,r.easeId),(!1===(r=s.extend({offset:[0,0],duration:500,easing:s.ease},r)).animate||this._prefersReducedMotion(r))&&(r.duration=0);const m=this.transform,b=this.getZoom(),T=this.getBearing(),O=this.getPitch(),L=this.getPadding(),Z="zoom"in r?+r.zoom:b,q="bearing"in r?this._normalizeBearing(r.bearing,T):T,W="pitch"in r?+r.pitch:O,se="padding"in r?r.padding:m.padding,Oe=s.Point.convert(r.offset);let $e,We,qe;if("globe"===m.projection.name){const zt=s.MercatorCoordinate.fromLngLat(m.center),dn=Oe.rotate(-m.angle);zt.x+=dn.x/m.worldSize,zt.y+=dn.y/m.worldSize;const Vn=zt.toLngLat(),on=s.LngLat.convert(r.center||Vn);this._normalizeCenter(on),$e=m.centerPoint.add(dn),We=new s.Point(zt.x,zt.y).mult(m.worldSize),qe=new s.Point(s.mercatorXfromLng(on.lng),s.mercatorYfromLat(on.lat)).mult(m.worldSize).sub(We)}else{$e=m.centerPoint.add(Oe);const zt=m.pointLocation($e),dn=s.LngLat.convert(r.center||zt);this._normalizeCenter(dn),We=m.project(zt),qe=m.project(dn).sub(We)}const Ke=m.zoomScale(Z-b);let ce,Ve;r.around&&(ce=s.LngLat.convert(r.around),Ve=m.locationPoint(ce));const rt=this._zooming||Z!==b,ot=this._rotating||T!==q,Tt=this._pitching||W!==O,Mt=!m.isPaddingEqual(se),Dt=zt=>dn=>{if(rt&&(zt.zoom=s.number(b,Z,dn)),ot&&(zt.bearing=s.number(T,q,dn)),Tt&&(zt.pitch=s.number(O,W,dn)),Mt&&(zt.interpolatePadding(L,se,dn),$e=zt.centerPoint.add(Oe)),ce)zt.setLocationAtPoint(ce,Ve);else{const Vn=zt.zoomScale(zt.zoom-b),on=Z>b?Math.min(2,Ke):Math.max(.5,Ke),Rn=Math.pow(on,1-dn),un=zt.unproject(We.add(qe.mult(dn*Rn)).mult(Vn));zt.setLocationAtPoint(zt.renderWorldCopies?un.wrap():un,$e)}return r.preloadOnly||this._fireMoveEvents(c),zt};if(r.preloadOnly){const zt=this._emulate(Dt,r.duration,m);return this._preloadTiles(zt),this}const $t={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=rt,this._rotating=ot,this._pitching=Tt,this._padding=Mt,this._easeId=r.easeId,this._prepareEase(c,r.noMoveStart,$t),this._ease(Dt(m),zt=>{m.recenterOnTerrain(),this._afterEase(c,zt)},r),this}_prepareEase(r,c,m={}){this._moving=!0,this.transform.cameraElevationReference="sea",c||m.moving||this.fire(new s.Event("movestart",r)),this._zooming&&!m.zooming&&this.fire(new s.Event("zoomstart",r)),this._rotating&&!m.rotating&&this.fire(new s.Event("rotatestart",r)),this._pitching&&!m.pitching&&this.fire(new s.Event("pitchstart",r))}_fireMoveEvents(r){this.fire(new s.Event("move",r)),this._zooming&&this.fire(new s.Event("zoom",r)),this._rotating&&this.fire(new s.Event("rotate",r)),this._pitching&&this.fire(new s.Event("pitch",r))}_afterEase(r,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const m=this._zooming,b=this._rotating,T=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,m&&this.fire(new s.Event("zoomend",r)),b&&this.fire(new s.Event("rotateend",r)),T&&this.fire(new s.Event("pitchend",r)),this.fire(new s.Event("moveend",r))}flyTo(r,c){if(this._prefersReducedMotion(r)){const Ln=s.pick(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ln,c)}this.stop(),r=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},r);const m=this.transform,b=this.getZoom(),T=this.getBearing(),O=this.getPitch(),L=this.getPadding(),Z="zoom"in r?s.clamp(+r.zoom,m.minZoom,m.maxZoom):b,q="bearing"in r?this._normalizeBearing(r.bearing,T):T,W="pitch"in r?+r.pitch:O,se="padding"in r?r.padding:m.padding,Oe=m.zoomScale(Z-b),$e=s.Point.convert(r.offset);let We=m.centerPoint.add($e);const qe=m.pointLocation(We),Ke=s.LngLat.convert(r.center||qe);this._normalizeCenter(Ke);const ce=m.project(qe),Ve=m.project(Ke).sub(ce);let rt=r.curve;const ot=Math.max(m.width,m.height),Tt=ot/Oe,Mt=Ve.mag();if("minZoom"in r){const Ln=s.clamp(Math.min(r.minZoom,b,Z),m.minZoom,m.maxZoom),Wn=ot/m.zoomScale(Ln-b);rt=Math.sqrt(Wn/Mt*2)}const Dt=rt*rt;function $t(Ln){const Wn=(Tt*Tt-ot*ot+(Ln?-1:1)*Dt*Dt*Mt*Mt)/(2*(Ln?Tt:ot)*Dt*Mt);return Math.log(Math.sqrt(Wn*Wn+1)-Wn)}function zt(Ln){return(Math.exp(Ln)-Math.exp(-Ln))/2}function dn(Ln){return(Math.exp(Ln)+Math.exp(-Ln))/2}const Vn=$t(0);let on=function(Ln){return dn(Vn)/dn(Vn+rt*Ln)},Rn=function(Ln){return ot*((dn(Vn)*(zt(Wn=Vn+rt*Ln)/dn(Wn))-zt(Vn))/Dt)/Mt;var Wn},un=($t(1)-Vn)/rt;if(Math.abs(Mt)<1e-6||!isFinite(un)){if(Math.abs(ot-Tt)<1e-6)return this.easeTo(r,c);const Ln=Ttr.maxDuration&&(r.duration=0);const Zn=T!==q,sn=W!==O,An=!m.isPaddingEqual(se),Gn=Ln=>Wn=>{const Di=Wn*un,Gi=1/on(Di);Ln.zoom=1===Wn?Z:b+Ln.scaleZoom(Gi),Zn&&(Ln.bearing=s.number(T,q,Wn)),sn&&(Ln.pitch=s.number(O,W,Wn)),An&&(Ln.interpolatePadding(L,se,Wn),We=Ln.centerPoint.add($e));const hi=1===Wn?Ke:Ln.unproject(ce.add(Ve.mult(Rn(Di))).mult(Gi));return Ln.setLocationAtPoint(Ln.renderWorldCopies?hi.wrap():hi,We),Ln._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(c),Ln};if(r.preloadOnly){const Ln=this._emulate(Gn,r.duration,m);return this._preloadTiles(Ln),this}return this._zooming=!0,this._rotating=Zn,this._pitching=sn,this._padding=An,this._prepareEase(c,!1),this._ease(Gn(m),()=>this._afterEase(c),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const m=this._onEaseEnd;this._onEaseEnd=void 0,m.call(this,c)}if(!r){const m=this.handlers;m&&m.stop(!1)}return this}_ease(r,c,m){!1===m.animate||0===m.duration?(r(1),c()):(this._easeStart=s.exported.now(),this._easeOptions=m,this._onEaseFrame=r,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const r=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,c){r=s.wrap(r,-180,180);const m=Math.abs(r-c);return Math.abs(r-360-c)180?-360:m<-180?360:0}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(r&&r.essential)}_emulate(r,c,m){const b=Math.ceil(15*c/1e3),T=[],O=r(m.clone());for(let L=0;L<=b;L++){const Z=O(L/b);T.push(Z.clone())}return T}}class ui{constructor(r={}){this.options=r,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(r){const c=this.options&&this.options.compact;return this._map=r,this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=Ne("button","mapboxgl-ctrl-attrib-button",this._container),Ne("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Ne("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===c&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(r,c){const m=this._map._getUIString(`AttributionControl.${c}`);r.setAttribute("aria-label",m),r.removeAttribute("title"),r.firstElementChild&&r.firstElementChild.setAttribute("title",m)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(r){const m=c.reduce((b,T,O)=>(T.value&&(b+=`${T.key}=${T.value}${Ob.length-T.length),r=r.filter((b,T)=>{for(let O=T+1;O=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=[...this.options.customAttribution,...r]:r.unshift(this.options.customAttribution));const m=r.join(" | ");m!==this._attribHTML&&(this._attribHTML=m,r.length?(this._innerContainer.innerHTML=m,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class xc{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(r){this._map=r,this._container=Ne("div","mapboxgl-ctrl");const c=Ne("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(r){r&&"metadata"!==r.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const r=this._map.style._sourceCaches;if(0===Object.entries(r).length)return!0;for(const c in r){const m=r[c].getSource();if(m.hasOwnProperty("mapbox_logo")&&!m.mapbox_logo)return!1}return!0}_updateCompact(){const r=this._container.children;if(r.length){const c=r[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class Kc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const c=++this._id;return this._queue.push({callback:r,id:c,cancelled:!1}),c}remove(r){const c=this._currentlyRunning,m=c?this._queue.concat(c):this._queue;for(const b of m)if(b.id===r)return void(b.cancelled=!0)}run(r=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const m of c)if(!m.cancelled&&(m.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ml(f,r,c){if(f=new s.LngLat(f.lng,f.lat),r){const m=new s.LngLat(f.lng-360,f.lat),b=new s.LngLat(f.lng+360,f.lat),T=360*Math.ceil(Math.abs(f.lng-c.center.lng)/360),O=c.locationPoint(f).distSqr(r),L=r.x<0||r.y<0||r.x>c.width||r.y>c.height;c.locationPoint(m).distSqr(r)180;){const m=c.locationPoint(f);if(m.x>=0&&m.y>=0&&m.x<=c.width&&m.y<=c.height)break;f.lng>c.center.lng?f.lng-=360:f.lng+=360}return f}const al={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%)"};class R extends s.Evented{constructor(r,c){if(super(),(r instanceof s.window.HTMLElement||c)&&(r=s.extend({element:r},c)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=r&&r.occludedOpacity||.2,r&&r.element)this._element=r.element,this._offset=s.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=Ne("div");const b=41,T=27,O=me("svg",{display:"block",height:b*this._scale+"px",width:T*this._scale+"px",viewBox:`0 0 ${T} ${b}`},this._element),L=me("radialGradient",{id:"shadowGradient"},me("defs",{},O));me("stop",{offset:"10%","stop-opacity":.4},L),me("stop",{offset:"100%","stop-opacity":.05},L),me("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},O),me("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},O),me("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},O),me("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},O),this._offset=s.Point.convert(r&&r.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",b=>{b.preventDefault()}),this._element.addEventListener("mousedown",b=>{b.preventDefault()});const m=this._element.classList;for(const b in al)m.remove(`mapboxgl-marker-anchor-${b}`);m.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(r){return r===this._map||(this.remove(),this._map=r,r.getCanvasContainer().appendChild(this._element),r.on("move",this._updateMoving),r.on("moveend",this._update),r.on("remove",this._clearFadeTimer),r._addMarker(this),this.setDraggable(this._draggable),this._update(),r.on("click",this._onMapClick)),this}remove(){const r=this._map;return r&&(r.off("click",this._onMapClick),r.off("move",this._updateMoving),r.off("moveend",this._update),r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler),r.off("mouseup",this._onUp),r.off("touchend",this._onUp),r.off("mousemove",this._onMove),r.off("touchmove",this._onMove),r.off("remove",this._clearFadeTimer),r._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=s.LngLat.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const b=Math.sqrt(Math.pow(13.5,2)/2);r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[b,-1*(24.6+b)],"bottom-right":[-b,-1*(24.6+b)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=r,r._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(r){const c=r.code,m=r.charCode||r.keyCode;"Space"!==c&&"Enter"!==c&&32!==m&&13!==m||this.togglePopup()}_onMapClick(r){const c=r.originalEvent.target,m=this._element;this._popup&&(c===m||m.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const r=this._popup;return r?(r.isOpen()?(r.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(r.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const r=this._map,c=this._pos;if(!r||!c)return!1;const m=r.unproject(c),b=r.getFreeCameraOptions();if(!b.position)return!1;const T=b.position.toLngLat();return T.distanceTo(m)<.9*T.distanceTo(this._lngLat)}_evaluateOpacity(){const r=this._map;if(!r)return;const c=this._pos;if(!c||c.x<0||c.x>r.transform.width||c.y<0||c.y>r.transform.height)return void this._clearFadeTimer();const m=r.unproject(c);let b;r._showingGlobe()&&s.isLngLatBehindGlobe(r.transform,this._lngLat)?b=0:(b=1-r._queryFogOpacity(m),r.transform._terrainEnabled()&&r.getTerrain()&&this._behindTerrain()&&(b*=this._occludedOpacity)),this._element.style.opacity=`${b}`,this._element.style.pointerEvents=b>0?"auto":"none",this._popup&&this._popup._setOpacity(b),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const r=this._pos;if(!r||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${r.x}px,${r.y}px)\n ${al[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${c.x}px,${c.y}px)\n `}_calculateXYTransform(){const r=this._pos,c=this._map,m=this.getPitchAlignment();if(!c||!r||"map"!==m)return"";if(!c._showingGlobe()){const Z=c.getPitch();return Z?`rotateX(${Z}deg)`:""}const b=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),T=r.sub(s.globeCenterToScreenPoint(c.transform)),O=Math.abs(T.x)+Math.abs(T.y);if(0===O)return"";const L=b/O;return`rotateX(${-T.y*L}deg) rotateY(${T.x*L}deg)`}_calculateZTransform(){const r=this._pos,c=this._map;if(!c||!r)return"";let m=0;const b=this.getRotationAlignment();if("map"===b)if(c._showingGlobe()){const T=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),O=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(T);m=s.radToDeg(Math.atan2(O.y,O.x))-90}else m=-c.getBearing();else if("horizon"===b){const T=s.smoothstep(4,6,c.getZoom()),O=s.globeCenterToScreenPoint(c.transform);O.y+=T*c.transform.height;const L=r.sub(O),Z=s.radToDeg(Math.atan2(L.y,L.x));m=(Z>90?Z-270:Z+90)*(1-T)}return m+=this._rotation,m?`rotateZ(${m}deg)`:""}_update(r){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Ml(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),!0===r?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=s.Point.convert(r),this._update(),this}_onMove(r){const c=this._map;if(!c)return;const m=this._pointerdownPos,b=this._positionDelta;if(m&&b){if(!this._isDragging){const T=this._clickTolerance||c._clickTolerance;if(r.point.dist(m)=this._endTime)return this._end;const c=s.easeCubicInOut((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(r){return r>=this._startTime&&r<=this._endTime}jumpTo(r){this._startTime=-1/0,this._endTime=-1/0,this._start=r,this._end=r}easeTo(r,c,m){this._start=this.getValue(c),this._end=r,this._startTime=c,this._endTime=c+m}}const Me={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Ge={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},en={showCompass:!0,showZoom:!0,visualizePitch:!1};class $n{constructor(r,c,m=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new Wc({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,m&&(this.mousePitch=new Pu({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(r,c){this.mouseRotate.mousedown(r,c),this.mousePitch&&this.mousePitch.mousedown(r,c),ae()}move(r,c){const m=this.map,b=this.mouseRotate.mousemoveWindow(r,c),T=b&&b.bearingDelta;if(T&&m.setBearing(m.getBearing()+T),this.mousePitch){const O=this.mousePitch.mousemoveWindow(r,c),L=O&&O.pitchDelta;L&&m.setPitch(m.getPitch()+L)}}off(){const r=this.element;r.removeEventListener("mousedown",this.mousedown),r.removeEventListener("touchstart",this.touchstart,{passive:!1}),r.removeEventListener("touchmove",this.touchmove),r.removeEventListener("touchend",this.touchend),r.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){oe(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(r){this.down(s.extend({},r,{ctrlKey:!0,preventDefault:()=>r.preventDefault()}),Ee(this.element,r)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(r){this.move(r,Ee(this.element,r))}mouseup(r){this.mouseRotate.mouseupWindow(r),this.mousePitch&&this.mousePitch.mouseupWindow(r),this.offTemp()}touchstart(r){1!==r.targetTouches.length?this.reset():(this._startPos=this._lastPos=Ue(this.element,r.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>r.preventDefault()},this._startPos))}touchmove(r){1!==r.targetTouches.length?this.reset():(this._lastPos=Ue(this.element,r.targetTouches)[0],this.move({preventDefault:()=>r.preventDefault()},this._lastPos))}touchend(r){0===r.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=f.minPitch&&null!=f.maxPitch&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=f.minPitch&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=f.maxPitch&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(f.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(f.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new ps(f.minZoom,f.maxZoom,f.minPitch,f.maxPitch,f.renderWorldCopies),f),this._interactive=f.interactive,this._minTileCacheSize=f.minTileCacheSize,this._maxTileCacheSize=f.maxTileCacheSize,this._failIfMajorPerformanceCaveat=f.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=f.preserveDrawingBuffer,this._antialias=f.antialias,this._useWebGL2=f.useWebGL2,this._trackResize=f.trackResize,this._bearingSnap=f.bearingSnap,this._refreshExpiredTiles=f.refreshExpiredTiles,this._fadeDuration=f.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=f.crossSourceCollisions,this._collectResourceTiming=f.collectResourceTiming,this._optimizeForTerrain=f.optimizeForTerrain,this._language=this._parseLanguage(f.language),this._worldview=f.worldview,this._renderTaskQueue=new Kc,this._domRenderTaskQueue=new Kc,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},Me,f.locale),this._clickTolerance=f.clickTolerance,this._cooperativeGestures=f.cooperativeGestures,this._performanceMetricsCollection=f.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new K(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(f.transformRequest,f.accessToken,f.testMode),this._silenceAuthErrors=!!f.testMode,"string"==typeof f.container){if(this._container=s.window.document.getElementById(f.container),!this._container)throw new Error(`Container '${f.container}' not found.`)}else{if(!(f.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),f.maxBounds&&this.setMaxBounds(f.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),void 0!==s.window&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Xs(this,f),this._localFontFamily=f.localFontFamily,this._localIdeographFontFamily=f.localIdeographFontFamily,f.style&&this.setStyle(f.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),f.projection&&this.setProjection(f.projection),this._hash=f.hash&&new No("string"==typeof f.hash&&f.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch}),f.bounds&&(this.resize(),this.fitBounds(f.bounds,s.extend({},f.fitBoundsOptions,{duration:0})))),this.resize(),f.attributionControl&&this.addControl(new ui({customAttribution:f.customAttribution})),this._logoControl=new xc,this.addControl(this._logoControl,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",r=>{this._update("style"===r.dataType),this.fire(new s.Event(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new s.Event(`${r.dataType}dataloading`,r))})}_getMapId(){return this._mapId}addControl(f,r){if(void 0===r&&(r=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=f.onAdd(this);this._controls.push(f);const m=this._controlPositions[r];return-1!==r.indexOf("bottom")?m.insertBefore(c,m.firstChild):m.appendChild(c),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(f);return r>-1&&this._controls.splice(r,1),f.onRemove(this),this}hasControl(f){return this._controls.indexOf(f)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(f){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new s.Event("movestart",f)).fire(new s.Event("move",f)),this.fire(new s.Event("resize",f)),r&&this.fire(new s.Event("moveend",f)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(f){return this.transform.setMaxBounds(s.LngLatBounds.convert(f)),this._update()}setMinZoom(f){if((f=f??-2)>=-2&&f<=this.transform.maxZoom)return this.transform.minZoom=f,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f?this.setZoom(f):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(f){if((f=f??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(f>=0&&f<=this.transform.maxPitch)return this.transform.minPitch=f,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(f>=this.transform.minPitch)return this.transform.maxPitch=f,this._update(),this.getPitch()>f?this.setPitch(f):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(f){return this.transform.renderWorldCopies=f,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(f){return"auto"===f?s.window.navigator.language:Array.isArray(f)?0===f.length?void 0:f.map(r=>"auto"===r?s.window.navigator.language:r):f}setLanguage(f){const r=this._parseLanguage(f);if(!this.style||r===this._language)return this;this._language=r,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(f){return this.style&&f!==this._worldview?(this._worldview=f,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(f){return this._lazyInitEmptyStyle(),f?"string"==typeof f&&(f={name:f}):f=null,this._useExplicitProjection=!!f,this._prioritizeAndUpdateProjection(f,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const f=this.transform,r=f.projection.name;let c;"globe"===r&&f.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(f.setMercatorFromTransition(),c=!0):"mercator"===r&&f.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(f),this.style.applyProjectionUpdate(),r){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(f){return this.transform.locationPoint3D(s.LngLat.convert(f))}unproject(f){return this.transform.pointLocation3D(s.Point.convert(f))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(f,r,c){if("mouseenter"===f||"mouseover"===f){let m=!1;const b=O=>{const L=r.filter(q=>this.getLayer(q)),Z=L.length?this.queryRenderedFeatures(O.point,{layers:L}):[];Z.length?m||(m=!0,c.call(this,new zo(f,this,O.originalEvent,{features:Z}))):m=!1},T=()=>{m=!1};return{layers:new Set(r),listener:c,delegates:{mousemove:b,mouseout:T}}}if("mouseleave"===f||"mouseout"===f){let m=!1;const b=O=>{const L=r.filter(Z=>this.getLayer(Z));(L.length?this.queryRenderedFeatures(O.point,{layers:L}):[]).length?m=!0:m&&(m=!1,c.call(this,new zo(f,this,O.originalEvent)))},T=O=>{m&&(m=!1,c.call(this,new zo(f,this,O.originalEvent)))};return{layers:new Set(r),listener:c,delegates:{mousemove:b,mouseout:T}}}{const m=b=>{const T=r.filter(L=>this.getLayer(L)),O=T.length?this.queryRenderedFeatures(b.point,{layers:T}):[];O.length&&(b.features=O,c.call(this,b),delete b.features)};return{layers:new Set(r),listener:c,delegates:{[f]:m}}}}on(f,r,c){if(void 0===c)return super.on(f,r);Array.isArray(r)||(r=[r]);const m=this._createDelegatedListener(f,r,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(m);for(const b in m.delegates)this.on(b,m.delegates[b]);return this}once(f,r,c){if(void 0===c)return super.once(f,r);Array.isArray(r)||(r=[r]);const m=this._createDelegatedListener(f,r,c);for(const b in m.delegates)this.once(b,m.delegates[b]);return this}off(f,r,c){if(void 0===c)return super.off(f,r);r=new Set(Array.isArray(r)?r:[r]);const m=(T,O)=>{if(T.size!==O.size)return!1;for(const L of T)if(!O.has(L))return!1;return!0},b=this._delegatedListeners?this._delegatedListeners[f]:void 0;return b&&(T=>{for(let O=0;O{b?this.fire(new s.ErrorEvent(b)):T&&this._updateDiff(T,r)})}else"object"==typeof f&&this._updateDiff(f,r)}_updateDiff(f,r){try{this.style.setState(f)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(f,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(f,r){return this._lazyInitEmptyStyle(),this.style.addSource(f,r),this._update(!0)}isSourceLoaded(f){return!!this.style&&this.style._isSourceCacheLoaded(f)}areTilesLoaded(){const f=this.style&&this.style._sourceCaches;for(const r in f){const c=f[r]._tiles;for(const m in c){const b=c[m];if("loaded"!==b.state&&"errored"!==b.state)return!1}}return!0}addSourceType(f,r,c){this._lazyInitEmptyStyle(),this.style.addSourceType(f,r,c)}removeSource(f){return this.style.removeSource(f),this._updateTerrain(),this._update(!0)}getSource(f){return this.style.getSource(f)}addImage(f,r,{pixelRatio:c=1,sdf:m=!1,stretchX:b,stretchY:T,content:O}={}){if(this._lazyInitEmptyStyle(),r instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&r instanceof s.window.ImageBitmap){const{width:L,height:Z,data:q}=s.exported.getImageData(r);this.style.addImage(f,{data:new s.RGBAImage({width:L,height:Z},q),pixelRatio:c,stretchX:b,stretchY:T,content:O,sdf:m,version:0})}else if(void 0===r.width||void 0===r.height)this.fire(new s.ErrorEvent(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`")));else{const{width:L,height:Z}=r,q=r;this.style.addImage(f,{data:new s.RGBAImage({width:L,height:Z},new Uint8Array(q.data)),pixelRatio:c,stretchX:b,stretchY:T,content:O,sdf:m,version:0,userImage:q}),q.onAdd&&q.onAdd(this,f)}}updateImage(f,r){const c=this.style.getImage(f);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const m=r instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&r instanceof s.window.ImageBitmap?s.exported.getImageData(r):r,{width:b,height:T}=m;void 0!==b&&void 0!==T?b===c.data.width&&T===c.data.height?(c.data.replace(m.data,!(r instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&r instanceof s.window.ImageBitmap)),this.style.updateImage(f,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${b}, ${T})\n must be that same as the previous version of the image\n (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(f){return f?!!this.style.getImage(f):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(f)}loadImage(f,r){s.getImage(this._requestManager.transformRequest(f,s.ResourceType.Image),(c,m)=>{r(c,m instanceof s.window.HTMLImageElement?s.exported.getImageData(m):m)})}listImages(){return this.style.listImages()}addLayer(f,r){return this._lazyInitEmptyStyle(),this.style.addLayer(f,r),this._update(!0)}moveLayer(f,r){return this.style.moveLayer(f,r),this._update(!0)}removeLayer(f){return this.style.removeLayer(f),this._update(!0)}getLayer(f){return this.style.getLayer(f)}setLayerZoomRange(f,r,c){return this.style.setLayerZoomRange(f,r,c),this._update(!0)}setFilter(f,r,c={}){return this.style.setFilter(f,r,c),this._update(!0)}getFilter(f){return this.style.getFilter(f)}setPaintProperty(f,r,c,m={}){return this.style.setPaintProperty(f,r,c,m),this._update(!0)}getPaintProperty(f,r){return this.style.getPaintProperty(f,r)}setLayoutProperty(f,r,c,m={}){return this.style.setLayoutProperty(f,r,c,m),this._update(!0)}getLayoutProperty(f,r){return this.style.getLayoutProperty(f,r)}setLight(f,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(f,r),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(f){return this._lazyInitEmptyStyle(),!f&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(f),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(f){return this._lazyInitEmptyStyle(),this.style.setFog(f),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(f){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(f),this.transform):0}setFeatureState(f,r){return this.style.setFeatureState(f,r),this._update()}removeFeatureState(f,r){return this.style.removeFeatureState(f,r),this._update()}getFeatureState(f){return this.style.getFeatureState(f)}_updateContainerDimensions(){if(!this._container)return;const f=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300;let c,m,b,T=this._container;for(;T&&(!m||!b);){const O=s.window.getComputedStyle(T).transform;O&&"none"!==O&&(c=O.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&"0"!==c[0]&&"1"!==c[0]&&(m=c[0]),c[3]&&"0"!==c[3]&&"1"!==c[3]&&(b=c[3])),T=T.parentElement}this._containerWidth=m?Math.abs(f/m):f,this._containerHeight=b?Math.abs(r/b):r}_detectMissingCSS(){"rgb(250, 128, 114)"!==s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const f=this._container;f.classList.add("mapboxgl-map"),(this._missingCSSCanary=Ne("div","mapboxgl-canary",f)).style.visibility="hidden",this._detectMissingCSS();const r=this._canvasContainer=Ne("div","mapboxgl-canvas-container",f);this._interactive&&r.classList.add("mapboxgl-interactive"),this._canvas=Ne("canvas","mapboxgl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=Ne("div","mapboxgl-control-container",f),m=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(b=>{m[b]=Ne("div",`mapboxgl-ctrl-${b}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(f,r){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(f),this._canvas.height=c*Math.ceil(r),this._canvas.style.width=`${f}px`,this._canvas.style.height=`${r}px`}_addMarker(f){this._markers.push(f)}_removeMarker(f){const r=this._markers.indexOf(f);-1!==r&&this._markers.splice(r,1)}_addPopup(f){this._popups.push(f)}_removePopup(f){const r=this._popups.indexOf(f);-1!==r&&this._popups.splice(r,1)}_setupPainter(){const f=s.extend({},ie.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._useWebGL2&&this._canvas.getContext("webgl2",f),c=r||this._canvas.getContext("webgl",f)||this._canvas.getContext("experimental-webgl",f);c?(this._useWebGL2&&!r&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new Q(c,this.transform,!!r),this.on("data",m=>{"source"===m.dataType&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(f){f.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:f}))}_contextRestored(f){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:f}))}_onMapScroll(f){if(f.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(f){return this.style?(this._styleDirty=this._styleDirty||f,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(f){return this._update(),this._renderTaskQueue.add(f)}_cancelRenderFrame(f){this._renderTaskQueue.remove(f)}_requestDomTask(f){!this.loaded()||this.loaded()&&!this.isMoving()?f():this._domRenderTaskQueue.add(f)}_render(f){let r;const c=this.painter.context.extTimerQuery,m=s.exported.now();if(this.listens("gpu-timing-frame")&&(r=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(f),this._domRenderTaskQueue.run(f),this._removed)return;this._updateProjectionTransition();const b=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const L=this.transform.zoom,Z=this.transform.pitch,q=s.exported.now(),W=new s.EvaluationParameters(L,{now:q,fadeDuration:b,pitch:Z,transition:this.style.getTransition()});this.style.update(W)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let T=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),T=this._updateAverageElevation(m),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):T=this._updateAverageElevation(m),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,b,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:b,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const L=s.exported.now()-m;c.endQueryEXT(c.TIME_ELAPSED_EXT,r),setTimeout(()=>{const Z=c.getQueryObjectEXT(r,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(r),this.fire(new s.Event("gpu-timing-frame",{cpuTime:L,gpuTime:Z})),s.window.performance.mark("frame-gpu",{startTime:m,detail:{gpuTime:Z}})},50)}if(this.listens("gpu-timing-layer")){const L=this.painter.collectGpuTimers();setTimeout(()=>{const Z=this.painter.queryGpuTimers(L);this.fire(new s.Event("gpu-timing-layer",{layerTimes:Z}))},50)}if(this.listens("gpu-timing-deferred-render")){const L=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const Z=this.painter.queryGpuTimeDeferredRender(L);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:Z}))},50)}const O=this._sourcesDirty||this._styleDirty||this._placementDirty||T;if(O||this._repaint)this.triggerRepaint();else{const L=!this.isMoving()&&this.loaded();if(L&&(T=this._updateAverageElevation(m,!0)),T)this.triggerRepaint();else if(this._triggerFrame(!1),L&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const Z=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:Z})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||O||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(f){for(const r of this._markers)f&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(const r of this._popups)!f||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(f,r=!1){const c=m=>(this.transform.averageElevation=m,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&c(0);if((r||f-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(f)){const m=this.transform.averageElevation;let b=this.transform.sampleAverageElevation(),T=!1;this.transform.elevation&&(T=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(b)?b=0:this._averageElevationLastSampledAt=f;const O=Math.abs(m-b);if(O>1){if(this._isInitialLoad||T)return this._averageElevation.jumpTo(b),c(b);this._averageElevation.easeTo(b,f,300)}else if(O>1e-4)return this._averageElevation.jumpTo(b),c(b)}return!!this._averageElevation.isEasing(f)&&c(this._averageElevation.getValue(f))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,f=>{if(f&&(f.message===s.AUTH_ERR_MSG||401===f.status)){const r=this.painter.context.gl;s.storeAuthState(r,!1),this._logoControl instanceof xc&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const f=this._isDragging();this.painter.updateTerrain(this.style,f)}_calculateSpeedIndex(){const f=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());const c=this.painter.context.gl,m=c.createFramebuffer();function b(T){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,T,0);const O=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,O),O}return c.bindFramebuffer(c.FRAMEBUFFER,m),this._canvasPixelComparison(b(f),r.canvasCopies.map(b),r.timeStamps)}_canvasPixelComparison(f,r,c){let m=c[1]-c[0];const b=f.length/4;for(let T=0;T{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(r)}))}_preloadTiles(f){const r=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(r,(c,m)=>c._preloadTiles(f,m),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(f){this._trackResize&&this.resize({originalEvent:f})._update()}_onVisibilityChange(){"hidden"===s.window.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(f){this._showTileBoundaries!==f&&(this._showTileBoundaries=f,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(f){this._showTerrainWireframe!==f&&(this._showTerrainWireframe=f,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(f){this._speedIndexTiming!==f&&(this._speedIndexTiming=f,this._update())}get showPadding(){return!!this._showPadding}set showPadding(f){this._showPadding!==f&&(this._showPadding=f,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(f){this._showCollisionBoxes!==f&&(this._showCollisionBoxes=f,f?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(f){this._showOverdrawInspector!==f&&(this._showOverdrawInspector=f,this._update())}get repaint(){return!!this._repaint}set repaint(f){this._repaint!==f&&(this._repaint=f,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(f){this._vertices=f,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(f){this._showTileAABBs!==f&&(this._showTileAABBs=f,f&&this._update())}_setCacheLimits(f,r){s.setCacheLimits(f,r)}get version(){return s.version}},NavigationControl:class{constructor(f){this.options=s.extend({},en,f),this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",r=>{this._map&&this._map.zoomIn({},{originalEvent:r})}),Ne("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",r=>{this._map&&this._map.zoomOut({},{originalEvent:r})}),Ne("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",r=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:r}):c.resetNorth({},{originalEvent:r}))}),this._compassIcon=Ne("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const f=this._map;if(!f)return;const r=f.getZoom(),c=r===f.getMaxZoom(),m=r===f.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=m,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",m.toString())}_rotateCompassArrow(){const f=this._map;if(!f)return;const r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(f.transform.pitch*(Math.PI/180)),.5)}) rotateX(${f.transform.pitch}deg) rotateZ(${f.transform.angle*(180/Math.PI)}deg)`:`rotate(${f.transform.angle*(180/Math.PI)}deg)`;f._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(f){return this._map=f,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),f.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&f.on("pitch",this._rotateCompassArrow),f.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new $n(f,this._compass,this.options.visualizePitch)),this._container}onRemove(){const f=this._map;f&&(this._container.remove(),this.options.showZoom&&f.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&f.off("pitch",this._rotateCompassArrow),f.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(f,r){const c=Ne("button",f,this._container);return c.type="button",c.addEventListener("click",r),c}_setButtonTitle(f,r){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${r}`);f.setAttribute("aria-label",c),f.firstElementChild&&f.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(f){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},xn,f),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ss(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(f){return this._map=f,this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(f){const r=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,f(c)};void 0!==this._supportsGeolocation?f(this._supportsGeolocation):void 0!==s.window.navigator.permissions?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>r("denied"!==c.state)).catch(()=>r()):r()}_isOutOfMapMaxBounds(f){const r=this._map.getMaxBounds(),c=f.coords;return!!r&&(c.longituder.getEast()||c.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(f){if(this._map){if(this._isOutOfMapMaxBounds(f))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",f)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=f,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(f),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(f),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",f)),this._finish()}}_updateCamera(f){const r=new s.LngLat(f.coords.longitude,f.coords.latitude),c=f.coords.accuracy,m=this._map.getBearing(),b=s.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(c),b,{geolocateSource:!0})}_updateMarker(f){if(f){const r=new s.LngLat(f.coords.longitude,f.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=f.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const f=this._map.transform,r=s.mercatorZfromAltitude(1,f._center.lat)*f.worldSize,c=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(f){if(this._map){if(this.options.trackUserLocation)if(1===f.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===f.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",f)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(f){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",r=>r.preventDefault()),this._geolocateButton=Ne("button","mapboxgl-ctrl-geolocate",this._container),Ne("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===f){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ne("div","mapboxgl-user-location"),this._dotElement.appendChild(Ne("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(Ne("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new R({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=Ne("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new R({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||"ACTIVE_LOCK"!==this._watchState||r.originalEvent&&"resize"===r.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(f){this._userLocationDotMarker&&(f.webkitCompassHeading?this._heading=f.webkitCompassHeading:!0===f.absolute&&(this._heading=-1*f.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let f;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(f={maximumAge:6e5,timeout:0},this._noTimeout=!0):(f=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,f),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const f=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==s.window.DeviceMotionEvent&&"function"==typeof s.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(r=>{"granted"===r&&f()}).catch(console.error):f()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ui,ScaleControl:class{constructor(f){this.options=s.extend({},Oi,f),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const f=this.options.maxWidth||100,r=this._map,c=r._containerHeight/2,m=r._containerWidth/2-f/2,b=r.unproject([m,c]),T=r.unproject([m+f,c]),O=b.distanceTo(T);if("imperial"===this.options.unit){const L=3.2808*O;L>5280?this._setScale(f,L/5280,"mile"):this._setScale(f,L,"foot")}else"nautical"===this.options.unit?this._setScale(f,O/1852,"nautical-mile"):O>=1e3?this._setScale(f,O/1e3,"kilometer"):this._setScale(f,O,"meter")}_setScale(f,r,c){this._map._requestDomTask(()=>{const m=function(T){const O=Math.pow(10,`${Math.floor(T)}`.length-1);let L=T/O;return L=L>=10?10:L>=5?5:L>=3?3:L>=2?2:L>=1?1:function(Z){const q=Math.pow(10,Math.ceil(-Math.log(Z)/Math.LN10));return Math.round(Z*q)/q}(L),O*L}(r),b=m/r;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==c?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(m):`${m} ${ar[c]}`,this._container.style.width=f*b+"px"})}onAdd(f){return this._map=f,this._language=f.getLanguage(),this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-scale",f.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(f){this._language=f,this._update()}setUnit(f){this.options.unit=f,this._update()}},FullscreenControl:class{constructor(f){this._fullscreen=!1,f&&f.container&&(f.container instanceof s.window.HTMLElement?this._container=f.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const f=this._fullscreenButton=Ne("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Ne("span","mapboxgl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",f)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(f){super(),this.options=s.extend(Object.create(U),f),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(f&&f.className?f.className.trim().split(/\s+/):[])}addTo(f){return this._map&&this.remove(),this._map=f,this.options.closeOnClick&&f.on("preclick",this._onClose),this.options.closeOnMove&&f.on("move",this._onClose),f.on("remove",this.remove),this._update(),f._addPopup(this),this._focusFirstElement(),this._trackPointer?(f.on("mousemove",this._onMouseEvent),f.on("mouseup",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")):f.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const f=this._map;return f&&(f.off("move",this._update),f.off("move",this._onClose),f.off("preclick",this._onClose),f.off("click",this._onClose),f.off("remove",this.remove),f.off("mousemove",this._onMouseEvent),f.off("mouseup",this._onMouseEvent),f.off("drag",this._onMouseEvent),f._canvasContainer&&f._canvasContainer.classList.remove("mapboxgl-track-pointer"),f._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(f){this._lngLat=s.LngLat.convert(f),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const f=this._map;return f&&(f.off("move",this._update),f.on("mousemove",this._onMouseEvent),f.on("drag",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(f){return this.setDOMContent(s.window.document.createTextNode(f))}setHTML(f){const r=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let m;for(c.innerHTML=f;m=c.firstChild,m;)r.appendChild(m);return this.setDOMContent(r)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=Ne("div","mapboxgl-popup-content",this._container||void 0);if(r.appendChild(f),this.options.closeButton){const c=this._closeButton=Ne("button","mapboxgl-popup-close-button",r);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(f){return this._classList.add(f),this._updateClassList(),this}removeClassName(f){return this._classList.delete(f),this._updateClassList(),this}setOffset(f){return this.options.offset=f,this._update(),this}toggleClassName(f){let r;return this._classList.delete(f)?r=!1:(this._classList.add(f),r=!0),this._updateClassList(),r}_onMouseEvent(f){this._update(f.point)}_getAnchor(f){if(this.options.anchor)return this.options.anchor;const r=this._map,c=this._container,m=this._pos;if(!r||!c||!m)return"bottom";const b=c.offsetWidth,T=c.offsetHeight,O=m.xr.transform.width-b/2;if(m.y+fr.transform.height-T){if(O)return"bottom-left";if(L)return"bottom-right"}return O?"left":L?"right":"bottom"}_updateClassList(){const f=this._container;if(!f)return;const r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),f.className=r.join(" ")}_update(f){const r=this._map,c=this._content;if(!r||!this._lngLat&&!this._trackPointer||!c)return;let m=this._container;if(m||(m=this._container=Ne("div","mapboxgl-popup",r.getContainer()),this._tip=Ne("div","mapboxgl-popup-tip",m),m.appendChild(c)),this.options.maxWidth&&m.style.maxWidth!==this.options.maxWidth&&(m.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ml(this._lngLat,this._pos,r.transform)),!this._trackPointer||f){const b=this._pos=this._trackPointer&&f?f:r.project(this._lngLat),T=z(this.options.offset),O=this._anchor=this._getAnchor(T.y),L=z(this.options.offset,O),Z=b.add(L).round();r._requestDomTask(()=>{this._container&&O&&(this._container.style.transform=`${al[O]} translate(${Z.x}px,${Z.y}px)`)})}if(!this._marker&&r._showingGlobe()){const b=s.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(b)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const f=this._container.querySelector($);f&&f.focus()}_onClose(){this.remove()}_setOpacity(f){this._container&&(this._container.style.opacity=`${f}`),this._content&&(this._content.style.pointerEvents=f?"auto":"none")}},Marker:R,Style:zr,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:fr,Evented:s.Evented,config:s.config,prewarm:function(){st().acquire(cr)},clearPrewarmedResources:function(){const f=Lt;f&&(f.isPreloaded()&&1===f.numActive()?(f.release(cr),Lt=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(f){s.config.ACCESS_TOKEN=f},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(f){s.config.API_URL=f},get workerCount(){return Ui.workerCount},set workerCount(f){Ui.workerCount=f},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){s.config.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage(f){s.clearTileCache(f)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return po}),x}()},5619:(Nn,yt,k)=>{"use strict";k.d(yt,{X:()=>h});var x=k(8645);class h extends x.x{constructor(s){super(),this._value=s}get value(){return this.getValue()}_subscribe(s){const J=super._subscribe(s);return!J.closed&&s.next(this._value),J}getValue(){const{hasError:s,thrownError:J,_value:ie}=this;if(s)throw J;return this._throwIfClosed(),ie}next(s){super.next(this._value=s)}}},5592:(Nn,yt,k)=>{"use strict";k.d(yt,{y:()=>E});var x=k(305),h=k(7394),y=k(4850),s=k(8407),J=k(2653),ie=k(4674),Y=k(1441);let E=(()=>{class _e{constructor(ae){ae&&(this._subscribe=ae)}lift(ae){const oe=new _e;return oe.source=this,oe.operator=ae,oe}subscribe(ae,oe,Be){const Ie=function he(_e){return _e&&_e instanceof x.Lv||function me(_e){return _e&&(0,ie.m)(_e.next)&&(0,ie.m)(_e.error)&&(0,ie.m)(_e.complete)}(_e)&&(0,h.Nn)(_e)}(ae)?ae:new x.Hp(ae,oe,Be);return(0,Y.x)(()=>{const{operator:Ee,source:Ue}=this;Ie.add(Ee?Ee.call(Ie,Ue):Ue?this._subscribe(Ie):this._trySubscribe(Ie))}),Ie}_trySubscribe(ae){try{return this._subscribe(ae)}catch(oe){ae.error(oe)}}forEach(ae,oe){return new(oe=Ne(oe))((Be,Ie)=>{const Ee=new x.Hp({next:Ue=>{try{ae(Ue)}catch(et){Ie(et),Ee.unsubscribe()}},error:Ie,complete:Be});this.subscribe(Ee)})}_subscribe(ae){var oe;return null===(oe=this.source)||void 0===oe?void 0:oe.subscribe(ae)}[y.L](){return this}pipe(...ae){return(0,s.U)(ae)(this)}toPromise(ae){return new(ae=Ne(ae))((oe,Be)=>{let Ie;this.subscribe(Ee=>Ie=Ee,Ee=>Be(Ee),()=>oe(Ie))})}}return _e.create=ee=>new _e(ee),_e})();function Ne(_e){var ee;return null!==(ee=_e??J.config.Promise)&&void 0!==ee?ee:Promise}},8645:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>Y});var x=k(5592),h=k(7394);const s=(0,k(2306).d)(Ne=>function(){Ne(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var J=k(9039),ie=k(1441);let Y=(()=>{class Ne extends x.y{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(he){const _e=new E(this,this);return _e.operator=he,_e}_throwIfClosed(){if(this.closed)throw new s}next(he){(0,ie.x)(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const _e of this.currentObservers)_e.next(he)}})}error(he){(0,ie.x)(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=he;const{observers:_e}=this;for(;_e.length;)_e.shift().error(he)}})}complete(){(0,ie.x)(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:he}=this;for(;he.length;)he.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var he;return(null===(he=this.observers)||void 0===he?void 0:he.length)>0}_trySubscribe(he){return this._throwIfClosed(),super._trySubscribe(he)}_subscribe(he){return this._throwIfClosed(),this._checkFinalizedStatuses(he),this._innerSubscribe(he)}_innerSubscribe(he){const{hasError:_e,isStopped:ee,observers:ae}=this;return _e||ee?h.Lc:(this.currentObservers=null,ae.push(he),new h.w0(()=>{this.currentObservers=null,(0,J.P)(ae,he)}))}_checkFinalizedStatuses(he){const{hasError:_e,thrownError:ee,isStopped:ae}=this;_e?he.error(ee):ae&&he.complete()}asObservable(){const he=new x.y;return he.source=this,he}}return Ne.create=(me,he)=>new E(me,he),Ne})();class E extends Y{constructor(me,he){super(),this.destination=me,this.source=he}next(me){var he,_e;null===(_e=null===(he=this.destination)||void 0===he?void 0:he.next)||void 0===_e||_e.call(he,me)}error(me){var he,_e;null===(_e=null===(he=this.destination)||void 0===he?void 0:he.error)||void 0===_e||_e.call(he,me)}complete(){var me,he;null===(he=null===(me=this.destination)||void 0===me?void 0:me.complete)||void 0===he||he.call(me)}_subscribe(me){var he,_e;return null!==(_e=null===(he=this.source)||void 0===he?void 0:he.subscribe(me))&&void 0!==_e?_e:h.Lc}}},305:(Nn,yt,k)=>{"use strict";k.d(yt,{Hp:()=>Be,Lv:()=>_e});var x=k(4674),h=k(7394),y=k(2653),s=k(3894),J=k(2420);const ie=Ne("C",void 0,void 0);function Ne(le,ue,ct){return{kind:le,value:ue,error:ct}}var me=k(7599),he=k(1441);class _e extends h.w0{constructor(ue){super(),this.isStopped=!1,ue?(this.destination=ue,(0,h.Nn)(ue)&&ue.add(this)):this.destination=et}static create(ue,ct,ht){return new Be(ue,ct,ht)}next(ue){this.isStopped?Ue(function E(le){return Ne("N",le,void 0)}(ue),this):this._next(ue)}error(ue){this.isStopped?Ue(function Y(le){return Ne("E",void 0,le)}(ue),this):(this.isStopped=!0,this._error(ue))}complete(){this.isStopped?Ue(ie,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(ue){this.destination.next(ue)}_error(ue){try{this.destination.error(ue)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const ee=Function.prototype.bind;function ae(le,ue){return ee.call(le,ue)}class oe{constructor(ue){this.partialObserver=ue}next(ue){const{partialObserver:ct}=this;if(ct.next)try{ct.next(ue)}catch(ht){Ie(ht)}}error(ue){const{partialObserver:ct}=this;if(ct.error)try{ct.error(ue)}catch(ht){Ie(ht)}else Ie(ue)}complete(){const{partialObserver:ue}=this;if(ue.complete)try{ue.complete()}catch(ct){Ie(ct)}}}class Be extends _e{constructor(ue,ct,ht){let Le;if(super(),(0,x.m)(ue)||!ue)Le={next:ue??void 0,error:ct??void 0,complete:ht??void 0};else{let ye;this&&y.config.useDeprecatedNextContext?(ye=Object.create(ue),ye.unsubscribe=()=>this.unsubscribe(),Le={next:ue.next&&ae(ue.next,ye),error:ue.error&&ae(ue.error,ye),complete:ue.complete&&ae(ue.complete,ye)}):Le=ue}this.destination=new oe(Le)}}function Ie(le){y.config.useDeprecatedSynchronousErrorHandling?(0,he.O)(le):(0,s.h)(le)}function Ue(le,ue){const{onStoppedNotification:ct}=y.config;ct&&me.z.setTimeout(()=>ct(le,ue))}const et={closed:!0,next:J.Z,error:function Ee(le){throw le},complete:J.Z}},7394:(Nn,yt,k)=>{"use strict";k.d(yt,{Lc:()=>ie,w0:()=>J,Nn:()=>Y});var x=k(4674);const y=(0,k(2306).d)(Ne=>function(he){Ne(this),this.message=he?`${he.length} errors occurred during unsubscription:\n${he.map((_e,ee)=>`${ee+1}) ${_e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=he});var s=k(9039);class J{constructor(me){this.initialTeardown=me,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let me;if(!this.closed){this.closed=!0;const{_parentage:he}=this;if(he)if(this._parentage=null,Array.isArray(he))for(const ae of he)ae.remove(this);else he.remove(this);const{initialTeardown:_e}=this;if((0,x.m)(_e))try{_e()}catch(ae){me=ae instanceof y?ae.errors:[ae]}const{_finalizers:ee}=this;if(ee){this._finalizers=null;for(const ae of ee)try{E(ae)}catch(oe){me=me??[],oe instanceof y?me=[...me,...oe.errors]:me.push(oe)}}if(me)throw new y(me)}}add(me){var he;if(me&&me!==this)if(this.closed)E(me);else{if(me instanceof J){if(me.closed||me._hasParent(this))return;me._addParent(this)}(this._finalizers=null!==(he=this._finalizers)&&void 0!==he?he:[]).push(me)}}_hasParent(me){const{_parentage:he}=this;return he===me||Array.isArray(he)&&he.includes(me)}_addParent(me){const{_parentage:he}=this;this._parentage=Array.isArray(he)?(he.push(me),he):he?[he,me]:me}_removeParent(me){const{_parentage:he}=this;he===me?this._parentage=null:Array.isArray(he)&&(0,s.P)(he,me)}remove(me){const{_finalizers:he}=this;he&&(0,s.P)(he,me),me instanceof J&&me._removeParent(this)}}J.EMPTY=(()=>{const Ne=new J;return Ne.closed=!0,Ne})();const ie=J.EMPTY;function Y(Ne){return Ne instanceof J||Ne&&"closed"in Ne&&(0,x.m)(Ne.remove)&&(0,x.m)(Ne.add)&&(0,x.m)(Ne.unsubscribe)}function E(Ne){(0,x.m)(Ne)?Ne():Ne.unsubscribe()}},2653:(Nn,yt,k)=>{"use strict";k.d(yt,{config:()=>x});const x={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2572:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>me});var x=k(5592),h=k(7453),y=k(7715),s=k(2737),J=k(7400),ie=k(4564),Y=k(2714),E=k(8251),Ne=k(7103);function me(...ee){const ae=(0,ie.yG)(ee),oe=(0,ie.jO)(ee),{args:Be,keys:Ie}=(0,h.D)(ee);if(0===Be.length)return(0,y.D)([],ae);const Ee=new x.y(function he(ee,ae,oe=s.y){return Be=>{_e(ae,()=>{const{length:Ie}=ee,Ee=new Array(Ie);let Ue=Ie,et=Ie;for(let le=0;le{const ue=(0,y.D)(ee[le],ae);let ct=!1;ue.subscribe((0,E.x)(Be,ht=>{Ee[le]=ht,ct||(ct=!0,et--),et||Be.next(oe(Ee.slice()))},()=>{--Ue||Be.complete()}))},Be)},Be)}}(Be,ae,Ie?Ue=>(0,Y.n)(Ie,Ue):s.y));return oe?Ee.pipe((0,J.Z)(oe)):Ee}function _e(ee,ae,oe){ee?(0,Ne.f)(oe,ee,ae):ae()}},5211:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>J});var x=k(7537),y=k(4564),s=k(7715);function J(...ie){return function h(){return(0,x.J)(1)}()((0,s.D)(ie,(0,y.yG)(ie)))}},4911:(Nn,yt,k)=>{"use strict";k.d(yt,{P:()=>y});var x=k(5592),h=k(4829);function y(s){return new x.y(J=>{(0,h.Xf)(s()).subscribe(J)})}},6232:(Nn,yt,k)=>{"use strict";k.d(yt,{E:()=>h});const h=new(k(5592).y)(J=>J.complete())},9315:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>E});var x=k(5592),h=k(7453),y=k(4829),s=k(4564),J=k(8251),ie=k(7400),Y=k(2714);function E(...Ne){const me=(0,s.jO)(Ne),{args:he,keys:_e}=(0,h.D)(Ne),ee=new x.y(ae=>{const{length:oe}=he;if(!oe)return void ae.complete();const Be=new Array(oe);let Ie=oe,Ee=oe;for(let Ue=0;Ue{et||(et=!0,Ee--),Be[Ue]=le},()=>Ie--,void 0,()=>{(!Ie||!et)&&(Ee||ae.next(_e?(0,Y.n)(_e,Be):Be),ae.complete())}))}});return me?ee.pipe((0,ie.Z)(me)):ee}},7715:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>ht});var x=k(4829),h=k(7103),y=k(9360),s=k(8251);function J(Le,ye=0){return(0,y.e)((gt,Te)=>{gt.subscribe((0,s.x)(Te,Pe=>(0,h.f)(Te,Le,()=>Te.next(Pe),ye),()=>(0,h.f)(Te,Le,()=>Te.complete(),ye),Pe=>(0,h.f)(Te,Le,()=>Te.error(Pe),ye)))})}function ie(Le,ye=0){return(0,y.e)((gt,Te)=>{Te.add(Le.schedule(()=>gt.subscribe(Te),ye))})}var Ne=k(5592),he=k(4971),_e=k(4674);function ae(Le,ye){if(!Le)throw new Error("Iterable cannot be null");return new Ne.y(gt=>{(0,h.f)(gt,ye,()=>{const Te=Le[Symbol.asyncIterator]();(0,h.f)(gt,ye,()=>{Te.next().then(Pe=>{Pe.done?gt.complete():gt.next(Pe.value)})},0,!0)})})}var oe=k(8382),Be=k(4026),Ie=k(4266),Ee=k(3664),Ue=k(5726),et=k(9853),le=k(541);function ht(Le,ye){return ye?function ct(Le,ye){if(null!=Le){if((0,oe.c)(Le))return function Y(Le,ye){return(0,x.Xf)(Le).pipe(ie(ye),J(ye))}(Le,ye);if((0,Ie.z)(Le))return function me(Le,ye){return new Ne.y(gt=>{let Te=0;return ye.schedule(function(){Te===Le.length?gt.complete():(gt.next(Le[Te++]),gt.closed||this.schedule())})})}(Le,ye);if((0,Be.t)(Le))return function E(Le,ye){return(0,x.Xf)(Le).pipe(ie(ye),J(ye))}(Le,ye);if((0,Ue.D)(Le))return ae(Le,ye);if((0,Ee.T)(Le))return function ee(Le,ye){return new Ne.y(gt=>{let Te;return(0,h.f)(gt,ye,()=>{Te=Le[he.h](),(0,h.f)(gt,ye,()=>{let Pe,Ae;try{({value:Pe,done:Ae}=Te.next())}catch(Ye){return void gt.error(Ye)}Ae?gt.complete():gt.next(Pe)},0,!0)}),()=>(0,_e.m)(Te?.return)&&Te.return()})}(Le,ye);if((0,le.L)(Le))return function ue(Le,ye){return ae((0,le.Q)(Le),ye)}(Le,ye)}throw(0,et.z)(Le)}(Le,ye):(0,x.Xf)(Le)}},2438:(Nn,yt,k)=>{"use strict";k.d(yt,{R:()=>me});var x=k(4829),h=k(5592),y=k(1631),s=k(4266),J=k(4674),ie=k(7400);const Y=["addListener","removeListener"],E=["addEventListener","removeEventListener"],Ne=["on","off"];function me(oe,Be,Ie,Ee){if((0,J.m)(Ie)&&(Ee=Ie,Ie=void 0),Ee)return me(oe,Be,Ie).pipe((0,ie.Z)(Ee));const[Ue,et]=function ae(oe){return(0,J.m)(oe.addEventListener)&&(0,J.m)(oe.removeEventListener)}(oe)?E.map(le=>ue=>oe[le](Be,ue,Ie)):function _e(oe){return(0,J.m)(oe.addListener)&&(0,J.m)(oe.removeListener)}(oe)?Y.map(he(oe,Be)):function ee(oe){return(0,J.m)(oe.on)&&(0,J.m)(oe.off)}(oe)?Ne.map(he(oe,Be)):[];if(!Ue&&(0,s.z)(oe))return(0,y.z)(le=>me(le,Be,Ie))((0,x.Xf)(oe));if(!Ue)throw new TypeError("Invalid event target");return new h.y(le=>{const ue=(...ct)=>le.next(1et(ue)})}function he(oe,Be){return Ie=>Ee=>oe[Ie](Be,Ee)}},4829:(Nn,yt,k)=>{"use strict";k.d(yt,{Xf:()=>ee});var x=k(7582),h=k(4266),y=k(4026),s=k(5592),J=k(8382),ie=k(5726),Y=k(9853),E=k(3664),Ne=k(541),me=k(4674),he=k(3894),_e=k(4850);function ee(le){if(le instanceof s.y)return le;if(null!=le){if((0,J.c)(le))return function ae(le){return new s.y(ue=>{const ct=le[_e.L]();if((0,me.m)(ct.subscribe))return ct.subscribe(ue);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(le);if((0,h.z)(le))return function oe(le){return new s.y(ue=>{for(let ct=0;ct{le.then(ct=>{ue.closed||(ue.next(ct),ue.complete())},ct=>ue.error(ct)).then(null,he.h)})}(le);if((0,ie.D)(le))return Ee(le);if((0,E.T)(le))return function Ie(le){return new s.y(ue=>{for(const ct of le)if(ue.next(ct),ue.closed)return;ue.complete()})}(le);if((0,Ne.L)(le))return function Ue(le){return Ee((0,Ne.Q)(le))}(le)}throw(0,Y.z)(le)}function Ee(le){return new s.y(ue=>{(function et(le,ue){var ct,ht,Le,ye;return(0,x.mG)(this,void 0,void 0,function*(){try{for(ct=(0,x.KL)(le);!(ht=yield ct.next()).done;)if(ue.next(ht.value),ue.closed)return}catch(gt){Le={error:gt}}finally{try{ht&&!ht.done&&(ye=ct.return)&&(yield ye.call(ct))}finally{if(Le)throw Le.error}}ue.complete()})})(le,ue).catch(ct=>ue.error(ct))})}},2096:(Nn,yt,k)=>{"use strict";k.d(yt,{of:()=>y});var x=k(4564),h=k(7715);function y(...s){const J=(0,x.yG)(s);return(0,h.D)(s,J)}},8251:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>h});var x=k(305);function h(s,J,ie,Y,E){return new y(s,J,ie,Y,E)}class y extends x.Lv{constructor(J,ie,Y,E,Ne,me){super(J),this.onFinalize=Ne,this.shouldUnsubscribe=me,this._next=ie?function(he){try{ie(he)}catch(_e){J.error(_e)}}:super._next,this._error=E?function(he){try{E(he)}catch(_e){J.error(_e)}finally{this.unsubscribe()}}:super._error,this._complete=Y?function(){try{Y()}catch(he){J.error(he)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var J;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:ie}=this;super.unsubscribe(),!ie&&(null===(J=this.onFinalize)||void 0===J||J.call(this))}}}},6328:(Nn,yt,k)=>{"use strict";k.d(yt,{b:()=>y});var x=k(1631),h=k(4674);function y(s,J){return(0,h.m)(J)?(0,x.z)(s,J,1):(0,x.z)(s,1)}},3997:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>s});var x=k(2737),h=k(9360),y=k(8251);function s(ie,Y=x.y){return ie=ie??J,(0,h.e)((E,Ne)=>{let me,he=!0;E.subscribe((0,y.x)(Ne,_e=>{const ee=Y(_e);(he||!ie(me,ee))&&(he=!1,me=ee,Ne.next(_e))}))})}function J(ie,Y){return ie===Y}},2181:(Nn,yt,k)=>{"use strict";k.d(yt,{h:()=>y});var x=k(9360),h=k(8251);function y(s,J){return(0,x.e)((ie,Y)=>{let E=0;ie.subscribe((0,h.x)(Y,Ne=>s.call(J,Ne,E++)&&Y.next(Ne)))})}},4716:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>h});var x=k(9360);function h(y){return(0,x.e)((s,J)=>{try{s.subscribe(J)}finally{J.add(y)}})}},7398:(Nn,yt,k)=>{"use strict";k.d(yt,{U:()=>y});var x=k(9360),h=k(8251);function y(s,J){return(0,x.e)((ie,Y)=>{let E=0;ie.subscribe((0,h.x)(Y,Ne=>{Y.next(s.call(J,Ne,E++))}))})}},7537:(Nn,yt,k)=>{"use strict";k.d(yt,{J:()=>y});var x=k(1631),h=k(2737);function y(s=1/0){return(0,x.z)(h.y,s)}},1631:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>E});var x=k(7398),h=k(4829),y=k(9360),s=k(7103),J=k(8251),Y=k(4674);function E(Ne,me,he=1/0){return(0,Y.m)(me)?E((_e,ee)=>(0,x.U)((ae,oe)=>me(_e,ae,ee,oe))((0,h.Xf)(Ne(_e,ee))),he):("number"==typeof me&&(he=me),(0,y.e)((_e,ee)=>function ie(Ne,me,he,_e,ee,ae,oe,Be){const Ie=[];let Ee=0,Ue=0,et=!1;const le=()=>{et&&!Ie.length&&!Ee&&me.complete()},ue=ht=>Ee<_e?ct(ht):Ie.push(ht),ct=ht=>{ae&&me.next(ht),Ee++;let Le=!1;(0,h.Xf)(he(ht,Ue++)).subscribe((0,J.x)(me,ye=>{ee?.(ye),ae?ue(ye):me.next(ye)},()=>{Le=!0},void 0,()=>{if(Le)try{for(Ee--;Ie.length&&Ee<_e;){const ye=Ie.shift();oe?(0,s.f)(me,oe,()=>ct(ye)):ct(ye)}le()}catch(ye){me.error(ye)}}))};return Ne.subscribe((0,J.x)(me,ue,()=>{et=!0,le()})),()=>{Be?.()}}(_e,ee,Ne,he)))}},3020:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>J});var x=k(4829),h=k(8645),y=k(305),s=k(9360);function J(Y={}){const{connector:E=(()=>new h.x),resetOnError:Ne=!0,resetOnComplete:me=!0,resetOnRefCountZero:he=!0}=Y;return _e=>{let ee,ae,oe,Be=0,Ie=!1,Ee=!1;const Ue=()=>{ae?.unsubscribe(),ae=void 0},et=()=>{Ue(),ee=oe=void 0,Ie=Ee=!1},le=()=>{const ue=ee;et(),ue?.unsubscribe()};return(0,s.e)((ue,ct)=>{Be++,!Ee&&!Ie&&Ue();const ht=oe=oe??E();ct.add(()=>{Be--,0===Be&&!Ee&&!Ie&&(ae=ie(le,he))}),ht.subscribe(ct),!ee&&Be>0&&(ee=new y.Hp({next:Le=>ht.next(Le),error:Le=>{Ee=!0,Ue(),ae=ie(et,Ne,Le),ht.error(Le)},complete:()=>{Ie=!0,Ue(),ae=ie(et,me),ht.complete()}}),(0,x.Xf)(ue).subscribe(ee))})(_e)}}function ie(Y,E,...Ne){if(!0===E)return void Y();if(!1===E)return;const me=new y.Hp({next:()=>{me.unsubscribe(),Y()}});return(0,x.Xf)(E(...Ne)).subscribe(me)}},4664:(Nn,yt,k)=>{"use strict";k.d(yt,{w:()=>s});var x=k(4829),h=k(9360),y=k(8251);function s(J,ie){return(0,h.e)((Y,E)=>{let Ne=null,me=0,he=!1;const _e=()=>he&&!Ne&&E.complete();Y.subscribe((0,y.x)(E,ee=>{Ne?.unsubscribe();let ae=0;const oe=me++;(0,x.Xf)(J(ee,oe)).subscribe(Ne=(0,y.x)(E,Be=>E.next(ie?ie(ee,Be,oe,ae++):Be),()=>{Ne=null,_e()}))},()=>{he=!0,_e()}))})}},8180:(Nn,yt,k)=>{"use strict";k.d(yt,{q:()=>s});var x=k(6232),h=k(9360),y=k(8251);function s(J){return J<=0?()=>x.E:(0,h.e)((ie,Y)=>{let E=0;ie.subscribe((0,y.x)(Y,Ne=>{++E<=J&&(Y.next(Ne),J<=E&&Y.complete())}))})}},4552:(Nn,yt,k)=>{"use strict";k.d(yt,{l:()=>x});const x={now:()=>(x.delegate||Date).now(),delegate:void 0}},7599:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>x});const x={setTimeout(h,y,...s){const{delegate:J}=x;return J?.setTimeout?J.setTimeout(h,y,...s):setTimeout(h,y,...s)},clearTimeout(h){const{delegate:y}=x;return(y?.clearTimeout||clearTimeout)(h)},delegate:void 0}},4971:(Nn,yt,k)=>{"use strict";k.d(yt,{h:()=>h});const h=function x(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},4850:(Nn,yt,k)=>{"use strict";k.d(yt,{L:()=>x});const x="function"==typeof Symbol&&Symbol.observable||"@@observable"},4564:(Nn,yt,k)=>{"use strict";k.d(yt,{_6:()=>ie,jO:()=>s,yG:()=>J});var x=k(4674);function y(Y){return Y[Y.length-1]}function s(Y){return(0,x.m)(y(Y))?Y.pop():void 0}function J(Y){return function h(Y){return Y&&(0,x.m)(Y.schedule)}(y(Y))?Y.pop():void 0}function ie(Y,E){return"number"==typeof y(Y)?Y.pop():E}},7453:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>J});const{isArray:x}=Array,{getPrototypeOf:h,prototype:y,keys:s}=Object;function J(Y){if(1===Y.length){const E=Y[0];if(x(E))return{args:E,keys:null};if(function ie(Y){return Y&&"object"==typeof Y&&h(Y)===y}(E)){const Ne=s(E);return{args:Ne.map(me=>E[me]),keys:Ne}}}return{args:Y,keys:null}}},9039:(Nn,yt,k)=>{"use strict";function x(h,y){if(h){const s=h.indexOf(y);0<=s&&h.splice(s,1)}}k.d(yt,{P:()=>x})},2306:(Nn,yt,k)=>{"use strict";function x(h){const s=h(J=>{Error.call(J),J.stack=(new Error).stack});return s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s}k.d(yt,{d:()=>x})},2714:(Nn,yt,k)=>{"use strict";function x(h,y){return h.reduce((s,J,ie)=>(s[J]=y[ie],s),{})}k.d(yt,{n:()=>x})},1441:(Nn,yt,k)=>{"use strict";k.d(yt,{O:()=>s,x:()=>y});var x=k(2653);let h=null;function y(J){if(x.config.useDeprecatedSynchronousErrorHandling){const ie=!h;if(ie&&(h={errorThrown:!1,error:null}),J(),ie){const{errorThrown:Y,error:E}=h;if(h=null,Y)throw E}}else J()}function s(J){x.config.useDeprecatedSynchronousErrorHandling&&h&&(h.errorThrown=!0,h.error=J)}},7103:(Nn,yt,k)=>{"use strict";function x(h,y,s,J=0,ie=!1){const Y=y.schedule(function(){s(),ie?h.add(this.schedule(null,J)):this.unsubscribe()},J);if(h.add(Y),!ie)return Y}k.d(yt,{f:()=>x})},2737:(Nn,yt,k)=>{"use strict";function x(h){return h}k.d(yt,{y:()=>x})},4266:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>x});const x=h=>h&&"number"==typeof h.length&&"function"!=typeof h},5726:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>h});var x=k(4674);function h(y){return Symbol.asyncIterator&&(0,x.m)(y?.[Symbol.asyncIterator])}},4674:(Nn,yt,k)=>{"use strict";function x(h){return"function"==typeof h}k.d(yt,{m:()=>x})},8382:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>y});var x=k(4850),h=k(4674);function y(s){return(0,h.m)(s[x.L])}},3664:(Nn,yt,k)=>{"use strict";k.d(yt,{T:()=>y});var x=k(4971),h=k(4674);function y(s){return(0,h.m)(s?.[x.h])}},2664:(Nn,yt,k)=>{"use strict";k.d(yt,{b:()=>y});var x=k(5592),h=k(4674);function y(s){return!!s&&(s instanceof x.y||(0,h.m)(s.lift)&&(0,h.m)(s.subscribe))}},4026:(Nn,yt,k)=>{"use strict";k.d(yt,{t:()=>h});var x=k(4674);function h(y){return(0,x.m)(y?.then)}},541:(Nn,yt,k)=>{"use strict";k.d(yt,{L:()=>s,Q:()=>y});var x=k(7582),h=k(4674);function y(J){return(0,x.FC)(this,arguments,function*(){const Y=J.getReader();try{for(;;){const{value:E,done:Ne}=yield(0,x.qq)(Y.read());if(Ne)return yield(0,x.qq)(void 0);yield yield(0,x.qq)(E)}}finally{Y.releaseLock()}})}function s(J){return(0,h.m)(J?.getReader)}},9360:(Nn,yt,k)=>{"use strict";k.d(yt,{A:()=>h,e:()=>y});var x=k(4674);function h(s){return(0,x.m)(s?.lift)}function y(s){return J=>{if(h(J))return J.lift(function(ie){try{return s(ie,this)}catch(Y){this.error(Y)}});throw new TypeError("Unable to lift unknown Observable type")}}},7400:(Nn,yt,k)=>{"use strict";k.d(yt,{Z:()=>s});var x=k(7398);const{isArray:h}=Array;function s(J){return(0,x.U)(ie=>function y(J,ie){return h(ie)?J(...ie):J(ie)}(J,ie))}},2420:(Nn,yt,k)=>{"use strict";function x(){}k.d(yt,{Z:()=>x})},8407:(Nn,yt,k)=>{"use strict";k.d(yt,{U:()=>y,z:()=>h});var x=k(2737);function h(...s){return y(s)}function y(s){return 0===s.length?x.y:1===s.length?s[0]:function(ie){return s.reduce((Y,E)=>E(Y),ie)}}},3894:(Nn,yt,k)=>{"use strict";k.d(yt,{h:()=>y});var x=k(2653),h=k(7599);function y(s){h.z.setTimeout(()=>{const{onUnhandledError:J}=x.config;if(!J)throw s;J(s)})}},9853:(Nn,yt,k)=>{"use strict";function x(h){return new TypeError(`You provided ${null!==h&&"object"==typeof h?"an invalid object":`'${h}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}k.d(yt,{z:()=>x})},863:(Nn,yt,k)=>{var x={"./ion-accordion_2.entry.js":[8484,8592,8484],"./ion-action-sheet.entry.js":[9882,8592,9882],"./ion-alert.entry.js":[6304,8592,6304],"./ion-app_8.entry.js":[5860,8592,5860],"./ion-avatar_3.entry.js":[3544,3544],"./ion-back-button.entry.js":[505,8592,505],"./ion-backdrop.entry.js":[469,469],"./ion-breadcrumb_2.entry.js":[9857,8592,9857],"./ion-button_2.entry.js":[1372,1372],"./ion-card_5.entry.js":[3150,3150],"./ion-checkbox.entry.js":[7635,8592,7635],"./ion-chip.entry.js":[6673,6673],"./ion-col_3.entry.js":[1315,1315],"./ion-datetime-button.entry.js":[433,1207,433],"./ion-datetime_3.entry.js":[7059,1207,8592,7059],"./ion-fab_3.entry.js":[4087,8592,4087],"./ion-img.entry.js":[1745,1745],"./ion-infinite-scroll_2.entry.js":[9352,8592,9352],"./ion-input.entry.js":[4530,8592,4530],"./ion-item-option_3.entry.js":[8633,8592,8633],"./ion-item_8.entry.js":[5962,8592,5962],"./ion-loading.entry.js":[3483,3483],"./ion-menu_3.entry.js":[2939,8592,8382],"./ion-modal.entry.js":[8577,8592,8577],"./ion-nav_2.entry.js":[5675,8592,5675],"./ion-picker-column-internal.entry.js":[9992,8592,9992],"./ion-picker-internal.entry.js":[9820,9820],"./ion-popover.entry.js":[185,185],"./ion-progress-bar.entry.js":[5454,5454],"./ion-radio_2.entry.js":[4458,8592,4458],"./ion-range.entry.js":[7666,8592,7666],"./ion-refresher_2.entry.js":[7219,8592,7219],"./ion-reorder_2.entry.js":[2975,8592,2975],"./ion-ripple-effect.entry.js":[7465,7465],"./ion-route_4.entry.js":[4764,4764],"./ion-searchbar.entry.js":[3998,8592,3998],"./ion-segment_2.entry.js":[3672,8592,3672],"./ion-select_3.entry.js":[6754,8592,6754],"./ion-spinner.entry.js":[9588,8592,9588],"./ion-split-pane.entry.js":[9793,9793],"./ion-tab-bar_2.entry.js":[4090,8592,4090],"./ion-tab_2.entry.js":[2841,2841],"./ion-text.entry.js":[8811,8811],"./ion-textarea.entry.js":[3734,8592,3734],"./ion-toast.entry.js":[6642,6642],"./ion-toggle.entry.js":[8866,8592,8866]};function h(y){if(!k.o(x,y))return Promise.resolve().then(()=>{var ie=new Error("Cannot find module '"+y+"'");throw ie.code="MODULE_NOT_FOUND",ie});var s=x[y],J=s[0];return Promise.all(s.slice(1).map(k.e)).then(()=>k(J))}h.keys=()=>Object.keys(x),h.id=863,Nn.exports=h},6814:(Nn,yt,k)=>{"use strict";k.d(yt,{Do:()=>Be,EM:()=>Xo,HT:()=>s,JF:()=>ws,JJ:()=>Po,K0:()=>ie,Mx:()=>Ar,O5:()=>Eo,PM:()=>bo,S$:()=>ee,V_:()=>E,Ye:()=>Ie,b0:()=>oe,bD:()=>_o,ez:()=>Rr,q:()=>y,sg:()=>xr,tP:()=>vn,uU:()=>ds,w_:()=>J});var x=k(2029);let h=null;function y(){return h}function s(N){h||(h=N)}class J{}const ie=new x.OlP("DocumentToken");let Y=(()=>{var N;class ne{historyGo(Q){throw new Error("Not implemented")}}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275prov=x.Yz7({token:N,factory:function(){return(0,x.f3M)(Ne)},providedIn:"platform"}),ne})();const E=new x.OlP("Location Initialized");let Ne=(()=>{var N;class ne extends Y{constructor(){super(),this._doc=(0,x.f3M)(ie),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return y().getBaseHref(this._doc)}onPopState(Q){const He=y().getGlobalEventTarget(this._doc,"window");return He.addEventListener("popstate",Q,!1),()=>He.removeEventListener("popstate",Q)}onHashChange(Q){const He=y().getGlobalEventTarget(this._doc,"window");return He.addEventListener("hashchange",Q,!1),()=>He.removeEventListener("hashchange",Q)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(Q){this._location.pathname=Q}pushState(Q,He,At){this._history.pushState(Q,He,At)}replaceState(Q,He,At){this._history.replaceState(Q,He,At)}forward(){this._history.forward()}back(){this._history.back()}historyGo(Q=0){this._history.go(Q)}getState(){return this._history.state}}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275prov=x.Yz7({token:N,factory:function(){return new N},providedIn:"platform"}),ne})();function me(N,ne){if(0==N.length)return ne;if(0==ne.length)return N;let it=0;return N.endsWith("/")&&it++,ne.startsWith("/")&&it++,2==it?N+ne.substring(1):1==it?N+ne:N+"/"+ne}function he(N){const ne=N.match(/#|\?|$/),it=ne&&ne.index||N.length;return N.slice(0,it-("/"===N[it-1]?1:0))+N.slice(it)}function _e(N){return N&&"?"!==N[0]?"?"+N:N}let ee=(()=>{var N;class ne{historyGo(Q){throw new Error("Not implemented")}}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275prov=x.Yz7({token:N,factory:function(){return(0,x.f3M)(oe)},providedIn:"root"}),ne})();const ae=new x.OlP("appBaseHref");let oe=(()=>{var N;class ne extends ee{constructor(Q,He){super(),this._platformLocation=Q,this._removeListenerFns=[],this._baseHref=He??this._platformLocation.getBaseHrefFromDOM()??(0,x.f3M)(ie).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(Q){this._removeListenerFns.push(this._platformLocation.onPopState(Q),this._platformLocation.onHashChange(Q))}getBaseHref(){return this._baseHref}prepareExternalUrl(Q){return me(this._baseHref,Q)}path(Q=!1){const He=this._platformLocation.pathname+_e(this._platformLocation.search),At=this._platformLocation.hash;return At&&Q?`${He}${At}`:He}pushState(Q,He,At,cn){const ri=this.prepareExternalUrl(At+_e(cn));this._platformLocation.pushState(Q,He,ri)}replaceState(Q,He,At,cn){const ri=this.prepareExternalUrl(At+_e(cn));this._platformLocation.replaceState(Q,He,ri)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(Q=0){this._platformLocation.historyGo?.(Q)}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.LFG(Y),x.LFG(ae,8))},N.\u0275prov=x.Yz7({token:N,factory:N.\u0275fac,providedIn:"root"}),ne})(),Be=(()=>{var N;class ne extends ee{constructor(Q,He){super(),this._platformLocation=Q,this._baseHref="",this._removeListenerFns=[],null!=He&&(this._baseHref=He)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(Q){this._removeListenerFns.push(this._platformLocation.onPopState(Q),this._platformLocation.onHashChange(Q))}getBaseHref(){return this._baseHref}path(Q=!1){let He=this._platformLocation.hash;return null==He&&(He="#"),He.length>0?He.substring(1):He}prepareExternalUrl(Q){const He=me(this._baseHref,Q);return He.length>0?"#"+He:He}pushState(Q,He,At,cn){let ri=this.prepareExternalUrl(At+_e(cn));0==ri.length&&(ri=this._platformLocation.pathname),this._platformLocation.pushState(Q,He,ri)}replaceState(Q,He,At,cn){let ri=this.prepareExternalUrl(At+_e(cn));0==ri.length&&(ri=this._platformLocation.pathname),this._platformLocation.replaceState(Q,He,ri)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(Q=0){this._platformLocation.historyGo?.(Q)}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.LFG(Y),x.LFG(ae,8))},N.\u0275prov=x.Yz7({token:N,factory:N.\u0275fac}),ne})(),Ie=(()=>{var N;class ne{constructor(Q){this._subject=new x.vpe,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=Q;const He=this._locationStrategy.getBaseHref();this._basePath=function le(N){if(new RegExp("^(https?:)?//").test(N)){const[,it]=N.split(/\/\/[^\/]+/);return it}return N}(he(et(He))),this._locationStrategy.onPopState(At=>{this._subject.emit({url:this.path(!0),pop:!0,state:At.state,type:At.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(Q=!1){return this.normalize(this._locationStrategy.path(Q))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(Q,He=""){return this.path()==this.normalize(Q+_e(He))}normalize(Q){return ne.stripTrailingSlash(function Ue(N,ne){if(!N||!ne.startsWith(N))return ne;const it=ne.substring(N.length);return""===it||["/",";","?","#"].includes(it[0])?it:ne}(this._basePath,et(Q)))}prepareExternalUrl(Q){return Q&&"/"!==Q[0]&&(Q="/"+Q),this._locationStrategy.prepareExternalUrl(Q)}go(Q,He="",At=null){this._locationStrategy.pushState(At,"",Q,He),this._notifyUrlChangeListeners(this.prepareExternalUrl(Q+_e(He)),At)}replaceState(Q,He="",At=null){this._locationStrategy.replaceState(At,"",Q,He),this._notifyUrlChangeListeners(this.prepareExternalUrl(Q+_e(He)),At)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(Q=0){this._locationStrategy.historyGo?.(Q)}onUrlChange(Q){return this._urlChangeListeners.push(Q),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(He=>{this._notifyUrlChangeListeners(He.url,He.state)})),()=>{const He=this._urlChangeListeners.indexOf(Q);this._urlChangeListeners.splice(He,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(Q="",He){this._urlChangeListeners.forEach(At=>At(Q,He))}subscribe(Q,He,At){return this._subject.subscribe({next:Q,error:He,complete:At})}}return(N=ne).normalizeQueryParams=_e,N.joinWithSlash=me,N.stripTrailingSlash=he,N.\u0275fac=function(Q){return new(Q||N)(x.LFG(ee))},N.\u0275prov=x.Yz7({token:N,factory:function(){return function Ee(){return new Ie((0,x.LFG)(ee))}()},providedIn:"root"}),ne})();function et(N){return N.replace(/\/index.html$/,"")}var ct=function(N){return N[N.Decimal=0]="Decimal",N[N.Percent=1]="Percent",N[N.Currency=2]="Currency",N[N.Scientific=3]="Scientific",N}(ct||{}),Le=function(N){return N[N.Format=0]="Format",N[N.Standalone=1]="Standalone",N}(Le||{}),ye=function(N){return N[N.Narrow=0]="Narrow",N[N.Abbreviated=1]="Abbreviated",N[N.Wide=2]="Wide",N[N.Short=3]="Short",N}(ye||{}),gt=function(N){return N[N.Short=0]="Short",N[N.Medium=1]="Medium",N[N.Long=2]="Long",N[N.Full=3]="Full",N}(gt||{}),Te=function(N){return N[N.Decimal=0]="Decimal",N[N.Group=1]="Group",N[N.List=2]="List",N[N.PercentSign=3]="PercentSign",N[N.PlusSign=4]="PlusSign",N[N.MinusSign=5]="MinusSign",N[N.Exponential=6]="Exponential",N[N.SuperscriptingExponent=7]="SuperscriptingExponent",N[N.PerMille=8]="PerMille",N[N.Infinity=9]="Infinity",N[N.NaN=10]="NaN",N[N.TimeSeparator=11]="TimeSeparator",N[N.CurrencyDecimal=12]="CurrencyDecimal",N[N.CurrencyGroup=13]="CurrencyGroup",N}(Te||{});function Je(N,ne){return Yt((0,x.cg1)(N)[x.wAp.DateFormat],ne)}function Re(N,ne){return Yt((0,x.cg1)(N)[x.wAp.TimeFormat],ne)}function Fe(N,ne){return Yt((0,x.cg1)(N)[x.wAp.DateTimeFormat],ne)}function St(N,ne){const it=(0,x.cg1)(N),Q=it[x.wAp.NumberSymbols][ne];if(typeof Q>"u"){if(ne===Te.CurrencyDecimal)return it[x.wAp.NumberSymbols][Te.Decimal];if(ne===Te.CurrencyGroup)return it[x.wAp.NumberSymbols][Te.Group]}return Q}function kt(N){if(!N[x.wAp.ExtraData])throw new Error(`Missing extra locale data for the locale "${N[x.wAp.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Yt(N,ne){for(let it=ne;it>-1;it--)if(typeof N[it]<"u")return N[it];throw new Error("Locale data API: locale data undefined")}function Ut(N){const[ne,it]=N.split(":");return{hours:+ne,minutes:+it}}const Jn=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Wt={},wt=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var vt=function(N){return N[N.Short=0]="Short",N[N.ShortGMT=1]="ShortGMT",N[N.Long=2]="Long",N[N.Extended=3]="Extended",N}(vt||{}),ln=function(N){return N[N.FullYear=0]="FullYear",N[N.Month=1]="Month",N[N.Date=2]="Date",N[N.Hours=3]="Hours",N[N.Minutes=4]="Minutes",N[N.Seconds=5]="Seconds",N[N.FractionalSeconds=6]="FractionalSeconds",N[N.Day=7]="Day",N}(ln||{}),ni=function(N){return N[N.DayPeriods=0]="DayPeriods",N[N.Days=1]="Days",N[N.Months=2]="Months",N[N.Eras=3]="Eras",N}(ni||{});function er(N,ne,it,Q){let He=function pe(N){if(xe(N))return N;if("number"==typeof N&&!isNaN(N))return new Date(N);if("string"==typeof N){if(N=N.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(N)){const[He,At=1,cn=1]=N.split("-").map(ri=>+ri);return lr(He,At-1,cn)}const it=parseFloat(N);if(!isNaN(N-it))return new Date(it);let Q;if(Q=N.match(Jn))return function ze(N){const ne=new Date(0);let it=0,Q=0;const He=N[8]?ne.setUTCFullYear:ne.setFullYear,At=N[8]?ne.setUTCHours:ne.setHours;N[9]&&(it=Number(N[9]+N[10]),Q=Number(N[9]+N[11])),He.call(ne,Number(N[1]),Number(N[2])-1,Number(N[3]));const cn=Number(N[4]||0)-it,ri=Number(N[5]||0)-Q,fr=Number(N[6]||0),Xi=Math.floor(1e3*parseFloat("0."+(N[7]||0)));return At.call(ne,cn,ri,fr,Xi),ne}(Q)}const ne=new Date(N);if(!xe(ne))throw new Error(`Unable to convert "${N}" into a date`);return ne}(N);ne=mi(it,ne)||ne;let ri,cn=[];for(;ne;){if(ri=wt.exec(ne),!ri){cn.push(ne);break}{cn=cn.concat(ri.slice(1));const pr=cn.pop();if(!pr)break;ne=pr}}let fr=He.getTimezoneOffset();Q&&(fr=Xt(Q,fr),He=function zn(N,ne,it){const Q=it?-1:1,He=N.getTimezoneOffset();return function Sn(N,ne){return(N=new Date(N.getTime())).setMinutes(N.getMinutes()+ne),N}(N,Q*(Xt(ne,He)-He))}(He,Q,!0));let Xi="";return cn.forEach(pr=>{const sr=function Et(N){if(jt[N])return jt[N];let ne;switch(N){case"G":case"GG":case"GGG":ne=_n(ni.Eras,ye.Abbreviated);break;case"GGGG":ne=_n(ni.Eras,ye.Wide);break;case"GGGGG":ne=_n(ni.Eras,ye.Narrow);break;case"y":ne=qn(ln.FullYear,1,0,!1,!0);break;case"yy":ne=qn(ln.FullYear,2,0,!0,!0);break;case"yyy":ne=qn(ln.FullYear,3,0,!1,!0);break;case"yyyy":ne=qn(ln.FullYear,4,0,!1,!0);break;case"Y":ne=Bt(1);break;case"YY":ne=Bt(2,!0);break;case"YYY":ne=Bt(3);break;case"YYYY":ne=Bt(4);break;case"M":case"L":ne=qn(ln.Month,1,1);break;case"MM":case"LL":ne=qn(ln.Month,2,1);break;case"MMM":ne=_n(ni.Months,ye.Abbreviated);break;case"MMMM":ne=_n(ni.Months,ye.Wide);break;case"MMMMM":ne=_n(ni.Months,ye.Narrow);break;case"LLL":ne=_n(ni.Months,ye.Abbreviated,Le.Standalone);break;case"LLLL":ne=_n(ni.Months,ye.Wide,Le.Standalone);break;case"LLLLL":ne=_n(ni.Months,ye.Narrow,Le.Standalone);break;case"w":ne=Ct(1);break;case"ww":ne=Ct(2);break;case"W":ne=Ct(1,!0);break;case"d":ne=qn(ln.Date,1);break;case"dd":ne=qn(ln.Date,2);break;case"c":case"cc":ne=qn(ln.Day,1);break;case"ccc":ne=_n(ni.Days,ye.Abbreviated,Le.Standalone);break;case"cccc":ne=_n(ni.Days,ye.Wide,Le.Standalone);break;case"ccccc":ne=_n(ni.Days,ye.Narrow,Le.Standalone);break;case"cccccc":ne=_n(ni.Days,ye.Short,Le.Standalone);break;case"E":case"EE":case"EEE":ne=_n(ni.Days,ye.Abbreviated);break;case"EEEE":ne=_n(ni.Days,ye.Wide);break;case"EEEEE":ne=_n(ni.Days,ye.Narrow);break;case"EEEEEE":ne=_n(ni.Days,ye.Short);break;case"a":case"aa":case"aaa":ne=_n(ni.DayPeriods,ye.Abbreviated);break;case"aaaa":ne=_n(ni.DayPeriods,ye.Wide);break;case"aaaaa":ne=_n(ni.DayPeriods,ye.Narrow);break;case"b":case"bb":case"bbb":ne=_n(ni.DayPeriods,ye.Abbreviated,Le.Standalone,!0);break;case"bbbb":ne=_n(ni.DayPeriods,ye.Wide,Le.Standalone,!0);break;case"bbbbb":ne=_n(ni.DayPeriods,ye.Narrow,Le.Standalone,!0);break;case"B":case"BB":case"BBB":ne=_n(ni.DayPeriods,ye.Abbreviated,Le.Format,!0);break;case"BBBB":ne=_n(ni.DayPeriods,ye.Wide,Le.Format,!0);break;case"BBBBB":ne=_n(ni.DayPeriods,ye.Narrow,Le.Format,!0);break;case"h":ne=qn(ln.Hours,1,-12);break;case"hh":ne=qn(ln.Hours,2,-12);break;case"H":ne=qn(ln.Hours,1);break;case"HH":ne=qn(ln.Hours,2);break;case"m":ne=qn(ln.Minutes,1);break;case"mm":ne=qn(ln.Minutes,2);break;case"s":ne=qn(ln.Seconds,1);break;case"ss":ne=qn(ln.Seconds,2);break;case"S":ne=qn(ln.FractionalSeconds,1);break;case"SS":ne=qn(ln.FractionalSeconds,2);break;case"SSS":ne=qn(ln.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":ne=nt(vt.Short);break;case"ZZZZZ":ne=nt(vt.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":ne=nt(vt.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":ne=nt(vt.Long);break;default:return null}return jt[N]=ne,ne}(pr);Xi+=sr?sr(He,it,fr):"''"===pr?"'":pr.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),Xi}function lr(N,ne,it){const Q=new Date(0);return Q.setFullYear(N,ne,it),Q.setHours(0,0,0),Q}function mi(N,ne){const it=function Ae(N){return(0,x.cg1)(N)[x.wAp.LocaleId]}(N);if(Wt[it]=Wt[it]||{},Wt[it][ne])return Wt[it][ne];let Q="";switch(ne){case"shortDate":Q=Je(N,gt.Short);break;case"mediumDate":Q=Je(N,gt.Medium);break;case"longDate":Q=Je(N,gt.Long);break;case"fullDate":Q=Je(N,gt.Full);break;case"shortTime":Q=Re(N,gt.Short);break;case"mediumTime":Q=Re(N,gt.Medium);break;case"longTime":Q=Re(N,gt.Long);break;case"fullTime":Q=Re(N,gt.Full);break;case"short":const He=mi(N,"shortTime"),At=mi(N,"shortDate");Q=Fi(Fe(N,gt.Short),[He,At]);break;case"medium":const cn=mi(N,"mediumTime"),ri=mi(N,"mediumDate");Q=Fi(Fe(N,gt.Medium),[cn,ri]);break;case"long":const fr=mi(N,"longTime"),Xi=mi(N,"longDate");Q=Fi(Fe(N,gt.Long),[fr,Xi]);break;case"full":const pr=mi(N,"fullTime"),sr=mi(N,"fullDate");Q=Fi(Fe(N,gt.Full),[pr,sr])}return Q&&(Wt[it][ne]=Q),Q}function Fi(N,ne){return ne&&(N=N.replace(/\{([^}]+)}/g,function(it,Q){return null!=ne&&Q in ne?ne[Q]:it})),N}function Cn(N,ne,it="-",Q,He){let At="";(N<0||He&&N<=0)&&(He?N=1-N:(N=-N,At=it));let cn=String(N);for(;cn.length0||ri>-it)&&(ri+=it),N===ln.Hours)0===ri&&-12===it&&(ri=12);else if(N===ln.FractionalSeconds)return function Mn(N,ne){return Cn(N,3).substring(0,ne)}(ri,ne);const fr=St(cn,Te.MinusSign);return Cn(ri,ne,fr,Q,He)}}function _n(N,ne,it=Le.Format,Q=!1){return function(He,At){return function Hi(N,ne,it,Q,He,At){switch(it){case ni.Months:return function hn(N,ne,it){const Q=(0,x.cg1)(N),At=Yt([Q[x.wAp.MonthsFormat],Q[x.wAp.MonthsStandalone]],ne);return Yt(At,it)}(ne,He,Q)[N.getMonth()];case ni.Days:return function _t(N,ne,it){const Q=(0,x.cg1)(N),At=Yt([Q[x.wAp.DaysFormat],Q[x.wAp.DaysStandalone]],ne);return Yt(At,it)}(ne,He,Q)[N.getDay()];case ni.DayPeriods:const cn=N.getHours(),ri=N.getMinutes();if(At){const Xi=function dt(N){const ne=(0,x.cg1)(N);return kt(ne),(ne[x.wAp.ExtraData][2]||[]).map(Q=>"string"==typeof Q?Ut(Q):[Ut(Q[0]),Ut(Q[1])])}(ne),pr=function Ot(N,ne,it){const Q=(0,x.cg1)(N);kt(Q);const At=Yt([Q[x.wAp.ExtraData][0],Q[x.wAp.ExtraData][1]],ne)||[];return Yt(At,it)||[]}(ne,He,Q),sr=Xi.findIndex(Vi=>{if(Array.isArray(Vi)){const[Tr,ho]=Vi,ao=cn>=Tr.hours&&ri>=Tr.minutes,ps=cn0?Math.floor(He/60):Math.ceil(He/60);switch(N){case vt.Short:return(He>=0?"+":"")+Cn(cn,2,At)+Cn(Math.abs(He%60),2,At);case vt.ShortGMT:return"GMT"+(He>=0?"+":"")+Cn(cn,1,At);case vt.Long:return"GMT"+(He>=0?"+":"")+Cn(cn,2,At)+":"+Cn(Math.abs(He%60),2,At);case vt.Extended:return 0===Q?"Z":(He>=0?"+":"")+Cn(cn,2,At)+":"+Cn(Math.abs(He%60),2,At);default:throw new Error(`Unknown zone width "${N}"`)}}}const ge=0,ve=4;function ft(N){return lr(N.getFullYear(),N.getMonth(),N.getDate()+(ve-N.getDay()))}function Ct(N,ne=!1){return function(it,Q){let He;if(ne){const At=new Date(it.getFullYear(),it.getMonth(),1).getDay()-1,cn=it.getDate();He=1+Math.floor((cn+At)/7)}else{const At=ft(it),cn=function Xe(N){const ne=lr(N,ge,1).getDay();return lr(N,0,1+(ne<=ve?ve:ve+7)-ne)}(At.getFullYear()),ri=At.getTime()-cn.getTime();He=1+Math.round(ri/6048e5)}return Cn(He,N,St(Q,Te.MinusSign))}}function Bt(N,ne=!1){return function(it,Q){return Cn(ft(it).getFullYear(),N,St(Q,Te.MinusSign),ne)}}const jt={};function Xt(N,ne){N=N.replace(/:/g,"");const it=Date.parse("Jan 01, 1970 00:00:00 "+N)/6e4;return isNaN(it)?ne:it}function xe(N){return N instanceof Date&&!isNaN(N.valueOf())}const be=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function Li(N){const ne=parseInt(N);if(isNaN(ne))throw new Error("Invalid integer literal when parsing "+N);return ne}function Ar(N,ne){ne=encodeURIComponent(ne);for(const it of N.split(";")){const Q=it.indexOf("="),[He,At]=-1==Q?[it,""]:[it.slice(0,Q),it.slice(Q+1)];if(He.trim()===ne)return decodeURIComponent(At)}return null}class yr{constructor(ne,it,Q,He){this.$implicit=ne,this.ngForOf=it,this.index=Q,this.count=He}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let xr=(()=>{var N;class ne{set ngForOf(Q){this._ngForOf=Q,this._ngForOfDirty=!0}set ngForTrackBy(Q){this._trackByFn=Q}get ngForTrackBy(){return this._trackByFn}constructor(Q,He,At){this._viewContainer=Q,this._template=He,this._differs=At,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(Q){Q&&(this._template=Q)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const Q=this._ngForOf;!this._differ&&Q&&(this._differ=this._differs.find(Q).create(this.ngForTrackBy))}if(this._differ){const Q=this._differ.diff(this._ngForOf);Q&&this._applyChanges(Q)}}_applyChanges(Q){const He=this._viewContainer;Q.forEachOperation((At,cn,ri)=>{if(null==At.previousIndex)He.createEmbeddedView(this._template,new yr(At.item,this._ngForOf,-1,-1),null===ri?void 0:ri);else if(null==ri)He.remove(null===cn?void 0:cn);else if(null!==cn){const fr=He.get(cn);He.move(fr,ri),Sr(fr,At)}});for(let At=0,cn=He.length;At{Sr(He.get(At.currentIndex),At)})}static ngTemplateContextGuard(Q,He){return!0}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.s_b),x.Y36(x.Rgc),x.Y36(x.ZZ4))},N.\u0275dir=x.lG2({type:N,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0}),ne})();function Sr(N,ne){N.context.$implicit=ne.item}let Eo=(()=>{var N;class ne{constructor(Q,He){this._viewContainer=Q,this._context=new to,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=He}set ngIf(Q){this._context.$implicit=this._context.ngIf=Q,this._updateView()}set ngIfThen(Q){Xn("ngIfThen",Q),this._thenTemplateRef=Q,this._thenViewRef=null,this._updateView()}set ngIfElse(Q){Xn("ngIfElse",Q),this._elseTemplateRef=Q,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(Q,He){return!0}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.s_b),x.Y36(x.Rgc))},N.\u0275dir=x.lG2({type:N,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0}),ne})();class to{constructor(){this.$implicit=null,this.ngIf=null}}function Xn(N,ne){if(ne&&!ne.createEmbeddedView)throw new Error(`${N} must be a TemplateRef, but received '${(0,x.AaK)(ne)}'.`)}let vn=(()=>{var N;class ne{constructor(Q){this._viewContainerRef=Q,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null,this.ngTemplateOutletInjector=null}ngOnChanges(Q){if(Q.ngTemplateOutlet||Q.ngTemplateOutletInjector){const He=this._viewContainerRef;if(this._viewRef&&He.remove(He.indexOf(this._viewRef)),this.ngTemplateOutlet){const{ngTemplateOutlet:At,ngTemplateOutletContext:cn,ngTemplateOutletInjector:ri}=this;this._viewRef=He.createEmbeddedView(At,cn,ri?{injector:ri}:void 0)}else this._viewRef=null}else this._viewRef&&Q.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.s_b))},N.\u0275dir=x.lG2({type:N,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},standalone:!0,features:[x.TTD]}),ne})();function In(N,ne){return new x.vHH(2100,!1)}const kr=new x.OlP("DATE_PIPE_DEFAULT_TIMEZONE"),To=new x.OlP("DATE_PIPE_DEFAULT_OPTIONS");let ds=(()=>{var N;class ne{constructor(Q,He,At){this.locale=Q,this.defaultTimezone=He,this.defaultOptions=At}transform(Q,He,At,cn){if(null==Q||""===Q||Q!=Q)return null;try{return er(Q,He??this.defaultOptions?.dateFormat??"mediumDate",cn||this.locale,At??this.defaultOptions?.timezone??this.defaultTimezone??void 0)}catch(ri){throw In()}}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.soG,16),x.Y36(kr,24),x.Y36(To,24))},N.\u0275pipe=x.Yjl({name:"date",type:N,pure:!0,standalone:!0}),ne})(),Po=(()=>{var N;class ne{constructor(Q){this._locale=Q}transform(Q,He,At){if(!function bs(N){return!(null==N||""===N||N!=N)}(Q))return null;At=At||this._locale;try{return function mn(N,ne,it){return function Lt(N,ne,it,Q,He,At,cn=!1){let ri="",fr=!1;if(isFinite(N)){let Xi=function gi(N){let Q,He,At,cn,ri,ne=Math.abs(N)+"",it=0;for((He=ne.indexOf("."))>-1&&(ne=ne.replace(".","")),(At=ne.search(/e/i))>0?(He<0&&(He=At),He+=+ne.slice(At+1),ne=ne.substring(0,At)):He<0&&(He=ne.length),At=0;"0"===ne.charAt(At);At++);if(At===(ri=ne.length))Q=[0],He=1;else{for(ri--;"0"===ne.charAt(ri);)ri--;for(He-=At,Q=[],cn=0;At<=ri;At++,cn++)Q[cn]=Number(ne.charAt(At))}return He>22&&(Q=Q.splice(0,21),it=He-1,He=1),{digits:Q,exponent:it,integerLen:He}}(N);cn&&(Xi=function ti(N){if(0===N.digits[0])return N;const ne=N.digits.length-N.integerLen;return N.exponent?N.exponent+=2:(0===ne?N.digits.push(0,0):1===ne&&N.digits.push(0),N.integerLen+=2),N}(Xi));let pr=ne.minInt,sr=ne.minFrac,Vi=ne.maxFrac;if(At){const No=At.match(be);if(null===No)throw new Error(`${At} is not a valid digit info`);const fo=No[1],as=No[3],Ys=No[5];null!=fo&&(pr=Li(fo)),null!=as&&(sr=Li(as)),null!=Ys?Vi=Li(Ys):null!=as&&sr>Vi&&(Vi=sr)}!function _i(N,ne,it){if(ne>it)throw new Error(`The minimum number of digits after fraction (${ne}) is higher than the maximum (${it}).`);let Q=N.digits,He=Q.length-N.integerLen;const At=Math.min(Math.max(ne,He),it);let cn=At+N.integerLen,ri=Q[cn];if(cn>0){Q.splice(Math.max(N.integerLen,cn));for(let sr=cn;sr=5)if(cn-1<0){for(let sr=0;sr>cn;sr--)Q.unshift(0),N.integerLen++;Q.unshift(1),N.integerLen++}else Q[cn-1]++;for(;He=Xi?ho.pop():fr=!1),Vi>=10?1:0},0);pr&&(Q.unshift(pr),N.integerLen++)}(Xi,sr,Vi);let Tr=Xi.digits,ho=Xi.integerLen;const ao=Xi.exponent;let ps=[];for(fr=Tr.every(No=>!No);ho0?ps=Tr.splice(ho,Tr.length):(ps=Tr,Tr=[0]);const ss=[];for(Tr.length>=ne.lgSize&&ss.unshift(Tr.splice(-ne.lgSize,Tr.length).join(""));Tr.length>ne.gSize;)ss.unshift(Tr.splice(-ne.gSize,Tr.length).join(""));Tr.length&&ss.unshift(Tr.join("")),ri=ss.join(St(it,Q)),ps.length&&(ri+=St(it,He)+ps.join("")),ao&&(ri+=St(it,Te.Exponential)+"+"+ao)}else ri=St(it,Te.Infinity);return ri=N<0&&!fr?ne.negPre+ri+ne.negSuf:ne.posPre+ri+ne.posSuf,ri}(N,function En(N,ne="-"){const it={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},Q=N.split(";"),He=Q[0],At=Q[1],cn=-1!==He.indexOf(".")?He.split("."):[He.substring(0,He.lastIndexOf("0")+1),He.substring(He.lastIndexOf("0")+1)],ri=cn[0],fr=cn[1]||"";it.posPre=ri.substring(0,ri.indexOf("#"));for(let pr=0;pr{var N;class ne{}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275mod=x.oAB({type:N}),N.\u0275inj=x.cJS({}),ne})();const _o="browser",rs="server";function bo(N){return N===rs}let Xo=(()=>{var N;class ne{}return(N=ne).\u0275prov=(0,x.Yz7)({token:N,providedIn:"root",factory:()=>new os((0,x.LFG)(ie),window)}),ne})();class os{constructor(ne,it){this.document=ne,this.window=it,this.offset=()=>[0,0]}setOffset(ne){this.offset=Array.isArray(ne)?()=>ne:ne}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(ne){this.supportsScrolling()&&this.window.scrollTo(ne[0],ne[1])}scrollToAnchor(ne){if(!this.supportsScrolling())return;const it=function Br(N,ne){const it=N.getElementById(ne)||N.getElementsByName(ne)[0];if(it)return it;if("function"==typeof N.createTreeWalker&&N.body&&"function"==typeof N.body.attachShadow){const Q=N.createTreeWalker(N.body,NodeFilter.SHOW_ELEMENT);let He=Q.currentNode;for(;He;){const At=He.shadowRoot;if(At){const cn=At.getElementById(ne)||At.querySelector(`[name="${ne}"]`);if(cn)return cn}He=Q.nextNode()}}return null}(this.document,ne);it&&(this.scrollToElement(it),it.focus())}setHistoryScrollRestoration(ne){this.supportsScrolling()&&(this.window.history.scrollRestoration=ne)}scrollToElement(ne){const it=ne.getBoundingClientRect(),Q=it.left+this.window.pageXOffset,He=it.top+this.window.pageYOffset,At=this.offset();this.window.scrollTo(Q-At[0],He-At[1])}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}class ws{}},9862:(Nn,yt,k)=>{"use strict";k.d(yt,{JF:()=>be,TP:()=>kt,WM:()=>ee,eN:()=>De});var x=k(2029),h=k(2096),y=k(7715),s=k(5592),J=k(6328),ie=k(2181),Y=k(7398),E=k(4716),Ne=k(4664),me=k(6814);class he{}class _e{}class ee{constructor(st){this.normalizedNames=new Map,this.lazyUpdate=null,st?"string"==typeof st?this.lazyInit=()=>{this.headers=new Map,st.split("\n").forEach(pn=>{const mn=pn.indexOf(":");if(mn>0){const En=pn.slice(0,mn),ti=En.toLowerCase(),gi=pn.slice(mn+1).trim();this.maybeSetNormalizedName(En,ti),this.headers.has(ti)?this.headers.get(ti).push(gi):this.headers.set(ti,[gi])}})}:typeof Headers<"u"&&st instanceof Headers?(this.headers=new Map,st.forEach((pn,mn)=>{this.setHeaderEntries(mn,pn)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(st).forEach(([pn,mn])=>{this.setHeaderEntries(pn,mn)})}:this.headers=new Map}has(st){return this.init(),this.headers.has(st.toLowerCase())}get(st){this.init();const pn=this.headers.get(st.toLowerCase());return pn&&pn.length>0?pn[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(st){return this.init(),this.headers.get(st.toLowerCase())||null}append(st,pn){return this.clone({name:st,value:pn,op:"a"})}set(st,pn){return this.clone({name:st,value:pn,op:"s"})}delete(st,pn){return this.clone({name:st,value:pn,op:"d"})}maybeSetNormalizedName(st,pn){this.normalizedNames.has(pn)||this.normalizedNames.set(pn,st)}init(){this.lazyInit&&(this.lazyInit instanceof ee?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(st=>this.applyUpdate(st)),this.lazyUpdate=null))}copyFrom(st){st.init(),Array.from(st.headers.keys()).forEach(pn=>{this.headers.set(pn,st.headers.get(pn)),this.normalizedNames.set(pn,st.normalizedNames.get(pn))})}clone(st){const pn=new ee;return pn.lazyInit=this.lazyInit&&this.lazyInit instanceof ee?this.lazyInit:this,pn.lazyUpdate=(this.lazyUpdate||[]).concat([st]),pn}applyUpdate(st){const pn=st.name.toLowerCase();switch(st.op){case"a":case"s":let mn=st.value;if("string"==typeof mn&&(mn=[mn]),0===mn.length)return;this.maybeSetNormalizedName(st.name,pn);const En=("a"===st.op?this.headers.get(pn):void 0)||[];En.push(...mn),this.headers.set(pn,En);break;case"d":const ti=st.value;if(ti){let gi=this.headers.get(pn);if(!gi)return;gi=gi.filter(_i=>-1===ti.indexOf(_i)),0===gi.length?(this.headers.delete(pn),this.normalizedNames.delete(pn)):this.headers.set(pn,gi)}else this.headers.delete(pn),this.normalizedNames.delete(pn)}}setHeaderEntries(st,pn){const mn=(Array.isArray(pn)?pn:[pn]).map(ti=>ti.toString()),En=st.toLowerCase();this.headers.set(En,mn),this.maybeSetNormalizedName(st,En)}forEach(st){this.init(),Array.from(this.normalizedNames.keys()).forEach(pn=>st(this.normalizedNames.get(pn),this.headers.get(pn)))}}class oe{encodeKey(st){return Ue(st)}encodeValue(st){return Ue(st)}decodeKey(st){return decodeURIComponent(st)}decodeValue(st){return decodeURIComponent(st)}}const Ie=/%(\d[a-f0-9])/gi,Ee={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function Ue(Lt){return encodeURIComponent(Lt).replace(Ie,(st,pn)=>Ee[pn]??st)}function et(Lt){return`${Lt}`}class le{constructor(st={}){if(this.updates=null,this.cloneFrom=null,this.encoder=st.encoder||new oe,st.fromString){if(st.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function Be(Lt,st){const pn=new Map;return Lt.length>0&&Lt.replace(/^\?/,"").split("&").forEach(En=>{const ti=En.indexOf("="),[gi,_i]=-1==ti?[st.decodeKey(En),""]:[st.decodeKey(En.slice(0,ti)),st.decodeValue(En.slice(ti+1))],Li=pn.get(gi)||[];Li.push(_i),pn.set(gi,Li)}),pn}(st.fromString,this.encoder)}else st.fromObject?(this.map=new Map,Object.keys(st.fromObject).forEach(pn=>{const mn=st.fromObject[pn],En=Array.isArray(mn)?mn.map(et):[et(mn)];this.map.set(pn,En)})):this.map=null}has(st){return this.init(),this.map.has(st)}get(st){this.init();const pn=this.map.get(st);return pn?pn[0]:null}getAll(st){return this.init(),this.map.get(st)||null}keys(){return this.init(),Array.from(this.map.keys())}append(st,pn){return this.clone({param:st,value:pn,op:"a"})}appendAll(st){const pn=[];return Object.keys(st).forEach(mn=>{const En=st[mn];Array.isArray(En)?En.forEach(ti=>{pn.push({param:mn,value:ti,op:"a"})}):pn.push({param:mn,value:En,op:"a"})}),this.clone(pn)}set(st,pn){return this.clone({param:st,value:pn,op:"s"})}delete(st,pn){return this.clone({param:st,value:pn,op:"d"})}toString(){return this.init(),this.keys().map(st=>{const pn=this.encoder.encodeKey(st);return this.map.get(st).map(mn=>pn+"="+this.encoder.encodeValue(mn)).join("&")}).filter(st=>""!==st).join("&")}clone(st){const pn=new le({encoder:this.encoder});return pn.cloneFrom=this.cloneFrom||this,pn.updates=(this.updates||[]).concat(st),pn}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(st=>this.map.set(st,this.cloneFrom.map.get(st))),this.updates.forEach(st=>{switch(st.op){case"a":case"s":const pn=("a"===st.op?this.map.get(st.param):void 0)||[];pn.push(et(st.value)),this.map.set(st.param,pn);break;case"d":if(void 0===st.value){this.map.delete(st.param);break}{let mn=this.map.get(st.param)||[];const En=mn.indexOf(et(st.value));-1!==En&&mn.splice(En,1),mn.length>0?this.map.set(st.param,mn):this.map.delete(st.param)}}}),this.cloneFrom=this.updates=null)}}class ct{constructor(){this.map=new Map}set(st,pn){return this.map.set(st,pn),this}get(st){return this.map.has(st)||this.map.set(st,st.defaultValue()),this.map.get(st)}delete(st){return this.map.delete(st),this}has(st){return this.map.has(st)}keys(){return this.map.keys()}}function Le(Lt){return typeof ArrayBuffer<"u"&&Lt instanceof ArrayBuffer}function ye(Lt){return typeof Blob<"u"&&Lt instanceof Blob}function gt(Lt){return typeof FormData<"u"&&Lt instanceof FormData}class Pe{constructor(st,pn,mn,En){let ti;if(this.url=pn,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=st.toUpperCase(),function ht(Lt){switch(Lt){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||En?(this.body=void 0!==mn?mn:null,ti=En):ti=mn,ti&&(this.reportProgress=!!ti.reportProgress,this.withCredentials=!!ti.withCredentials,ti.responseType&&(this.responseType=ti.responseType),ti.headers&&(this.headers=ti.headers),ti.context&&(this.context=ti.context),ti.params&&(this.params=ti.params)),this.headers||(this.headers=new ee),this.context||(this.context=new ct),this.params){const gi=this.params.toString();if(0===gi.length)this.urlWithParams=pn;else{const _i=pn.indexOf("?");this.urlWithParams=pn+(-1===_i?"?":_iDr.set(vi,st.setHeaders[vi]),Li)),st.setParams&&(bi=Object.keys(st.setParams).reduce((Dr,vi)=>Dr.set(vi,st.setParams[vi]),bi)),new Pe(pn,mn,ti,{params:bi,headers:Li,context:ir,reportProgress:_i,responseType:En,withCredentials:gi})}}var Ae=function(Lt){return Lt[Lt.Sent=0]="Sent",Lt[Lt.UploadProgress=1]="UploadProgress",Lt[Lt.ResponseHeader=2]="ResponseHeader",Lt[Lt.DownloadProgress=3]="DownloadProgress",Lt[Lt.Response=4]="Response",Lt[Lt.User=5]="User",Lt}(Ae||{});class Ye{constructor(st,pn=200,mn="OK"){this.headers=st.headers||new ee,this.status=void 0!==st.status?st.status:pn,this.statusText=st.statusText||mn,this.url=st.url||null,this.ok=this.status>=200&&this.status<300}}class _t extends Ye{constructor(st={}){super(st),this.type=Ae.ResponseHeader}clone(st={}){return new _t({headers:st.headers||this.headers,status:void 0!==st.status?st.status:this.status,statusText:st.statusText||this.statusText,url:st.url||this.url||void 0})}}class hn extends Ye{constructor(st={}){super(st),this.type=Ae.Response,this.body=void 0!==st.body?st.body:null}clone(st={}){return new hn({body:void 0!==st.body?st.body:this.body,headers:st.headers||this.headers,status:void 0!==st.status?st.status:this.status,statusText:st.statusText||this.statusText,url:st.url||this.url||void 0})}}class qt extends Ye{constructor(st){super(st,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${st.url||"(unknown url)"}`:`Http failure response for ${st.url||"(unknown url)"}: ${st.status} ${st.statusText}`,this.error=st.error||null}}function Ht(Lt,st){return{body:st,headers:Lt.headers,context:Lt.context,observe:Lt.observe,params:Lt.params,reportProgress:Lt.reportProgress,responseType:Lt.responseType,withCredentials:Lt.withCredentials}}let De=(()=>{var Lt;class st{constructor(mn){this.handler=mn}request(mn,En,ti={}){let gi;if(mn instanceof Pe)gi=mn;else{let bi,ir;bi=ti.headers instanceof ee?ti.headers:new ee(ti.headers),ti.params&&(ir=ti.params instanceof le?ti.params:new le({fromObject:ti.params})),gi=new Pe(mn,En,void 0!==ti.body?ti.body:null,{headers:bi,context:ti.context,params:ir,reportProgress:ti.reportProgress,responseType:ti.responseType||"json",withCredentials:ti.withCredentials})}const _i=(0,h.of)(gi).pipe((0,J.b)(bi=>this.handler.handle(bi)));if(mn instanceof Pe||"events"===ti.observe)return _i;const Li=_i.pipe((0,ie.h)(bi=>bi instanceof hn));switch(ti.observe||"body"){case"body":switch(gi.responseType){case"arraybuffer":return Li.pipe((0,Y.U)(bi=>{if(null!==bi.body&&!(bi.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return bi.body}));case"blob":return Li.pipe((0,Y.U)(bi=>{if(null!==bi.body&&!(bi.body instanceof Blob))throw new Error("Response is not a Blob.");return bi.body}));case"text":return Li.pipe((0,Y.U)(bi=>{if(null!==bi.body&&"string"!=typeof bi.body)throw new Error("Response is not a string.");return bi.body}));default:return Li.pipe((0,Y.U)(bi=>bi.body))}case"response":return Li;default:throw new Error(`Unreachable: unhandled observe type ${ti.observe}}`)}}delete(mn,En={}){return this.request("DELETE",mn,En)}get(mn,En={}){return this.request("GET",mn,En)}head(mn,En={}){return this.request("HEAD",mn,En)}jsonp(mn,En){return this.request("JSONP",mn,{params:(new le).append(En,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(mn,En={}){return this.request("OPTIONS",mn,En)}patch(mn,En,ti={}){return this.request("PATCH",mn,Ht(ti,En))}post(mn,En,ti={}){return this.request("POST",mn,Ht(ti,En))}put(mn,En,ti={}){return this.request("PUT",mn,Ht(ti,En))}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(he))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();function Gt(Lt,st){return st(Lt)}function Zt(Lt,st){return(pn,mn)=>st.intercept(pn,{handle:En=>Lt(En,mn)})}const kt=new x.OlP(""),dt=new x.OlP(""),Ot=new x.OlP("");function pt(){let Lt=null;return(st,pn)=>{null===Lt&&(Lt=((0,x.f3M)(kt,{optional:!0})??[]).reduceRight(Zt,Gt));const mn=(0,x.f3M)(x.HDt),En=mn.add();return Lt(st,pn).pipe((0,E.x)(()=>mn.remove(En)))}}let Yt=(()=>{var Lt;class st extends he{constructor(mn,En){super(),this.backend=mn,this.injector=En,this.chain=null,this.pendingTasks=(0,x.f3M)(x.HDt)}handle(mn){if(null===this.chain){const ti=Array.from(new Set([...this.injector.get(dt),...this.injector.get(Ot,[])]));this.chain=ti.reduceRight((gi,_i)=>function Jt(Lt,st,pn){return(mn,En)=>pn.runInContext(()=>st(mn,ti=>Lt(ti,En)))}(gi,_i,this.injector),Gt)}const En=this.pendingTasks.add();return this.chain(mn,ti=>this.backend.handle(ti)).pipe((0,E.x)(()=>this.pendingTasks.remove(En)))}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(_e),x.LFG(x.lqb))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();const lr=/^\)\]\}',?\n/;let Fi=(()=>{var Lt;class st{constructor(mn){this.xhrFactory=mn}handle(mn){if("JSONP"===mn.method)throw new x.vHH(-2800,!1);const En=this.xhrFactory;return(En.\u0275loadImpl?(0,y.D)(En.\u0275loadImpl()):(0,h.of)(null)).pipe((0,Ne.w)(()=>new s.y(gi=>{const _i=En.build();if(_i.open(mn.method,mn.urlWithParams),mn.withCredentials&&(_i.withCredentials=!0),mn.headers.forEach((Kt,Wi)=>_i.setRequestHeader(Kt,Wi.join(","))),mn.headers.has("Accept")||_i.setRequestHeader("Accept","application/json, text/plain, */*"),!mn.headers.has("Content-Type")){const Kt=mn.detectContentTypeHeader();null!==Kt&&_i.setRequestHeader("Content-Type",Kt)}if(mn.responseType){const Kt=mn.responseType.toLowerCase();_i.responseType="json"!==Kt?Kt:"text"}const Li=mn.serializeBody();let bi=null;const ir=()=>{if(null!==bi)return bi;const Kt=_i.statusText||"OK",Wi=new ee(_i.getAllResponseHeaders()),rr=function mi(Lt){return"responseURL"in Lt&&Lt.responseURL?Lt.responseURL:/^X-Request-URL:/m.test(Lt.getAllResponseHeaders())?Lt.getResponseHeader("X-Request-URL"):null}(_i)||mn.url;return bi=new _t({headers:Wi,status:_i.status,statusText:Kt,url:rr}),bi},Dr=()=>{let{headers:Kt,status:Wi,statusText:rr,url:yr}=ir(),xr=null;204!==Wi&&(xr=typeof _i.response>"u"?_i.responseText:_i.response),0===Wi&&(Wi=xr?200:0);let Sr=Wi>=200&&Wi<300;if("json"===mn.responseType&&"string"==typeof xr){const Go=xr;xr=xr.replace(lr,"");try{xr=""!==xr?JSON.parse(xr):null}catch(Eo){xr=Go,Sr&&(Sr=!1,xr={error:Eo,text:xr})}}Sr?(gi.next(new hn({body:xr,headers:Kt,status:Wi,statusText:rr,url:yr||void 0})),gi.complete()):gi.error(new qt({error:xr,headers:Kt,status:Wi,statusText:rr,url:yr||void 0}))},vi=Kt=>{const{url:Wi}=ir(),rr=new qt({error:Kt,status:_i.status||0,statusText:_i.statusText||"Unknown Error",url:Wi||void 0});gi.error(rr)};let Ar=!1;const qi=Kt=>{Ar||(gi.next(ir()),Ar=!0);let Wi={type:Ae.DownloadProgress,loaded:Kt.loaded};Kt.lengthComputable&&(Wi.total=Kt.total),"text"===mn.responseType&&_i.responseText&&(Wi.partialText=_i.responseText),gi.next(Wi)},Bi=Kt=>{let Wi={type:Ae.UploadProgress,loaded:Kt.loaded};Kt.lengthComputable&&(Wi.total=Kt.total),gi.next(Wi)};return _i.addEventListener("load",Dr),_i.addEventListener("error",vi),_i.addEventListener("timeout",vi),_i.addEventListener("abort",vi),mn.reportProgress&&(_i.addEventListener("progress",qi),null!==Li&&_i.upload&&_i.upload.addEventListener("progress",Bi)),_i.send(Li),gi.next({type:Ae.Sent}),()=>{_i.removeEventListener("error",vi),_i.removeEventListener("abort",vi),_i.removeEventListener("load",Dr),_i.removeEventListener("timeout",vi),mn.reportProgress&&(_i.removeEventListener("progress",qi),null!==Li&&_i.upload&&_i.upload.removeEventListener("progress",Bi)),_i.readyState!==_i.DONE&&_i.abort()}})))}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(me.JF))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();const Cn=new x.OlP("XSRF_ENABLED"),qn=new x.OlP("XSRF_COOKIE_NAME",{providedIn:"root",factory:()=>"XSRF-TOKEN"}),_n=new x.OlP("XSRF_HEADER_NAME",{providedIn:"root",factory:()=>"X-XSRF-TOKEN"});class Hi{}let nt=(()=>{var Lt;class st{constructor(mn,En,ti){this.doc=mn,this.platform=En,this.cookieName=ti,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const mn=this.doc.cookie||"";return mn!==this.lastCookieString&&(this.parseCount++,this.lastToken=(0,me.Mx)(mn,this.cookieName),this.lastCookieString=mn),this.lastToken}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(me.K0),x.LFG(x.Lbi),x.LFG(qn))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();function ge(Lt,st){const pn=Lt.url.toLowerCase();if(!(0,x.f3M)(Cn)||"GET"===Lt.method||"HEAD"===Lt.method||pn.startsWith("http://")||pn.startsWith("https://"))return st(Lt);const mn=(0,x.f3M)(Hi).getToken(),En=(0,x.f3M)(_n);return null!=mn&&!Lt.headers.has(En)&&(Lt=Lt.clone({headers:Lt.headers.set(En,mn)})),st(Lt)}var Xe=function(Lt){return Lt[Lt.Interceptors=0]="Interceptors",Lt[Lt.LegacyInterceptors=1]="LegacyInterceptors",Lt[Lt.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",Lt[Lt.NoXsrfProtection=3]="NoXsrfProtection",Lt[Lt.JsonpSupport=4]="JsonpSupport",Lt[Lt.RequestsMadeViaParent=5]="RequestsMadeViaParent",Lt[Lt.Fetch=6]="Fetch",Lt}(Xe||{});function ft(Lt,st){return{\u0275kind:Lt,\u0275providers:st}}function Ct(...Lt){const st=[De,Fi,Yt,{provide:he,useExisting:Yt},{provide:_e,useExisting:Fi},{provide:dt,useValue:ge,multi:!0},{provide:Cn,useValue:!0},{provide:Hi,useClass:nt}];for(const pn of Lt)st.push(...pn.\u0275providers);return(0,x.MR2)(st)}const jt=new x.OlP("LEGACY_INTERCEPTOR_FN");let be=(()=>{var Lt;class st{}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)},Lt.\u0275mod=x.oAB({type:Lt}),Lt.\u0275inj=x.cJS({providers:[Ct(ft(Xe.LegacyInterceptors,[{provide:jt,useFactory:pt},{provide:dt,useExisting:jt,multi:!0}]))]}),st})()},2029:(Nn,yt,k)=>{"use strict";k.d(yt,{tb:()=>hv,AFp:()=>Xm,ip1:()=>u1,hGG:()=>fT,z2F:()=>Df,Ojb:()=>j_,sBO:()=>KE,Sil:()=>fE,EJc:()=>uE,Xts:()=>Ac,SBq:()=>yu,lqb:()=>la,qLn:()=>ad,vpe:()=>$c,XFs:()=>mi,OlP:()=>Gr,zs3:()=>qa,ZZ4:()=>yv,aQg:()=>vv,soG:()=>o_,YKP:()=>dx,h0i:()=>mh,PXZ:()=>jE,R0b:()=>ba,FiY:()=>Ii,Lbi:()=>Kh,g9A:()=>hp,Qsj:()=>ag,FYo:()=>va,JOm:()=>Zu,tp0:()=>Qc,Rgc:()=>im,dDg:()=>NE,eoX:()=>C1,GfV:()=>nf,s_b:()=>i_,ifc:()=>ir,VuI:()=>ET,LMc:()=>DT,MMx:()=>fx,Lck:()=>Yw,eFA:()=>I1,G48:()=>JE,Gpc:()=>et,f3M:()=>st,$WT:()=>Er,MR2:()=>pu,_c5:()=>hT,qFp:()=>IT,rg0:()=>pc,c2e:()=>d1,zSh:()=>Yh,HDt:()=>h1,wAp:()=>wf,vHH:()=>ye,lri:()=>b1,rWj:()=>w1,cg1:()=>Fy,kL8:()=>F0,dqk:()=>_n,Z0I:()=>Jn,eJc:()=>ev,QGY:()=>wy,F4k:()=>jv,RDi:()=>ya,AaK:()=>Ie,qOj:()=>_f,Xq5:()=>j,TTD:()=>N,_Bn:()=>ux,jDz:()=>px,xp6:()=>ic,uIk:()=>nn,ekj:()=>Sy,Suo:()=>Vx,Xpm:()=>go,lG2:()=>ds,Yz7:()=>Ut,cJS:()=>gn,oAB:()=>Jr,Yjl:()=>xo,Y36:()=>zl,_UZ:()=>xy,GkF:()=>by,BQk:()=>Wg,ynx:()=>Hg,qZA:()=>Gg,TgZ:()=>jl,EpF:()=>Zv,n5z:()=>mo,LFG:()=>Ui,$8M:()=>Ds,$Z:()=>dd,NdJ:()=>Cy,CRH:()=>$x,oxw:()=>Wv,ALo:()=>Ix,lcZ:()=>Mx,xi3:()=>Ax,Hsn:()=>Yv,F$t:()=>qv,Q6J:()=>Tu,s9C:()=>Ey,DdM:()=>bx,iGM:()=>Zx,MAs:()=>ua,KtG:()=>Gl,CHM:()=>sl,LSH:()=>Mc,P3R:()=>$m,Udp:()=>Ay,YNc:()=>yf,_uU:()=>y0,Oqu:()=>Oy,hij:()=>Jg,AsE:()=>Ry,lnq:()=>Ly,HOy:()=>ky,Gf:()=>jx});var x=k(8645),h=k(7394),y=k(5619),s=k(5592),J=k(7537),ie=k(4829),Y=k(6232),E=k(4564),Ne=k(7715),he=k(2096),_e=k(3020),ee=k(4664),ae=k(3997);function oe(t){for(let o in t)if(t[o]===oe)return o;throw Error("Could not find renamed property on target object.")}function Be(t,o){for(const l in o)o.hasOwnProperty(l)&&!t.hasOwnProperty(l)&&(t[l]=o[l])}function Ie(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(Ie).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const o=t.toString();if(null==o)return""+o;const l=o.indexOf("\n");return-1===l?o:o.substring(0,l)}function Ee(t,o){return null==t||""===t?null===o?"":o:null==o||""===o?t:t+" "+o}const Ue=oe({__forward_ref__:oe});function et(t){return t.__forward_ref__=et,t.toString=function(){return Ie(this())},t}function le(t){return ue(t)?t():t}function ue(t){return"function"==typeof t&&t.hasOwnProperty(Ue)&&t.__forward_ref__===et}function ct(t){return t&&!!t.\u0275providers}const Le="https://g.co/ng/security#xss";class ye extends Error{constructor(o,l){super(function gt(t,o){return`NG0${Math.abs(t)}${o?": "+o:""}`}(o,l)),this.code=o}}function Te(t){return"string"==typeof t?t:null==t?"":String(t)}function hn(t,o){throw new ye(-201,!1)}function kt(t,o){null==t&&function dt(t,o,l,d){throw new Error(`ASSERTION ERROR: ${t}`+(null==d?"":` [Expected=> ${l} ${d} ${o} <=Actual]`))}(o,t,null,"!=")}function Ut(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function gn(t){return{providers:t.providers||[],imports:t.imports||[]}}function Ft(t){return Wt(t,ln)||Wt(t,er)}function Jn(t){return null!==Ft(t)}function Wt(t,o){return t.hasOwnProperty(o)?t[o]:null}function vt(t){return t&&(t.hasOwnProperty(ni)||t.hasOwnProperty(lr))?t[ni]:null}const ln=oe({\u0275prov:oe}),ni=oe({\u0275inj:oe}),er=oe({ngInjectableDef:oe}),lr=oe({ngInjectorDef:oe});var mi=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(mi||{});let Fi;function Mn(t){const o=Fi;return Fi=t,o}function qn(t,o,l){const d=Ft(t);return d&&"root"==d.providedIn?void 0===d.value?d.value=d.factory():d.value:l&mi.Optional?null:void 0!==o?o:void hn(Ie(t))}const _n=globalThis,pe={},ze="__NG_DI_FLAG__",xe="ngTempTokenPath",Ze=/\n/gm,bn="__source";let Kn;function wi(t){const o=Kn;return Kn=t,o}function cr(t,o=mi.Default){if(void 0===Kn)throw new ye(-203,!1);return null===Kn?qn(t,void 0,o):Kn.get(t,o&mi.Optional?null:void 0,o)}function Ui(t,o=mi.Default){return(function Cn(){return Fi}()||cr)(le(t),o)}function st(t,o=mi.Default){return Ui(t,pn(o))}function pn(t){return typeof t>"u"||"number"==typeof t?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function mn(t){const o=[];for(let l=0;lo){P=C-1;break}}}for(;CC?"":g[at+1].toLowerCase();const rn=8&d?Nt:null;if(rn&&-1!==xr(rn,re,0)||2&d&&re!==Nt){if(lt(d))return!1;P=!0}}}}else{if(!P&&!lt(d)&&!lt(V))return!1;if(P&<(V))continue;P=!1,d=V|1&d}}return lt(d)||P}function lt(t){return 0==(1&t)}function an(t,o,l,d){if(null===o)return-1;let g=0;if(d||!l){let C=!1;for(;g-1)for(l++;l0?'="'+F+'"':"")+"]"}else 8&d?g+="."+P:4&d&&(g+=" "+P);else""!==g&&!lt(P)&&(o+=di(C,g),g=""),d=P,C=C||!lt(d);l++}return""!==g&&(o+=di(C,g)),o}function go(t){return Li(()=>{const o=Gs(t),l={...o,decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection===bi.OnPush,directiveDefs:null,pipeDefs:null,dependencies:o.standalone&&t.dependencies||null,getStandaloneInjector:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||ir.Emulated,styles:t.styles||vi,_:null,schemas:t.schemas||null,tView:null,id:""};Po(l);const d=t.dependencies;return l.directiveDefs=Hr(d,!1),l.pipeDefs=Hr(d,!0),l.id=function bs(t){let o=0;const l=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,t.consts,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery].join("|");for(const g of l)o=Math.imul(31,o)+g.charCodeAt(0)<<0;return o+=2147483648,"c"+o}(l),l})}function co(t){return zi(t)||Fr(t)}function uo(t){return null!==t}function Jr(t){return Li(()=>({type:t.type,bootstrap:t.bootstrap||vi,declarations:t.declarations||vi,imports:t.imports||vi,exports:t.exports||vi,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null}))}function To(t,o){if(null==t)return Dr;const l={};for(const d in t)if(t.hasOwnProperty(d)){let g=t[d],C=g;Array.isArray(g)&&(C=g[1],g=g[0]),l[g]=d,o&&(o[g]=C)}return l}function ds(t){return Li(()=>{const o=Gs(t);return Po(o),o})}function xo(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,standalone:!0===t.standalone,onDestroy:t.type.prototype.ngOnDestroy||null}}function zi(t){return t[Ar]||null}function Fr(t){return t[qi]||null}function Or(t){return t[Bi]||null}function Er(t){const o=zi(t)||Fr(t)||Or(t);return null!==o&&o.standalone}function so(t,o){const l=t[Kt]||null;if(!l&&!0===o)throw new Error(`Type ${Ie(t)} does not have '\u0275mod' property.`);return l}function Gs(t){const o={};return{type:t.type,providersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:o,inputTransforms:null,inputConfig:t.inputs||Dr,exportAs:t.exportAs||null,standalone:!0===t.standalone,signals:!0===t.signals,selectors:t.selectors||vi,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:To(t.inputs,o),outputs:To(t.outputs)}}function Po(t){t.features?.forEach(o=>o(t))}function Hr(t,o){if(!t)return null;const l=o?Or:co;return()=>("function"==typeof t?t():t).map(d=>l(d)).filter(uo)}const gr=0,li=1,Zi=2,Rr=3,_o=4,rs=5,zr=6,ko=7,br=8,bo=9,Oo=10,Ti=11,Ns=12,Xo=13,os=14,Br=15,zs=16,ws=17,Fo=18,Ho=19,hr=20,Ps=21,Qo=22,hs=23,Cs=24,or=25,Os=1,ia=2,Ur=7,Do=9,Io=11;function Bo(t){return Array.isArray(t)&&"object"==typeof t[Os]}function yo(t){return Array.isArray(t)&&!0===t[Os]}function ra(t){return 0!=(4&t.flags)}function Rs(t){return t.componentOffset>-1}function Ls(t){return 1==(1&t.flags)}function ki(t){return!!t.template}function Ws(t){return 0!=(512&t[Zi])}function ha(t,o){return t.hasOwnProperty(Wi)?t[Wi]:null}let Na=_n.WeakRef??class fa{constructor(o){this.ref=o}deref(){return this.ref}},hc=0,Us=null,nl=!1;function Ao(t){const o=Us;return Us=t,o}class za{constructor(){this.id=hc++,this.ref=function xl(t){return new Na(t)}(this),this.producers=new Map,this.consumers=new Map,this.trackingVersion=0,this.valueVersion=0}consumerPollProducersForChange(){for(const[o,l]of this.producers){const d=l.producerNode.deref();if(null!=d&&l.atTrackingVersion===this.trackingVersion){if(d.producerPollStatus(l.seenValueVersion))return!0}else this.producers.delete(o),d?.consumers.delete(this.id)}return!1}producerMayHaveChanged(){const o=nl;nl=!0;try{for(const[l,d]of this.consumers){const g=d.consumerNode.deref();null!=g&&g.trackingVersion===d.atTrackingVersion?g.onConsumerDependencyMayHaveChanged():(this.consumers.delete(l),g?.producers.delete(this.id))}}finally{nl=o}}producerAccessed(){if(nl)throw new Error("");if(null===Us)return;let o=Us.producers.get(this.id);void 0===o?(o={consumerNode:Us.ref,producerNode:this.ref,seenValueVersion:this.valueVersion,atTrackingVersion:Us.trackingVersion},Us.producers.set(this.id,o),this.consumers.set(Us.id,o)):(o.seenValueVersion=this.valueVersion,o.atTrackingVersion=Us.trackingVersion)}get hasProducers(){return this.producers.size>0}get producerUpdatesAllowed(){return!1!==Us?.consumerAllowSignalWrites}producerPollStatus(o){return this.valueVersion!==o||(this.onProducerUpdateValueVersion(),this.valueVersion!==o)}}let Gc=null;function pc(t){const o=Ao(null);try{return t()}finally{Ao(o)}}const qs=()=>{};class Ta extends za{constructor(o,l,d){super(),this.watch=o,this.schedule=l,this.dirty=!1,this.cleanupFn=qs,this.registerOnCleanup=g=>{this.cleanupFn=g},this.consumerAllowSignalWrites=d}notify(){this.dirty||this.schedule(this),this.dirty=!0}onConsumerDependencyMayHaveChanged(){this.notify()}onProducerUpdateValueVersion(){}run(){if(this.dirty=!1,0!==this.trackingVersion&&!this.consumerPollProducersForChange())return;const o=Ao(this);this.trackingVersion++;try{this.cleanupFn(),this.cleanupFn=qs,this.watch(this.registerOnCleanup)}finally{Ao(o)}}cleanup(){this.cleanupFn()}}class Zs{constructor(o,l,d){this.previousValue=o,this.currentValue=l,this.firstChange=d}isFirstChange(){return this.firstChange}}function N(){return ne}function ne(t){return t.type.prototype.ngOnChanges&&(t.setInput=Q),it}function it(){const t=At(this),o=t?.current;if(o){const l=t.previous;if(l===Dr)t.previous=o;else for(let d in o)l[d]=o[d];t.current=null,this.ngOnChanges(o)}}function Q(t,o,l,d){const g=this.declaredInputs[l],C=At(t)||function cn(t,o){return t[He]=o}(t,{previous:Dr,current:null}),P=C.current||(C.current={}),F=C.previous,V=F[g];P[g]=new Zs(V&&V.currentValue,o,F===Dr),t[d]=o}N.ngInherit=!0;const He="__ngSimpleChanges__";function At(t){return t[He]||null}const Xi=function(t,o,l){};function Vi(t){for(;Array.isArray(t);)t=t[gr];return t}function ho(t,o){return Vi(o[t])}function ao(t,o){return Vi(o[t.index])}function ss(t,o){return t.data[o]}function No(t,o){return t[o]}function fo(t,o){const l=o[t];return Bo(l)?l:l[gr]}function ai(t,o){return null==o?null:t[o]}function Js(t){t[ws]=0}function Su(t){1024&t[Zi]||(t[Zi]|=1024,Cl(t,1))}function es(t){1024&t[Zi]&&(t[Zi]&=-1025,Cl(t,-1))}function Cl(t,o){let l=t[Rr];if(null===l)return;l[rs]+=o;let d=l;for(l=l[Rr];null!==l&&(1===o&&1===d[rs]||-1===o&&0===d[rs]);)l[rs]+=o,d=l,l=l[Rr]}const $i={lFrame:Ml(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function Tl(){return $i.bindingsEnabled}function rl(){return null!==$i.skipHydrationRootTNode}function jn(){return $i.lFrame.lView}function wr(){return $i.lFrame.tView}function sl(t){return $i.lFrame.contextLView=t,t[br]}function Gl(t){return $i.lFrame.contextLView=null,t}function Uo(){let t=yc();for(;null!==t&&64===t.type;)t=t.parent;return t}function yc(){return $i.lFrame.currentTNode}function ms(t,o){const l=$i.lFrame;l.currentTNode=t,l.isParent=o}function Hl(){return $i.lFrame.isParent}function vc(){$i.lFrame.isParent=!1}function gs(){const t=$i.lFrame;let o=t.bindingRootIndex;return-1===o&&(o=t.bindingRootIndex=t.tView.bindingStartIndex),o}function Da(){return $i.lFrame.bindingIndex}function Il(){return $i.lFrame.bindingIndex++}function pa(t){const o=$i.lFrame,l=o.bindingIndex;return o.bindingIndex=o.bindingIndex+t,l}function Ks(t,o){const l=$i.lFrame;l.bindingIndex=l.bindingRootIndex=t,Yc(o)}function Yc(t){$i.lFrame.currentDirectiveIndex=t}function Xs(){return $i.lFrame.currentQueryIndex}function Ia(t){$i.lFrame.currentQueryIndex=t}function Jc(t){const o=t[li];return 2===o.type?o.declTNode:1===o.type?t[zr]:null}function ui(t,o,l){if(l&mi.SkipSelf){let g=o,C=t;for(;!(g=g.parent,null!==g||l&mi.Host||(g=Jc(C),null===g||(C=C[os],10&g.type))););if(null===g)return!1;o=g,t=C}const d=$i.lFrame=Kc();return d.currentTNode=o,d.lView=t,!0}function xc(t){const o=Kc(),l=t[li];$i.lFrame=o,o.currentTNode=l.firstChild,o.lView=t,o.tView=l,o.contextLView=t,o.bindingIndex=l.bindingStartIndex,o.inI18n=!1}function Kc(){const t=$i.lFrame,o=null===t?null:t.child;return null===o?Ml(t):o}function Ml(t){const o={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=o),o}function al(){const t=$i.lFrame;return $i.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const R=al;function U(){const t=al();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function K(){return $i.lFrame.selectedIndex}function Me(t){$i.lFrame.selectedIndex=t}function Ge(){const t=$i.lFrame;return ss(t.tView,t.selectedIndex)}let po=!0;function f(){return po}function r(t){po=t}function m(t,o){for(let l=o.directiveStart,d=o.directiveEnd;l=d)break}else o[V]<0&&(t[ws]+=65536),(F>13>16&&(3&t[Zi])===o&&(t[Zi]+=8192,Z(F,C)):Z(F,C)}const W=-1;class se{constructor(o,l,d){this.factory=o,this.resolving=!1,this.canSeeViewProviders=l,this.injectImpl=d}}function ot(t){return t!==W}function Tt(t){return 32767&t}function Dt(t,o){let l=function Mt(t){return t>>16}(t),d=o;for(;l>0;)d=d[os],l--;return d}let $t=!0;function zt(t){const o=$t;return $t=t,o}const Vn=255,on=5;let Rn=0;const un={};function sn(t,o){const l=Gn(t,o);if(-1!==l)return l;const d=o[li];d.firstCreatePass&&(t.injectorIndex=o.length,An(d.data,t),An(o,null),An(d.blueprint,null));const g=Ln(t,o),C=t.injectorIndex;if(ot(g)){const P=Tt(g),F=Dt(g,o),V=F[li].data;for(let re=0;re<8;re++)o[C+re]=F[P+re]|V[P+re]}return o[C+8]=g,C}function An(t,o){t.push(0,0,0,0,0,0,0,0,o)}function Gn(t,o){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===o[t.injectorIndex+8]?-1:t.injectorIndex}function Ln(t,o){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let l=0,d=null,g=o;for(;null!==g;){if(d=Zo(g),null===d)return W;if(l++,g=g[os],-1!==d.injectorIndex)return d.injectorIndex|l<<16}return W}function Wn(t,o,l){!function Zn(t,o,l){let d;"string"==typeof l?d=l.charCodeAt(0)||0:l.hasOwnProperty(rr)&&(d=l[rr]),null==d&&(d=l[rr]=Rn++);const g=d&Vn;o.data[t+(g>>on)]|=1<=0?o&Vn:ja:o}(l);if("function"==typeof C){if(!ui(o,t,d))return d&mi.Host?Gi(g,0,d):hi(o,l,d,g);try{let P;if(P=C(d),null!=P||d&mi.Optional)return P;hn()}finally{R()}}else if("number"==typeof C){let P=null,F=Gn(t,o),V=W,re=d&mi.Host?o[Br][zr]:null;for((-1===F||d&mi.SkipSelf)&&(V=-1===F?Ln(t,o):o[F+8],V!==W&&qr(d,!1)?(P=o[li],F=Tt(V),o=Dt(V,o)):F=-1);-1!==F;){const Se=o[li];if(Wr(C,F,Se.data)){const at=dr(F,o,l,P,d,re);if(at!==un)return at}V=o[F+8],V!==W&&qr(d,o[li].data[F+8]===re)&&Wr(C,F,o)?(P=Se,F=Tt(V),o=Dt(V,o)):F=-1}}return g}function dr(t,o,l,d,g,C){const P=o[li],F=P.data[t+8],Se=xi(F,P,l,null==d?Rs(F)&&$t:d!=P&&0!=(3&F.type),g&mi.Host&&C===F);return null!==Se?Cr(o,P,Se,F):un}function xi(t,o,l,d,g){const C=t.providerIndexes,P=o.data,F=1048575&C,V=t.directiveStart,Se=C>>20,Nt=g?F+Se:t.directiveEnd;for(let rn=d?F:F+Se;rn=V&&kn.type===l)return rn}if(g){const rn=P[V];if(rn&&ki(rn)&&rn.type===l)return V}return null}function Cr(t,o,l,d){let g=t[l];const C=o.data;if(function Oe(t){return t instanceof se}(g)){const P=g;P.resolving&&function Ae(t,o){const l=o?`. Dependency path: ${o.join(" > ")} > ${t}`:"";throw new ye(-200,`Circular dependency in DI detected for ${t}${l}`)}(function Pe(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():Te(t)}(C[l]));const F=zt(P.canSeeViewProviders);P.resolving=!0;const re=P.injectImpl?Mn(P.injectImpl):null;ui(t,d,mi.Default);try{g=t[l]=P.factory(void 0,C,t,d),o.firstCreatePass&&l>=d.directiveStart&&function c(t,o,l){const{ngOnChanges:d,ngOnInit:g,ngDoCheck:C}=o.type.prototype;if(d){const P=ne(o);(l.preOrderHooks??=[]).push(t,P),(l.preOrderCheckHooks??=[]).push(t,P)}g&&(l.preOrderHooks??=[]).push(0-t,g),C&&((l.preOrderHooks??=[]).push(t,C),(l.preOrderCheckHooks??=[]).push(t,C))}(l,C[l],o)}finally{null!==re&&Mn(re),zt(F),P.resolving=!1,R()}}return g}function Wr(t,o,l){return!!(l[o+(t>>on)]&1<{const o=t.prototype.constructor,l=o[Wi]||jr(o),d=Object.prototype;let g=Object.getPrototypeOf(t.prototype).constructor;for(;g&&g!==d;){const C=g[Wi]||jr(g);if(C&&C!==l)return C;g=Object.getPrototypeOf(g)}return C=>new C})}function jr(t){return ue(t)?()=>{const o=jr(le(t));return o&&o()}:ha(t)}function Zo(t){const o=t[li],l=o.type;return 2===l?o.declTNode:1===l?t[zr]:null}function Ds(t){return function Di(t,o){if("class"===o)return t.classes;if("style"===o)return t.styles;const l=t.attrs;if(l){const d=l.length;let g=0;for(;g{const d=function Wl(t){return function(...l){if(t){const d=t(...l);for(const g in d)this[g]=d[g]}}}(o);function g(...C){if(this instanceof g)return d.apply(this,C),this;const P=new g(...C);return F.annotation=P,F;function F(V,re,Se){const at=V.hasOwnProperty(ls)?V[ls]:Object.defineProperty(V,ls,{value:[]})[ls];for(;at.length<=Se;)at.push(null);return(at[Se]=at[Se]||[]).push(P),V}}return l&&(g.prototype=Object.create(l.prototype)),g.prototype.ngMetadataName=t,g.annotationCls=g,g})}function Xc(t,o){t.forEach(l=>Array.isArray(l)?Xc(l,o):o(l))}function am(t,o,l){o>=t.length?t.push(l):t.splice(o,0,l)}function Ch(t,o){return o>=t.length-1?t.pop():t.splice(o,1)[0]}function Td(t,o){const l=[];for(let d=0;d=0?t[1|d]=l:(d=~d,function ku(t,o,l,d){let g=t.length;if(g==o)t.push(l,d);else if(1===g)t.push(d,t[0]),t[0]=l;else{for(g--,t.push(t[g-1],t[g]);g>o;)t[g]=t[g-2],g--;t[o]=l,t[o+1]=d}}(t,d,o,l)),d}function Sl(t,o){const l=Sa(t,o);if(l>=0)return t[1|l]}function Sa(t,o){return function lm(t,o,l){let d=0,g=t.length>>l;for(;g!==d;){const C=d+(g-d>>1),P=t[C<o?g=C:d=C+1}return~(g<|^->||--!>|)/,Bf="\u200b$1\u200b";const Ha=new Map;let b_=0;const Od="__ngContext__";function Ro(t,o){Bo(o)?(t[Od]=o[Ho],function Pd(t){Ha.set(t[Ho],t)}(o)):t[Od]=o}let su;function Ld(t,o){return su(t,o)}function Ol(t){const o=t[Rr];return yo(o)?o[Rr]:o}function Vf(t){return xm(t[Ns])}function vm(t){return xm(t[_o])}function xm(t){for(;null!==t&&!yo(t);)t=t[_o];return t}function Rl(t,o,l,d,g){if(null!=d){let C,P=!1;yo(d)?C=d:Bo(d)&&(P=!0,d=d[gr]);const F=Vi(d);0===t&&null!==l?null==g?Cm(o,l,F):Dc(o,l,F,g||null,!0):1===t&&null!==l?Dc(o,l,F,g||null,!0):2===t?function Bl(t,o,l){const d=lu(t,o);d&&function au(t,o,l,d){t.removeChild(o,l,d)}(t,d,o,l)}(o,F,P):3===t&&o.destroyNode(F),null!=C&&function Tm(t,o,l,d,g){const C=l[Ur];C!==Vi(l)&&Rl(o,t,d,C,g);for(let F=Io;Fo.replace(ta,Bf))}(o))}function $u(t,o,l){return t.createElement(o,l)}function Is(t,o){const l=t[Do],d=l.indexOf(o);es(o),l.splice(d,1)}function Fd(t,o){if(t.length<=Io)return;const l=Io+o,d=t[l];if(d){const g=d[zs];null!==g&&g!==t&&Is(g,d),o>0&&(t[l-1][_o]=d[_o]);const C=Ch(t,Io+o);!function Ll(t,o){Nl(t,o,o[Ti],2,null,null),o[gr]=null,o[zr]=null}(d[li],d);const P=C[Fo];null!==P&&P.detachView(C[li]),d[Rr]=null,d[_o]=null,d[Zi]&=-129}return d}function Tc(t,o){if(!(256&o[Zi])){const l=o[Ti];o[hs]?.destroy(),o[Cs]?.destroy(),l.destroyNode&&Nl(t,o,l,3,null,null),function Oa(t){let o=t[Ns];if(!o)return Bd(t[li],t);for(;o;){let l=null;if(Bo(o))l=o[Ns];else{const d=o[Io];d&&(l=d)}if(!l){for(;o&&!o[_o]&&o!==t;)Bo(o)&&Bd(o[li],o),o=o[Rr];null===o&&(o=t),Bo(o)&&Bd(o[li],o),l=o&&o[_o]}o=l}}(o)}}function Bd(t,o){if(!(256&o[Zi])){o[Zi]&=-129,o[Zi]|=256,function $f(t,o){let l;if(null!=t&&null!=(l=t.destroyHooks))for(let d=0;d=0?d[P]():d[-P].unsubscribe(),C+=2}else l[C].call(d[l[C+1]]);null!==d&&(o[ko]=null);const g=o[Ps];if(null!==g){o[Ps]=null;for(let C=0;C-1){const{encapsulation:C}=t.data[d.directiveStart+g];if(C===ir.None||C===ir.Emulated)return null}return ao(d,l)}}(t,o.parent,l)}function Dc(t,o,l,d,g){t.insertBefore(o,l,d,g)}function Cm(t,o,l){t.appendChild(o,l)}function Fl(t,o,l,d,g){null!==d?Dc(t,o,l,d,g):Cm(t,o,l)}function lu(t,o){return t.parentNode(o)}function qf(t,o,l){return Yf(t,o,l)}let Jf,hl,Wu,Yf=function Em(t,o,l){return 40&t.type?ao(t,l):null};function Fh(t,o,l,d){const g=Gf(t,d,o),C=o[Ti],F=qf(d.parent||o[zr],d,o);if(null!=g)if(Array.isArray(l))for(let V=0;Vt,createScript:t=>t,createScriptURL:t=>t})}catch{}return Wu}()?.createScriptURL(t)||t}class zd{constructor(o){this.changingThisBreaksApplicationSecurity=o}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Le})`}}function Ic(t){return t instanceof zd?t.changingThisBreaksApplicationSecurity:t}function Zd(t,o){const l=function A_(t){return t instanceof zd&&t.getTypeName()||null}(t);if(null!=l&&l!==o){if("ResourceURL"===l&&"URL"===o)return!0;throw new Error(`Required a safe ${o}, got a ${l} (see ${Le})`)}return l===o}const Zh=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;var Kl=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}(Kl||{});function Mc(t){const o=hu();return o?o.sanitize(Kl.URL,t)||"":Zd(t,"URL")?Ic(t):function qu(t){return(t=String(t)).match(Zh)?t:"unsafe:"+t}(Te(t))}function Zm(t){const o=hu();if(o)return zh(o.sanitize(Kl.RESOURCE_URL,t)||"");if(Zd(t,"ResourceURL"))return zh(Ic(t));throw new ye(904,!1)}function $m(t,o,l){return function Vm(t,o){return"src"===o&&("embed"===t||"frame"===t||"iframe"===t||"media"===t||"script"===t)||"href"===o&&("base"===t||"link"===t)?Zm:Mc}(o,l)(t)}function hu(){const t=jn();return t&&t[Oo].sanitizer}class Gr{constructor(o,l){this._desc=o,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof l?this.__NG_ELEMENT_ID__=l:void 0!==l&&(this.\u0275prov=Ut({token:this,providedIn:l.providedIn||"root",factory:l.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}const Ac=new Gr("ENVIRONMENT_INITIALIZER"),Gm=new Gr("INJECTOR",-1),Hm=new Gr("INJECTOR_DEF_TYPES");class fu{get(o,l=pe){if(l===pe){const d=new Error(`NullInjectorError: No provider for ${Ie(o)}!`);throw d.name="NullInjectorError",d}return l}}function pu(t){return{\u0275providers:t}}function Wm(...t){return{\u0275providers:Ku(0,t),\u0275fromNgModule:!0}}function Ku(t,...o){const l=[],d=new Set;let g;const C=P=>{l.push(P)};return Xc(o,P=>{const F=P;Hh(F,C,[],d)&&(g||=[],g.push(F))}),void 0!==g&&cp(g,C),l}function cp(t,o){for(let l=0;l{o(C,d)})}}function Hh(t,o,l,d){if(!(t=le(t)))return!1;let g=null,C=vt(t);const P=!C&&zi(t);if(C||P){if(P&&!P.standalone)return!1;g=t}else{const V=t.ngModule;if(C=vt(V),!C)return!1;g=V}const F=d.has(g);if(P){if(F)return!1;if(d.add(g),P.dependencies){const V="function"==typeof P.dependencies?P.dependencies():P.dependencies;for(const re of V)Hh(re,o,l,d)}}else{if(!C)return!1;{if(null!=C.imports&&!F){let re;d.add(g);try{Xc(C.imports,Se=>{Hh(Se,o,l,d)&&(re||=[],re.push(Se))})}finally{}void 0!==re&&cp(re,o)}if(!F){const re=ha(g)||(()=>new g);o({provide:g,useFactory:re,deps:vi},g),o({provide:Hm,useValue:g,multi:!0},g),o({provide:Ac,useValue:()=>Ui(g),multi:!0},g)}const V=C.providers;if(null!=V&&!F){const re=t;Wh(V,Se=>{o(Se,re)})}}}return g!==t&&void 0!==t.providers}function Wh(t,o){for(let l of t)ct(l)&&(l=l.\u0275providers),Array.isArray(l)?Wh(l,o):o(l)}const qm=oe({provide:String,useValue:oe});function qh(t){return null!==t&&"object"==typeof t&&qm in t}function mu(t){return"function"==typeof t}const Yh=new Gr("Set Injector scope."),gu={},Ym={};let Bs;function Sc(){return void 0===Bs&&(Bs=new fu),Bs}class la{}class Pc extends la{get destroyed(){return this._destroyed}constructor(o,l,d,g){super(),this.parent=l,this.source=d,this.scopes=g,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,Qu(o,P=>this.processProvider(P)),this.records.set(Gm,Xu(void 0,this)),g.has("environment")&&this.records.set(la,Xu(void 0,this));const C=this.records.get(Yh);null!=C&&"string"==typeof C.value&&this.scopes.add(C.value),this.injectorDefTypes=new Set(this.get(Hm.multi,vi,mi.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const l of this._ngOnDestroyHooks)l.ngOnDestroy();const o=this._onDestroyHooks;this._onDestroyHooks=[];for(const l of o)l()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear()}}onDestroy(o){return this.assertNotDestroyed(),this._onDestroyHooks.push(o),()=>this.removeOnDestroy(o)}runInContext(o){this.assertNotDestroyed();const l=wi(this),d=Mn(void 0);try{return o()}finally{wi(l),Mn(d)}}get(o,l=pe,d=mi.Default){if(this.assertNotDestroyed(),o.hasOwnProperty(yr))return o[yr](this);d=pn(d);const C=wi(this),P=Mn(void 0);try{if(!(d&mi.SkipSelf)){let V=this.records.get(o);if(void 0===V){const re=function Z_(t){return"function"==typeof t||"object"==typeof t&&t instanceof Gr}(o)&&Ft(o);V=re&&this.injectableDefInScope(re)?Xu(Jh(o),gu):null,this.records.set(o,V)}if(null!=V)return this.hydrate(o,V)}return(d&mi.Self?Sc():this.parent).get(o,l=d&mi.Optional&&l===pe?null:l)}catch(F){if("NullInjectorError"===F.name){if((F[xe]=F[xe]||[]).unshift(Ie(o)),C)throw F;return function gi(t,o,l,d){const g=t[xe];throw o[bn]&&g.unshift(o[bn]),t.message=function _i(t,o,l,d=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.slice(2):t;let g=Ie(o);if(Array.isArray(o))g=o.map(Ie).join(" -> ");else if("object"==typeof o){let C=[];for(let P in o)if(o.hasOwnProperty(P)){let F=o[P];C.push(P+":"+("string"==typeof F?JSON.stringify(F):Ie(F)))}g=`{${C.join(", ")}}`}return`${l}${d?"("+d+")":""}[${g}]: ${t.replace(Ze,"\n ")}`}("\n"+t.message,g,l,d),t.ngTokenPath=g,t[xe]=null,t}(F,o,"R3InjectorError",this.source)}throw F}finally{Mn(P),wi(C)}}resolveInjectorInitializers(){const o=wi(this),l=Mn(void 0);try{const g=this.get(Ac.multi,vi,mi.Self);for(const C of g)C()}finally{wi(o),Mn(l)}}toString(){const o=[],l=this.records;for(const d of l.keys())o.push(Ie(d));return`R3Injector[${o.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new ye(205,!1)}processProvider(o){let l=mu(o=le(o))?o:le(o&&o.provide);const d=function N_(t){return qh(t)?Xu(void 0,t.useValue):Xu(Km(t),gu)}(o);if(mu(o)||!0!==o.multi)this.records.get(l);else{let g=this.records.get(l);g||(g=Xu(void 0,gu,!0),g.factory=()=>mn(g.multi),this.records.set(l,g)),l=o,g.multi.push(o)}this.records.set(l,d)}hydrate(o,l){return l.value===gu&&(l.value=Ym,l.value=l.factory()),"object"==typeof l.value&&l.value&&function U_(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(l.value)&&this._ngOnDestroyHooks.add(l.value),l.value}injectableDefInScope(o){if(!o.providedIn)return!1;const l=le(o.providedIn);return"string"==typeof l?"any"===l||this.scopes.has(l):this.injectorDefTypes.has(l)}removeOnDestroy(o){const l=this._onDestroyHooks.indexOf(o);-1!==l&&this._onDestroyHooks.splice(l,1)}}function Jh(t){const o=Ft(t),l=null!==o?o.factory:ha(t);if(null!==l)return l;if(t instanceof Gr)throw new ye(204,!1);if(t instanceof Function)return function Jm(t){const o=t.length;if(o>0)throw Td(o,"?"),new ye(204,!1);const l=function wt(t){return t&&(t[ln]||t[er])||null}(t);return null!==l?()=>l.factory(t):()=>new t}(t);throw new ye(204,!1)}function Km(t,o,l){let d;if(mu(t)){const g=le(t);return ha(g)||Jh(g)}if(qh(t))d=()=>le(t.useValue);else if(function dp(t){return!(!t||!t.useFactory)}(t))d=()=>t.useFactory(...mn(t.deps||[]));else if(function up(t){return!(!t||!t.useExisting)}(t))d=()=>Ui(le(t.useExisting));else{const g=le(t&&(t.useClass||t.provide));if(!function z_(t){return!!t.deps}(t))return ha(g)||Jh(g);d=()=>new g(...mn(t.deps))}return d}function Xu(t,o,l=!1){return{factory:t,value:o,multi:l?[]:void 0}}function Qu(t,o){for(const l of t)Array.isArray(l)?Qu(l,o):l&&ct(l)?Qu(l.\u0275providers,o):o(l)}const Xm=new Gr("AppId",{providedIn:"root",factory:()=>Qm}),Qm="ng",hp=new Gr("Platform Initializer"),Kh=new Gr("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),j_=new Gr("CSP nonce",{providedIn:"root",factory:()=>function Hu(){if(void 0!==hl)return hl;if(typeof document<"u")return document;throw new ye(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let pp=(t,o,l)=>null;function ef(t,o,l=!1){return pp(t,o,l)}class rg{}class Wd{}class J_{resolveComponentFactory(o){throw function gp(t){const o=Error(`No component factory found for ${Ie(t)}.`);return o.ngComponent=t,o}(o)}}let qd=(()=>{class o{}return o.NULL=new J_,o})();function _p(){return ys(Uo(),jn())}function ys(t,o){return new yu(ao(t,o))}let yu=(()=>{class o{constructor(d){this.nativeElement=d}}return o.__NG_ELEMENT_ID__=_p,o})();function sg(t){return t instanceof yu?t.nativeElement:t}class va{}let ag=(()=>{class o{constructor(){this.destroyNode=null}}return o.__NG_ELEMENT_ID__=()=>function Yd(){const t=jn(),l=fo(Uo().index,t);return(Bo(l)?l:t)[Ti]}(),o})(),nd=(()=>{var t;class o{}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:()=>null}),o})();class nf{constructor(o){this.full=o,this.major=o.split(".")[0],this.minor=o.split(".")[1],this.patch=o.split(".").slice(2).join(".")}}const rf=new nf("16.2.2"),yp={};function vp(t,o=null,l=null,d){const g=xp(t,o,l,d);return g.resolveInjectorInitializers(),g}function xp(t,o=null,l=null,d,g=new Set){const C=[l||vi,Wm(t)];return d=d||("object"==typeof t?void 0:Ie(t)),new Pc(C,o||Sc(),d||null,g)}let qa=(()=>{var t;class o{static create(d,g){if(Array.isArray(d))return vp({name:""},g,d,"");{const C=d.name??"";return vp({name:C},d.parent,d.providers,C)}}}return(t=o).THROW_IF_NOT_FOUND=pe,t.NULL=new fu,t.\u0275prov=Ut({token:t,providedIn:"any",factory:()=>Ui(Gm)}),t.__NG_ELEMENT_ID__=-1,o})();function As(t){return t instanceof Function?t():t}let od=(()=>{var t;class o{constructor(){this.callbacks=new Set,this.deferredCallbacks=new Set,this.renderDepth=0,this.runningCallbacks=!1}begin(){if(this.runningCallbacks)throw new ye(102,!1);this.renderDepth++}end(){if(this.renderDepth--,0===this.renderDepth)try{this.runningCallbacks=!0;for(const d of this.callbacks)d.invoke()}finally{this.runningCallbacks=!1;for(const d of this.deferredCallbacks)this.callbacks.add(d);this.deferredCallbacks.clear()}}register(d){(this.runningCallbacks?this.deferredCallbacks:this.callbacks).add(d)}unregister(d){this.callbacks.delete(d),this.deferredCallbacks.delete(d)}ngOnDestroy(){this.callbacks.clear(),this.deferredCallbacks.clear()}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:()=>new t}),o})();function sd(t){for(;t;){t[Zi]|=64;const o=Ol(t);if(Ws(t)&&!o)return t;t=o}return null}function Tp(t){return t.ngOriginalError}class ad{constructor(){this._console=console}handleError(o){const l=this._findOriginalError(o);this._console.error("ERROR",o),l&&this._console.error("ORIGINAL ERROR",l)}_findOriginalError(o){let l=o&&Tp(o);for(;l&&Tp(l);)l=Tp(l);return l||null}}const gg=new Gr("",{providedIn:"root",factory:()=>!1});class Xd extends za{constructor(){super(...arguments),this.consumerAllowSignalWrites=!1,this._lView=null}set lView(o){this._lView=o}onConsumerDependencyMayHaveChanged(){sd(this._lView)}onProducerUpdateValueVersion(){}get hasReadASignal(){return this.hasProducers}runInContext(o,l,d){const g=Ao(this);this.trackingVersion++;try{o(l,d)}finally{Ao(g)}}destroy(){this.trackingVersion++}}let ud=null;function _g(){return ud??=new Xd,ud}function Sp(t,o){return t[o]??_g()}function kc(t,o){const l=_g();l.hasReadASignal&&(t[o]=ud,l.lView=t,ud=new Xd)}const _r={};function ic(t){yg(wr(),jn(),K()+t,!1)}function yg(t,o,l,d){if(!d)if(3==(3&o[Zi])){const C=t.preOrderCheckHooks;null!==C&&b(o,C,l)}else{const C=t.preOrderHooks;null!==C&&T(o,C,0,l)}Me(l)}function zl(t,o=mi.Default){const l=jn();return null===l?Ui(t,o):Pi(Uo(),l,le(t),o)}function dd(){throw new Error("invalid")}function Fc(t,o,l,d,g,C,P,F,V,re,Se){const at=o.blueprint.slice();return at[gr]=g,at[Zi]=140|d,(null!==re||t&&2048&t[Zi])&&(at[Zi]|=2048),Js(at),at[Rr]=at[os]=t,at[br]=l,at[Oo]=P||t&&t[Oo],at[Ti]=F||t&&t[Ti],at[bo]=V||t&&t[bo]||null,at[zr]=C,at[Ho]=function ru(){return b_++}(),at[Qo]=Se,at[hr]=re,at[Br]=2==o.type?t[Br]:at,at}function rc(t,o,l,d,g){let C=t.data[o];if(null===C)C=function Pp(t,o,l,d,g){const C=yc(),P=Hl(),V=t.data[o]=function df(t,o,l,d,g,C){let P=o?o.injectorIndex:-1,F=0;return rl()&&(F|=128),{type:l,index:d,insertBeforeIndex:null,injectorIndex:P,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:F,providerIndexes:0,value:g,attrs:C,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:o,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,P?C:C&&C.parent,l,o,d,g);return null===t.firstChild&&(t.firstChild=V),null!==C&&(P?null==C.child&&null!==V.parent&&(C.child=V):null===C.next&&(C.next=V,V.prev=C)),V}(t,o,l,d,g),function Cd(){return $i.lFrame.inI18n}()&&(C.flags|=32);else if(64&C.type){C.type=l,C.value=d,C.attrs=g;const P=function Dl(){const t=$i.lFrame,o=t.currentTNode;return t.isParent?o:o.parent}();C.injectorIndex=null===P?-1:P.injectorIndex}return ms(C,!0),C}function eh(t,o,l,d){if(0===l)return-1;const g=o.length;for(let C=0;Cor&&yg(t,o,or,!1),Xi(F?2:0,g),F)C.runInContext(l,d,g);else{const re=Ao(null);try{l(d,g)}finally{Ao(re)}}}finally{F&&null===o[hs]&&kc(o,hs),Me(P),Xi(F?3:1,g)}}function hd(t,o,l){if(ra(o)){const d=Ao(null);try{const C=o.directiveEnd;for(let P=o.directiveStart;Pnull;function th(t,o,l,d){for(let g in t)if(t.hasOwnProperty(g)){l=null===l?{}:l;const C=t[g];null===d?nh(l,o,g,C):d.hasOwnProperty(g)&&nh(l,o,d[g],C)}return l}function nh(t,o,l,d){t.hasOwnProperty(l)?t[l].push(o,d):t[l]=[o,d]}function ca(t,o,l,d,g,C,P,F){const V=ao(o,l);let Se,re=o.inputs;!F&&null!=re&&(Se=re[d])?(pf(t,l,Se,d,g),Rs(o)&&function Bc(t,o){const l=fo(o,t);16&l[Zi]||(l[Zi]|=64)}(l,o.index)):3&o.type&&(d=function kp(t){return"class"===t?"className":"for"===t?"htmlFor":"formaction"===t?"formAction":"innerHtml"===t?"innerHTML":"readonly"===t?"readOnly":"tabindex"===t?"tabIndex":t}(d),g=null!=P?P(g,o.value||"",d):g,C.setProperty(V,d,g))}function hf(t,o,l,d){if(Tl()){const g=null===d?null:{"":-1},C=function dy(t,o){const l=t.directiveRegistry;let d=null,g=null;if(l)for(let C=0;C0;){const l=t[--o];if("number"==typeof l&&l<0)return l}return 0})(P)!=F&&P.push(F),P.push(l,d,C)}}(t,o,d,eh(t,l,g.hostVars,_r),g)}function us(t,o,l,d,g,C){const P=ao(t,o);!function Ya(t,o,l,d,g,C,P){if(null==C)t.removeAttribute(o,g,l);else{const F=null==P?Te(C):P(C,d||"",g);t.setAttribute(o,g,F,l)}}(o[Ti],P,C,t.value,l,d,g)}function Nc(t,o,l,d,g,C){const P=C[o];if(null!==P)for(let F=0;F{var t;class o{constructor(){this.all=new Set,this.queue=new Map}create(d,g,C){const P=typeof Zone>"u"?null:Zone.current,F=new Ta(d,Se=>{this.all.has(Se)&&this.queue.set(Se,P)},C);let V;this.all.add(F),F.notify();const re=()=>{F.cleanup(),V?.(),this.all.delete(F),this.queue.delete(F)};return V=g?.onDestroy(re),{destroy:re}}flush(){if(0!==this.queue.size)for(const[d,g]of this.queue)this.queue.delete(d),g?g.run(()=>d.run()):d.run()}get isQueueEmpty(){return 0===this.queue.size}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:()=>new t}),o})();function wu(t,o,l){let d=l?t.styles:null,g=l?t.classes:null,C=0;if(null!==o)for(let P=0;P0){mf(t,1);const g=t[li].components;null!==g&&Vp(t,g,1)}}function Vp(t,o,l){for(let d=0;d-1&&(Fd(o,d),Ch(l,d))}this._attachedToViewContainer=!1}Tc(this._lView[li],this._lView)}onDestroy(o){!function zo(t,o){if(256==(256&t[Zi]))throw new ye(911,!1);null===t[Ps]&&(t[Ps]=[]),t[Ps].push(o)}(this._lView,o)}markForCheck(){sd(this._cdRefInjectingView||this._lView)}detach(){this._lView[Zi]&=-129}reattach(){this._lView[Zi]|=128}detectChanges(){oc(this._lView[li],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new ye(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function dl(t,o){Nl(t,o,o[Ti],2,null,null)}(this._lView[li],this._lView)}attachToAppRef(o){if(this._attachedToViewContainer)throw new ye(902,!1);this._appRef=o}}class ah extends fd{constructor(o){super(o),this._view=o}detectChanges(){const o=this._view;oc(o[li],o,o[br],!1)}checkNoChanges(){}get context(){return null}}class lh extends qd{constructor(o){super(),this.ngModule=o}resolveComponentFactory(o){const l=zi(o);return new pd(l,this.ngModule)}}function $p(t){const o=[];for(let l in t)t.hasOwnProperty(l)&&o.push({propName:t[l],templateName:l});return o}class gy{constructor(o,l){this.injector=o,this.parentInjector=l}get(o,l,d){d=pn(d);const g=this.injector.get(o,yp,d);return g!==yp||l===yp?g:this.parentInjector.get(o,l,d)}}class pd extends Wd{get inputs(){const o=this.componentDef,l=o.inputTransforms,d=$p(o.inputs);if(null!==l)for(const g of d)l.hasOwnProperty(g.propName)&&(g.transform=l[g.propName]);return d}get outputs(){return $p(this.componentDef.outputs)}constructor(o,l){super(),this.componentDef=o,this.ngModule=l,this.componentType=o.type,this.selector=function Ni(t){return t.map(Ai).join(",")}(o.selectors),this.ngContentSelectors=o.ngContentSelectors?o.ngContentSelectors:[],this.isBoundToModule=!!l}create(o,l,d,g){let C=(g=g||this.ngModule)instanceof la?g:g?.injector;C&&null!==this.componentDef.getStandaloneInjector&&(C=this.componentDef.getStandaloneInjector(C)||C);const P=C?new gy(o,C):o,F=P.get(va,null);if(null===F)throw new ye(407,!1);const at={rendererFactory:F,sanitizer:P.get(nd,null),effectManager:P.get(Og,null),afterRenderEventManager:P.get(od,null)},Nt=F.createRenderer(null,this.componentDef),rn=this.componentDef.selectors[0][0]||"div",kn=d?function iy(t,o,l,d){const C=d.get(gg,!1)||l===ir.ShadowDom,P=t.selectRootElement(o,C);return function xg(t){bg(t)}(P),P}(Nt,d,this.componentDef.encapsulation,P):$u(Nt,rn,function Lg(t){const o=t.toLowerCase();return"svg"===o?"svg":"math"===o?"math":null}(rn)),ji=this.componentDef.signals?4608:this.componentDef.onPush?576:528;let ei=null;null!==kn&&(ei=ef(kn,P,!0));const mr=Lp(0,null,null,1,0,null,null,null,null,null,null),Pr=Fc(null,mr,null,ji,null,null,at,Nt,P,null,ei);let Co,Xa;xc(Pr);try{const Du=this.componentDef;let If,bv=null;Du.findHostDirectiveDefs?(If=[],bv=new Map,Du.findHostDirectiveDefs(Du,If,bv),If.push(Du)):If=[Du];const MT=function Fg(t,o){const l=t[li],d=or;return t[d]=o,rc(l,d,2,"#host",null)}(Pr,kn),AT=function _y(t,o,l,d,g,C,P){const F=g[li];!function Gp(t,o,l,d){for(const g of t)o.mergedAttrs=to(o.mergedAttrs,g.hostAttrs);null!==o.mergedAttrs&&(wu(o,o.mergedAttrs,!0),null!==l&&Dm(d,l,o))}(d,t,o,P);let V=null;null!==o&&(V=ef(o,g[bo]));const re=C.rendererFactory.createRenderer(o,l);let Se=16;l.signals?Se=4096:l.onPush&&(Se=64);const at=Fc(g,Rp(l),null,Se,g[t.index],t,C,re,null,null,V);return F.firstCreatePass&&bu(F,t,d.length-1),oh(g,at),g[t.index]=at}(MT,kn,Du,If,Pr,at,Nt);Xa=ss(mr,or),kn&&function Ng(t,o,l,d){if(d)Sr(t,l,["ng-version",rf.full]);else{const{attrs:g,classes:C}=function vr(t){const o=[],l=[];let d=1,g=2;for(;d0&&tp(t,l,C.join(" "))}}(Nt,Du,kn,d),void 0!==l&&function zg(t,o,l){const d=t.projection=[];for(let g=0;g=0;d--){const g=t[d];g.hostVars=o+=g.hostVars,g.hostAttrs=to(g.hostAttrs,l=to(l,g.hostAttrs))}}(d)}function md(t){return t===Dr?{}:t===vi?[]:t}function Ug(t,o){const l=t.viewQuery;t.viewQuery=l?(d,g)=>{o(d,g),l(d,g)}:o}function n(t,o){const l=t.contentQueries;t.contentQueries=l?(d,g,C)=>{o(d,g,C),l(d,g,C)}:o}function e(t,o){const l=t.hostBindings;t.hostBindings=l?(d,g)=>{o(d,g),l(d,g)}:o}function j(t){const o=t.inputConfig,l={};for(const d in o)if(o.hasOwnProperty(d)){const g=o[d];Array.isArray(g)&&g[2]&&(l[d]=g[2])}t.inputTransforms=l}function X(t){return!!ke(t)&&(Array.isArray(t)||!(t instanceof Map)&&Symbol.iterator in t)}function ke(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function mt(t,o,l){return t[o]=l}function ut(t,o,l){return!Object.is(t[o],l)&&(t[o]=l,!0)}function xt(t,o,l,d){const g=ut(t,o,l);return ut(t,o+1,d)||g}function nn(t,o,l,d){const g=jn();return ut(g,Il(),o)&&(wr(),us(Ge(),g,t,o,l,d)),nn}function Un(t,o,l,d){return ut(t,Il(),l)?o+Te(l)+d:_r}function Pn(t,o,l,d,g,C,P,F){const re=function bt(t,o,l,d,g){const C=xt(t,o,l,d);return ut(t,o+2,g)||C}(t,Da(),l,g,P);return pa(3),re?o+Te(l)+d+Te(g)+C+Te(P)+F:_r}function On(t,o,l,d,g,C,P,F,V,re){const at=function tn(t,o,l,d,g,C){const P=xt(t,o,l,d);return xt(t,o+2,g,C)||P}(t,Da(),l,g,P,V);return pa(4),at?o+Te(l)+d+Te(g)+C+Te(P)+F+Te(V)+re:_r}function yf(t,o,l,d,g,C,P,F){const V=jn(),re=wr(),Se=t+or,at=re.firstCreatePass?function Eu(t,o,l,d,g,C,P,F,V){const re=o.consts,Se=rc(o,t,4,P||null,ai(re,F));hf(o,l,Se,ai(re,V)),m(o,Se);const at=Se.tView=Lp(2,Se,d,g,C,o.directiveRegistry,o.pipeRegistry,null,o.schemas,re,null);return null!==o.queries&&(o.queries.template(o,Se),at.queries=o.queries.embeddedTView(Se)),Se}(Se,re,V,o,l,d,g,C,P):re.data[Se];ms(at,!1);const Nt=vf(re,V,at,t);f()&&Fh(re,V,Nt,at),Ro(Nt,V),oh(V,V[Se]=rh(Nt,V,Nt,at)),Ls(at)&&Op(re,V,at),null!=P&&uf(V,at,F)}let vf=function sc(t,o,l,d){return r(!0),o[Ti].createComment("")};function ua(t){return No(function _h(){return $i.lFrame.contextLView}(),or+t)}function Tu(t,o,l){const d=jn();return ut(d,Il(),o)&&ca(wr(),Ge(),d,t,o,d[Ti],l,!1),Tu}function hh(t,o,l,d,g){const P=g?"class":"style";pf(t,l,o.inputs[P],P,d)}function jl(t,o,l,d){const g=jn(),C=wr(),P=or+t,F=g[Ti],V=C.firstCreatePass?function $g(t,o,l,d,g,C){const P=o.consts,V=rc(o,t,2,d,ai(P,g));return hf(o,l,V,ai(P,C)),null!==V.attrs&&wu(V,V.attrs,!1),null!==V.mergedAttrs&&wu(V,V.mergedAttrs,!0),null!==o.queries&&o.queries.elementStart(o,V),V}(P,C,g,o,l,d):C.data[P],re=zv(C,g,V,F,o,t);g[P]=re;const Se=Ls(V);return ms(V,!0),Dm(F,re,V),32!=(32&V.flags)&&f()&&Fh(C,g,re,V),0===function bd(){return $i.lFrame.elementDepthCount}()&&Ro(re,g),function Hc(){$i.lFrame.elementDepthCount++}(),Se&&(Op(C,g,V),hd(C,V,g)),null!==d&&uf(g,V),jl}function Gg(){let t=Uo();Hl()?vc():(t=t.parent,ms(t,!1));const o=t;(function wd(t){return $i.skipHydrationRootTNode===t})(o)&&function Pu(){$i.skipHydrationRootTNode=null}(),function El(){$i.lFrame.elementDepthCount--}();const l=wr();return l.firstCreatePass&&(m(l,t),ra(t)&&l.queries.elementEnd(t)),null!=o.classesWithoutHost&&function Ke(t){return 0!=(8&t.flags)}(o)&&hh(l,o,jn(),o.classesWithoutHost,!0),null!=o.stylesWithoutHost&&function ce(t){return 0!=(16&t.flags)}(o)&&hh(l,o,jn(),o.stylesWithoutHost,!1),Gg}function xy(t,o,l,d){return jl(t,o,l,d),Gg(),xy}let zv=(t,o,l,d,g,C)=>(r(!0),$u(d,g,function ar(){return $i.lFrame.currentNamespace}()));function Hg(t,o,l){const d=jn(),g=wr(),C=t+or,P=g.firstCreatePass?function tb(t,o,l,d,g){const C=o.consts,P=ai(C,d),F=rc(o,t,8,"ng-container",P);return null!==P&&wu(F,P,!0),hf(o,l,F,ai(C,g)),null!==o.queries&&o.queries.elementStart(o,F),F}(C,g,d,o,l):g.data[C];ms(P,!0);const F=Uv(g,d,P,t);return d[C]=F,f()&&Fh(g,d,F,P),Ro(F,d),Ls(P)&&(Op(g,d,P),hd(g,P,d)),null!=l&&uf(d,P),Hg}function Wg(){let t=Uo();const o=wr();return Hl()?vc():(t=t.parent,ms(t,!1)),o.firstCreatePass&&(m(o,t),ra(t)&&o.queries.elementEnd(t)),Wg}function by(t,o,l){return Hg(t,o,l),Wg(),by}let Uv=(t,o,l,d)=>(r(!0),$r(o[Ti],""));function Zv(){return jn()}function wy(t){return!!t&&"function"==typeof t.then}function jv(t){return!!t&&"function"==typeof t.subscribe}function Cy(t,o,l,d){const g=jn(),C=wr(),P=Uo();return function $v(t,o,l,d,g,C,P){const F=Ls(d),re=t.firstCreatePass&&Np(t),Se=o[br],at=Mg(o);let Nt=!0;if(3&d.type||P){const oi=ao(d,o),yi=P?P(oi):oi,ji=at.length,ei=P?Pr=>P(Vi(Pr[d.index])):d.index;let mr=null;if(!P&&F&&(mr=function rb(t,o,l,d){const g=t.cleanup;if(null!=g)for(let C=0;CV?F[V]:null}"string"==typeof P&&(C+=2)}return null}(t,o,g,d.index)),null!==mr)(mr.__ngLastListenerFn__||mr).__ngNextListenerFn__=C,mr.__ngLastListenerFn__=C,Nt=!1;else{C=Hv(d,o,Se,C,!1);const Pr=l.listen(yi,g,C);at.push(C,Pr),re&&re.push(g,ei,ji,ji+1)}}else C=Hv(d,o,Se,C,!1);const rn=d.outputs;let kn;if(Nt&&null!==rn&&(kn=rn[g])){const oi=kn.length;if(oi)for(let yi=0;yi-1?fo(t.index,o):o);let V=Gv(o,l,d,P),re=C.__ngNextListenerFn__;for(;re;)V=Gv(o,l,re,P)&&V,re=re.__ngNextListenerFn__;return g&&!1===V&&P.preventDefault(),V}}function Wv(t=1){return function $(t){return($i.lFrame.contextLView=function z(t,o){for(;t>0;)o=o[os],t--;return o}(t,$i.lFrame.contextLView))[br]}(t)}function ob(t,o){let l=null;const d=function vn(t){const o=t.attrs;if(null!=o){const l=o.indexOf(5);if(!(1&l))return o[l+1]}return null}(t);for(let g=0;g>17&32767}function Dy(t){return 2|t}function fh(t){return(131068&t)>>2}function Iy(t,o){return-131069&t|o<<2}function My(t){return 1|t}function o0(t,o,l,d,g){const C=t[l+1],P=null===o;let F=d?_d(C):fh(C),V=!1;for(;0!==F&&(!1===V||P);){const Se=t[F+1];db(t[F],o)&&(V=!0,t[F+1]=d?My(Se):Dy(Se)),F=d?_d(Se):fh(Se)}V&&(t[l+1]=d?Dy(C):My(C))}function db(t,o){return null===t||null==o||(Array.isArray(t)?t[1]:t)===o||!(!Array.isArray(t)||"string"!=typeof o)&&Sa(t,o)>=0}function Ay(t,o,l){return ac(t,o,l,!1),Ay}function Sy(t,o){return ac(t,o,null,!0),Sy}function ac(t,o,l,d){const g=jn(),C=wr(),P=pa(2);C.firstUpdatePass&&function f0(t,o,l,d){const g=t.data;if(null===g[l+1]){const C=g[K()],P=function h0(t,o){return o>=t.expandoStartIndex}(t,l);(function _0(t,o){return 0!=(t.flags&(o?8:16))})(C,d)&&null===o&&!P&&(o=!1),o=function xb(t,o,l,d){const g=function js(t){const o=$i.lFrame.currentDirectiveIndex;return-1===o?null:t[o]}(t);let C=d?o.residualClasses:o.residualStyles;if(null===g)0===(d?o.classBindings:o.styleBindings)&&(l=Yp(l=Py(null,t,o,l,d),o.attrs,d),C=null);else{const P=o.directiveStylingLast;if(-1===P||t[P]!==g)if(l=Py(g,t,o,l,d),null===C){let V=function bb(t,o,l){const d=l?o.classBindings:o.styleBindings;if(0!==fh(d))return t[_d(d)]}(t,o,d);void 0!==V&&Array.isArray(V)&&(V=Py(null,t,o,V[1],d),V=Yp(V,o.attrs,d),function wb(t,o,l,d){t[_d(l?o.classBindings:o.styleBindings)]=d}(t,o,d,V))}else C=function Cb(t,o,l){let d;const g=o.directiveEnd;for(let C=1+o.directiveStylingLast;C0)&&(re=!0)):Se=l,g)if(0!==V){const Nt=_d(t[F+1]);t[d+1]=qg(Nt,F),0!==Nt&&(t[Nt+1]=Iy(t[Nt+1],d)),t[F+1]=function ab(t,o){return 131071&t|o<<17}(t[F+1],d)}else t[d+1]=qg(F,0),0!==F&&(t[F+1]=Iy(t[F+1],d)),F=d;else t[d+1]=qg(V,0),0===F?F=d:t[V+1]=Iy(t[V+1],d),V=d;re&&(t[d+1]=Dy(t[d+1])),o0(t,Se,d,!0),o0(t,Se,d,!1),function ub(t,o,l,d,g){const C=g?t.residualClasses:t.residualStyles;null!=C&&"string"==typeof o&&Sa(C,o)>=0&&(l[d+1]=My(l[d+1]))}(o,Se,t,d,C),P=qg(F,V),C?o.classBindings=P:o.styleBindings=P}(g,C,o,l,P,d)}}(C,t,P,d),o!==_r&&ut(g,P,o)&&function m0(t,o,l,d,g,C,P,F){if(!(3&o.type))return;const V=t.data,re=V[F+1],Se=function lb(t){return 1==(1&t)}(re)?g0(V,o,l,g,fh(re),P):void 0;Yg(Se)||(Yg(C)||function sb(t){return 2==(2&t)}(re)&&(C=g0(V,null,l,g,F,P)),function E_(t,o,l,d,g){if(o)g?t.addClass(l,d):t.removeClass(l,d);else{let C=-1===d.indexOf("-")?void 0:Zu.DashCase;null==g?t.removeStyle(l,d,C):("string"==typeof g&&g.endsWith("!important")&&(g=g.slice(0,-10),C|=Zu.Important),t.setStyle(l,d,g,C))}}(d,P,ho(K(),l),g,C))}(C,C.data[K()],g,g[Ti],t,g[P+1]=function Ib(t,o){return null==t||""===t||("string"==typeof o?t+=o:"object"==typeof t&&(t=Ie(Ic(t)))),t}(o,l),d,P)}function Py(t,o,l,d,g){let C=null;const P=l.directiveEnd;let F=l.directiveStylingLast;for(-1===F?F=l.directiveStart:F++;F0;){const V=t[g],re=Array.isArray(V),Se=re?V[1]:V,at=null===Se;let Nt=l[g+1];Nt===_r&&(Nt=at?vi:void 0);let rn=at?Sl(Nt,d):Se===d?Nt:void 0;if(re&&!Yg(rn)&&(rn=Sl(V,d)),Yg(rn)&&(F=rn,P))return F;const kn=t[g+1];g=P?_d(kn):fh(kn)}if(null!==o){let V=C?o.residualClasses:o.residualStyles;null!=V&&(F=Sl(V,d))}return F}function Yg(t){return void 0!==t}function y0(t,o=""){const l=jn(),d=wr(),g=t+or,C=d.firstCreatePass?rc(d,g,1,o,null):d.data[g],P=v0(d,l,C,o,t);l[g]=P,f()&&Fh(d,l,P,C),ms(C,!1)}let v0=(t,o,l,d,g)=>(r(!0),function kd(t,o){return t.createText(o)}(o[Ti],d));function Oy(t){return Jg("",t,""),Oy}function Jg(t,o,l){const d=jn(),g=Un(d,t,o,l);return g!==_r&&Ul(d,K(),g),Jg}function Ry(t,o,l,d,g){const C=jn(),P=function fn(t,o,l,d,g,C){const F=xt(t,Da(),l,g);return pa(2),F?o+Te(l)+d+Te(g)+C:_r}(C,t,o,l,d,g);return P!==_r&&Ul(C,K(),P),Ry}function Ly(t,o,l,d,g,C,P){const F=jn(),V=Pn(F,t,o,l,d,g,C,P);return V!==_r&&Ul(F,K(),V),Ly}function ky(t,o,l,d,g,C,P,F,V){const re=jn(),Se=On(re,t,o,l,d,g,C,P,F,V);return Se!==_r&&Ul(re,K(),Se),ky}const ph=void 0;var Yb=["en",[["a","p"],["AM","PM"],ph],[["AM","PM"],ph,ph],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],ph,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],ph,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",ph,"{1} 'at' {0}",ph],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function qb(t){const l=Math.floor(Math.abs(t)),d=t.toString().replace(/^[^.]*\.?/,"").length;return 1===l&&0===d?1:5}];let bf={};function Fy(t){const o=function Jb(t){return t.toLowerCase().replace(/_/g,"-")}(t);let l=B0(o);if(l)return l;const d=o.split("-")[0];if(l=B0(d),l)return l;if("en"===d)return Yb;throw new ye(701,!1)}function F0(t){return Fy(t)[wf.PluralCase]}function B0(t){return t in bf||(bf[t]=_n.ng&&_n.ng.common&&_n.ng.common.locales&&_n.ng.common.locales[t]),bf[t]}var wf=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}(wf||{});const Cf="en-US";let N0=Cf;function zy(t,o,l,d,g){if(t=le(t),Array.isArray(t))for(let C=0;C>20;if(mu(t)||!t.multi){const rn=new se(re,g,zl),kn=Zy(V,o,g?Se:Se+Nt,at);-1===kn?(Wn(sn(F,P),C,V),Uy(C,t,o.length),o.push(V),F.directiveStart++,F.directiveEnd++,g&&(F.providerIndexes+=1048576),l.push(rn),P.push(rn)):(l[kn]=rn,P[kn]=rn)}else{const rn=Zy(V,o,Se+Nt,at),kn=Zy(V,o,Se,Se+Nt),yi=kn>=0&&l[kn];if(g&&!yi||!g&&!(rn>=0&&l[rn])){Wn(sn(F,P),C,V);const ji=function qw(t,o,l,d,g){const C=new se(t,l,zl);return C.multi=[],C.index=o,C.componentProviders=0,cx(C,g,d&&!l),C}(g?Ww:Hw,l.length,g,d,re);!g&&yi&&(l[kn].providerFactory=ji),Uy(C,t,o.length,0),o.push(V),F.directiveStart++,F.directiveEnd++,g&&(F.providerIndexes+=1048576),l.push(ji),P.push(ji)}else Uy(C,t,rn>-1?rn:kn,cx(l[g?kn:rn],re,!g&&d));!g&&d&&yi&&l[kn].componentProviders++}}}function Uy(t,o,l,d){const g=mu(o),C=function B_(t){return!!t.useClass}(o);if(g||C){const V=(C?le(o.useClass):o).prototype.ngOnDestroy;if(V){const re=t.destroyHooks||(t.destroyHooks=[]);if(!g&&o.multi){const Se=re.indexOf(l);-1===Se?re.push(l,[d,V]):re[Se+1].push(d,V)}else re.push(l,V)}}}function cx(t,o,l){return l&&t.componentProviders++,t.multi.push(o)-1}function Zy(t,o,l,d){for(let g=l;g{l.providersResolver=(d,g)=>function Gw(t,o,l){const d=wr();if(d.firstCreatePass){const g=ki(t);zy(l,d.data,d.blueprint,g,!0),zy(o,d.data,d.blueprint,g,!1)}}(d,g?g(t):t,o)}}class mh{}class dx{}function Yw(t,o){return new Vy(t,o??null,[])}class Vy extends mh{constructor(o,l,d){super(),this._parent=l,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new lh(this);const g=so(o);this._bootstrapComponents=As(g.bootstrap),this._r3Injector=xp(o,l,[{provide:mh,useValue:this},{provide:qd,useValue:this.componentFactoryResolver},...d],Ie(o),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(o)}get injector(){return this._r3Injector}destroy(){const o=this._r3Injector;!o.destroyed&&o.destroy(),this.destroyCbs.forEach(l=>l()),this.destroyCbs=null}onDestroy(o){this.destroyCbs.push(o)}}class $y extends dx{constructor(o){super(),this.moduleType=o}create(o){return new Vy(this.moduleType,o,[])}}class hx extends mh{constructor(o){super(),this.componentFactoryResolver=new lh(this),this.instance=null;const l=new Pc([...o.providers,{provide:mh,useValue:this},{provide:qd,useValue:this.componentFactoryResolver}],o.parent||Sc(),o.debugName,new Set(["environment"]));this.injector=l,o.runEnvironmentInitializers&&l.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(o){this.injector.onDestroy(o)}}function fx(t,o,l=null){return new hx({providers:t,parent:o,debugName:l,runEnvironmentInitializers:!0}).injector}let Kw=(()=>{var t;class o{constructor(d){this._injector=d,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(d){if(!d.standalone)return null;if(!this.cachedInjectors.has(d)){const g=Ku(0,d.type),C=g.length>0?fx([g],this._injector,`Standalone[${d.type.name}]`):null;this.cachedInjectors.set(d,C)}return this.cachedInjectors.get(d)}ngOnDestroy(){try{for(const d of this.cachedInjectors.values())null!==d&&d.destroy()}finally{this.cachedInjectors.clear()}}}return(t=o).\u0275prov=Ut({token:t,providedIn:"environment",factory:()=>new t(Ui(la))}),o})();function px(t){t.getStandaloneInjector=o=>o.get(Kw).getOrCreateStandaloneInjector(t)}function bx(t,o,l){const d=gs()+t,g=jn();return g[d]===_r?mt(g,d,l?o.call(l):o()):function Qe(t,o){return t[o]}(g,d)}function tm(t,o){const l=t[o];return l===_r?void 0:l}function Ix(t,o){const l=wr();let d;const g=t+or;l.firstCreatePass?(d=function mC(t,o){if(o)for(let l=o.length-1;l>=0;l--){const d=o[l];if(t===d.name)return d}}(o,l.pipeRegistry),l.data[g]=d,d.onDestroy&&(l.destroyHooks??=[]).push(g,d.onDestroy)):d=l.data[g];const C=d.factory||(d.factory=ha(d.type)),F=Mn(zl);try{const V=zt(!1),re=C();return zt(V),function xa(t,o,l,d){l>=t.data.length&&(t.data[l]=null,t.blueprint[l]=null),o[l]=d}(l,jn(),g,re),re}finally{Mn(F)}}function Mx(t,o,l){const d=t+or,g=jn(),C=No(g,d);return nm(g,d)?function wx(t,o,l,d,g,C){const P=o+l;return ut(t,P,g)?mt(t,P+1,C?d.call(C,g):d(g)):tm(t,P+1)}(g,gs(),o,C.transform,l,C):C.transform(l)}function Ax(t,o,l,d){const g=t+or,C=jn(),P=No(C,g);return nm(C,g)?function Cx(t,o,l,d,g,C,P){const F=o+l;return xt(t,F,g,C)?mt(t,F+2,P?d.call(P,g,C):d(g,C)):tm(t,F+2)}(C,gs(),o,P.transform,l,d,P):P.transform(l,d)}function nm(t,o){return t[li].data[o].pure}function Hy(t){return o=>{setTimeout(t,void 0,o)}}const $c=class vC extends x.x{constructor(o=!1){super(),this.__isAsync=o}emit(o){super.next(o)}subscribe(o,l,d){let g=o,C=l||(()=>null),P=d;if(o&&"object"==typeof o){const V=o;g=V.next?.bind(V),C=V.error?.bind(V),P=V.complete?.bind(V)}this.__isAsync&&(C=Hy(C),g&&(g=Hy(g)),P&&(P=Hy(P)));const F=super.subscribe({next:g,error:C,complete:P});return o instanceof h.w0&&o.add(F),F}};function xC(){return this._results[Symbol.iterator]()}class Wy{get changes(){return this._changes||(this._changes=new $c)}constructor(o=!1){this._emitDistinctChangesOnly=o,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const l=Wy.prototype;l[Symbol.iterator]||(l[Symbol.iterator]=xC)}get(o){return this._results[o]}map(o){return this._results.map(o)}filter(o){return this._results.filter(o)}find(o){return this._results.find(o)}reduce(o,l){return this._results.reduce(o,l)}forEach(o){this._results.forEach(o)}some(o){return this._results.some(o)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(o,l){const d=this;d.dirty=!1;const g=function Aa(t){return t.flat(Number.POSITIVE_INFINITY)}(o);(this._changesDetected=!function wh(t,o,l){if(t.length!==o.length)return!1;for(let d=0;d0&&(l[g-1][_o]=o),d{class o{}return o.__NG_ELEMENT_ID__=TC,o})();const CC=im,EC=class extends CC{constructor(o,l,d){super(),this._declarationLView=o,this._declarationTContainer=l,this.elementRef=d}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(o,l){return this.createEmbeddedViewImpl(o,l)}createEmbeddedViewImpl(o,l,d){const g=function bC(t,o,l,d){const g=o.tView,F=Fc(t,g,l,4096&t[Zi]?4096:16,null,o,null,null,null,d?.injector??null,d?.hydrationInfo??null);F[zs]=t[o.index];const re=t[Fo];return null!==re&&(F[Fo]=re.createEmbeddedView(g)),Zl(g,F,l),F}(this._declarationLView,this._declarationTContainer,o,{injector:l,hydrationInfo:d});return new fd(g)}};function TC(){return t_(Uo(),jn())}function t_(t,o){return 4&t.type?new EC(o,t,ys(t,o)):null}let i_=(()=>{class o{}return o.__NG_ELEMENT_ID__=PC,o})();function PC(){return Fx(Uo(),jn())}const OC=i_,Lx=class extends OC{constructor(o,l,d){super(),this._lContainer=o,this._hostTNode=l,this._hostLView=d}get element(){return ys(this._hostTNode,this._hostLView)}get injector(){return new vo(this._hostTNode,this._hostLView)}get parentInjector(){const o=Ln(this._hostTNode,this._hostLView);if(ot(o)){const l=Dt(o,this._hostLView),d=Tt(o);return new vo(l[li].data[d+8],l)}return new vo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(o){const l=kx(this._lContainer);return null!==l&&l[o]||null}get length(){return this._lContainer.length-Io}createEmbeddedView(o,l,d){let g,C;"number"==typeof d?g=d:null!=d&&(g=d.index,C=d.injector);const F=o.createEmbeddedViewImpl(l||{},C,null);return this.insertImpl(F,g,false),F}createComponent(o,l,d,g,C){const P=o&&!function Ma(t){return"function"==typeof t}(o);let F;if(P)F=l;else{const oi=l||{};F=oi.index,d=oi.injector,g=oi.projectableNodes,C=oi.environmentInjector||oi.ngModuleRef}const V=P?o:new pd(zi(o)),re=d||this.parentInjector;if(!C&&null==V.ngModule){const yi=(P?re:this.parentInjector).get(la,null);yi&&(C=yi)}zi(V.componentType??{});const rn=V.create(re,g,null,C);return this.insertImpl(rn.hostView,F,false),rn}insert(o,l){return this.insertImpl(o,l,!1)}insertImpl(o,l,d){const g=o._lView;if(function mc(t){return yo(t[Rr])}(g)){const V=this.indexOf(o);if(-1!==V)this.detach(V);else{const re=g[Rr],Se=new Lx(re,re[zr],re[Rr]);Se.detach(Se.indexOf(o))}}const P=this._adjustIndex(l),F=this._lContainer;return wC(F,g,P,!d),o.attachToViewContainerRef(),am(qy(F),P,o),o}move(o,l){return this.insert(o,l)}indexOf(o){const l=kx(this._lContainer);return null!==l?l.indexOf(o):-1}remove(o){const l=this._adjustIndex(o,-1),d=Fd(this._lContainer,l);d&&(Ch(qy(this._lContainer),l),Tc(d[li],d))}detach(o){const l=this._adjustIndex(o,-1),d=Fd(this._lContainer,l);return d&&null!=Ch(qy(this._lContainer),l)?new fd(d):null}_adjustIndex(o,l=0){return o??this.length+l}};function kx(t){return t[8]}function qy(t){return t[8]||(t[8]=[])}function Fx(t,o){let l;const d=o[t.index];return yo(d)?l=d:(l=rh(d,o,null,t),o[t.index]=l,oh(o,l)),Bx(l,o,t,d),new Lx(l,t,o)}let Bx=function Nx(t,o,l,d){if(t[Ur])return;let g;g=8&l.type?Vi(d):function RC(t,o){const l=t[Ti],d=l.createComment(""),g=ao(o,t);return Dc(l,lu(l,g),d,function Wf(t,o){return t.nextSibling(o)}(l,g),!1),d}(o,l),t[Ur]=g};class Yy{constructor(o){this.queryList=o,this.matches=null}clone(){return new Yy(this.queryList)}setDirty(){this.queryList.setDirty()}}class Jy{constructor(o=[]){this.queries=o}createEmbeddedView(o){const l=o.queries;if(null!==l){const d=null!==o.contentQueries?o.contentQueries[0]:l.length,g=[];for(let C=0;C0)d.push(P[F/2]);else{const re=C[F+1],Se=o[-V];for(let at=Io;at{var t;class o{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((d,g)=>{this.resolve=d,this.reject=g}),this.appInits=st(u1,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const d=[];for(const C of this.appInits){const P=C();if(wy(P))d.push(P);else if(jv(P)){const F=new Promise((V,re)=>{P.subscribe({complete:V,error:re})});d.push(F)}}const g=()=>{this.done=!0,this.resolve()};Promise.all(d).then(()=>{g()}).catch(C=>{this.reject(C)}),0===d.length&&g(),this.initialized=!0}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})(),d1=(()=>{var t;class o{log(d){console.log(d)}warn(d){console.warn(d)}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"platform"}),o})();const o_=new Gr("LocaleId",{providedIn:"root",factory:()=>st(o_,mi.Optional|mi.SkipSelf)||function cE(){return typeof $localize<"u"&&$localize.locale||Cf}()}),uE=new Gr("DefaultCurrencyCode",{providedIn:"root",factory:()=>"USD"});let h1=(()=>{var t;class o{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new y.X(!1)}add(){this.hasPendingTasks.next(!0);const d=this.taskId++;return this.pendingTasks.add(d),d}remove(d){this.pendingTasks.delete(d),0===this.pendingTasks.size&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks.next(!1)}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();class hE{constructor(o,l){this.ngModuleFactory=o,this.componentFactories=l}}let fE=(()=>{var t;class o{compileModuleSync(d){return new $y(d)}compileModuleAsync(d){return Promise.resolve(this.compileModuleSync(d))}compileModuleAndAllComponentsSync(d){const g=this.compileModuleSync(d),P=As(so(d).declarations).reduce((F,V)=>{const re=zi(V);return re&&F.push(new pd(re)),F},[]);return new hE(g,P)}compileModuleAndAllComponentsAsync(d){return Promise.resolve(this.compileModuleAndAllComponentsSync(d))}clearCache(){}clearCacheFor(d){}getModuleId(d){}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();function g1(...t){}class ba{constructor({enableLongStackTrace:o=!1,shouldCoalesceEventChangeDetection:l=!1,shouldCoalesceRunChangeDetection:d=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new $c(!1),this.onMicrotaskEmpty=new $c(!1),this.onStable=new $c(!1),this.onError=new $c(!1),typeof Zone>"u")throw new ye(908,!1);Zone.assertZonePatched();const g=this;g._nesting=0,g._outer=g._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(g._inner=g._inner.fork(new Zone.TaskTrackingZoneSpec)),o&&Zone.longStackTraceZoneSpec&&(g._inner=g._inner.fork(Zone.longStackTraceZoneSpec)),g.shouldCoalesceEventChangeDetection=!d&&l,g.shouldCoalesceRunChangeDetection=d,g.lastRequestAnimationFrameId=-1,g.nativeRequestAnimationFrame=function RE(){const t="function"==typeof _n.requestAnimationFrame;let o=_n[t?"requestAnimationFrame":"setTimeout"],l=_n[t?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&o&&l){const d=o[Zone.__symbol__("OriginalDelegate")];d&&(o=d);const g=l[Zone.__symbol__("OriginalDelegate")];g&&(l=g)}return{nativeRequestAnimationFrame:o,nativeCancelAnimationFrame:l}}().nativeRequestAnimationFrame,function FE(t){const o=()=>{!function kE(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(_n,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,cv(t),t.isCheckStableRunning=!0,lv(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),cv(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(l,d,g,C,P,F)=>{try{return _1(t),l.invokeTask(g,C,P,F)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===C.type||t.shouldCoalesceRunChangeDetection)&&o(),y1(t)}},onInvoke:(l,d,g,C,P,F,V)=>{try{return _1(t),l.invoke(g,C,P,F,V)}finally{t.shouldCoalesceRunChangeDetection&&o(),y1(t)}},onHasTask:(l,d,g,C)=>{l.hasTask(g,C),d===g&&("microTask"==C.change?(t._hasPendingMicrotasks=C.microTask,cv(t),lv(t)):"macroTask"==C.change&&(t.hasPendingMacrotasks=C.macroTask))},onHandleError:(l,d,g,C)=>(l.handleError(g,C),t.runOutsideAngular(()=>t.onError.emit(C)),!1)})}(g)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!ba.isInAngularZone())throw new ye(909,!1)}static assertNotInAngularZone(){if(ba.isInAngularZone())throw new ye(909,!1)}run(o,l,d){return this._inner.run(o,l,d)}runTask(o,l,d,g){const C=this._inner,P=C.scheduleEventTask("NgZoneEvent: "+g,o,LE,g1,g1);try{return C.runTask(P,l,d)}finally{C.cancelTask(P)}}runGuarded(o,l,d){return this._inner.runGuarded(o,l,d)}runOutsideAngular(o){return this._outer.run(o)}}const LE={};function lv(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function cv(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function _1(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function y1(t){t._nesting--,lv(t)}class BE{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new $c,this.onMicrotaskEmpty=new $c,this.onStable=new $c,this.onError=new $c}run(o,l,d){return o.apply(l,d)}runGuarded(o,l,d){return o.apply(l,d)}runOutsideAngular(o){return o()}runTask(o,l,d,g){return o.apply(l,d)}}const v1=new Gr("",{providedIn:"root",factory:x1});function x1(){const t=st(ba);let o=!0;return function me(...t){const o=(0,E.yG)(t),l=(0,E._6)(t,1/0),d=t;return d.length?1===d.length?(0,ie.Xf)(d[0]):(0,J.J)(l)((0,Ne.D)(d,o)):Y.E}(new s.y(g=>{o=t.isStable&&!t.hasPendingMacrotasks&&!t.hasPendingMicrotasks,t.runOutsideAngular(()=>{g.next(o),g.complete()})}),new s.y(g=>{let C;t.runOutsideAngular(()=>{C=t.onStable.subscribe(()=>{ba.assertNotInAngularZone(),queueMicrotask(()=>{!o&&!t.hasPendingMacrotasks&&!t.hasPendingMicrotasks&&(o=!0,g.next(!0))})})});const P=t.onUnstable.subscribe(()=>{ba.assertInAngularZone(),o&&(o=!1,t.runOutsideAngular(()=>{g.next(!1)}))});return()=>{C.unsubscribe(),P.unsubscribe()}}).pipe((0,_e.B)()))}const b1=new Gr(""),w1=new Gr("");let uv,NE=(()=>{var t;class o{constructor(d,g,C){this._ngZone=d,this.registry=g,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,uv||(function zE(t){uv=t}(C),C.addToWindow(g)),this._watchAngularEvents(),d.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{ba.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let d=this._callbacks.pop();clearTimeout(d.timeoutId),d.doneCb(this._didWork)}this._didWork=!1});else{let d=this.getPendingTasks();this._callbacks=this._callbacks.filter(g=>!g.updateCb||!g.updateCb(d)||(clearTimeout(g.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(d=>({source:d.source,creationLocation:d.creationLocation,data:d.data})):[]}addCallback(d,g,C){let P=-1;g&&g>0&&(P=setTimeout(()=>{this._callbacks=this._callbacks.filter(F=>F.timeoutId!==P),d(this._didWork,this.getPendingTasks())},g)),this._callbacks.push({doneCb:d,timeoutId:P,updateCb:C})}whenStable(d,g,C){if(C&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(d,g,C),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(d){this.registry.registerApplication(d,this)}unregisterApplication(d){this.registry.unregisterApplication(d)}findProviders(d,g,C){return[]}}return(t=o).\u0275fac=function(d){return new(d||t)(Ui(ba),Ui(C1),Ui(w1))},t.\u0275prov=Ut({token:t,factory:t.\u0275fac}),o})(),C1=(()=>{var t;class o{constructor(){this._applications=new Map}registerApplication(d,g){this._applications.set(d,g)}unregisterApplication(d){this._applications.delete(d)}unregisterAllApplications(){this._applications.clear()}getTestability(d){return this._applications.get(d)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(d,g=!0){return uv?.findTestabilityInTree(this,d,g)??null}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"platform"}),o})(),yd=null;const E1=new Gr("AllowMultipleToken"),dv=new Gr("PlatformDestroyListeners"),hv=new Gr("appBootstrapListener");class jE{constructor(o,l){this.name=o,this.token=l}}function I1(t,o,l=[]){const d=`Platform: ${o}`,g=new Gr(d);return(C=[])=>{let P=fv();if(!P||P.injector.get(E1,!1)){const F=[...l,...C,{provide:g,useValue:!0}];t?t(F):function VE(t){if(yd&&!yd.get(E1,!1))throw new ye(400,!1);(function T1(){!function Au(t){Gc=t}(()=>{throw new ye(600,!1)})})(),yd=t;const o=t.get(A1);(function D1(t){t.get(hp,null)?.forEach(l=>l())})(t)}(function M1(t=[],o){return qa.create({name:o,providers:[{provide:Yh,useValue:"platform"},{provide:dv,useValue:new Set([()=>yd=null])},...t]})}(F,d))}return function GE(t){const o=fv();if(!o)throw new ye(401,!1);return o}()}}function fv(){return yd?.get(A1)??null}let A1=(()=>{var t;class o{constructor(d){this._injector=d,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(d,g){const C=function HE(t="zone.js",o){return"noop"===t?new BE:"zone.js"===t?new ba(o):t}(g?.ngZone,function S1(t){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:t?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:t?.runCoalescing??!1}}({eventCoalescing:g?.ngZoneEventCoalescing,runCoalescing:g?.ngZoneRunCoalescing}));return C.run(()=>{const P=function Jw(t,o,l){return new Vy(t,o,l)}(d.moduleType,this.injector,function k1(t){return[{provide:ba,useFactory:t},{provide:Ac,multi:!0,useFactory:()=>{const o=st(qE,{optional:!0});return()=>o.initialize()}},{provide:L1,useFactory:WE},{provide:v1,useFactory:x1}]}(()=>C)),F=P.injector.get(ad,null);return C.runOutsideAngular(()=>{const V=C.onError.subscribe({next:re=>{F.handleError(re)}});P.onDestroy(()=>{a_(this._modules,P),V.unsubscribe()})}),function P1(t,o,l){try{const d=l();return wy(d)?d.catch(g=>{throw o.runOutsideAngular(()=>t.handleError(g)),g}):d}catch(d){throw o.runOutsideAngular(()=>t.handleError(d)),d}}(F,C,()=>{const V=P.injector.get(ov);return V.runInitializers(),V.donePromise.then(()=>(function z0(t){kt(t,"Expected localeId to be defined"),"string"==typeof t&&(N0=t.toLowerCase().replace(/_/g,"-"))}(P.injector.get(o_,Cf)||Cf),this._moduleDoBootstrap(P),P))})})}bootstrapModule(d,g=[]){const C=O1({},g);return function UE(t,o,l){const d=new $y(l);return Promise.resolve(d)}(0,0,d).then(P=>this.bootstrapModuleFactory(P,C))}_moduleDoBootstrap(d){const g=d.injector.get(Df);if(d._bootstrapComponents.length>0)d._bootstrapComponents.forEach(C=>g.bootstrap(C));else{if(!d.instance.ngDoBootstrap)throw new ye(-403,!1);d.instance.ngDoBootstrap(g)}this._modules.push(d)}onDestroy(d){this._destroyListeners.push(d)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new ye(404,!1);this._modules.slice().forEach(g=>g.destroy()),this._destroyListeners.forEach(g=>g());const d=this._injector.get(dv,null);d&&(d.forEach(g=>g()),d.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}}return(t=o).\u0275fac=function(d){return new(d||t)(Ui(qa))},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"platform"}),o})();function O1(t,o){return Array.isArray(o)?o.reduce(O1,t):{...t,...o}}let Df=(()=>{var t;class o{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=st(L1),this.zoneIsStable=st(v1),this.componentTypes=[],this.components=[],this.isStable=st(h1).hasPendingTasks.pipe((0,ee.w)(d=>d?(0,he.of)(!1):this.zoneIsStable),(0,ae.x)(),(0,_e.B)()),this._injector=st(la)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(d,g){const C=d instanceof Wd;if(!this._injector.get(ov).done)throw!C&&Er(d),new ye(405,!1);let F;F=C?d:this._injector.get(qd).resolveComponentFactory(d),this.componentTypes.push(F.componentType);const V=function ZE(t){return t.isBoundToModule}(F)?void 0:this._injector.get(mh),Se=F.create(qa.NULL,[],g||F.selector,V),at=Se.location.nativeElement,Nt=Se.injector.get(b1,null);return Nt?.registerApplication(at),Se.onDestroy(()=>{this.detachView(Se.hostView),a_(this.components,Se),Nt?.unregisterApplication(at)}),this._loadComponent(Se),Se}tick(){if(this._runningTick)throw new ye(101,!1);try{this._runningTick=!0;for(let d of this._views)d.detectChanges()}catch(d){this.internalErrorHandler(d)}finally{this._runningTick=!1}}attachView(d){const g=d;this._views.push(g),g.attachToAppRef(this)}detachView(d){const g=d;a_(this._views,g),g.detachFromAppRef()}_loadComponent(d){this.attachView(d.hostView),this.tick(),this.components.push(d);const g=this._injector.get(hv,[]);g.push(...this._bootstrapListeners),g.forEach(C=>C(d))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(d=>d()),this._views.slice().forEach(d=>d.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(d){return this._destroyListeners.push(d),()=>a_(this._destroyListeners,d)}destroy(){if(this._destroyed)throw new ye(406,!1);const d=this._injector;d.destroy&&!d.destroyed&&d.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();function a_(t,o){const l=t.indexOf(o);l>-1&&t.splice(l,1)}const L1=new Gr("",{providedIn:"root",factory:()=>st(ad).handleError.bind(void 0)});function WE(){const t=st(ba),o=st(ad);return l=>t.runOutsideAngular(()=>o.handleError(l))}let qE=(()=>{var t;class o{constructor(){this.zone=st(ba),this.applicationRef=st(Df)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();function JE(){}let KE=(()=>{class o{}return o.__NG_ELEMENT_ID__=XE,o})();function XE(t){return function QE(t,o,l){if(Rs(t)&&!l){const d=fo(t.index,o);return new fd(d,d)}return 47&t.type?new fd(o[Br],o):null}(Uo(),jn(),16==(16&t))}class z1{constructor(){}supports(o){return X(o)}create(o){return new oT(o)}}const rT=(t,o)=>o;class oT{constructor(o){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=o||rT}forEachItem(o){let l;for(l=this._itHead;null!==l;l=l._next)o(l)}forEachOperation(o){let l=this._itHead,d=this._removalsHead,g=0,C=null;for(;l||d;){const P=!d||l&&l.currentIndex{P=this._trackByFn(g,F),null!==l&&Object.is(l.trackById,P)?(d&&(l=this._verifyReinsertion(l,F,P,g)),Object.is(l.item,F)||this._addIdentityChange(l,F)):(l=this._mismatch(l,F,P,g),d=!0),l=l._next,g++}),this.length=g;return this._truncate(l),this.collection=o,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let o;for(o=this._previousItHead=this._itHead;null!==o;o=o._next)o._nextPrevious=o._next;for(o=this._additionsHead;null!==o;o=o._nextAdded)o.previousIndex=o.currentIndex;for(this._additionsHead=this._additionsTail=null,o=this._movesHead;null!==o;o=o._nextMoved)o.previousIndex=o.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(o,l,d,g){let C;return null===o?C=this._itTail:(C=o._prev,this._remove(o)),null!==(o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(d,null))?(Object.is(o.item,l)||this._addIdentityChange(o,l),this._reinsertAfter(o,C,g)):null!==(o=null===this._linkedRecords?null:this._linkedRecords.get(d,g))?(Object.is(o.item,l)||this._addIdentityChange(o,l),this._moveAfter(o,C,g)):o=this._addAfter(new sT(l,d),C,g),o}_verifyReinsertion(o,l,d,g){let C=null===this._unlinkedRecords?null:this._unlinkedRecords.get(d,null);return null!==C?o=this._reinsertAfter(C,o._prev,g):o.currentIndex!=g&&(o.currentIndex=g,this._addToMoves(o,g)),o}_truncate(o){for(;null!==o;){const l=o._next;this._addToRemovals(this._unlink(o)),o=l}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(o,l,d){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(o);const g=o._prevRemoved,C=o._nextRemoved;return null===g?this._removalsHead=C:g._nextRemoved=C,null===C?this._removalsTail=g:C._prevRemoved=g,this._insertAfter(o,l,d),this._addToMoves(o,d),o}_moveAfter(o,l,d){return this._unlink(o),this._insertAfter(o,l,d),this._addToMoves(o,d),o}_addAfter(o,l,d){return this._insertAfter(o,l,d),this._additionsTail=null===this._additionsTail?this._additionsHead=o:this._additionsTail._nextAdded=o,o}_insertAfter(o,l,d){const g=null===l?this._itHead:l._next;return o._next=g,o._prev=l,null===g?this._itTail=o:g._prev=o,null===l?this._itHead=o:l._next=o,null===this._linkedRecords&&(this._linkedRecords=new U1),this._linkedRecords.put(o),o.currentIndex=d,o}_remove(o){return this._addToRemovals(this._unlink(o))}_unlink(o){null!==this._linkedRecords&&this._linkedRecords.remove(o);const l=o._prev,d=o._next;return null===l?this._itHead=d:l._next=d,null===d?this._itTail=l:d._prev=l,o}_addToMoves(o,l){return o.previousIndex===l||(this._movesTail=null===this._movesTail?this._movesHead=o:this._movesTail._nextMoved=o),o}_addToRemovals(o){return null===this._unlinkedRecords&&(this._unlinkedRecords=new U1),this._unlinkedRecords.put(o),o.currentIndex=null,o._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=o,o._prevRemoved=null):(o._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=o),o}_addIdentityChange(o,l){return o.item=l,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=o:this._identityChangesTail._nextIdentityChange=o,o}}class sT{constructor(o,l){this.item=o,this.trackById=l,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class aT{constructor(){this._head=null,this._tail=null}add(o){null===this._head?(this._head=this._tail=o,o._nextDup=null,o._prevDup=null):(this._tail._nextDup=o,o._prevDup=this._tail,o._nextDup=null,this._tail=o)}get(o,l){let d;for(d=this._head;null!==d;d=d._nextDup)if((null===l||l<=d.currentIndex)&&Object.is(d.trackById,o))return d;return null}remove(o){const l=o._prevDup,d=o._nextDup;return null===l?this._head=d:l._nextDup=d,null===d?this._tail=l:d._prevDup=l,null===this._head}}class U1{constructor(){this.map=new Map}put(o){const l=o.trackById;let d=this.map.get(l);d||(d=new aT,this.map.set(l,d)),d.add(o)}get(o,l){const g=this.map.get(o);return g?g.get(o,l):null}remove(o){const l=o.trackById;return this.map.get(l).remove(o)&&this.map.delete(l),o}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Z1(t,o,l){const d=t.previousIndex;if(null===d)return d;let g=0;return l&&d{if(l&&l.key===g)this._maybeAddToChanges(l,d),this._appendAfter=l,l=l._next;else{const C=this._getOrCreateRecordForKey(g,d);l=this._insertBeforeOrAppend(l,C)}}),l){l._prev&&(l._prev._next=null),this._removalsHead=l;for(let d=l;null!==d;d=d._nextRemoved)d===this._mapHead&&(this._mapHead=null),this._records.delete(d.key),d._nextRemoved=d._next,d.previousValue=d.currentValue,d.currentValue=null,d._prev=null,d._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(o,l){if(o){const d=o._prev;return l._next=o,l._prev=d,o._prev=l,d&&(d._next=l),o===this._mapHead&&(this._mapHead=l),this._appendAfter=o,o}return this._appendAfter?(this._appendAfter._next=l,l._prev=this._appendAfter):this._mapHead=l,this._appendAfter=l,null}_getOrCreateRecordForKey(o,l){if(this._records.has(o)){const g=this._records.get(o);this._maybeAddToChanges(g,l);const C=g._prev,P=g._next;return C&&(C._next=P),P&&(P._prev=C),g._next=null,g._prev=null,g}const d=new cT(o);return this._records.set(o,d),d.currentValue=l,this._addToAdditions(d),d}_reset(){if(this.isDirty){let o;for(this._previousMapHead=this._mapHead,o=this._previousMapHead;null!==o;o=o._next)o._nextPrevious=o._next;for(o=this._changesHead;null!==o;o=o._nextChanged)o.previousValue=o.currentValue;for(o=this._additionsHead;null!=o;o=o._nextAdded)o.previousValue=o.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(o,l){Object.is(l,o.currentValue)||(o.previousValue=o.currentValue,o.currentValue=l,this._addToChanges(o))}_addToAdditions(o){null===this._additionsHead?this._additionsHead=this._additionsTail=o:(this._additionsTail._nextAdded=o,this._additionsTail=o)}_addToChanges(o){null===this._changesHead?this._changesHead=this._changesTail=o:(this._changesTail._nextChanged=o,this._changesTail=o)}_forEach(o,l){o instanceof Map?o.forEach(l):Object.keys(o).forEach(d=>l(o[d],d))}}class cT{constructor(o){this.key=o,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function V1(){return new yv([new z1])}let yv=(()=>{var t;class o{constructor(d){this.factories=d}static create(d,g){if(null!=g){const C=g.factories.slice();d=d.concat(C)}return new o(d)}static extend(d){return{provide:o,useFactory:g=>o.create(d,g||V1()),deps:[[o,new Qc,new Ii]]}}find(d){const g=this.factories.find(C=>C.supports(d));if(null!=g)return g;throw new ye(901,!1)}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:V1}),o})();function $1(){return new vv([new j1])}let vv=(()=>{var t;class o{constructor(d){this.factories=d}static create(d,g){if(g){const C=g.factories.slice();d=d.concat(C)}return new o(d)}static extend(d){return{provide:o,useFactory:g=>o.create(d,g||$1()),deps:[[o,new Qc,new Ii]]}}find(d){const g=this.factories.find(C=>C.supports(d));if(g)return g;throw new ye(901,!1)}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:$1}),o})();const hT=I1(null,"core",[]);let fT=(()=>{var t;class o{constructor(d){}}return(t=o).\u0275fac=function(d){return new(d||t)(Ui(Df))},t.\u0275mod=Jr({type:t}),t.\u0275inj=gn({}),o})();function ET(t){return"boolean"==typeof t?t:null!=t&&"false"!==t}function DT(t,o){const l=zi(t),d=o.elementInjector||Sc();return new pd(l).create(d,o.projectableNodes,o.hostElement,o.environmentInjector)}function IT(t){const o=zi(t);if(!o)return null;const l=new pd(o);return{get selector(){return l.selector},get type(){return l.componentType},get inputs(){return l.inputs},get outputs(){return l.outputs},get ngContentSelectors(){return l.ngContentSelectors},get isStandalone(){return o.standalone},get isSignal(){return o.signals}}}},6223:(Nn,yt,k)=>{"use strict";k.d(yt,{Cf:()=>Ie,Fd:()=>Xo,Fj:()=>ae,JJ:()=>ii,JU:()=>E,On:()=>In,a5:()=>Ot,qQ:()=>Br,u5:()=>ki,wV:()=>Ai});var x=k(2029),h=k(6814),y=k(7715),s=k(9315),J=k(7398);let ie=(()=>{var v;class M{constructor(A,G){this._renderer=A,this._elementRef=G,this.onChange=It=>{},this.onTouched=()=>{}}setProperty(A,G){this._renderer.setProperty(this._elementRef.nativeElement,A,G)}registerOnTouched(A){this.onTouched=A}registerOnChange(A){this.onChange=A}setDisabledState(A){this.setProperty("disabled",A)}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(x.Qsj),x.Y36(x.SBq))},v.\u0275dir=x.lG2({type:v}),M})(),Y=(()=>{var v;class M extends ie{}return(v=M).\u0275fac=function(){let D;return function(G){return(D||(D=x.n5z(v)))(G||v)}}(),v.\u0275dir=x.lG2({type:v,features:[x.qOj]}),M})();const E=new x.OlP("NgValueAccessor"),he={provide:E,useExisting:(0,x.Gpc)(()=>ae),multi:!0},ee=new x.OlP("CompositionEventMode");let ae=(()=>{var v;class M extends ie{constructor(A,G,It){super(A,G),this._compositionMode=It,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function _e(){const v=(0,h.q)()?(0,h.q)().getUserAgent():"";return/android (\d+)/.test(v.toLowerCase())}())}writeValue(A){this.setProperty("value",A??"")}_handleInput(A){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(A)}_compositionStart(){this._composing=!0}_compositionEnd(A){this._composing=!1,this._compositionMode&&this.onChange(A)}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(x.Qsj),x.Y36(x.SBq),x.Y36(ee,8))},v.\u0275dir=x.lG2({type:v,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(A,G){1&A&&x.NdJ("input",function(Yn){return G._handleInput(Yn.target.value)})("blur",function(){return G.onTouched()})("compositionstart",function(){return G._compositionStart()})("compositionend",function(Yn){return G._compositionEnd(Yn.target.value)})},features:[x._Bn([he]),x.qOj]}),M})();function oe(v){return null==v||("string"==typeof v||Array.isArray(v))&&0===v.length}const Ie=new x.OlP("NgValidators"),Ee=new x.OlP("NgAsyncValidators");function Pe(v){return null}function Ae(v){return null!=v}function Ye(v){return(0,x.QGY)(v)?(0,y.D)(v):v}function _t(v){let M={};return v.forEach(D=>{M=null!=D?{...M,...D}:M}),0===Object.keys(M).length?null:M}function hn(v,M){return M.map(D=>D(v))}function Ht(v){return v.map(M=>function qt(v){return!v.validate}(M)?M:D=>M.validate(D))}function Je(v){return null!=v?function De(v){if(!v)return null;const M=v.filter(Ae);return 0==M.length?null:function(D){return _t(hn(D,M))}}(Ht(v)):null}function Fe(v){return null!=v?function Re(v){if(!v)return null;const M=v.filter(Ae);return 0==M.length?null:function(D){const A=hn(D,M).map(Ye);return(0,s.D)(A).pipe((0,J.U)(_t))}}(Ht(v)):null}function St(v,M){return null===v?[M]:Array.isArray(v)?[...v,M]:[v,M]}function Qt(v){return v?Array.isArray(v)?v:[v]:[]}function Gt(v,M){return Array.isArray(v)?v.includes(M):v===M}function Zt(v,M){const D=Qt(M);return Qt(v).forEach(G=>{Gt(D,G)||D.push(G)}),D}function Jt(v,M){return Qt(M).filter(D=>!Gt(v,D))}class kt{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(M){this._rawValidators=M||[],this._composedValidatorFn=Je(this._rawValidators)}_setAsyncValidators(M){this._rawAsyncValidators=M||[],this._composedAsyncValidatorFn=Fe(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(M){this._onDestroyCallbacks.push(M)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(M=>M()),this._onDestroyCallbacks=[]}reset(M=void 0){this.control&&this.control.reset(M)}hasError(M,D){return!!this.control&&this.control.hasError(M,D)}getError(M,D){return this.control?this.control.getError(M,D):null}}class dt extends kt{get formDirective(){return null}get path(){return null}}class Ot extends kt{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class pt{constructor(M){this._cd=M}get isTouched(){return!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return!!this._cd?.submitted}}let ii=(()=>{var v;class M extends pt{constructor(A){super(A)}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(Ot,2))},v.\u0275dir=x.lG2({type:v,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(A,G){2&A&&x.ekj("ng-untouched",G.isUntouched)("ng-touched",G.isTouched)("ng-pristine",G.isPristine)("ng-dirty",G.isDirty)("ng-valid",G.isValid)("ng-invalid",G.isInvalid)("ng-pending",G.isPending)},features:[x.qOj]}),M})();const nt="VALID",ge="INVALID",ve="PENDING",Xe="DISABLED";function Et(v){return null!=v&&!Array.isArray(v)&&"object"==typeof v}class zn{constructor(M,D){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(M),this._assignAsyncValidators(D)}get validator(){return this._composedValidatorFn}set validator(M){this._rawValidators=this._composedValidatorFn=M}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(M){this._rawAsyncValidators=this._composedAsyncValidatorFn=M}get parent(){return this._parent}get valid(){return this.status===nt}get invalid(){return this.status===ge}get pending(){return this.status==ve}get disabled(){return this.status===Xe}get enabled(){return this.status!==Xe}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(M){this._assignValidators(M)}setAsyncValidators(M){this._assignAsyncValidators(M)}addValidators(M){this.setValidators(Zt(M,this._rawValidators))}addAsyncValidators(M){this.setAsyncValidators(Zt(M,this._rawAsyncValidators))}removeValidators(M){this.setValidators(Jt(M,this._rawValidators))}removeAsyncValidators(M){this.setAsyncValidators(Jt(M,this._rawAsyncValidators))}hasValidator(M){return Gt(this._rawValidators,M)}hasAsyncValidator(M){return Gt(this._rawAsyncValidators,M)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(M={}){this.touched=!0,this._parent&&!M.onlySelf&&this._parent.markAsTouched(M)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(M=>M.markAllAsTouched())}markAsUntouched(M={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(D=>{D.markAsUntouched({onlySelf:!0})}),this._parent&&!M.onlySelf&&this._parent._updateTouched(M)}markAsDirty(M={}){this.pristine=!1,this._parent&&!M.onlySelf&&this._parent.markAsDirty(M)}markAsPristine(M={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(D=>{D.markAsPristine({onlySelf:!0})}),this._parent&&!M.onlySelf&&this._parent._updatePristine(M)}markAsPending(M={}){this.status=ve,!1!==M.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!M.onlySelf&&this._parent.markAsPending(M)}disable(M={}){const D=this._parentMarkedDirty(M.onlySelf);this.status=Xe,this.errors=null,this._forEachChild(A=>{A.disable({...M,onlySelf:!0})}),this._updateValue(),!1!==M.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...M,skipPristineCheck:D}),this._onDisabledChange.forEach(A=>A(!0))}enable(M={}){const D=this._parentMarkedDirty(M.onlySelf);this.status=nt,this._forEachChild(A=>{A.enable({...M,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:M.emitEvent}),this._updateAncestors({...M,skipPristineCheck:D}),this._onDisabledChange.forEach(A=>A(!1))}_updateAncestors(M){this._parent&&!M.onlySelf&&(this._parent.updateValueAndValidity(M),M.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(M){this._parent=M}getRawValue(){return this.value}updateValueAndValidity(M={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===nt||this.status===ve)&&this._runAsyncValidator(M.emitEvent)),!1!==M.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!M.onlySelf&&this._parent.updateValueAndValidity(M)}_updateTreeValidity(M={emitEvent:!0}){this._forEachChild(D=>D._updateTreeValidity(M)),this.updateValueAndValidity({onlySelf:!0,emitEvent:M.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Xe:nt}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(M){if(this.asyncValidator){this.status=ve,this._hasOwnPendingAsyncValidator=!0;const D=Ye(this.asyncValidator(this));this._asyncValidationSubscription=D.subscribe(A=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(A,{emitEvent:M})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(M,D={}){this.errors=M,this._updateControlsErrors(!1!==D.emitEvent)}get(M){let D=M;return null==D||(Array.isArray(D)||(D=D.split(".")),0===D.length)?null:D.reduce((A,G)=>A&&A._find(G),this)}getError(M,D){const A=D?this.get(D):this;return A&&A.errors?A.errors[M]:null}hasError(M,D){return!!this.getError(M,D)}get root(){let M=this;for(;M._parent;)M=M._parent;return M}_updateControlsErrors(M){this.status=this._calculateStatus(),M&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(M)}_initObservables(){this.valueChanges=new x.vpe,this.statusChanges=new x.vpe}_calculateStatus(){return this._allControlsDisabled()?Xe:this.errors?ge:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ve)?ve:this._anyControlsHaveStatus(ge)?ge:nt}_anyControlsHaveStatus(M){return this._anyControls(D=>D.status===M)}_anyControlsDirty(){return this._anyControls(M=>M.dirty)}_anyControlsTouched(){return this._anyControls(M=>M.touched)}_updatePristine(M={}){this.pristine=!this._anyControlsDirty(),this._parent&&!M.onlySelf&&this._parent._updatePristine(M)}_updateTouched(M={}){this.touched=this._anyControlsTouched(),this._parent&&!M.onlySelf&&this._parent._updateTouched(M)}_registerOnCollectionChange(M){this._onCollectionChange=M}_setUpdateStrategy(M){Et(M)&&null!=M.updateOn&&(this._updateOn=M.updateOn)}_parentMarkedDirty(M){return!M&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(M){return null}_assignValidators(M){this._rawValidators=Array.isArray(M)?M.slice():M,this._composedValidatorFn=function Ct(v){return Array.isArray(v)?Je(v):v||null}(this._rawValidators)}_assignAsyncValidators(M){this._rawAsyncValidators=Array.isArray(M)?M.slice():M,this._composedAsyncValidatorFn=function jt(v){return Array.isArray(v)?Fe(v):v||null}(this._rawAsyncValidators)}}const Pt=new x.OlP("CallSetDisabledState",{providedIn:"root",factory:()=>bn}),bn="always";function Ci(v,M,D=bn){(function Lt(v,M){const D=function Ce(v){return v._rawValidators}(v);null!==M.validator?v.setValidators(St(D,M.validator)):"function"==typeof D&&v.setValidators([D]);const A=function Rt(v){return v._rawAsyncValidators}(v);null!==M.asyncValidator?v.setAsyncValidators(St(A,M.asyncValidator)):"function"==typeof A&&v.setAsyncValidators([A]);const G=()=>v.updateValueAndValidity();cr(M._rawValidators,G),cr(M._rawAsyncValidators,G)})(v,M),M.valueAccessor.writeValue(v.value),(v.disabled||"always"===D)&&M.valueAccessor.setDisabledState?.(v.disabled),function pn(v,M){M.valueAccessor.registerOnChange(D=>{v._pendingValue=D,v._pendingChange=!0,v._pendingDirty=!0,"change"===v.updateOn&&En(v,M)})}(v,M),function ti(v,M){const D=(A,G)=>{M.valueAccessor.writeValue(A),G&&M.viewToModelUpdate(A)};v.registerOnChange(D),M._registerOnDestroy(()=>{v._unregisterOnChange(D)})}(v,M),function mn(v,M){M.valueAccessor.registerOnTouched(()=>{v._pendingTouched=!0,"blur"===v.updateOn&&v._pendingChange&&En(v,M),"submit"!==v.updateOn&&v.markAsTouched()})}(v,M),function Ui(v,M){if(M.valueAccessor.setDisabledState){const D=A=>{M.valueAccessor.setDisabledState(A)};v.registerOnDisabledChange(D),M._registerOnDestroy(()=>{v._unregisterOnDisabledChange(D)})}}(v,M)}function cr(v,M){v.forEach(D=>{D.registerOnValidatorChange&&D.registerOnValidatorChange(M)})}function En(v,M){v._pendingDirty&&v.markAsDirty(),v.setValue(v._pendingValue,{emitModelToViewChange:!1}),M.viewToModelUpdate(v._pendingValue),v._pendingChange=!1}function Go(v,M){const D=v.indexOf(M);D>-1&&v.splice(D,1)}function Eo(v){return"object"==typeof v&&null!==v&&2===Object.keys(v).length&&"value"in v&&"disabled"in v}const to=class extends zn{constructor(M=null,D,A){super(function ft(v){return(Et(v)?v.validators:v)||null}(D),function Bt(v,M){return(Et(M)?M.asyncValidators:v)||null}(A,D)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(M),this._setUpdateStrategy(D),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Et(D)&&(D.nonNullable||D.initialValueIsDefault)&&(this.defaultValue=Eo(M)?M.value:M)}setValue(M,D={}){this.value=this._pendingValue=M,this._onChange.length&&!1!==D.emitModelToViewChange&&this._onChange.forEach(A=>A(this.value,!1!==D.emitViewToModelChange)),this.updateValueAndValidity(D)}patchValue(M,D={}){this.setValue(M,D)}reset(M=this.defaultValue,D={}){this._applyFormState(M),this.markAsPristine(D),this.markAsUntouched(D),this.setValue(this.value,D),this._pendingChange=!1}_updateValue(){}_anyControls(M){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(M){this._onChange.push(M)}_unregisterOnChange(M){Go(this._onChange,M)}registerOnDisabledChange(M){this._onDisabledChange.push(M)}_unregisterOnDisabledChange(M){Go(this._onDisabledChange,M)}_forEachChild(M){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(M){Eo(M)?(this.value=this._pendingValue=M.value,M.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=M}},vn={provide:Ot,useExisting:(0,x.Gpc)(()=>In)},Dn=(()=>Promise.resolve())();let In=(()=>{var v;class M extends Ot{constructor(A,G,It,Yn,pi,tr){super(),this._changeDetectorRef=pi,this.callSetDisabledState=tr,this.control=new to,this._registered=!1,this.name="",this.update=new x.vpe,this._parent=A,this._setValidators(G),this._setAsyncValidators(It),this.valueAccessor=function Kt(v,M){if(!M)return null;let D,A,G;return Array.isArray(M),M.forEach(It=>{It.constructor===ae?D=It:function qi(v){return Object.getPrototypeOf(v.constructor)===Y}(It)?A=It:G=It}),G||A||D||null}(0,Yn)}ngOnChanges(A){if(this._checkForErrors(),!this._registered||"name"in A){if(this._registered&&(this._checkName(),this.formDirective)){const G=A.name.previousValue;this.formDirective.removeControl({name:G,path:this._getPath(G)})}this._setUpControl()}"isDisabled"in A&&this._updateDisabled(A),function Ar(v,M){if(!v.hasOwnProperty("model"))return!1;const D=v.model;return!!D.isFirstChange()||!Object.is(M,D.currentValue)}(A,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(A){this.viewModel=A,this.update.emit(A)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Ci(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(A){Dn.then(()=>{this.control.setValue(A,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(A){const G=A.isDisabled.currentValue,It=0!==G&&(0,x.VuI)(G);Dn.then(()=>{It&&!this.control.disabled?this.control.disable():!It&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(A){return this._parent?function Kn(v,M){return[...M.path,v]}(A,this._parent):[A]}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(dt,9),x.Y36(Ie,10),x.Y36(Ee,10),x.Y36(E,10),x.Y36(x.sBO,8),x.Y36(Pt,8))},v.\u0275dir=x.lG2({type:v,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[x._Bn([vn]),x.qOj,x.TTD]}),M})();const di={provide:E,useExisting:(0,x.Gpc)(()=>Ai),multi:!0};let Ai=(()=>{var v;class M extends Y{writeValue(A){this.setProperty("value",A??"")}registerOnChange(A){this.onChange=G=>{A(""==G?null:parseFloat(G))}}}return(v=M).\u0275fac=function(){let D;return function(G){return(D||(D=x.n5z(v)))(G||v)}}(),v.\u0275dir=x.lG2({type:v,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(A,G){1&A&&x.NdJ("input",function(Yn){return G.onChange(Yn.target.value)})("blur",function(){return G.onTouched()})},features:[x._Bn([di]),x.qOj]}),M})(),go=(()=>{var v;class M{}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275mod=x.oAB({type:v}),v.\u0275inj=x.cJS({}),M})();function Oo(v){return"number"==typeof v?v:parseFloat(v)}let Ti=(()=>{var v;class M{constructor(){this._validator=Pe}ngOnChanges(A){if(this.inputName in A){const G=this.normalizeInput(A[this.inputName].currentValue);this._enabled=this.enabled(G),this._validator=this._enabled?this.createValidator(G):Pe,this._onChange&&this._onChange()}}validate(A){return this._validator(A)}registerOnValidatorChange(A){this._onChange=A}enabled(A){return null!=A}}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275dir=x.lG2({type:v,features:[x.TTD]}),M})();const Ns={provide:Ie,useExisting:(0,x.Gpc)(()=>Xo),multi:!0};let Xo=(()=>{var v;class M extends Ti{constructor(){super(...arguments),this.inputName="max",this.normalizeInput=A=>Oo(A),this.createValidator=A=>function ue(v){return M=>{if(oe(M.value)||oe(v))return null;const D=parseFloat(M.value);return!isNaN(D)&&D>v?{max:{max:v,actual:M.value}}:null}}(A)}}return(v=M).\u0275fac=function(){let D;return function(G){return(D||(D=x.n5z(v)))(G||v)}}(),v.\u0275dir=x.lG2({type:v,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(A,G){2&A&&x.uIk("max",G._enabled?G.max:null)},inputs:{max:"max"},features:[x._Bn([Ns]),x.qOj]}),M})();const os={provide:Ie,useExisting:(0,x.Gpc)(()=>Br),multi:!0};let Br=(()=>{var v;class M extends Ti{constructor(){super(...arguments),this.inputName="min",this.normalizeInput=A=>Oo(A),this.createValidator=A=>function le(v){return M=>{if(oe(M.value)||oe(v))return null;const D=parseFloat(M.value);return!isNaN(D)&&D{var v;class M{}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275mod=x.oAB({type:v}),v.\u0275inj=x.cJS({imports:[go]}),M})(),ki=(()=>{var v;class M{static withConfig(A){return{ngModule:M,providers:[{provide:Pt,useValue:A.callSetDisabledState??bn}]}}}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275mod=x.oAB({type:v}),v.\u0275inj=x.cJS({imports:[Do]}),M})()},6593:(Nn,yt,k)=>{"use strict";k.d(yt,{Dx:()=>Jn,b2:()=>Yt,q6:()=>kt});var x=k(2029),h=k(6814);class y extends h.w_{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class s extends y{static makeCurrent(){(0,h.HT)(new s)}onAndCancel(ze,xe,be){return ze.addEventListener(xe,be),()=>{ze.removeEventListener(xe,be)}}dispatchEvent(ze,xe){ze.dispatchEvent(xe)}remove(ze){ze.parentNode&&ze.parentNode.removeChild(ze)}createElement(ze,xe){return(xe=xe||this.getDefaultDocument()).createElement(ze)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(ze){return ze.nodeType===Node.ELEMENT_NODE}isShadowRoot(ze){return ze instanceof DocumentFragment}getGlobalEventTarget(ze,xe){return"window"===xe?window:"document"===xe?ze:"body"===xe?ze.body:null}getBaseHref(ze){const xe=function ie(){return J=J||document.querySelector("base"),J?J.getAttribute("href"):null}();return null==xe?null:function E(pe){Y=Y||document.createElement("a"),Y.setAttribute("href",pe);const ze=Y.pathname;return"/"===ze.charAt(0)?ze:`/${ze}`}(xe)}resetBaseElement(){J=null}getUserAgent(){return window.navigator.userAgent}getCookie(ze){return(0,h.Mx)(document.cookie,ze)}}let Y,J=null,me=(()=>{var pe;class ze{build(){return new XMLHttpRequest}}return(pe=ze).\u0275fac=function(be){return new(be||pe)},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const he=new x.OlP("EventManagerPlugins");let _e=(()=>{var pe;class ze{constructor(be,Ze){this._zone=Ze,this._eventNameToPlugin=new Map,be.forEach(Pt=>{Pt.manager=this}),this._plugins=be.slice().reverse()}addEventListener(be,Ze,Pt){return this._findPluginFor(Ze).addEventListener(be,Ze,Pt)}getZone(){return this._zone}_findPluginFor(be){let Ze=this._eventNameToPlugin.get(be);if(Ze)return Ze;if(Ze=this._plugins.find(bn=>bn.supports(be)),!Ze)throw new x.vHH(5101,!1);return this._eventNameToPlugin.set(be,Ze),Ze}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(he),x.LFG(x.R0b))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();class ee{constructor(ze){this._doc=ze}}const ae="ng-app-id";let oe=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn={}){this.doc=be,this.appId=Ze,this.nonce=Pt,this.platformId=bn,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=(0,h.PM)(bn),this.resetHostNodes()}addStyles(be){for(const Ze of be)1===this.changeUsageCount(Ze,1)&&this.onStyleAdded(Ze)}removeStyles(be){for(const Ze of be)this.changeUsageCount(Ze,-1)<=0&&this.onStyleRemoved(Ze)}ngOnDestroy(){const be=this.styleNodesInDOM;be&&(be.forEach(Ze=>Ze.remove()),be.clear());for(const Ze of this.getAllStyles())this.onStyleRemoved(Ze);this.resetHostNodes()}addHost(be){this.hostNodes.add(be);for(const Ze of this.getAllStyles())this.addStyleToHost(be,Ze)}removeHost(be){this.hostNodes.delete(be)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(be){for(const Ze of this.hostNodes)this.addStyleToHost(Ze,be)}onStyleRemoved(be){const Ze=this.styleRef;Ze.get(be)?.elements?.forEach(Pt=>Pt.remove()),Ze.delete(be)}collectServerRenderedStyles(){const be=this.doc.head?.querySelectorAll(`style[${ae}="${this.appId}"]`);if(be?.length){const Ze=new Map;return be.forEach(Pt=>{null!=Pt.textContent&&Ze.set(Pt.textContent,Pt)}),Ze}return null}changeUsageCount(be,Ze){const Pt=this.styleRef;if(Pt.has(be)){const bn=Pt.get(be);return bn.usage+=Ze,bn.usage}return Pt.set(be,{usage:Ze,elements:[]}),Ze}getStyleElement(be,Ze){const Pt=this.styleNodesInDOM,bn=Pt?.get(Ze);if(bn?.parentNode===be)return Pt.delete(Ze),bn.removeAttribute(ae),bn;{const Kn=this.doc.createElement("style");return this.nonce&&Kn.setAttribute("nonce",this.nonce),Kn.textContent=Ze,this.platformIsServer&&Kn.setAttribute(ae,this.appId),Kn}}addStyleToHost(be,Ze){const Pt=this.getStyleElement(be,Ze);be.appendChild(Pt);const bn=this.styleRef,Kn=bn.get(Ze)?.elements;Kn?Kn.push(Pt):bn.set(Ze,{elements:[Pt],usage:1})}resetHostNodes(){const be=this.hostNodes;be.clear(),be.add(this.doc.head)}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0),x.LFG(x.AFp),x.LFG(x.Ojb,8),x.LFG(x.Lbi))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const Be={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},Ie=/%COMP%/g,ue=new x.OlP("RemoveStylesOnCompDestroy",{providedIn:"root",factory:()=>!1});function Le(pe,ze){return ze.map(xe=>xe.replace(Ie,pe))}let ye=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn,Ci,wi,cr=null){this.eventManager=be,this.sharedStylesHost=Ze,this.appId=Pt,this.removeStylesOnCompDestroy=bn,this.doc=Kn,this.platformId=Ci,this.ngZone=wi,this.nonce=cr,this.rendererByCompId=new Map,this.platformIsServer=(0,h.PM)(Ci),this.defaultRenderer=new gt(be,Kn,wi,this.platformIsServer)}createRenderer(be,Ze){if(!be||!Ze)return this.defaultRenderer;this.platformIsServer&&Ze.encapsulation===x.ifc.ShadowDom&&(Ze={...Ze,encapsulation:x.ifc.Emulated});const Pt=this.getOrCreateRenderer(be,Ze);return Pt instanceof hn?Pt.applyToHost(be):Pt instanceof _t&&Pt.applyStyles(),Pt}getOrCreateRenderer(be,Ze){const Pt=this.rendererByCompId;let bn=Pt.get(Ze.id);if(!bn){const Kn=this.doc,Ci=this.ngZone,wi=this.eventManager,cr=this.sharedStylesHost,Ui=this.removeStylesOnCompDestroy,Lt=this.platformIsServer;switch(Ze.encapsulation){case x.ifc.Emulated:bn=new hn(wi,cr,Ze,this.appId,Ui,Kn,Ci,Lt);break;case x.ifc.ShadowDom:return new Ye(wi,cr,be,Ze,Kn,Ci,this.nonce,Lt);default:bn=new _t(wi,cr,Ze,Ui,Kn,Ci,Lt)}Pt.set(Ze.id,bn)}return bn}ngOnDestroy(){this.rendererByCompId.clear()}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(_e),x.LFG(oe),x.LFG(x.AFp),x.LFG(ue),x.LFG(h.K0),x.LFG(x.Lbi),x.LFG(x.R0b),x.LFG(x.Ojb))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();class gt{constructor(ze,xe,be,Ze){this.eventManager=ze,this.doc=xe,this.ngZone=be,this.platformIsServer=Ze,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(ze,xe){return xe?this.doc.createElementNS(Be[xe]||xe,ze):this.doc.createElement(ze)}createComment(ze){return this.doc.createComment(ze)}createText(ze){return this.doc.createTextNode(ze)}appendChild(ze,xe){(Ae(ze)?ze.content:ze).appendChild(xe)}insertBefore(ze,xe,be){ze&&(Ae(ze)?ze.content:ze).insertBefore(xe,be)}removeChild(ze,xe){ze&&ze.removeChild(xe)}selectRootElement(ze,xe){let be="string"==typeof ze?this.doc.querySelector(ze):ze;if(!be)throw new x.vHH(-5104,!1);return xe||(be.textContent=""),be}parentNode(ze){return ze.parentNode}nextSibling(ze){return ze.nextSibling}setAttribute(ze,xe,be,Ze){if(Ze){xe=Ze+":"+xe;const Pt=Be[Ze];Pt?ze.setAttributeNS(Pt,xe,be):ze.setAttribute(xe,be)}else ze.setAttribute(xe,be)}removeAttribute(ze,xe,be){if(be){const Ze=Be[be];Ze?ze.removeAttributeNS(Ze,xe):ze.removeAttribute(`${be}:${xe}`)}else ze.removeAttribute(xe)}addClass(ze,xe){ze.classList.add(xe)}removeClass(ze,xe){ze.classList.remove(xe)}setStyle(ze,xe,be,Ze){Ze&(x.JOm.DashCase|x.JOm.Important)?ze.style.setProperty(xe,be,Ze&x.JOm.Important?"important":""):ze.style[xe]=be}removeStyle(ze,xe,be){be&x.JOm.DashCase?ze.style.removeProperty(xe):ze.style[xe]=""}setProperty(ze,xe,be){ze[xe]=be}setValue(ze,xe){ze.nodeValue=xe}listen(ze,xe,be){if("string"==typeof ze&&!(ze=(0,h.q)().getGlobalEventTarget(this.doc,ze)))throw new Error(`Unsupported event target ${ze} for event ${xe}`);return this.eventManager.addEventListener(ze,xe,this.decoratePreventDefault(be))}decoratePreventDefault(ze){return xe=>{if("__ngUnwrap__"===xe)return ze;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>ze(xe)):ze(xe))&&xe.preventDefault()}}}function Ae(pe){return"TEMPLATE"===pe.tagName&&void 0!==pe.content}class Ye extends gt{constructor(ze,xe,be,Ze,Pt,bn,Kn,Ci){super(ze,Pt,bn,Ci),this.sharedStylesHost=xe,this.hostEl=be,this.shadowRoot=be.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const wi=Le(Ze.id,Ze.styles);for(const cr of wi){const Ui=document.createElement("style");Kn&&Ui.setAttribute("nonce",Kn),Ui.textContent=cr,this.shadowRoot.appendChild(Ui)}}nodeOrShadowRoot(ze){return ze===this.hostEl?this.shadowRoot:ze}appendChild(ze,xe){return super.appendChild(this.nodeOrShadowRoot(ze),xe)}insertBefore(ze,xe,be){return super.insertBefore(this.nodeOrShadowRoot(ze),xe,be)}removeChild(ze,xe){return super.removeChild(this.nodeOrShadowRoot(ze),xe)}parentNode(ze){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(ze)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class _t extends gt{constructor(ze,xe,be,Ze,Pt,bn,Kn,Ci){super(ze,Pt,bn,Kn),this.sharedStylesHost=xe,this.removeStylesOnCompDestroy=Ze,this.styles=Ci?Le(Ci,be.styles):be.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class hn extends _t{constructor(ze,xe,be,Ze,Pt,bn,Kn,Ci){const wi=Ze+"-"+be.id;super(ze,xe,be,Pt,bn,Kn,Ci,wi),this.contentAttr=function ct(pe){return"_ngcontent-%COMP%".replace(Ie,pe)}(wi),this.hostAttr=function ht(pe){return"_nghost-%COMP%".replace(Ie,pe)}(wi)}applyToHost(ze){this.applyStyles(),this.setAttribute(ze,this.hostAttr,"")}createElement(ze,xe){const be=super.createElement(ze,xe);return super.setAttribute(be,this.contentAttr,""),be}}let qt=(()=>{var pe;class ze extends ee{constructor(be){super(be)}supports(be){return!0}addEventListener(be,Ze,Pt){return be.addEventListener(Ze,Pt,!1),()=>this.removeEventListener(be,Ze,Pt)}removeEventListener(be,Ze,Pt){return be.removeEventListener(Ze,Pt)}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const Ht=["alt","control","meta","shift"],De={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Je={alt:pe=>pe.altKey,control:pe=>pe.ctrlKey,meta:pe=>pe.metaKey,shift:pe=>pe.shiftKey};let Re=(()=>{var pe;class ze extends ee{constructor(be){super(be)}supports(be){return null!=ze.parseEventName(be)}addEventListener(be,Ze,Pt){const bn=ze.parseEventName(Ze),Kn=ze.eventCallback(bn.fullKey,Pt,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>(0,h.q)().onAndCancel(be,bn.domEventName,Kn))}static parseEventName(be){const Ze=be.toLowerCase().split("."),Pt=Ze.shift();if(0===Ze.length||"keydown"!==Pt&&"keyup"!==Pt)return null;const bn=ze._normalizeKey(Ze.pop());let Kn="",Ci=Ze.indexOf("code");if(Ci>-1&&(Ze.splice(Ci,1),Kn="code."),Ht.forEach(cr=>{const Ui=Ze.indexOf(cr);Ui>-1&&(Ze.splice(Ui,1),Kn+=cr+".")}),Kn+=bn,0!=Ze.length||0===bn.length)return null;const wi={};return wi.domEventName=Pt,wi.fullKey=Kn,wi}static matchEventFullKeyCode(be,Ze){let Pt=De[be.key]||be.key,bn="";return Ze.indexOf("code.")>-1&&(Pt=be.code,bn="code."),!(null==Pt||!Pt)&&(Pt=Pt.toLowerCase()," "===Pt?Pt="space":"."===Pt&&(Pt="dot"),Ht.forEach(Kn=>{Kn!==Pt&&(0,Je[Kn])(be)&&(bn+=Kn+".")}),bn+=Pt,bn===Ze)}static eventCallback(be,Ze,Pt){return bn=>{ze.matchEventFullKeyCode(bn,be)&&Pt.runGuarded(()=>Ze(bn))}}static _normalizeKey(be){return"esc"===be?"escape":be}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const kt=(0,x.eFA)(x._c5,"browser",[{provide:x.Lbi,useValue:h.bD},{provide:x.g9A,useValue:function Qt(){s.makeCurrent()},multi:!0},{provide:h.K0,useFactory:function Zt(){return(0,x.RDi)(document),document},deps:[]}]),dt=new x.OlP(""),Ot=[{provide:x.rWj,useClass:class Ne{addToWindow(ze){x.dqk.getAngularTestability=(be,Ze=!0)=>{const Pt=ze.findTestabilityInTree(be,Ze);if(null==Pt)throw new x.vHH(5103,!1);return Pt},x.dqk.getAllAngularTestabilities=()=>ze.getAllTestabilities(),x.dqk.getAllAngularRootElements=()=>ze.getAllRootElements(),x.dqk.frameworkStabilizers||(x.dqk.frameworkStabilizers=[]),x.dqk.frameworkStabilizers.push(be=>{const Ze=x.dqk.getAllAngularTestabilities();let Pt=Ze.length,bn=!1;const Kn=function(Ci){bn=bn||Ci,Pt--,0==Pt&&be(bn)};Ze.forEach(Ci=>{Ci.whenStable(Kn)})})}findTestabilityInTree(ze,xe,be){return null==xe?null:ze.getTestability(xe)??(be?(0,h.q)().isShadowRoot(xe)?this.findTestabilityInTree(ze,xe.host,!0):this.findTestabilityInTree(ze,xe.parentElement,!0):null)}},deps:[]},{provide:x.lri,useClass:x.dDg,deps:[x.R0b,x.eoX,x.rWj]},{provide:x.dDg,useClass:x.dDg,deps:[x.R0b,x.eoX,x.rWj]}],pt=[{provide:x.zSh,useValue:"root"},{provide:x.qLn,useFactory:function Gt(){return new x.qLn},deps:[]},{provide:he,useClass:qt,multi:!0,deps:[h.K0,x.R0b,x.Lbi]},{provide:he,useClass:Re,multi:!0,deps:[h.K0]},ye,oe,_e,{provide:x.FYo,useExisting:ye},{provide:h.JF,useClass:me,deps:[]},[]];let Yt=(()=>{var pe;class ze{constructor(be){}static withServerTransition(be){return{ngModule:ze,providers:[{provide:x.AFp,useValue:be.appId}]}}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(dt,12))},pe.\u0275mod=x.oAB({type:pe}),pe.\u0275inj=x.cJS({providers:[...pt,...Ot],imports:[h.ez,x.hGG]}),ze})(),Jn=(()=>{var pe;class ze{constructor(be){this._doc=be}getTitle(){return this._doc.title}setTitle(be){this._doc.title=be||""}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0))},pe.\u0275prov=x.Yz7({token:pe,factory:function(be){let Ze=null;return Ze=be?new be:function Ft(){return new Jn((0,x.LFG)(h.K0))}(),Ze},providedIn:"root"}),ze})();typeof window<"u"&&window},6800:(Nn,yt,k)=>{"use strict";k.d(yt,{gz:()=>Po,y6:()=>To,OD:()=>Si,eC:()=>Ot,wN:()=>ho,F0:()=>es,rH:()=>Za,Bz:()=>Cd,Hx:()=>ve});var x=k(2029),h=k(2664),y=k(7715),s=k(2096),J=k(5619),ie=k(2572);const E=(0,k(2306).d)(R=>function(){R(this),this.name="EmptyError",this.message="no elements in sequence"});var Ne=k(5211),me=k(4911),he=k(8407),_e=k(5592),ee=k(4674);function ae(R,U){const $=(0,ee.m)(R)?R:()=>R,z=K=>K.error($());return new _e.y(U?K=>U.schedule(z,0,K):z)}var oe=k(6232),Be=k(7394),Ie=k(9360),Ee=k(8251);function Ue(){return(0,Ie.e)((R,U)=>{let $=null;R._refCount++;const z=(0,Ee.x)(U,void 0,void 0,void 0,()=>{if(!R||R._refCount<=0||0<--R._refCount)return void($=null);const K=R._connection,Me=$;$=null,K&&(!Me||K===Me)&&K.unsubscribe(),U.unsubscribe()});R.subscribe(z),z.closed||($=R.connect())})}class et extends _e.y{constructor(U,$){super(),this.source=U,this.subjectFactory=$,this._subject=null,this._refCount=0,this._connection=null,(0,Ie.A)(U)&&(this.lift=U.lift)}_subscribe(U){return this.getSubject().subscribe(U)}getSubject(){const U=this._subject;return(!U||U.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:U}=this;this._subject=this._connection=null,U?.unsubscribe()}connect(){let U=this._connection;if(!U){U=this._connection=new Be.w0;const $=this.getSubject();U.add(this.source.subscribe((0,Ee.x)($,void 0,()=>{this._teardown(),$.complete()},z=>{this._teardown(),$.error(z)},()=>this._teardown()))),U.closed&&(this._connection=null,U=Be.w0.EMPTY)}return U}refCount(){return Ue()(this)}}var le=k(8645),ue=k(6814),ct=k(7398),ht=k(4664),Le=k(8180),ye=k(4564),Te=k(2181),Pe=k(1631);function Ae(R){return(0,Ie.e)((U,$)=>{let z=!1;U.subscribe((0,Ee.x)($,K=>{z=!0,$.next(K)},()=>{z||$.next(R),$.complete()}))})}function Ye(R=_t){return(0,Ie.e)((U,$)=>{let z=!1;U.subscribe((0,Ee.x)($,K=>{z=!0,$.next(K)},()=>z?$.complete():$.error(R())))})}function _t(){return new E}var hn=k(2737);function qt(R,U){const $=arguments.length>=2;return z=>z.pipe(R?(0,Te.h)((K,Me)=>R(K,Me,z)):hn.y,(0,Le.q)(1),$?Ae(U):Ye(()=>new E))}var Ht=k(6328);function De(R,U,$){const z=(0,ee.m)(R)||U||$?{next:R,error:U,complete:$}:R;return z?(0,Ie.e)((K,Me)=>{var Ge;null===(Ge=z.subscribe)||void 0===Ge||Ge.call(z);let en=!0;K.subscribe((0,Ee.x)(Me,$n=>{var xn;null===(xn=z.next)||void 0===xn||xn.call(z,$n),Me.next($n)},()=>{var $n;en=!1,null===($n=z.complete)||void 0===$n||$n.call(z),Me.complete()},$n=>{var xn;en=!1,null===(xn=z.error)||void 0===xn||xn.call(z,$n),Me.error($n)},()=>{var $n,xn;en&&(null===($n=z.unsubscribe)||void 0===$n||$n.call(z)),null===(xn=z.finalize)||void 0===xn||xn.call(z)}))}):hn.y}var Je=k(4829);function Re(R){return(0,Ie.e)((U,$)=>{let Me,z=null,K=!1;z=U.subscribe((0,Ee.x)($,void 0,void 0,Ge=>{Me=(0,Je.Xf)(R(Ge,Re(R)(U))),z?(z.unsubscribe(),z=null,Me.subscribe($)):K=!0})),K&&(z.unsubscribe(),z=null,Me.subscribe($))})}function Ce(R){return R<=0?()=>oe.E:(0,Ie.e)((U,$)=>{let z=[];U.subscribe((0,Ee.x)($,K=>{z.push(K),R{for(const K of z)$.next(K);$.complete()},void 0,()=>{z=null}))})}var Gt=k(4716),Zt=k(2420),kt=k(7537),dt=k(6593);const Ot="primary",pt=Symbol("RouteTitle");class Yt{constructor(U){this.params=U||{}}has(U){return Object.prototype.hasOwnProperty.call(this.params,U)}get(U){if(this.has(U)){const $=this.params[U];return Array.isArray($)?$[0]:$}return null}getAll(U){if(this.has(U)){const $=this.params[U];return Array.isArray($)?$:[$]}return[]}get keys(){return Object.keys(this.params)}}function Ut(R){return new Yt(R)}function ii(R,U,$){const z=$.path.split("/");if(z.length>R.length||"full"===$.pathMatch&&(U.hasChildren()||z.lengthz[Me]===K)}return R===U}function Wt(R){return R.length>0?R[R.length-1]:null}function wt(R){return(0,h.b)(R)?R:(0,x.QGY)(R)?(0,y.D)(Promise.resolve(R)):(0,s.of)(R)}const vt={exact:function lr(R,U,$){if(!nt(R.segments,U.segments)||!Mn(R.segments,U.segments,$)||R.numberOfChildren!==U.numberOfChildren)return!1;for(const z in U.children)if(!R.children[z]||!lr(R.children[z],U.children[z],$))return!1;return!0},subset:Fi},ln={exact:function er(R,U){return Ft(R,U)},subset:function mi(R,U){return Object.keys(U).length<=Object.keys(R).length&&Object.keys(U).every($=>Jn(R[$],U[$]))},ignored:()=>!0};function ni(R,U,$){return vt[$.paths](R.root,U.root,$.matrixParams)&&ln[$.queryParams](R.queryParams,U.queryParams)&&!("exact"===$.fragment&&R.fragment!==U.fragment)}function Fi(R,U,$){return Cn(R,U,U.segments,$)}function Cn(R,U,$,z){if(R.segments.length>$.length){const K=R.segments.slice(0,$.length);return!(!nt(K,$)||U.hasChildren()||!Mn(K,$,z))}if(R.segments.length===$.length){if(!nt(R.segments,$)||!Mn(R.segments,$,z))return!1;for(const K in U.children)if(!R.children[K]||!Fi(R.children[K],U.children[K],z))return!1;return!0}{const K=$.slice(0,R.segments.length),Me=$.slice(R.segments.length);return!!(nt(R.segments,K)&&Mn(R.segments,K,z)&&R.children[Ot])&&Cn(R.children[Ot],U,Me,z)}}function Mn(R,U,$){return U.every((z,K)=>ln[$](R[K].parameters,z.parameters))}class qn{constructor(U=new yn([],{}),$={},z=null){this.root=U,this.queryParams=$,this.fragment=z}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Ut(this.queryParams)),this._queryParamMap}toString(){return ft.serialize(this)}}class yn{constructor(U,$){this.segments=U,this.children=$,this.parent=null,Object.values($).forEach(z=>z.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Ct(this)}}class _n{constructor(U,$){this.path=U,this.parameters=$}get parameterMap(){return this._parameterMap||(this._parameterMap=Ut(this.parameters)),this._parameterMap}toString(){return ze(this)}}function nt(R,U){return R.length===U.length&&R.every(($,z)=>$.path===U[z].path)}let ve=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return new Xe},providedIn:"root"}),U})();class Xe{parse(U){const $=new Lt(U);return new qn($.parseRootSegment(),$.parseQueryParams(),$.parseFragment())}serialize(U){const $=`/${Bt(U.root,!0)}`,z=function be(R){const U=Object.keys(R).map($=>{const z=R[$];return Array.isArray(z)?z.map(K=>`${Et($)}=${Et(K)}`).join("&"):`${Et($)}=${Et(z)}`}).filter($=>!!$);return U.length?`?${U.join("&")}`:""}(U.queryParams);return`${$}${z}${"string"==typeof U.fragment?`#${function Xt(R){return encodeURI(R)}(U.fragment)}`:""}`}}const ft=new Xe;function Ct(R){return R.segments.map(U=>ze(U)).join("/")}function Bt(R,U){if(!R.hasChildren())return Ct(R);if(U){const $=R.children[Ot]?Bt(R.children[Ot],!1):"",z=[];return Object.entries(R.children).forEach(([K,Me])=>{K!==Ot&&z.push(`${K}:${Bt(Me,!1)}`)}),z.length>0?`${$}(${z.join("//")})`:$}{const $=function ge(R,U){let $=[];return Object.entries(R.children).forEach(([z,K])=>{z===Ot&&($=$.concat(U(K,z)))}),Object.entries(R.children).forEach(([z,K])=>{z!==Ot&&($=$.concat(U(K,z)))}),$}(R,(z,K)=>K===Ot?[Bt(R.children[Ot],!1)]:[`${K}:${Bt(z,!1)}`]);return 1===Object.keys(R.children).length&&null!=R.children[Ot]?`${Ct(R)}/${$[0]}`:`${Ct(R)}/(${$.join("//")})`}}function jt(R){return encodeURIComponent(R).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Et(R){return jt(R).replace(/%3B/gi,";")}function Sn(R){return jt(R).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function zn(R){return decodeURIComponent(R)}function pe(R){return zn(R.replace(/\+/g,"%20"))}function ze(R){return`${Sn(R.path)}${function xe(R){return Object.keys(R).map(U=>`;${Sn(U)}=${Sn(R[U])}`).join("")}(R.parameters)}`}const Ze=/^[^\/()?;#]+/;function Pt(R){const U=R.match(Ze);return U?U[0]:""}const bn=/^[^\/()?;=#]+/,Ci=/^[^=?&#]+/,cr=/^[^&#]+/;class Lt{constructor(U){this.url=U,this.remaining=U}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new yn([],{}):new yn([],this.parseChildren())}parseQueryParams(){const U={};if(this.consumeOptional("?"))do{this.parseQueryParam(U)}while(this.consumeOptional("&"));return U}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const U=[];for(this.peekStartsWith("(")||U.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),U.push(this.parseSegment());let $={};this.peekStartsWith("/(")&&(this.capture("/"),$=this.parseParens(!0));let z={};return this.peekStartsWith("(")&&(z=this.parseParens(!1)),(U.length>0||Object.keys($).length>0)&&(z[Ot]=new yn(U,$)),z}parseSegment(){const U=Pt(this.remaining);if(""===U&&this.peekStartsWith(";"))throw new x.vHH(4009,!1);return this.capture(U),new _n(zn(U),this.parseMatrixParams())}parseMatrixParams(){const U={};for(;this.consumeOptional(";");)this.parseParam(U);return U}parseParam(U){const $=function Kn(R){const U=R.match(bn);return U?U[0]:""}(this.remaining);if(!$)return;this.capture($);let z="";if(this.consumeOptional("=")){const K=Pt(this.remaining);K&&(z=K,this.capture(z))}U[zn($)]=zn(z)}parseQueryParam(U){const $=function wi(R){const U=R.match(Ci);return U?U[0]:""}(this.remaining);if(!$)return;this.capture($);let z="";if(this.consumeOptional("=")){const Ge=function Ui(R){const U=R.match(cr);return U?U[0]:""}(this.remaining);Ge&&(z=Ge,this.capture(z))}const K=pe($),Me=pe(z);if(U.hasOwnProperty(K)){let Ge=U[K];Array.isArray(Ge)||(Ge=[Ge],U[K]=Ge),Ge.push(Me)}else U[K]=Me}parseParens(U){const $={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const z=Pt(this.remaining),K=this.remaining[z.length];if("/"!==K&&")"!==K&&";"!==K)throw new x.vHH(4010,!1);let Me;z.indexOf(":")>-1?(Me=z.slice(0,z.indexOf(":")),this.capture(Me),this.capture(":")):U&&(Me=Ot);const Ge=this.parseChildren();$[Me]=1===Object.keys(Ge).length?Ge[Ot]:new yn([],Ge),this.consumeOptional("//")}return $}peekStartsWith(U){return this.remaining.startsWith(U)}consumeOptional(U){return!!this.peekStartsWith(U)&&(this.remaining=this.remaining.substring(U.length),!0)}capture(U){if(!this.consumeOptional(U))throw new x.vHH(4011,!1)}}function st(R){return R.segments.length>0?new yn([],{[Ot]:R}):R}function pn(R){const U={};for(const z of Object.keys(R.children)){const Me=pn(R.children[z]);if(z===Ot&&0===Me.segments.length&&Me.hasChildren())for(const[Ge,en]of Object.entries(Me.children))U[Ge]=en;else(Me.segments.length>0||Me.hasChildren())&&(U[z]=Me)}return function mn(R){if(1===R.numberOfChildren&&R.children[Ot]){const U=R.children[Ot];return new yn(R.segments.concat(U.segments),U.children)}return R}(new yn(R.segments,U))}function En(R){return R instanceof qn}function gi(R){let U;const K=st(function $(Me){const Ge={};for(const $n of Me.children){const xn=$($n);Ge[$n.outlet]=xn}const en=new yn(Me.url,Ge);return Me===R&&(U=en),en}(R.root));return U??K}function _i(R,U,$,z){let K=R;for(;K.parent;)K=K.parent;if(0===U.length)return ir(K,K,K,$,z);const Me=function Ar(R){if("string"==typeof R[0]&&1===R.length&&"/"===R[0])return new vi(!0,0,R);let U=0,$=!1;const z=R.reduce((K,Me,Ge)=>{if("object"==typeof Me&&null!=Me){if(Me.outlets){const en={};return Object.entries(Me.outlets).forEach(([$n,xn])=>{en[$n]="string"==typeof xn?xn.split("/"):xn}),[...K,{outlets:en}]}if(Me.segmentPath)return[...K,Me.segmentPath]}return"string"!=typeof Me?[...K,Me]:0===Ge?(Me.split("/").forEach((en,$n)=>{0==$n&&"."===en||(0==$n&&""===en?$=!0:".."===en?U++:""!=en&&K.push(en))}),K):[...K,Me]},[]);return new vi($,U,z)}(U);if(Me.toRoot())return ir(K,K,new yn([],{}),$,z);const Ge=function Bi(R,U,$){if(R.isAbsolute)return new qi(U,!0,0);if(!$)return new qi(U,!1,NaN);if(null===$.parent)return new qi($,!0,0);const z=Li(R.commands[0])?0:1;return function Kt(R,U,$){let z=R,K=U,Me=$;for(;Me>K;){if(Me-=K,z=z.parent,!z)throw new x.vHH(4005,!1);K=z.segments.length}return new qi(z,!1,K-Me)}($,$.segments.length-1+z,R.numberOfDoubleDots)}(Me,K,R),en=Ge.processChildren?yr(Ge.segmentGroup,Ge.index,Me.commands):rr(Ge.segmentGroup,Ge.index,Me.commands);return ir(K,Ge.segmentGroup,en,$,z)}function Li(R){return"object"==typeof R&&null!=R&&!R.outlets&&!R.segmentPath}function bi(R){return"object"==typeof R&&null!=R&&R.outlets}function ir(R,U,$,z,K){let Ge,Me={};z&&Object.entries(z).forEach(([$n,xn])=>{Me[$n]=Array.isArray(xn)?xn.map(Oi=>`${Oi}`):`${xn}`}),Ge=R===U?$:Dr(R,U,$);const en=st(pn(Ge));return new qn(en,Me,K)}function Dr(R,U,$){const z={};return Object.entries(R.children).forEach(([K,Me])=>{z[K]=Me===U?$:Dr(Me,U,$)}),new yn(R.segments,z)}class vi{constructor(U,$,z){if(this.isAbsolute=U,this.numberOfDoubleDots=$,this.commands=z,U&&z.length>0&&Li(z[0]))throw new x.vHH(4003,!1);const K=z.find(bi);if(K&&K!==Wt(z))throw new x.vHH(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class qi{constructor(U,$,z){this.segmentGroup=U,this.processChildren=$,this.index=z}}function rr(R,U,$){if(R||(R=new yn([],{})),0===R.segments.length&&R.hasChildren())return yr(R,U,$);const z=function xr(R,U,$){let z=0,K=U;const Me={match:!1,pathIndex:0,commandIndex:0};for(;K=$.length)return Me;const Ge=R.segments[K],en=$[z];if(bi(en))break;const $n=`${en}`,xn=z<$.length-1?$[z+1]:null;if(K>0&&void 0===$n)break;if($n&&xn&&"object"==typeof xn&&void 0===xn.outlets){if(!to($n,xn,Ge))return Me;z+=2}else{if(!to($n,{},Ge))return Me;z++}K++}return{match:!0,pathIndex:K,commandIndex:z}}(R,U,$),K=$.slice(z.commandIndex);if(z.match&&z.pathIndexMe!==Ot)&&R.children[Ot]&&1===R.numberOfChildren&&0===R.children[Ot].segments.length){const Me=yr(R.children[Ot],U,$);return new yn(R.segments,Me.children)}return Object.entries(z).forEach(([Me,Ge])=>{"string"==typeof Ge&&(Ge=[Ge]),null!==Ge&&(K[Me]=rr(R.children[Me],U,Ge))}),Object.entries(R.children).forEach(([Me,Ge])=>{void 0===z[Me]&&(K[Me]=Ge)}),new yn(R.segments,K)}}function Sr(R,U,$){const z=R.segments.slice(0,U);let K=0;for(;K<$.length;){const Me=$[K];if(bi(Me)){const $n=Go(Me.outlets);return new yn(z,$n)}if(0===K&&Li($[0])){z.push(new _n(R.segments[U].path,Eo($[0]))),K++;continue}const Ge=bi(Me)?Me.outlets[Ot]:`${Me}`,en=K<$.length-1?$[K+1]:null;Ge&&en&&Li(en)?(z.push(new _n(Ge,Eo(en))),K+=2):(z.push(new _n(Ge,{})),K++)}return new yn(z,{})}function Go(R){const U={};return Object.entries(R).forEach(([$,z])=>{"string"==typeof z&&(z=[z]),null!==z&&(U[$]=Sr(new yn([],{}),0,z))}),U}function Eo(R){const U={};return Object.entries(R).forEach(([$,z])=>U[$]=`${z}`),U}function to(R,U,$){return R==$.path&&Ft(U,$.parameters)}const Xn="imperative";class Ei{constructor(U,$){this.id=U,this.url=$}}class Si extends Ei{constructor(U,$,z="imperative",K=null){super(U,$),this.type=0,this.navigationTrigger=z,this.restoredState=K}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class we extends Ei{constructor(U,$,z){super(U,$),this.urlAfterRedirects=z,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class fe extends Ei{constructor(U,$,z,K){super(U,$),this.reason=z,this.code=K,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class je extends Ei{constructor(U,$,z,K){super(U,$),this.reason=z,this.code=K,this.type=16}}class lt extends Ei{constructor(U,$,z,K){super(U,$),this.error=z,this.target=K,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class an extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Vt extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class vn extends Ei{constructor(U,$,z,K,Me){super(U,$),this.urlAfterRedirects=z,this.state=K,this.shouldActivate=Me,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Dn extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class In extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Fn{constructor(U){this.route=U,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class di{constructor(U){this.route=U,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Ai{constructor(U){this.snapshot=U,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ni{constructor(U){this.snapshot=U,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class vr{constructor(U){this.snapshot=U,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class go{constructor(U){this.snapshot=U,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Nr{constructor(U,$,z){this.routerEvent=U,this.position=$,this.anchor=z,this.type=15}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class co{}class uo{constructor(U){this.url=U}}class kr{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new To,this.attachRef=null}}let To=(()=>{var R;class U{constructor(){this.contexts=new Map}onChildOutletCreated(z,K){const Me=this.getOrCreateContext(z);Me.outlet=K,this.contexts.set(z,Me)}onChildOutletDestroyed(z){const K=this.getContext(z);K&&(K.outlet=null,K.attachRef=null)}onOutletDeactivated(){const z=this.contexts;return this.contexts=new Map,z}onOutletReAttached(z){this.contexts=z}getOrCreateContext(z){let K=this.getContext(z);return K||(K=new kr,this.contexts.set(z,K)),K}getContext(z){return this.contexts.get(z)||null}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();class ds{constructor(U){this._root=U}get root(){return this._root.value}parent(U){const $=this.pathFromRoot(U);return $.length>1?$[$.length-2]:null}children(U){const $=xo(U,this._root);return $?$.children.map(z=>z.value):[]}firstChild(U){const $=xo(U,this._root);return $&&$.children.length>0?$.children[0].value:null}siblings(U){const $=zi(U,this._root);return $.length<2?[]:$[$.length-2].children.map(K=>K.value).filter(K=>K!==U)}pathFromRoot(U){return zi(U,this._root).map($=>$.value)}}function xo(R,U){if(R===U.value)return U;for(const $ of U.children){const z=xo(R,$);if(z)return z}return null}function zi(R,U){if(R===U.value)return[U];for(const $ of U.children){const z=zi(R,$);if(z.length)return z.unshift(U),z}return[]}class Fr{constructor(U,$){this.value=U,this.children=$}toString(){return`TreeNode(${this.value})`}}function Or(R){const U={};return R&&R.children.forEach($=>U[$.value.outlet]=$),U}class Er extends ds{constructor(U,$){super(U),this.snapshot=$,li(this,U)}toString(){return this.snapshot.toString()}}function so(R,U){const $=function Gs(R,U){const Ge=new bs([],{},{},"",{},Ot,U,null,{});return new gr("",new Fr(Ge,[]))}(0,U),z=new J.X([new _n("",{})]),K=new J.X({}),Me=new J.X({}),Ge=new J.X({}),en=new J.X(""),$n=new Po(z,K,Ge,en,Me,Ot,U,$.root);return $n.snapshot=$.root,new Er(new Fr($n,[]),$)}class Po{constructor(U,$,z,K,Me,Ge,en,$n){this.urlSubject=U,this.paramsSubject=$,this.queryParamsSubject=z,this.fragmentSubject=K,this.dataSubject=Me,this.outlet=Ge,this.component=en,this._futureSnapshot=$n,this.title=this.dataSubject?.pipe((0,ct.U)(xn=>xn[pt]))??(0,s.of)(void 0),this.url=U,this.params=$,this.queryParams=z,this.fragment=K,this.data=Me}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe((0,ct.U)(U=>Ut(U)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe((0,ct.U)(U=>Ut(U)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Hr(R,U="emptyOnly"){const $=R.pathFromRoot;let z=0;if("always"!==U)for(z=$.length-1;z>=1;){const K=$[z],Me=$[z-1];if(K.routeConfig&&""===K.routeConfig.path)z--;else{if(Me.component)break;z--}}return function wa(R){return R.reduce((U,$)=>({params:{...U.params,...$.params},data:{...U.data,...$.data},resolve:{...$.data,...U.resolve,...$.routeConfig?.data,...$._resolvedData}}),{params:{},data:{},resolve:{}})}($.slice(z))}class bs{get title(){return this.data?.[pt]}constructor(U,$,z,K,Me,Ge,en,$n,xn){this.url=U,this.params=$,this.queryParams=z,this.fragment=K,this.data=Me,this.outlet=Ge,this.component=en,this.routeConfig=$n,this._resolve=xn}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Ut(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Ut(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(z=>z.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class gr extends ds{constructor(U,$){super($),this.url=U,li(this,$)}toString(){return Zi(this._root)}}function li(R,U){U.value._routerState=R,U.children.forEach($=>li(R,$))}function Zi(R){const U=R.children.length>0?` { ${R.children.map(Zi).join(", ")} } `:"";return`${R.value}${U}`}function Rr(R){if(R.snapshot){const U=R.snapshot,$=R._futureSnapshot;R.snapshot=$,Ft(U.queryParams,$.queryParams)||R.queryParamsSubject.next($.queryParams),U.fragment!==$.fragment&&R.fragmentSubject.next($.fragment),Ft(U.params,$.params)||R.paramsSubject.next($.params),function gn(R,U){if(R.length!==U.length)return!1;for(let $=0;$Ft($.parameters,U[z].parameters))}(R.url,U.url);return $&&!(!R.parent!=!U.parent)&&(!R.parent||_o(R.parent,U.parent))}let rs=(()=>{var R;class U{constructor(){this.activated=null,this._activatedRoute=null,this.name=Ot,this.activateEvents=new x.vpe,this.deactivateEvents=new x.vpe,this.attachEvents=new x.vpe,this.detachEvents=new x.vpe,this.parentContexts=(0,x.f3M)(To),this.location=(0,x.f3M)(x.s_b),this.changeDetector=(0,x.f3M)(x.sBO),this.environmentInjector=(0,x.f3M)(x.lqb),this.inputBinder=(0,x.f3M)(ko,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(z){if(z.name){const{firstChange:K,previousValue:Me}=z.name;if(K)return;this.isTrackedInParentContexts(Me)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(Me)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(z){return this.parentContexts.getContext(z)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const z=this.parentContexts.getContext(this.name);z?.route&&(z.attachRef?this.attach(z.attachRef,z.route):this.activateWith(z.route,z.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new x.vHH(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new x.vHH(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new x.vHH(4012,!1);this.location.detach();const z=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(z.instance),z}attach(z,K){this.activated=z,this._activatedRoute=K,this.location.insert(z.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(z.instance)}deactivate(){if(this.activated){const z=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(z)}}activateWith(z,K){if(this.isActivated)throw new x.vHH(4013,!1);this._activatedRoute=z;const Me=this.location,en=z.snapshot.component,$n=this.parentContexts.getOrCreateContext(this.name).children,xn=new zr(z,$n,Me.injector);this.activated=Me.createComponent(en,{index:Me.length,injector:xn,environmentInjector:K??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275dir=x.lG2({type:R,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[x.TTD]}),U})();class zr{constructor(U,$,z){this.route=U,this.childContexts=$,this.parent=z}get(U,$){return U===Po?this.route:U===To?this.childContexts:this.parent.get(U,$)}}const ko=new x.OlP("");let br=(()=>{var R;class U{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(z){this.unsubscribeFromRouteData(z),this.subscribeToRouteData(z)}unsubscribeFromRouteData(z){this.outletDataSubscriptions.get(z)?.unsubscribe(),this.outletDataSubscriptions.delete(z)}subscribeToRouteData(z){const{activatedRoute:K}=z,Me=(0,ie.a)([K.queryParams,K.params,K.data]).pipe((0,ht.w)(([Ge,en,$n],xn)=>($n={...Ge,...en,...$n},0===xn?(0,s.of)($n):Promise.resolve($n)))).subscribe(Ge=>{if(!z.isActivated||!z.activatedComponentRef||z.activatedRoute!==K||null===K.component)return void this.unsubscribeFromRouteData(z);const en=(0,x.qFp)(K.component);if(en)for(const{templateName:$n}of en.inputs)z.activatedComponentRef.setInput($n,Ge[$n]);else this.unsubscribeFromRouteData(z)});this.outletDataSubscriptions.set(z,Me)}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac}),U})();function Oo(R,U,$){if($&&R.shouldReuseRoute(U.value,$.value.snapshot)){const z=$.value;z._futureSnapshot=U.value;const K=function Ti(R,U,$){return U.children.map(z=>{for(const K of $.children)if(R.shouldReuseRoute(z.value,K.value.snapshot))return Oo(R,z,K);return Oo(R,z)})}(R,U,$);return new Fr(z,K)}{if(R.shouldAttach(U.value)){const Me=R.retrieve(U.value);if(null!==Me){const Ge=Me.route;return Ge.value._futureSnapshot=U.value,Ge.children=U.children.map(en=>Oo(R,en)),Ge}}const z=function Ns(R){return new Po(new J.X(R.url),new J.X(R.params),new J.X(R.queryParams),new J.X(R.fragment),new J.X(R.data),R.outlet,R.component,R)}(U.value),K=U.children.map(Me=>Oo(R,Me));return new Fr(z,K)}}const Xo="ngNavigationCancelingError";function os(R,U){const{redirectTo:$,navigationBehaviorOptions:z}=En(U)?{redirectTo:U,navigationBehaviorOptions:void 0}:U,K=Br(!1,0,U);return K.url=$,K.navigationBehaviorOptions=z,K}function Br(R,U,$){const z=new Error("NavigationCancelingError: "+(R||""));return z[Xo]=!0,z.cancellationCode=U,$&&(z.url=$),z}function ws(R){return R&&R[Xo]}let Fo=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275cmp=x.Xpm({type:R,selectors:[["ng-component"]],standalone:!0,features:[x.jDz],decls:1,vars:0,template:function(z,K){1&z&&x._UZ(0,"router-outlet")},dependencies:[rs],encapsulation:2}),U})();function ia(R){const U=R.children&&R.children.map(ia),$=U?{...R,children:U}:{...R};return!$.component&&!$.loadComponent&&(U||$.loadChildren)&&$.outlet&&$.outlet!==Ot&&($.component=Fo),$}function Ur(R){return R.outlet||Ot}function Do(R){if(!R)return null;if(R.routeConfig?._injector)return R.routeConfig._injector;for(let U=R.parent;U;U=U.parent){const $=U.routeConfig;if($?._loadedInjector)return $._loadedInjector;if($?._injector)return $._injector}return null}class el{constructor(U,$,z,K,Me){this.routeReuseStrategy=U,this.futureState=$,this.currState=z,this.forwardEvent=K,this.inputBindingEnabled=Me}activate(U){const $=this.futureState._root,z=this.currState?this.currState._root:null;this.deactivateChildRoutes($,z,U),Rr(this.futureState.root),this.activateChildRoutes($,z,U)}deactivateChildRoutes(U,$,z){const K=Or($);U.children.forEach(Me=>{const Ge=Me.value.outlet;this.deactivateRoutes(Me,K[Ge],z),delete K[Ge]}),Object.values(K).forEach(Me=>{this.deactivateRouteAndItsChildren(Me,z)})}deactivateRoutes(U,$,z){const K=U.value,Me=$?$.value:null;if(K===Me)if(K.component){const Ge=z.getContext(K.outlet);Ge&&this.deactivateChildRoutes(U,$,Ge.children)}else this.deactivateChildRoutes(U,$,z);else Me&&this.deactivateRouteAndItsChildren($,z)}deactivateRouteAndItsChildren(U,$){U.value.component&&this.routeReuseStrategy.shouldDetach(U.value.snapshot)?this.detachAndStoreRouteSubtree(U,$):this.deactivateRouteAndOutlet(U,$)}detachAndStoreRouteSubtree(U,$){const z=$.getContext(U.value.outlet),K=z&&U.value.component?z.children:$,Me=Or(U);for(const Ge of Object.keys(Me))this.deactivateRouteAndItsChildren(Me[Ge],K);if(z&&z.outlet){const Ge=z.outlet.detach(),en=z.children.onOutletDeactivated();this.routeReuseStrategy.store(U.value.snapshot,{componentRef:Ge,route:U,contexts:en})}}deactivateRouteAndOutlet(U,$){const z=$.getContext(U.value.outlet),K=z&&U.value.component?z.children:$,Me=Or(U);for(const Ge of Object.keys(Me))this.deactivateRouteAndItsChildren(Me[Ge],K);z&&(z.outlet&&(z.outlet.deactivate(),z.children.onOutletDeactivated()),z.attachRef=null,z.route=null)}activateChildRoutes(U,$,z){const K=Or($);U.children.forEach(Me=>{this.activateRoutes(Me,K[Me.value.outlet],z),this.forwardEvent(new go(Me.value.snapshot))}),U.children.length&&this.forwardEvent(new Ni(U.value.snapshot))}activateRoutes(U,$,z){const K=U.value,Me=$?$.value:null;if(Rr(K),K===Me)if(K.component){const Ge=z.getOrCreateContext(K.outlet);this.activateChildRoutes(U,$,Ge.children)}else this.activateChildRoutes(U,$,z);else if(K.component){const Ge=z.getOrCreateContext(K.outlet);if(this.routeReuseStrategy.shouldAttach(K.snapshot)){const en=this.routeReuseStrategy.retrieve(K.snapshot);this.routeReuseStrategy.store(K.snapshot,null),Ge.children.onOutletReAttached(en.contexts),Ge.attachRef=en.componentRef,Ge.route=en.route.value,Ge.outlet&&Ge.outlet.attach(en.componentRef,en.route.value),Rr(en.route.value),this.activateChildRoutes(U,null,Ge.children)}else{const en=Do(K.snapshot);Ge.attachRef=null,Ge.route=K,Ge.injector=en,Ge.outlet&&Ge.outlet.activateWith(K,Ge.injector),this.activateChildRoutes(U,null,Ge.children)}}else this.activateChildRoutes(U,null,z)}}class Bo{constructor(U){this.path=U,this.route=this.path[this.path.length-1]}}class yo{constructor(U,$){this.component=U,this.route=$}}function ra(R,U,$){const z=R._root;return ki(z,U?U._root:null,$,[z.value])}function Ls(R,U){const $=Symbol(),z=U.get(R,$);return z===$?"function"!=typeof R||(0,x.Z0I)(R)?U.get(R):R:z}function ki(R,U,$,z,K={canDeactivateChecks:[],canActivateChecks:[]}){const Me=Or(U);return R.children.forEach(Ge=>{(function Ws(R,U,$,z,K={canDeactivateChecks:[],canActivateChecks:[]}){const Me=R.value,Ge=U?U.value:null,en=$?$.getContext(R.value.outlet):null;if(Ge&&Me.routeConfig===Ge.routeConfig){const $n=function v(R,U,$){if("function"==typeof $)return $(R,U);switch($){case"pathParamsChange":return!nt(R.url,U.url);case"pathParamsOrQueryParamsChange":return!nt(R.url,U.url)||!Ft(R.queryParams,U.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!_o(R,U)||!Ft(R.queryParams,U.queryParams);default:return!_o(R,U)}}(Ge,Me,Me.routeConfig.runGuardsAndResolvers);$n?K.canActivateChecks.push(new Bo(z)):(Me.data=Ge.data,Me._resolvedData=Ge._resolvedData),ki(R,U,Me.component?en?en.children:null:$,z,K),$n&&en&&en.outlet&&en.outlet.isActivated&&K.canDeactivateChecks.push(new yo(en.outlet.component,Ge))}else Ge&&M(U,en,K),K.canActivateChecks.push(new Bo(z)),ki(R,null,Me.component?en?en.children:null:$,z,K)})(Ge,Me[Ge.value.outlet],$,z.concat([Ge.value]),K),delete Me[Ge.value.outlet]}),Object.entries(Me).forEach(([Ge,en])=>M(en,$.getContext(Ge),K)),K}function M(R,U,$){const z=Or(R),K=R.value;Object.entries(z).forEach(([Me,Ge])=>{M(Ge,K.component?U?U.children.getContext(Me):null:U,$)}),$.canDeactivateChecks.push(new yo(K.component&&U&&U.outlet&&U.outlet.isActivated?U.outlet.component:null,K))}function D(R){return"function"==typeof R}function oa(R){return R instanceof E||"EmptyError"===R?.name}const Es=Symbol("INITIAL_VALUE");function ks(){return(0,ht.w)(R=>(0,ie.a)(R.map(U=>U.pipe((0,Le.q)(1),function gt(...R){const U=(0,ye.yG)(R);return(0,Ie.e)(($,z)=>{(U?(0,Ne.z)(R,$,U):(0,Ne.z)(R,$)).subscribe(z)})}(Es)))).pipe((0,ct.U)(U=>{for(const $ of U)if(!0!==$){if($===Es)return Es;if(!1===$||$ instanceof qn)return $}return!0}),(0,Te.h)(U=>U!==Es),(0,Le.q)(1)))}function Ca(R){return(0,he.z)(De(U=>{if(En(U))throw os(0,U)}),(0,ct.U)(U=>!0===U))}class Ea{constructor(U){this.segmentGroup=U||null}}class dc{constructor(U){this.urlTree=U}}function fa(R){return ae(new Ea(R))}function Na(R){return ae(new dc(R))}class hc{constructor(U,$){this.urlSerializer=U,this.urlTree=$}noMatchError(U){return new x.vHH(4002,!1)}lineralizeSegments(U,$){let z=[],K=$.root;for(;;){if(z=z.concat(K.segments),0===K.numberOfChildren)return(0,s.of)(z);if(K.numberOfChildren>1||!K.children[Ot])return ae(new x.vHH(4e3,!1));K=K.children[Ot]}}applyRedirectCommands(U,$,z){return this.applyRedirectCreateUrlTree($,this.urlSerializer.parse($),U,z)}applyRedirectCreateUrlTree(U,$,z,K){const Me=this.createSegmentGroup(U,$.root,z,K);return new qn(Me,this.createQueryParams($.queryParams,this.urlTree.queryParams),$.fragment)}createQueryParams(U,$){const z={};return Object.entries(U).forEach(([K,Me])=>{if("string"==typeof Me&&Me.startsWith(":")){const en=Me.substring(1);z[K]=$[en]}else z[K]=Me}),z}createSegmentGroup(U,$,z,K){const Me=this.createSegments(U,$.segments,z,K);let Ge={};return Object.entries($.children).forEach(([en,$n])=>{Ge[en]=this.createSegmentGroup(U,$n,z,K)}),new yn(Me,Ge)}createSegments(U,$,z,K){return $.map(Me=>Me.path.startsWith(":")?this.findPosParam(U,Me,K):this.findOrReturn(Me,z))}findPosParam(U,$,z){const K=z[$.path.substring(1)];if(!K)throw new x.vHH(4001,!1);return K}findOrReturn(U,$){let z=0;for(const K of $){if(K.path===U.path)return $.splice(z),K;z++}return U}}const Us={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function nl(R,U,$,z,K){const Me=Ao(R,U,$);return Me.matched?(z=function Ho(R,U){return R.providers&&!R._injector&&(R._injector=(0,x.MMx)(R.providers,U,`Route: ${R.path}`)),R._injector??U}(U,z),function uc(R,U,$,z){const K=U.canMatch;if(!K||0===K.length)return(0,s.of)(!0);const Me=K.map(Ge=>{const en=Ls(Ge,R);return wt(function tr(R){return R&&D(R.canMatch)}(en)?en.canMatch(U,$):R.runInContext(()=>en(U,$)))});return(0,s.of)(Me).pipe(ks(),Ca())}(z,U,$).pipe((0,ct.U)(Ge=>!0===Ge?Me:{...Us}))):(0,s.of)(Me)}function Ao(R,U,$){if(""===U.path)return"full"===U.pathMatch&&(R.hasChildren()||$.length>0)?{...Us}:{matched:!0,consumedSegments:[],remainingSegments:$,parameters:{},positionalParamSegments:{}};const K=(U.matcher||ii)($,R,U);if(!K)return{...Us};const Me={};Object.entries(K.posParams??{}).forEach(([en,$n])=>{Me[en]=$n.path});const Ge=K.consumed.length>0?{...Me,...K.consumed[K.consumed.length-1].parameters}:Me;return{matched:!0,consumedSegments:K.consumed,remainingSegments:$.slice(K.consumed.length),parameters:Ge,positionalParamSegments:K.posParams??{}}}function za(R,U,$,z){return $.length>0&&function Vl(R,U,$){return $.some(z=>bl(R,U,z)&&Ur(z)!==Ot)}(R,$,z)?{segmentGroup:new yn(U,Ua(z,new yn($,R.children))),slicedSegments:[]}:0===$.length&&function sa(R,U,$){return $.some(z=>bl(R,U,z))}(R,$,z)?{segmentGroup:new yn(R.segments,Mu(R,0,$,z,R.children)),slicedSegments:$}:{segmentGroup:new yn(R.segments,R.children),slicedSegments:$}}function Mu(R,U,$,z,K){const Me={};for(const Ge of z)if(bl(R,$,Ge)&&!K[Ur(Ge)]){const en=new yn([],{});Me[Ur(Ge)]=en}return{...K,...Me}}function Ua(R,U){const $={};$[Ot]=U;for(const z of R)if(""===z.path&&Ur(z)!==Ot){const K=new yn([],{});$[Ur(z)]=K}return $}function bl(R,U,$){return(!(R.hasChildren()||U.length>0)||"full"!==$.pathMatch)&&""===$.path}class Au{constructor(U,$,z,K,Me,Ge,en){this.injector=U,this.configLoader=$,this.rootComponentType=z,this.config=K,this.urlTree=Me,this.paramsInheritanceStrategy=Ge,this.urlSerializer=en,this.allowRedirects=!0,this.applyRedirects=new hc(this.urlSerializer,this.urlTree)}noMatchError(U){return new x.vHH(4002,!1)}recognize(){const U=za(this.urlTree.root,[],[],this.config).segmentGroup;return this.processSegmentGroup(this.injector,this.config,U,Ot).pipe(Re($=>{if($ instanceof dc)return this.allowRedirects=!1,this.urlTree=$.urlTree,this.match($.urlTree);throw $ instanceof Ea?this.noMatchError($):$}),(0,ct.U)($=>{const z=new bs([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},Ot,this.rootComponentType,null,{}),K=new Fr(z,$),Me=new gr("",K),Ge=function ti(R,U,$=null,z=null){return _i(gi(R),U,$,z)}(z,[],this.urlTree.queryParams,this.urlTree.fragment);return Ge.queryParams=this.urlTree.queryParams,Me.url=this.urlSerializer.serialize(Ge),this.inheritParamsAndData(Me._root),{state:Me,tree:Ge}}))}match(U){return this.processSegmentGroup(this.injector,this.config,U.root,Ot).pipe(Re(z=>{throw z instanceof Ea?this.noMatchError(z):z}))}inheritParamsAndData(U){const $=U.value,z=Hr($,this.paramsInheritanceStrategy);$.params=Object.freeze(z.params),$.data=Object.freeze(z.data),U.children.forEach(K=>this.inheritParamsAndData(K))}processSegmentGroup(U,$,z,K){return 0===z.segments.length&&z.hasChildren()?this.processChildren(U,$,z):this.processSegment(U,$,z,z.segments,K,!0)}processChildren(U,$,z){const K=[];for(const Me of Object.keys(z.children))"primary"===Me?K.unshift(Me):K.push(Me);return(0,y.D)(K).pipe((0,Ht.b)(Me=>{const Ge=z.children[Me],en=function fs(R,U){const $=R.filter(z=>Ur(z)===U);return $.push(...R.filter(z=>Ur(z)!==U)),$}($,Me);return this.processSegmentGroup(U,en,Ge,Me)}),function St(R,U){return(0,Ie.e)(function Fe(R,U,$,z,K){return(Me,Ge)=>{let en=$,$n=U,xn=0;Me.subscribe((0,Ee.x)(Ge,Oi=>{const ar=xn++;$n=en?R($n,Oi,ar):(en=!0,Oi),z&&Ge.next($n)},K&&(()=>{en&&Ge.next($n),Ge.complete()})))}}(R,U,arguments.length>=2,!0))}((Me,Ge)=>(Me.push(...Ge),Me)),Ae(null),function Rt(R,U){const $=arguments.length>=2;return z=>z.pipe(R?(0,Te.h)((K,Me)=>R(K,Me,z)):hn.y,Ce(1),$?Ae(U):Ye(()=>new E))}(),(0,Pe.z)(Me=>{if(null===Me)return fa(z);const Ge=il(Me);return function wl(R){R.sort((U,$)=>U.value.outlet===Ot?-1:$.value.outlet===Ot?1:U.value.outlet.localeCompare($.value.outlet))}(Ge),(0,s.of)(Ge)}))}processSegment(U,$,z,K,Me,Ge){return(0,y.D)($).pipe((0,Ht.b)(en=>this.processSegmentAgainstRoute(en._injector??U,$,en,z,K,Me,Ge).pipe(Re($n=>{if($n instanceof Ea)return(0,s.of)(null);throw $n}))),qt(en=>!!en),Re(en=>{if(oa(en))return function Gc(R,U,$){return 0===U.length&&!R.children[$]}(z,K,Me)?(0,s.of)([]):fa(z);throw en}))}processSegmentAgainstRoute(U,$,z,K,Me,Ge,en){return function vd(R,U,$,z){return!!(Ur(R)===z||z!==Ot&&bl(U,$,R))&&("**"===R.path||Ao(U,R,$).matched)}(z,K,Me,Ge)?void 0===z.redirectTo?this.matchSegmentAgainstRoute(U,K,z,Me,Ge,en):en&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(U,K,$,z,Me,Ge):fa(K):fa(K)}expandSegmentAgainstRouteUsingRedirect(U,$,z,K,Me,Ge){return"**"===K.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(U,z,K,Ge):this.expandRegularSegmentAgainstRouteUsingRedirect(U,$,z,K,Me,Ge)}expandWildCardWithParamsAgainstRouteUsingRedirect(U,$,z,K){const Me=this.applyRedirects.applyRedirectCommands([],z.redirectTo,{});return z.redirectTo.startsWith("/")?Na(Me):this.applyRedirects.lineralizeSegments(z,Me).pipe((0,Pe.z)(Ge=>{const en=new yn(Ge,{});return this.processSegment(U,$,en,Ge,K,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(U,$,z,K,Me,Ge){const{matched:en,consumedSegments:$n,remainingSegments:xn,positionalParamSegments:Oi}=Ao($,K,Me);if(!en)return fa($);const ar=this.applyRedirects.applyRedirectCommands($n,K.redirectTo,Oi);return K.redirectTo.startsWith("/")?Na(ar):this.applyRedirects.lineralizeSegments(K,ar).pipe((0,Pe.z)(po=>this.processSegment(U,z,$,po.concat(xn),Ge,!1)))}matchSegmentAgainstRoute(U,$,z,K,Me,Ge){let en;if("**"===z.path){const $n=K.length>0?Wt(K).parameters:{},xn=new bs(K,$n,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,pc(z),Ur(z),z.component??z._loadedComponent??null,z,qs(z));en=(0,s.of)({snapshot:xn,consumedSegments:[],remainingSegments:[]}),$.children={}}else en=nl($,z,K,U).pipe((0,ct.U)(({matched:$n,consumedSegments:xn,remainingSegments:Oi,parameters:ar})=>$n?{snapshot:new bs(xn,ar,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,pc(z),Ur(z),z.component??z._loadedComponent??null,z,qs(z)),consumedSegments:xn,remainingSegments:Oi}:null));return en.pipe((0,ht.w)($n=>null===$n?fa($):this.getChildConfig(U=z._injector??U,z,K).pipe((0,ht.w)(({routes:xn})=>{const Oi=z._loadedInjector??U,{snapshot:ar,consumedSegments:po,remainingSegments:f}=$n,{segmentGroup:r,slicedSegments:c}=za($,po,f,xn);if(0===c.length&&r.hasChildren())return this.processChildren(Oi,xn,r).pipe((0,ct.U)(b=>null===b?null:[new Fr(ar,b)]));if(0===xn.length&&0===c.length)return(0,s.of)([new Fr(ar,[])]);const m=Ur(z)===Me;return this.processSegment(Oi,xn,r,c,m?Ot:Me,!0).pipe((0,ct.U)(b=>[new Fr(ar,b)]))}))))}getChildConfig(U,$,z){return $.children?(0,s.of)({routes:$.children,injector:U}):$.loadChildren?void 0!==$._loadedRoutes?(0,s.of)({routes:$._loadedRoutes,injector:$._loadedInjector}):function ha(R,U,$,z){const K=U.canLoad;if(void 0===K||0===K.length)return(0,s.of)(!0);const Me=K.map(Ge=>{const en=Ls(Ge,R);return wt(function G(R){return R&&D(R.canLoad)}(en)?en.canLoad(U,$):R.runInContext(()=>en(U,$)))});return(0,s.of)(Me).pipe(ks(),Ca())}(U,$,z).pipe((0,Pe.z)(K=>K?this.configLoader.loadChildren(U,$).pipe(De(Me=>{$._loadedRoutes=Me.routes,$._loadedInjector=Me.injector})):function Iu(R){return ae(Br(!1,3))}())):(0,s.of)({routes:[],injector:U})}}function $l(R){const U=R.value.routeConfig;return U&&""===U.path}function il(R){const U=[],$=new Set;for(const z of R){if(!$l(z)){U.push(z);continue}const K=U.find(Me=>z.value.routeConfig===Me.value.routeConfig);void 0!==K?(K.children.push(...z.children),$.add(K)):U.push(z)}for(const z of $){const K=il(z.children);U.push(new Fr(z.value,K))}return U.filter(z=>!$.has(z))}function pc(R){return R.data||{}}function qs(R){return R.resolve||{}}function He(R){return"string"==typeof R.title||null===R.title}function At(R){return(0,ht.w)(U=>{const $=R(U);return $?(0,y.D)($).pipe((0,ct.U)(()=>U)):(0,s.of)(U)})}const cn=new x.OlP("ROUTES");let ri=(()=>{var R;class U{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=(0,x.f3M)(x.Sil)}loadComponent(z){if(this.componentLoaders.get(z))return this.componentLoaders.get(z);if(z._loadedComponent)return(0,s.of)(z._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(z);const K=wt(z.loadComponent()).pipe((0,ct.U)(Xi),De(Ge=>{this.onLoadEndListener&&this.onLoadEndListener(z),z._loadedComponent=Ge}),(0,Gt.x)(()=>{this.componentLoaders.delete(z)})),Me=new et(K,()=>new le.x).pipe(Ue());return this.componentLoaders.set(z,Me),Me}loadChildren(z,K){if(this.childrenLoaders.get(K))return this.childrenLoaders.get(K);if(K._loadedRoutes)return(0,s.of)({routes:K._loadedRoutes,injector:K._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(K);const Ge=this.loadModuleFactoryOrRoutes(K.loadChildren).pipe((0,ct.U)($n=>{this.onLoadEndListener&&this.onLoadEndListener(K);let xn,Oi;return Array.isArray($n)?Oi=$n:(xn=$n.create(z).injector,Oi=xn.get(cn,[],x.XFs.Self|x.XFs.Optional).flat()),{routes:Oi.map(ia),injector:xn}}),(0,Gt.x)(()=>{this.childrenLoaders.delete(K)})),en=new et(Ge,()=>new le.x).pipe(Ue());return this.childrenLoaders.set(K,en),en}loadModuleFactoryOrRoutes(z){return wt(z()).pipe((0,ct.U)(Xi),(0,Pe.z)(K=>K instanceof x.YKP||Array.isArray(K)?(0,s.of)(K):(0,y.D)(this.compiler.compileModuleAsync(K))))}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();function Xi(R){return function fr(R){return R&&"object"==typeof R&&"default"in R}(R)?R.default:R}let pr=(()=>{var R;class U{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new le.x,this.transitionAbortSubject=new le.x,this.configLoader=(0,x.f3M)(ri),this.environmentInjector=(0,x.f3M)(x.lqb),this.urlSerializer=(0,x.f3M)(ve),this.rootContexts=(0,x.f3M)(To),this.inputBindingEnabled=null!==(0,x.f3M)(ko,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>(0,s.of)(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=Me=>this.events.next(new di(Me)),this.configLoader.onLoadStartListener=Me=>this.events.next(new Fn(Me))}complete(){this.transitions?.complete()}handleNavigationRequest(z){const K=++this.navigationId;this.transitions?.next({...this.transitions.value,...z,id:K})}setupNavigations(z,K,Me){return this.transitions=new J.X({id:0,currentUrlTree:K,currentRawUrl:K,currentBrowserUrl:K,extractedUrl:z.urlHandlingStrategy.extract(K),urlAfterRedirects:z.urlHandlingStrategy.extract(K),rawUrl:K,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:Xn,restoredState:null,currentSnapshot:Me.snapshot,targetSnapshot:null,currentRouterState:Me,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe((0,Te.h)(Ge=>0!==Ge.id),(0,ct.U)(Ge=>({...Ge,extractedUrl:z.urlHandlingStrategy.extract(Ge.rawUrl)})),(0,ht.w)(Ge=>{this.currentTransition=Ge;let en=!1,$n=!1;return(0,s.of)(Ge).pipe(De(xn=>{this.currentNavigation={id:xn.id,initialUrl:xn.rawUrl,extractedUrl:xn.extractedUrl,trigger:xn.source,extras:xn.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),(0,ht.w)(xn=>{const Oi=xn.currentBrowserUrl.toString(),ar=!z.navigated||xn.extractedUrl.toString()!==Oi||Oi!==xn.currentUrlTree.toString();if(!ar&&"reload"!==(xn.extras.onSameUrlNavigation??z.onSameUrlNavigation)){const f="";return this.events.next(new je(xn.id,this.urlSerializer.serialize(xn.rawUrl),f,0)),xn.resolve(null),oe.E}if(z.urlHandlingStrategy.shouldProcessUrl(xn.rawUrl))return(0,s.of)(xn).pipe((0,ht.w)(f=>{const r=this.transitions?.getValue();return this.events.next(new Si(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),r!==this.transitions?.getValue()?oe.E:Promise.resolve(f)}),function Ta(R,U,$,z,K,Me){return(0,Pe.z)(Ge=>function fc(R,U,$,z,K,Me,Ge="emptyOnly"){return new Au(R,U,$,z,K,Ge,Me).recognize()}(R,U,$,z,Ge.extractedUrl,K,Me).pipe((0,ct.U)(({state:en,tree:$n})=>({...Ge,targetSnapshot:en,urlAfterRedirects:$n}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,z.config,this.urlSerializer,z.paramsInheritanceStrategy),De(f=>{Ge.targetSnapshot=f.targetSnapshot,Ge.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const r=new an(f.id,this.urlSerializer.serialize(f.extractedUrl),this.urlSerializer.serialize(f.urlAfterRedirects),f.targetSnapshot);this.events.next(r)}));if(ar&&z.urlHandlingStrategy.shouldProcessUrl(xn.currentRawUrl)){const{id:f,extractedUrl:r,source:c,restoredState:m,extras:b}=xn,T=new Si(f,this.urlSerializer.serialize(r),c,m);this.events.next(T);const O=so(0,this.rootComponentType).snapshot;return this.currentTransition=Ge={...xn,targetSnapshot:O,urlAfterRedirects:r,extras:{...b,skipLocationChange:!1,replaceUrl:!1}},(0,s.of)(Ge)}{const f="";return this.events.next(new je(xn.id,this.urlSerializer.serialize(xn.extractedUrl),f,1)),xn.resolve(null),oe.E}}),De(xn=>{const Oi=new Vt(xn.id,this.urlSerializer.serialize(xn.extractedUrl),this.urlSerializer.serialize(xn.urlAfterRedirects),xn.targetSnapshot);this.events.next(Oi)}),(0,ct.U)(xn=>(this.currentTransition=Ge={...xn,guards:ra(xn.targetSnapshot,xn.currentSnapshot,this.rootContexts)},Ge)),function Fa(R,U){return(0,Pe.z)($=>{const{targetSnapshot:z,currentSnapshot:K,guards:{canActivateChecks:Me,canDeactivateChecks:Ge}}=$;return 0===Ge.length&&0===Me.length?(0,s.of)({...$,guardsResult:!0}):function tl(R,U,$,z){return(0,y.D)(R).pipe((0,Pe.z)(K=>function cc(R,U,$,z,K){const Me=U&&U.routeConfig?U.routeConfig.canDeactivate:null;if(!Me||0===Me.length)return(0,s.of)(!0);const Ge=Me.map(en=>{const $n=Do(U)??K,xn=Ls(en,$n);return wt(function pi(R){return R&&D(R.canDeactivate)}(xn)?xn.canDeactivate(R,U,$,z):$n.runInContext(()=>xn(R,U,$,z))).pipe(qt())});return(0,s.of)(Ge).pipe(ks())}(K.component,K.route,$,U,z)),qt(K=>!0!==K,!0))}(Ge,z,K,R).pipe((0,Pe.z)(en=>en&&function A(R){return"boolean"==typeof R}(en)?function da(R,U,$,z){return(0,y.D)(U).pipe((0,Ht.b)(K=>(0,Ne.z)(function Ba(R,U){return null!==R&&U&&U(new Ai(R)),(0,s.of)(!0)}(K.route.parent,z),function yl(R,U){return null!==R&&U&&U(new vr(R)),(0,s.of)(!0)}(K.route,z),function Ts(R,U,$){const z=U[U.length-1],Me=U.slice(0,U.length-1).reverse().map(Ge=>function Rs(R){const U=R.routeConfig?R.routeConfig.canActivateChild:null;return U&&0!==U.length?{node:R,guards:U}:null}(Ge)).filter(Ge=>null!==Ge).map(Ge=>(0,me.P)(()=>{const en=Ge.guards.map($n=>{const xn=Do(Ge.node)??$,Oi=Ls($n,xn);return wt(function Yn(R){return R&&D(R.canActivateChild)}(Oi)?Oi.canActivateChild(z,R):xn.runInContext(()=>Oi(z,R))).pipe(qt())});return(0,s.of)(en).pipe(ks())}));return(0,s.of)(Me).pipe(ks())}(R,K.path,$),function vl(R,U,$){const z=U.routeConfig?U.routeConfig.canActivate:null;if(!z||0===z.length)return(0,s.of)(!0);const K=z.map(Me=>(0,me.P)(()=>{const Ge=Do(U)??$,en=Ls(Me,Ge);return wt(function It(R){return R&&D(R.canActivate)}(en)?en.canActivate(U,R):Ge.runInContext(()=>en(U,R))).pipe(qt())}));return(0,s.of)(K).pipe(ks())}(R,K.route,$))),qt(K=>!0!==K,!0))}(z,Me,R,U):(0,s.of)(en)),(0,ct.U)(en=>({...$,guardsResult:en})))})}(this.environmentInjector,xn=>this.events.next(xn)),De(xn=>{if(Ge.guardsResult=xn.guardsResult,En(xn.guardsResult))throw os(0,xn.guardsResult);const Oi=new vn(xn.id,this.urlSerializer.serialize(xn.extractedUrl),this.urlSerializer.serialize(xn.urlAfterRedirects),xn.targetSnapshot,!!xn.guardsResult);this.events.next(Oi)}),(0,Te.h)(xn=>!!xn.guardsResult||(this.cancelNavigationTransition(xn,"",3),!1)),At(xn=>{if(xn.guards.canActivateChecks.length)return(0,s.of)(xn).pipe(De(Oi=>{const ar=new Dn(Oi.id,this.urlSerializer.serialize(Oi.extractedUrl),this.urlSerializer.serialize(Oi.urlAfterRedirects),Oi.targetSnapshot);this.events.next(ar)}),(0,ht.w)(Oi=>{let ar=!1;return(0,s.of)(Oi).pipe(function Zs(R,U){return(0,Pe.z)($=>{const{targetSnapshot:z,guards:{canActivateChecks:K}}=$;if(!K.length)return(0,s.of)($);let Me=0;return(0,y.D)(K).pipe((0,Ht.b)(Ge=>function N(R,U,$,z){const K=R.routeConfig,Me=R._resolve;return void 0!==K?.title&&!He(K)&&(Me[pt]=K.title),function ne(R,U,$,z){const K=function it(R){return[...Object.keys(R),...Object.getOwnPropertySymbols(R)]}(R);if(0===K.length)return(0,s.of)({});const Me={};return(0,y.D)(K).pipe((0,Pe.z)(Ge=>function Q(R,U,$,z){const K=Do(U)??z,Me=Ls(R,K);return wt(Me.resolve?Me.resolve(U,$):K.runInContext(()=>Me(U,$)))}(R[Ge],U,$,z).pipe(qt(),De(en=>{Me[Ge]=en}))),Ce(1),function Qt(R){return(0,ct.U)(()=>R)}(Me),Re(Ge=>oa(Ge)?oe.E:ae(Ge)))}(Me,R,U,z).pipe((0,ct.U)(Ge=>(R._resolvedData=Ge,R.data=Hr(R,$).resolve,K&&He(K)&&(R.data[pt]=K.title),null)))}(Ge.route,z,R,U)),De(()=>Me++),Ce(1),(0,Pe.z)(Ge=>Me===K.length?(0,s.of)($):oe.E))})}(z.paramsInheritanceStrategy,this.environmentInjector),De({next:()=>ar=!0,complete:()=>{ar||this.cancelNavigationTransition(Oi,"",2)}}))}),De(Oi=>{const ar=new In(Oi.id,this.urlSerializer.serialize(Oi.extractedUrl),this.urlSerializer.serialize(Oi.urlAfterRedirects),Oi.targetSnapshot);this.events.next(ar)}))}),At(xn=>{const Oi=ar=>{const po=[];ar.routeConfig?.loadComponent&&!ar.routeConfig._loadedComponent&&po.push(this.configLoader.loadComponent(ar.routeConfig).pipe(De(f=>{ar.component=f}),(0,ct.U)(()=>{})));for(const f of ar.children)po.push(...Oi(f));return po};return(0,ie.a)(Oi(xn.targetSnapshot.root)).pipe(Ae(),(0,Le.q)(1))}),At(()=>this.afterPreactivation()),(0,ct.U)(xn=>{const Oi=function bo(R,U,$){const z=Oo(R,U._root,$?$._root:void 0);return new Er(z,U)}(z.routeReuseStrategy,xn.targetSnapshot,xn.currentRouterState);return this.currentTransition=Ge={...xn,targetRouterState:Oi},Ge}),De(()=>{this.events.next(new co)}),((R,U,$,z)=>(0,ct.U)(K=>(new el(U,K.targetRouterState,K.currentRouterState,$,z).activate(R),K)))(this.rootContexts,z.routeReuseStrategy,xn=>this.events.next(xn),this.inputBindingEnabled),(0,Le.q)(1),De({next:xn=>{en=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new we(xn.id,this.urlSerializer.serialize(xn.extractedUrl),this.urlSerializer.serialize(xn.urlAfterRedirects))),z.titleStrategy?.updateTitle(xn.targetRouterState.snapshot),xn.resolve(!0)},complete:()=>{en=!0}}),function Jt(R){return(0,Ie.e)((U,$)=>{(0,Je.Xf)(R).subscribe((0,Ee.x)($,()=>$.complete(),Zt.Z)),!$.closed&&U.subscribe($)})}(this.transitionAbortSubject.pipe(De(xn=>{throw xn}))),(0,Gt.x)(()=>{en||$n||this.cancelNavigationTransition(Ge,"",1),this.currentNavigation?.id===Ge.id&&(this.currentNavigation=null)}),Re(xn=>{if($n=!0,ws(xn))this.events.next(new fe(Ge.id,this.urlSerializer.serialize(Ge.extractedUrl),xn.message,xn.cancellationCode)),function zs(R){return ws(R)&&En(R.url)}(xn)?this.events.next(new uo(xn.url)):Ge.resolve(!1);else{this.events.next(new lt(Ge.id,this.urlSerializer.serialize(Ge.extractedUrl),xn,Ge.targetSnapshot??void 0));try{Ge.resolve(z.errorHandler(xn))}catch(Oi){Ge.reject(Oi)}}return oe.E}))}))}cancelNavigationTransition(z,K,Me){const Ge=new fe(z.id,this.urlSerializer.serialize(z.extractedUrl),K,Me);this.events.next(Ge),z.resolve(!1)}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();function sr(R){return R!==Xn}let Vi=(()=>{var R;class U{buildTitle(z){let K,Me=z.root;for(;void 0!==Me;)K=this.getResolvedTitleForRoute(Me)??K,Me=Me.children.find(Ge=>Ge.outlet===Ot);return K}getResolvedTitleForRoute(z){return z.data[pt]}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return(0,x.f3M)(Tr)},providedIn:"root"}),U})(),Tr=(()=>{var R;class U extends Vi{constructor(z){super(),this.title=z}updateTitle(z){const K=this.buildTitle(z);void 0!==K&&this.title.setTitle(K)}}return(R=U).\u0275fac=function(z){return new(z||R)(x.LFG(dt.Dx))},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})(),ho=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return(0,x.f3M)(ps)},providedIn:"root"}),U})();class ao{shouldDetach(U){return!1}store(U,$){}shouldAttach(U){return!1}retrieve(U){return null}shouldReuseRoute(U,$){return U.routeConfig===$.routeConfig}}let ps=(()=>{var R;class U extends ao{}return(R=U).\u0275fac=function(){let $;return function(K){return($||($=x.n5z(R)))(K||R)}}(),R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();const ss=new x.OlP("",{providedIn:"root",factory:()=>({})});let No=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return(0,x.f3M)(fo)},providedIn:"root"}),U})(),fo=(()=>{var R;class U{shouldProcessUrl(z){return!0}extract(z){return z}merge(z,K){return z}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();var as=function(R){return R[R.COMPLETE=0]="COMPLETE",R[R.FAILED=1]="FAILED",R[R.REDIRECTING=2]="REDIRECTING",R}(as||{});function Ys(R,U){R.events.pipe((0,Te.h)($=>$ instanceof we||$ instanceof fe||$ instanceof lt||$ instanceof je),(0,ct.U)($=>$ instanceof we||$ instanceof je?as.COMPLETE:$ instanceof fe&&(0===$.code||1===$.code)?as.REDIRECTING:as.FAILED),(0,Te.h)($=>$!==as.REDIRECTING),(0,Le.q)(1)).subscribe(()=>{U()})}function mc(R){throw R}function ai(R,U,$){return U.parse("/")}const Js={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Su={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let es=(()=>{var R;class U{get navigationId(){return this.navigationTransitions.navigationId}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.location.getState()?.\u0275routerPageId??this.currentPageId}get events(){return this._events}constructor(){this.disposed=!1,this.currentPageId=0,this.console=(0,x.f3M)(x.c2e),this.isNgZoneEnabled=!1,this._events=new le.x,this.options=(0,x.f3M)(ss,{optional:!0})||{},this.pendingTasks=(0,x.f3M)(x.HDt),this.errorHandler=this.options.errorHandler||mc,this.malformedUriErrorHandler=this.options.malformedUriErrorHandler||ai,this.navigated=!1,this.lastSuccessfulId=-1,this.urlHandlingStrategy=(0,x.f3M)(No),this.routeReuseStrategy=(0,x.f3M)(ho),this.titleStrategy=(0,x.f3M)(Vi),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.config=(0,x.f3M)(cn,{optional:!0})?.flat()??[],this.navigationTransitions=(0,x.f3M)(pr),this.urlSerializer=(0,x.f3M)(ve),this.location=(0,x.f3M)(ue.Ye),this.componentInputBindingEnabled=!!(0,x.f3M)(ko,{optional:!0}),this.eventsSubscription=new Be.w0,this.isNgZoneEnabled=(0,x.f3M)(x.R0b)instanceof x.R0b&&x.R0b.isInAngularZone(),this.resetConfig(this.config),this.currentUrlTree=new qn,this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.routerState=so(0,null),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe(z=>{this.lastSuccessfulId=z.id,this.currentPageId=this.browserPageId},z=>{this.console.warn(`Unhandled Navigation Error: ${z}`)}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const z=this.navigationTransitions.events.subscribe(K=>{try{const{currentTransition:Me}=this.navigationTransitions;if(null===Me)return void(zo(K)&&this._events.next(K));if(K instanceof Si)sr(Me.source)&&(this.browserUrlTree=Me.extractedUrl);else if(K instanceof je)this.rawUrlTree=Me.rawUrl;else if(K instanceof an){if("eager"===this.urlUpdateStrategy){if(!Me.extras.skipLocationChange){const Ge=this.urlHandlingStrategy.merge(Me.urlAfterRedirects,Me.rawUrl);this.setBrowserUrl(Ge,Me)}this.browserUrlTree=Me.urlAfterRedirects}}else if(K instanceof co)this.currentUrlTree=Me.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(Me.urlAfterRedirects,Me.rawUrl),this.routerState=Me.targetRouterState,"deferred"===this.urlUpdateStrategy&&(Me.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,Me),this.browserUrlTree=Me.urlAfterRedirects);else if(K instanceof fe)0!==K.code&&1!==K.code&&(this.navigated=!0),(3===K.code||2===K.code)&&this.restoreHistory(Me);else if(K instanceof uo){const Ge=this.urlHandlingStrategy.merge(K.url,Me.currentRawUrl),en={skipLocationChange:Me.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||sr(Me.source)};this.scheduleNavigation(Ge,Xn,null,en,{resolve:Me.resolve,reject:Me.reject,promise:Me.promise})}K instanceof lt&&this.restoreHistory(Me,!0),K instanceof we&&(this.navigated=!0),zo(K)&&this._events.next(K)}catch(Me){this.navigationTransitions.transitionAbortSubject.next(Me)}});this.eventsSubscription.add(z)}resetRootComponentType(z){this.routerState.root.component=z,this.navigationTransitions.rootComponentType=z}initialNavigation(){if(this.setUpLocationChangeListener(),!this.navigationTransitions.hasRequestedNavigation){const z=this.location.getState();this.navigateToSyncWithBrowser(this.location.path(!0),Xn,z)}}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(z=>{const K="popstate"===z.type?"popstate":"hashchange";"popstate"===K&&setTimeout(()=>{this.navigateToSyncWithBrowser(z.url,K,z.state)},0)}))}navigateToSyncWithBrowser(z,K,Me){const Ge={replaceUrl:!0},en=Me?.navigationId?Me:null;if(Me){const xn={...Me};delete xn.navigationId,delete xn.\u0275routerPageId,0!==Object.keys(xn).length&&(Ge.state=xn)}const $n=this.parseUrl(z);this.scheduleNavigation($n,K,en,Ge)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(z){this.config=z.map(ia),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(z,K={}){const{relativeTo:Me,queryParams:Ge,fragment:en,queryParamsHandling:$n,preserveFragment:xn}=K,Oi=xn?this.currentUrlTree.fragment:en;let po,ar=null;switch($n){case"merge":ar={...this.currentUrlTree.queryParams,...Ge};break;case"preserve":ar=this.currentUrlTree.queryParams;break;default:ar=Ge||null}null!==ar&&(ar=this.removeEmptyProps(ar));try{po=gi(Me?Me.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof z[0]||!z[0].startsWith("/"))&&(z=[]),po=this.currentUrlTree.root}return _i(po,z,ar,Oi??null)}navigateByUrl(z,K={skipLocationChange:!1}){const Me=En(z)?z:this.parseUrl(z),Ge=this.urlHandlingStrategy.merge(Me,this.rawUrlTree);return this.scheduleNavigation(Ge,Xn,null,K)}navigate(z,K={skipLocationChange:!1}){return function Cl(R){for(let U=0;U{const Ge=z[Me];return null!=Ge&&(K[Me]=Ge),K},{})}scheduleNavigation(z,K,Me,Ge,en){if(this.disposed)return Promise.resolve(!1);let $n,xn,Oi;en?($n=en.resolve,xn=en.reject,Oi=en.promise):Oi=new Promise((po,f)=>{$n=po,xn=f});const ar=this.pendingTasks.add();return Ys(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(ar))}),this.navigationTransitions.handleNavigationRequest({source:K,restoredState:Me,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,currentBrowserUrl:this.browserUrlTree,rawUrl:z,extras:Ge,resolve:$n,reject:xn,promise:Oi,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),Oi.catch(po=>Promise.reject(po))}setBrowserUrl(z,K){const Me=this.urlSerializer.serialize(z);if(this.location.isCurrentPathEqualTo(Me)||K.extras.replaceUrl){const en={...K.extras.state,...this.generateNgRouterState(K.id,this.browserPageId)};this.location.replaceState(Me,"",en)}else{const Ge={...K.extras.state,...this.generateNgRouterState(K.id,this.browserPageId+1)};this.location.go(Me,"",Ge)}}restoreHistory(z,K=!1){if("computed"===this.canceledNavigationResolution){const Ge=this.currentPageId-this.browserPageId;0!==Ge?this.location.historyGo(Ge):this.currentUrlTree===this.getCurrentNavigation()?.finalUrl&&0===Ge&&(this.resetState(z),this.browserUrlTree=z.currentUrlTree,this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(K&&this.resetState(z),this.resetUrlToCurrentUrlTree())}resetState(z){this.routerState=z.currentRouterState,this.currentUrlTree=z.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,z.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(z,K){return"computed"===this.canceledNavigationResolution?{navigationId:z,\u0275routerPageId:K}:{navigationId:z}}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();function zo(R){return!(R instanceof co||R instanceof uo)}let Za=(()=>{var R;class U{constructor(z,K,Me,Ge,en,$n){this.router=z,this.route=K,this.tabIndexAttribute=Me,this.renderer=Ge,this.el=en,this.locationStrategy=$n,this.href=null,this.commands=null,this.onChanges=new le.x,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;const xn=en.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===xn||"area"===xn,this.isAnchorElement?this.subscription=z.events.subscribe(Oi=>{Oi instanceof we&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(z){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",z)}ngOnChanges(z){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(z){null!=z?(this.commands=Array.isArray(z)?z:[z],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(z,K,Me,Ge,en){return!!(null===this.urlTree||this.isAnchorElement&&(0!==z||K||Me||Ge||en||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(this.urlTree,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){this.href=null!==this.urlTree&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(this.urlTree)):null;const z=null===this.href?null:(0,x.P3R)(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",z)}applyAttributeValue(z,K){const Me=this.renderer,Ge=this.el.nativeElement;null!==K?Me.setAttribute(Ge,z,K):Me.removeAttribute(Ge,z)}get urlTree(){return null===this.commands?null:this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}}return(R=U).\u0275fac=function(z){return new(z||R)(x.Y36(es),x.Y36(Po),x.$8M("tabindex"),x.Y36(x.Qsj),x.Y36(x.SBq),x.Y36(ue.S$))},R.\u0275dir=x.lG2({type:R,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(z,K){1&z&&x.NdJ("click",function(Ge){return K.onClick(Ge.button,Ge.ctrlKey,Ge.shiftKey,Ge.altKey,Ge.metaKey)}),2&z&&x.uIk("target",K.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",relativeTo:"relativeTo",preserveFragment:["preserveFragment","preserveFragment",x.VuI],skipLocationChange:["skipLocationChange","skipLocationChange",x.VuI],replaceUrl:["replaceUrl","replaceUrl",x.VuI],routerLink:"routerLink"},standalone:!0,features:[x.Xq5,x.TTD]}),U})();class _c{}let El=(()=>{var R;class U{constructor(z,K,Me,Ge,en){this.router=z,this.injector=Me,this.preloadingStrategy=Ge,this.loader=en}setUpPreloading(){this.subscription=this.router.events.pipe((0,Te.h)(z=>z instanceof we),(0,Ht.b)(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(z,K){const Me=[];for(const Ge of K){Ge.providers&&!Ge._injector&&(Ge._injector=(0,x.MMx)(Ge.providers,z,`Route: ${Ge.path}`));const en=Ge._injector??z,$n=Ge._loadedInjector??en;(Ge.loadChildren&&!Ge._loadedRoutes&&void 0===Ge.canLoad||Ge.loadComponent&&!Ge._loadedComponent)&&Me.push(this.preloadConfig(en,Ge)),(Ge.children||Ge._loadedRoutes)&&Me.push(this.processRoutes($n,Ge.children??Ge._loadedRoutes))}return(0,y.D)(Me).pipe((0,kt.J)())}preloadConfig(z,K){return this.preloadingStrategy.preload(K,()=>{let Me;Me=K.loadChildren&&void 0===K.canLoad?this.loader.loadChildren(z,K):(0,s.of)(null);const Ge=Me.pipe((0,Pe.z)(en=>null===en?(0,s.of)(void 0):(K._loadedRoutes=en.routes,K._loadedInjector=en.injector,this.processRoutes(en.injector??z,en.routes))));if(K.loadComponent&&!K._loadedComponent){const en=this.loader.loadComponent(K);return(0,y.D)([Ge,en]).pipe((0,kt.J)())}return Ge})}}return(R=U).\u0275fac=function(z){return new(z||R)(x.LFG(es),x.LFG(x.Sil),x.LFG(x.lqb),x.LFG(_c),x.LFG(ri))},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();const Tl=new x.OlP("");let rl=(()=>{var R;class U{constructor(z,K,Me,Ge,en={}){this.urlSerializer=z,this.transitions=K,this.viewportScroller=Me,this.zone=Ge,this.options=en,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},en.scrollPositionRestoration=en.scrollPositionRestoration||"disabled",en.anchorScrolling=en.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(z=>{z instanceof Si?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=z.navigationTrigger,this.restoredId=z.restoredState?z.restoredState.navigationId:0):z instanceof we?(this.lastId=z.id,this.scheduleScrollEvent(z,this.urlSerializer.parse(z.urlAfterRedirects).fragment)):z instanceof je&&0===z.code&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(z,this.urlSerializer.parse(z.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(z=>{z instanceof Nr&&(z.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(z.position):z.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(z.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(z,K){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new Nr(z,"popstate"===this.lastSource?this.store[this.restoredId]:null,K))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}}return(R=U).\u0275fac=function(z){x.$Z()},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac}),U})();function aa(R,U){return{\u0275kind:R,\u0275providers:U}}function sl(){const R=(0,x.f3M)(x.zs3);return U=>{const $=R.get(x.z2F);if(U!==$.components[0])return;const z=R.get(es),K=R.get(Gl);1===R.get(Uo)&&z.initialNavigation(),R.get(Hl,null,x.XFs.Optional)?.setUpPreloading(),R.get(Tl,null,x.XFs.Optional)?.init(),z.resetRootComponentType($.componentTypes[0]),K.closed||(K.next(),K.complete(),K.unsubscribe())}}const Gl=new x.OlP("",{factory:()=>new le.x}),Uo=new x.OlP("",{providedIn:"root",factory:()=>1}),Hl=new x.OlP("");function vc(R){return aa(0,[{provide:Hl,useExisting:El},{provide:_c,useExisting:R}])}const ts=new x.OlP("ROUTER_FORROOT_GUARD"),Il=[ue.Ye,{provide:ve,useClass:Xe},es,To,{provide:Po,useFactory:function ol(R){return R.routerState.root},deps:[es]},ri,[]];function pa(){return new x.PXZ("Router",es)}let Cd=(()=>{var R;class U{constructor(z){}static forRoot(z,K){return{ngModule:U,providers:[Il,[],{provide:cn,multi:!0,useValue:z},{provide:ts,useFactory:Yc,deps:[[es,new x.FiY,new x.tp0]]},{provide:ss,useValue:K||{}},K?.useHash?{provide:ue.S$,useClass:ue.Do}:{provide:ue.S$,useClass:ue.b0},{provide:Tl,useFactory:()=>{const R=(0,x.f3M)(ue.EM),U=(0,x.f3M)(x.R0b),$=(0,x.f3M)(ss),z=(0,x.f3M)(pr),K=(0,x.f3M)(ve);return $.scrollOffset&&R.setOffset($.scrollOffset),new rl(K,z,R,U,$)}},K?.preloadingStrategy?vc(K.preloadingStrategy).\u0275providers:[],{provide:x.PXZ,multi:!0,useFactory:pa},K?.initialNavigation?js(K):[],K?.bindToComponentInputs?aa(8,[br,{provide:ko,useExisting:br}]).\u0275providers:[],[{provide:Xs,useFactory:sl},{provide:x.tb,multi:!0,useExisting:Xs}]]}}static forChild(z){return{ngModule:U,providers:[{provide:cn,multi:!0,useValue:z}]}}}return(R=U).\u0275fac=function(z){return new(z||R)(x.LFG(ts,8))},R.\u0275mod=x.oAB({type:R}),R.\u0275inj=x.cJS({}),U})();function Yc(R){return"guarded"}function js(R){return["disabled"===R.initialNavigation?aa(3,[{provide:x.ip1,multi:!0,useFactory:()=>{const U=(0,x.f3M)(es);return()=>{U.setUpLocationChangeListener()}}},{provide:Uo,useValue:2}]).\u0275providers:[],"enabledBlocking"===R.initialNavigation?aa(2,[{provide:Uo,useValue:0},{provide:x.ip1,multi:!0,deps:[x.zs3],useFactory:U=>{const $=U.get(ue.V_,Promise.resolve());return()=>$.then(()=>new Promise(z=>{const K=U.get(es),Me=U.get(Gl);Ys(K,()=>{z(!0)}),U.get(pr).afterPreactivation=()=>(z(!0),Me.closed?(0,s.of)(void 0):Me),K.initialNavigation()}))}}]).\u0275providers:[]]}const Xs=new x.OlP("")},9843:(Nn,yt,k)=>{"use strict";k.d(yt,{BX:()=>Cs,Br:()=>or,w:()=>Zt,dr:()=>vt,BJ:()=>ln,oU:()=>ni,cs:()=>Xo,yp:()=>lr,YG:()=>Cn,Sm:()=>Mn,PM:()=>qn,FN:()=>yn,Zi:()=>_n,tO:()=>Hi,hM:()=>ve,wI:()=>Xe,W2:()=>ft,IJ:()=>jt,W4:()=>Et,zq:()=>Xt,fr:()=>Sn,jY:()=>zn,Gu:()=>pe,gu:()=>ze,pK:()=>Pt,Ie:()=>bn,Q$:()=>Lt,q_:()=>st,yh:()=>pn,Uj:()=>hr,z0:()=>En,fG:()=>ti,zc:()=>gi,yf:()=>Qo,uN:()=>bi,I_:()=>qi,nJ:()=>Bi,Wo:()=>Kt,jP:()=>br,Nd:()=>xr,VI:()=>Sr,cJ:()=>Go,GO:()=>Eo,t9:()=>to,n0:()=>Xn,PQ:()=>Si,jI:()=>we,g2:()=>an,Bs:()=>Vt,wd:()=>vn,ho:()=>In,sr:()=>Fn,Pc:()=>ki,r4:()=>yo,HT:()=>Qa,IN:()=>Ur,SH:()=>co,X1:()=>To,as:()=>Jt,t4:()=>vr,YI:()=>Br,QI:()=>dt,j9:()=>Ot,yF:()=>Do});var x=k(5861),h=k(2029),y=k(6223),s=k(7582),J=k(2438),ie=k(8645),Y=k(5619),E=k(2572),Ne=k(2096),me=k(6800),oe=(k(1774),k(2650),k(1904),k(9203),k(2085)),Be=k(839),Ie=k(3365),Ee=k(1651),et=(k(5662),k(4988)),ct=(k(6225),k(619),k(1688)),Le=k(2181),ye=k(4664),gt=k(3997),Te=k(6814);const Ae=oe.i,_t=["*"],Fe=v=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(v):"function"==typeof requestAnimationFrame?requestAnimationFrame(v):setTimeout(v);let St=(()=>{class v{constructor(D,A){this.injector=D,this.el=A,this.onChange=()=>{},this.onTouched=()=>{}}writeValue(D){this.el.nativeElement.value=this.lastValue=D,Ce(this.el)}handleValueChange(D,A){D===this.el.nativeElement&&(A!==this.lastValue&&(this.lastValue=A,this.onChange(A)),Ce(this.el))}_handleBlurEvent(D){D===this.el.nativeElement&&(this.onTouched(),Ce(this.el))}registerOnChange(D){this.onChange=D}registerOnTouched(D){this.onTouched=D}setDisabledState(D){this.el.nativeElement.disabled=D}ngOnDestroy(){this.statusChanges&&this.statusChanges.unsubscribe()}ngAfterViewInit(){let D;try{D=this.injector.get(y.a5)}catch{}if(!D)return;D.statusChanges&&(this.statusChanges=D.statusChanges.subscribe(()=>Ce(this.el)));const A=D.control;A&&["markAsTouched","markAllAsTouched","markAsUntouched","markAsDirty","markAsPristine"].forEach(It=>{if(typeof A[It]<"u"){const Yn=A[It].bind(A);A[It]=(...pi)=>{Yn(...pi),Ce(this.el)}}})}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,hostBindings:function(D,A){1&D&&h.NdJ("ionBlur",function(It){return A._handleBlurEvent(It.target)})}}),v})();const Ce=v=>{Fe(()=>{const M=v.nativeElement,D=null!=M.value&&M.value.toString().length>0,A=Rt(M);Qt(M,A);const G=M.closest("ion-item");G&&Qt(G,D?[...A,"item-has-value"]:A)})},Rt=v=>{const M=v.classList,D=[];for(let A=0;A{const D=v.classList;D.remove("ion-valid","ion-invalid","ion-touched","ion-untouched","ion-dirty","ion-pristine"),D.add(...M)},Gt=(v,M)=>v.substring(0,M.length)===M;let Zt=(()=>{class v extends St{constructor(D,A){super(D,A)}writeValue(D){this.el.nativeElement.checked=this.lastValue=D,Ce(this.el)}_handleIonChange(D){this.handleValueChange(D,D.checked)}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-checkbox"],["ion-toggle"]],hostBindings:function(D,A){1&D&&h.NdJ("ionChange",function(It){return A._handleIonChange(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})(),Jt=(()=>{class v extends St{constructor(D,A){super(D,A)}handleInputEvent(D){this.handleValueChange(D,D.value)}registerOnChange(D){super.registerOnChange(A=>{D(""===A?null:parseFloat(A))})}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-input","type","number"]],hostBindings:function(D,A){1&D&&h.NdJ("ionInput",function(It){return A.handleInputEvent(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})(),dt=(()=>{class v extends St{constructor(D,A){super(D,A)}_handleChangeEvent(D){this.handleValueChange(D,D.value)}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-range"],["ion-select"],["ion-radio-group"],["ion-segment"],["ion-datetime"]],hostBindings:function(D,A){1&D&&h.NdJ("ionChange",function(It){return A._handleChangeEvent(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})(),Ot=(()=>{class v extends St{constructor(D,A){super(D,A)}_handleInputEvent(D){this.handleValueChange(D,D.value)}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-input",3,"type","number"],["ion-textarea"],["ion-searchbar"]],hostBindings:function(D,A){1&D&&h.NdJ("ionInput",function(It){return A._handleInputEvent(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})();const pt=(v,M)=>{const D=v.prototype;M.forEach(A=>{Object.defineProperty(D,A,{get(){return this.el[A]},set(G){this.z.runOutsideAngular(()=>this.el[A]=G)}})})},Yt=(v,M)=>{const D=v.prototype;M.forEach(A=>{D[A]=function(){const G=arguments;return this.z.runOutsideAngular(()=>this.el[A].apply(this.el,G))}})},Ut=(v,M,D)=>{D.forEach(A=>v[A]=(0,J.R)(M,A))};function gn(v){return function(D){const{defineCustomElementFn:A,inputs:G,methods:It}=v;return void 0!==A&&A(),G&&pt(D,G),It&&Yt(D,It),D}}let vt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-app"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),ln=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-avatar"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),ni=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-back-button"]],inputs:{color:"color",defaultHref:"defaultHref",disabled:"disabled",icon:"icon",mode:"mode",routerAnimation:"routerAnimation",text:"text",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","defaultHref","disabled","icon","mode","routerAnimation","text","type"]})],v),v})(),lr=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-badge"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode"]})],v),v})(),Cn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-button"]],inputs:{buttonType:"buttonType",color:"color",disabled:"disabled",download:"download",expand:"expand",fill:"fill",form:"form",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",shape:"shape",size:"size",strong:"strong",target:"target",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["buttonType","color","disabled","download","expand","fill","form","href","mode","rel","routerAnimation","routerDirection","shape","size","strong","target","type"]})],v),v})(),Mn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-buttons"]],inputs:{collapse:"collapse"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["collapse"]})],v),v})(),qn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-card"]],inputs:{button:"button",color:"color",disabled:"disabled",download:"download",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",target:"target",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["button","color","disabled","download","href","mode","rel","routerAnimation","routerDirection","target","type"]})],v),v})(),yn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-card-content"]],inputs:{mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["mode"]})],v),v})(),_n=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-card-header"]],inputs:{color:"color",mode:"mode",translucent:"translucent"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode","translucent"]})],v),v})(),Hi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-card-subtitle"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode"]})],v),v})(),ve=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-chip"]],inputs:{color:"color",disabled:"disabled",mode:"mode",outline:"outline"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","disabled","mode","outline"]})],v),v})(),Xe=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-col"]],inputs:{offset:"offset",offsetLg:"offsetLg",offsetMd:"offsetMd",offsetSm:"offsetSm",offsetXl:"offsetXl",offsetXs:"offsetXs",pull:"pull",pullLg:"pullLg",pullMd:"pullMd",pullSm:"pullSm",pullXl:"pullXl",pullXs:"pullXs",push:"push",pushLg:"pushLg",pushMd:"pushMd",pushSm:"pushSm",pushXl:"pushXl",pushXs:"pushXs",size:"size",sizeLg:"sizeLg",sizeMd:"sizeMd",sizeSm:"sizeSm",sizeXl:"sizeXl",sizeXs:"sizeXs"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["offset","offsetLg","offsetMd","offsetSm","offsetXl","offsetXs","pull","pullLg","pullMd","pullSm","pullXl","pullXs","push","pushLg","pushMd","pushSm","pushXl","pushXs","size","sizeLg","sizeMd","sizeSm","sizeXl","sizeXs"]})],v),v})(),ft=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionScrollStart","ionScroll","ionScrollEnd"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-content"]],inputs:{color:"color",forceOverscroll:"forceOverscroll",fullscreen:"fullscreen",scrollEvents:"scrollEvents",scrollX:"scrollX",scrollY:"scrollY"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","forceOverscroll","fullscreen","scrollEvents","scrollX","scrollY"],methods:["getScrollElement","scrollToTop","scrollToBottom","scrollByPoint","scrollToPoint"]})],v),v})(),jt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-fab"]],inputs:{activated:"activated",edge:"edge",horizontal:"horizontal",vertical:"vertical"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activated","edge","horizontal","vertical"],methods:["close"]})],v),v})(),Et=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-fab-button"]],inputs:{activated:"activated",closeIcon:"closeIcon",color:"color",disabled:"disabled",download:"download",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",show:"show",size:"size",target:"target",translucent:"translucent",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activated","closeIcon","color","disabled","download","href","mode","rel","routerAnimation","routerDirection","show","size","target","translucent","type"]})],v),v})(),Xt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-fab-list"]],inputs:{activated:"activated",side:"side"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activated","side"]})],v),v})(),Sn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-footer"]],inputs:{collapse:"collapse",mode:"mode",translucent:"translucent"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["collapse","mode","translucent"]})],v),v})(),zn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-grid"]],inputs:{fixed:"fixed"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["fixed"]})],v),v})(),pe=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-header"]],inputs:{collapse:"collapse",mode:"mode",translucent:"translucent"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["collapse","mode","translucent"]})],v),v})(),ze=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-icon"]],inputs:{color:"color",flipRtl:"flipRtl",icon:"icon",ios:"ios",lazy:"lazy",md:"md",mode:"mode",name:"name",sanitize:"sanitize",size:"size",src:"src"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","flipRtl","icon","ios","lazy","md","mode","name","sanitize","size","src"]})],v),v})(),Pt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionInput","ionChange","ionBlur","ionFocus"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-input"]],inputs:{accept:"accept",autocapitalize:"autocapitalize",autocomplete:"autocomplete",autocorrect:"autocorrect",autofocus:"autofocus",clearInput:"clearInput",clearOnEdit:"clearOnEdit",color:"color",counter:"counter",counterFormatter:"counterFormatter",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",errorText:"errorText",fill:"fill",helperText:"helperText",inputmode:"inputmode",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",max:"max",maxlength:"maxlength",min:"min",minlength:"minlength",mode:"mode",multiple:"multiple",name:"name",pattern:"pattern",placeholder:"placeholder",readonly:"readonly",required:"required",shape:"shape",size:"size",spellcheck:"spellcheck",step:"step",type:"type",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["accept","autocapitalize","autocomplete","autocorrect","autofocus","clearInput","clearOnEdit","color","counter","counterFormatter","debounce","disabled","enterkeyhint","errorText","fill","helperText","inputmode","label","labelPlacement","legacy","max","maxlength","min","minlength","mode","multiple","name","pattern","placeholder","readonly","required","shape","size","spellcheck","step","type","value"],methods:["setFocus","getInputElement"]})],v),v})(),bn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-item"]],inputs:{button:"button",color:"color",counter:"counter",counterFormatter:"counterFormatter",detail:"detail",detailIcon:"detailIcon",disabled:"disabled",download:"download",fill:"fill",href:"href",lines:"lines",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",shape:"shape",target:"target",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["button","color","counter","counterFormatter","detail","detailIcon","disabled","download","fill","href","lines","mode","rel","routerAnimation","routerDirection","shape","target","type"]})],v),v})(),Lt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-label"]],inputs:{color:"color",mode:"mode",position:"position"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode","position"]})],v),v})(),st=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-list"]],inputs:{inset:"inset",lines:"lines",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["inset","lines","mode"],methods:["closeSlidingItems"]})],v),v})(),pn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-list-header"]],inputs:{color:"color",lines:"lines",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","lines","mode"]})],v),v})(),En=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionWillOpen","ionWillClose","ionDidOpen","ionDidClose"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-menu"]],inputs:{contentId:"contentId",disabled:"disabled",maxEdgeStart:"maxEdgeStart",menuId:"menuId",side:"side",swipeGesture:"swipeGesture",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["contentId","disabled","maxEdgeStart","menuId","side","swipeGesture","type"],methods:["isOpen","isActive","open","close","toggle","setOpen"]})],v),v})(),ti=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-menu-button"]],inputs:{autoHide:"autoHide",color:"color",disabled:"disabled",menu:"menu",mode:"mode",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["autoHide","color","disabled","menu","mode","type"]})],v),v})(),gi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-menu-toggle"]],inputs:{autoHide:"autoHide",menu:"menu"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["autoHide","menu"]})],v),v})(),bi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-note"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode"]})],v),v})(),qi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionInput","ionFocus","ionBlur","ionKnobMoveStart","ionKnobMoveEnd"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-range"]],inputs:{activeBarStart:"activeBarStart",color:"color",debounce:"debounce",disabled:"disabled",dualKnobs:"dualKnobs",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",max:"max",min:"min",mode:"mode",name:"name",pin:"pin",pinFormatter:"pinFormatter",snaps:"snaps",step:"step",ticks:"ticks",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activeBarStart","color","debounce","disabled","dualKnobs","label","labelPlacement","legacy","max","min","mode","name","pin","pinFormatter","snaps","step","ticks","value"]})],v),v})(),Bi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionRefresh","ionPull","ionStart"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-refresher"]],inputs:{closeDuration:"closeDuration",disabled:"disabled",pullFactor:"pullFactor",pullMax:"pullMax",pullMin:"pullMin",snapbackDuration:"snapbackDuration"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["closeDuration","disabled","pullFactor","pullMax","pullMin","snapbackDuration"],methods:["complete","cancel","getProgress"]})],v),v})(),Kt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-refresher-content"]],inputs:{pullingIcon:"pullingIcon",pullingText:"pullingText",refreshingSpinner:"refreshingSpinner",refreshingText:"refreshingText"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["pullingIcon","pullingText","refreshingSpinner","refreshingText"]})],v),v})(),xr=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-row"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),Sr=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionInput","ionChange","ionCancel","ionClear","ionBlur","ionFocus"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-searchbar"]],inputs:{animated:"animated",autocomplete:"autocomplete",autocorrect:"autocorrect",cancelButtonIcon:"cancelButtonIcon",cancelButtonText:"cancelButtonText",clearIcon:"clearIcon",color:"color",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",inputmode:"inputmode",mode:"mode",name:"name",placeholder:"placeholder",searchIcon:"searchIcon",showCancelButton:"showCancelButton",showClearButton:"showClearButton",spellcheck:"spellcheck",type:"type",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["animated","autocomplete","autocorrect","cancelButtonIcon","cancelButtonText","clearIcon","color","debounce","disabled","enterkeyhint","inputmode","mode","name","placeholder","searchIcon","showCancelButton","showClearButton","spellcheck","type","value"],methods:["setFocus","getInputElement"]})],v),v})(),Go=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-segment"]],inputs:{color:"color",disabled:"disabled",mode:"mode",scrollable:"scrollable",selectOnFocus:"selectOnFocus",swipeGesture:"swipeGesture",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","disabled","mode","scrollable","selectOnFocus","swipeGesture","value"]})],v),v})(),Eo=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-segment-button"]],inputs:{disabled:"disabled",layout:"layout",mode:"mode",type:"type",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["disabled","layout","mode","type","value"]})],v),v})(),to=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionCancel","ionDismiss","ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-select"]],inputs:{cancelText:"cancelText",color:"color",compareWith:"compareWith",disabled:"disabled",expandedIcon:"expandedIcon",fill:"fill",interface:"interface",interfaceOptions:"interfaceOptions",justify:"justify",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",mode:"mode",multiple:"multiple",name:"name",okText:"okText",placeholder:"placeholder",selectedText:"selectedText",shape:"shape",toggleIcon:"toggleIcon",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["cancelText","color","compareWith","disabled","expandedIcon","fill","interface","interfaceOptions","justify","label","labelPlacement","legacy","mode","multiple","name","okText","placeholder","selectedText","shape","toggleIcon","value"],methods:["open"]})],v),v})(),Xn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-select-option"]],inputs:{disabled:"disabled",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["disabled","value"]})],v),v})(),Si=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-spinner"]],inputs:{color:"color",duration:"duration",name:"name",paused:"paused"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","duration","name","paused"]})],v),v})(),we=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionSplitPaneVisible"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-split-pane"]],inputs:{contentId:"contentId",disabled:"disabled",when:"when"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["contentId","disabled","when"]})],v),v})(),an=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionInput","ionBlur","ionFocus"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-textarea"]],inputs:{autoGrow:"autoGrow",autocapitalize:"autocapitalize",autofocus:"autofocus",clearOnEdit:"clearOnEdit",color:"color",cols:"cols",counter:"counter",counterFormatter:"counterFormatter",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",errorText:"errorText",fill:"fill",helperText:"helperText",inputmode:"inputmode",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",maxlength:"maxlength",minlength:"minlength",mode:"mode",name:"name",placeholder:"placeholder",readonly:"readonly",required:"required",rows:"rows",shape:"shape",spellcheck:"spellcheck",value:"value",wrap:"wrap"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["autoGrow","autocapitalize","autofocus","clearOnEdit","color","cols","counter","counterFormatter","debounce","disabled","enterkeyhint","errorText","fill","helperText","inputmode","label","labelPlacement","legacy","maxlength","minlength","mode","name","placeholder","readonly","required","rows","shape","spellcheck","value","wrap"],methods:["setFocus","getInputElement"]})],v),v})(),Vt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-thumbnail"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),vn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-title"]],inputs:{color:"color",size:"size"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","size"]})],v),v})(),In=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-toggle"]],inputs:{checked:"checked",color:"color",disabled:"disabled",enableOnOffLabels:"enableOnOffLabels",justify:"justify",labelPlacement:"labelPlacement",legacy:"legacy",mode:"mode",name:"name",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["checked","color","disabled","enableOnOffLabels","justify","labelPlacement","legacy","mode","name","value"]})],v),v})(),Fn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-toolbar"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode"]})],v),v})(),di=(()=>{class v{get(D,A){const G=Ni();return G?G.get(D,A):null}getBoolean(D,A){const G=Ni();return!!G&&G.getBoolean(D,A)}getNumber(D,A){const G=Ni();return G?G.getNumber(D,A):0}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();const Ai=new h.OlP("USERCONFIG"),Ni=()=>{if(typeof window<"u"){const v=window.Ionic;if(v?.config)return v.config}return null};let vr=(()=>{class v{constructor(D,A){this.doc=D,this.backButton=new ie.x,this.keyboardDidShow=new ie.x,this.keyboardDidHide=new ie.x,this.pause=new ie.x,this.resume=new ie.x,this.resize=new ie.x,A.run(()=>{let G;this.win=D.defaultView,this.backButton.subscribeWithPriority=function(It,Yn){return this.subscribe(pi=>pi.register(It,tr=>A.run(()=>Yn(tr))))},Nr(this.pause,D,"pause"),Nr(this.resume,D,"resume"),Nr(this.backButton,D,"ionBackButton"),Nr(this.resize,this.win,"resize"),Nr(this.keyboardDidShow,this.win,"ionKeyboardDidShow"),Nr(this.keyboardDidHide,this.win,"ionKeyboardDidHide"),this._readyPromise=new Promise(It=>{G=It}),this.win?.cordova?D.addEventListener("deviceready",()=>{G("cordova")},{once:!0}):G("dom")})}is(D){return(0,oe.a)(this.win,D)}platforms(){return(0,oe.g)(this.win)}ready(){return this._readyPromise}get isRTL(){return"rtl"===this.doc.dir}getQueryParam(D){return go(this.win.location.href,D)}isLandscape(){return!this.isPortrait()}isPortrait(){return this.win.matchMedia?.("(orientation: portrait)").matches}testUserAgent(D){const A=this.win.navigator;return!!(A?.userAgent&&A.userAgent.indexOf(D)>=0)}url(){return this.win.location.href}width(){return this.win.innerWidth}height(){return this.win.innerHeight}}return v.\u0275fac=function(D){return new(D||v)(h.LFG(Te.K0),h.LFG(h.R0b))},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();const go=(v,M)=>{M=M.replace(/[[\]\\]/g,"\\$&");const A=new RegExp("[\\?&]"+M+"=([^&#]*)").exec(v);return A?decodeURIComponent(A[1].replace(/\+/g," ")):null},Nr=(v,M,D)=>{M&&M.addEventListener(D,A=>{const G=A?.detail;v.next(G)})};let co=(()=>{class v{constructor(D,A,G,It){this.location=A,this.serializer=G,this.router=It,this.direction=Jr,this.animated=kr,this.guessDirection="forward",this.lastNavId=-1,It&&It.events.subscribe(Yn=>{if(Yn instanceof me.OD){const pi=Yn.restoredState?Yn.restoredState.navigationId:Yn.id;this.guessDirection=pi{this.pop(),Yn()})}navigateForward(D,A={}){return this.setDirection("forward",A.animated,A.animationDirection,A.animation),this.navigate(D,A)}navigateBack(D,A={}){return this.setDirection("back",A.animated,A.animationDirection,A.animation),this.navigate(D,A)}navigateRoot(D,A={}){return this.setDirection("root",A.animated,A.animationDirection,A.animation),this.navigate(D,A)}back(D={animated:!0,animationDirection:"back"}){return this.setDirection("back",D.animated,D.animationDirection,D.animation),this.location.back()}pop(){var D=this;return(0,x.Z)(function*(){let A=D.topOutlet;for(;A;){if(yield A.pop())return!0;A=A.parentOutlet}return!1})()}setDirection(D,A,G,It){this.direction=D,this.animated=uo(D,A,G),this.animationBuilder=It}setTopOutlet(D){this.topOutlet=D}consumeTransition(){let A,D="root";const G=this.animationBuilder;return"auto"===this.direction?(D=this.guessDirection,A=this.guessAnimation):(A=this.animated,D=this.direction),this.direction=Jr,this.animated=kr,this.animationBuilder=void 0,{direction:D,animation:A,animationBuilder:G}}navigate(D,A){if(Array.isArray(D))return this.router.navigate(D,A);{const G=this.serializer.parse(D.toString());return void 0!==A.queryParams&&(G.queryParams={...A.queryParams}),void 0!==A.fragment&&(G.fragment=A.fragment),this.router.navigateByUrl(G,A)}}}return v.\u0275fac=function(D){return new(D||v)(h.LFG(vr),h.LFG(Te.Ye),h.LFG(me.Hx),h.LFG(me.F0,8))},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();const uo=(v,M,D)=>{if(!1!==M){if(void 0!==D)return D;if("forward"===v||"back"===v)return v;if("root"===v&&!0===M)return"forward"}},Jr="auto",kr=void 0;class To{constructor(M={}){this.data=M}get(M){return this.data[M]}}let ds=(()=>{class v{constructor(){this.zone=(0,h.f3M)(h.R0b),this.applicationRef=(0,h.f3M)(h.z2F)}create(D,A,G){return new xo(D,A,this.applicationRef,this.zone,G)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})();class xo{constructor(M,D,A,G,It){this.environmentInjector=M,this.injector=D,this.applicationRef=A,this.zone=G,this.elementReferenceKey=It,this.elRefMap=new WeakMap,this.elEventsMap=new WeakMap}attachViewToDom(M,D,A,G){return this.zone.run(()=>new Promise(It=>{const Yn={...A};void 0!==this.elementReferenceKey&&(Yn[this.elementReferenceKey]=M),It(zi(this.zone,this.environmentInjector,this.injector,this.applicationRef,this.elRefMap,this.elEventsMap,M,D,Yn,G,this.elementReferenceKey))}))}removeViewFromDom(M,D){return this.zone.run(()=>new Promise(A=>{const G=this.elRefMap.get(D);if(G){G.destroy(),this.elRefMap.delete(D);const It=this.elEventsMap.get(D);It&&(It(),this.elEventsMap.delete(D))}A()}))}}const zi=(v,M,D,A,G,It,Yn,pi,tr,Zr,Mo)=>{const oa=h.zs3.create({providers:so(tr),parent:D}),Es=(0,h.LMc)(pi,{environmentInjector:M,elementInjector:oa}),ks=Es.instance,Fa=Es.location.nativeElement;if(tr&&(Mo&&void 0!==ks[Mo]&&console.error(`[Ionic Error]: ${Mo} is a reserved property when using ${Yn.tagName.toLowerCase()}. Rename or remove the "${Mo}" property from ${pi.name}.`),Object.assign(ks,tr)),Zr)for(const da of Zr)Fa.classList.add(da);const tl=Or(v,ks,Fa);return Yn.appendChild(Fa),A.attachView(Es.hostView),G.set(Fa,Es),It.set(Fa,tl),Fa},Fr=[Ee.L,Ee.a,Ee.b,Ee.c,Ee.d],Or=(v,M,D)=>v.run(()=>{const A=Fr.filter(G=>"function"==typeof M[G]).map(G=>{const It=Yn=>M[G](Yn.detail);return D.addEventListener(G,It),()=>D.removeEventListener(G,It)});return()=>A.forEach(G=>G())}),Er=new h.OlP("NavParamsToken"),so=v=>[{provide:Er,useValue:v},{provide:To,useFactory:Gs,deps:[Er]}],Gs=v=>new To(v),Hr=(v,M)=>((v=v.filter(D=>D.stackId!==M.stackId)).push(M),v),gr=(v,M)=>{const D=v.createUrlTree(["."],{relativeTo:M});return v.serializeUrl(D)},li=(v,M)=>!M||v.stackId!==M.stackId,Zi=(v,M)=>{if(!v)return;const D=Rr(M);for(let A=0;A=v.length)return D[A];if(D[A]!==v[A])return}},Rr=v=>v.split("/").map(M=>M.trim()).filter(M=>""!==M),_o=v=>{v&&(v.ref.destroy(),v.unlistenEvents())};class rs{constructor(M,D,A,G,It,Yn){this.containerEl=D,this.router=A,this.navCtrl=G,this.zone=It,this.location=Yn,this.views=[],this.skipTransition=!1,this.nextId=0,this.tabsPrefix=void 0!==M?Rr(M):void 0}createView(M,D){const A=gr(this.router,D),G=M?.location?.nativeElement,It=Or(this.zone,M.instance,G);return{id:this.nextId++,stackId:Zi(this.tabsPrefix,A),unlistenEvents:It,element:G,ref:M,url:A}}getExistingView(M){const D=gr(this.router,M),A=this.views.find(G=>G.url===D);return A&&A.ref.changeDetectorRef.reattach(),A}setActive(M){const D=this.navCtrl.consumeTransition();let{direction:A,animation:G,animationBuilder:It}=D;const Yn=this.activeView,pi=li(M,Yn);pi&&(A="back",G=void 0);const tr=this.views.slice();let Zr;const Mo=this.router;Mo.getCurrentNavigation?Zr=Mo.getCurrentNavigation():Mo.navigations?.value&&(Zr=Mo.navigations.value),Zr?.extras?.replaceUrl&&this.views.length>0&&this.views.splice(-1,1);const oa=this.views.includes(M),Es=this.insertView(M,A);oa||M.ref.changeDetectorRef.detectChanges();const ks=M.animationBuilder;return void 0===It&&"back"===A&&!pi&&void 0!==ks&&(It=ks),Yn&&(Yn.animationBuilder=It),this.zone.runOutsideAngular(()=>this.wait(()=>(Yn&&Yn.ref.changeDetectorRef.detach(),M.ref.changeDetectorRef.reattach(),this.transition(M,Yn,G,this.canGoBack(1),!1,It).then(()=>zr(M,Es,tr,this.location,this.zone)).then(()=>({enteringView:M,direction:A,animation:G,tabSwitch:pi})))))}canGoBack(M,D=this.getActiveStackId()){return this.getStack(D).length>M}pop(M,D=this.getActiveStackId()){return this.zone.run(()=>{const A=this.getStack(D);if(A.length<=M)return Promise.resolve(!1);const G=A[A.length-M-1];let It=G.url;const Yn=G.savedData;if(Yn){const tr=Yn.get("primary");tr?.route?._routerState?.snapshot.url&&(It=tr.route._routerState.snapshot.url)}const{animationBuilder:pi}=this.navCtrl.consumeTransition();return this.navCtrl.navigateBack(It,{...G.savedExtras,animation:pi}).then(()=>!0)})}startBackTransition(){const M=this.activeView;if(M){const D=this.getStack(M.stackId),A=D[D.length-2],G=A.animationBuilder;return this.wait(()=>this.transition(A,M,"back",this.canGoBack(2),!0,G))}return Promise.resolve()}endBackTransition(M){M?(this.skipTransition=!0,this.pop(1)):this.activeView&&ko(this.activeView,this.views,this.views,this.location,this.zone)}getLastUrl(M){const D=this.getStack(M);return D.length>0?D[D.length-1]:void 0}getRootUrl(M){const D=this.getStack(M);return D.length>0?D[0]:void 0}getActiveStackId(){return this.activeView?this.activeView.stackId:void 0}getActiveView(){return this.activeView}hasRunningTask(){return void 0!==this.runningTask}destroy(){this.containerEl=void 0,this.views.forEach(_o),this.activeView=void 0,this.views=[]}getStack(M){return this.views.filter(D=>D.stackId===M)}insertView(M,D){return this.activeView=M,this.views=((v,M,D)=>"root"===D?Hr(v,M):"forward"===D?((v,M)=>(v.indexOf(M)>=0?v=v.filter(A=>A.stackId!==M.stackId||A.id<=M.id):v.push(M),v))(v,M):((v,M)=>v.indexOf(M)>=0?v.filter(A=>A.stackId!==M.stackId||A.id<=M.id):Hr(v,M))(v,M))(this.views,M,D),this.views.slice()}transition(M,D,A,G,It,Yn){if(this.skipTransition)return this.skipTransition=!1,Promise.resolve(!1);if(D===M)return Promise.resolve(!1);const pi=M?M.element:void 0,tr=D?D.element:void 0,Zr=this.containerEl;return pi&&pi!==tr&&(pi.classList.add("ion-page"),pi.classList.add("ion-page-invisible"),pi.parentElement!==Zr&&Zr.appendChild(pi),Zr.commit)?Zr.commit(pi,tr,{duration:void 0===A?0:void 0,direction:A,showGoBack:G,progressAnimation:It,animationBuilder:Yn}):Promise.resolve(!1)}wait(M){var D=this;return(0,x.Z)(function*(){void 0!==D.runningTask&&(yield D.runningTask,D.runningTask=void 0);const A=D.runningTask=M();return A.finally(()=>D.runningTask=void 0),A})()}}const zr=(v,M,D,A,G)=>"function"==typeof requestAnimationFrame?new Promise(It=>{requestAnimationFrame(()=>{ko(v,M,D,A,G),It()})}):Promise.resolve(),ko=(v,M,D,A,G)=>{G.run(()=>D.filter(It=>!M.includes(It)).forEach(_o)),M.forEach(It=>{const pi=A.path().split("?")[0].split("#")[0];if(It!==v&&It.url!==pi){const tr=It.element;tr.setAttribute("aria-hidden","true"),tr.classList.add("ion-page-hidden"),It.ref.changeDetectorRef.detach()}})};let br=(()=>{class v{constructor(D,A,G,It,Yn,pi,tr,Zr){this.parentOutlet=Zr,this.activatedView=null,this.proxyMap=new WeakMap,this.currentActivatedRoute$=new Y.X(null),this.activated=null,this._activatedRoute=null,this.name=me.eC,this.stackWillChange=new h.vpe,this.stackDidChange=new h.vpe,this.activateEvents=new h.vpe,this.deactivateEvents=new h.vpe,this.parentContexts=(0,h.f3M)(me.y6),this.location=(0,h.f3M)(h.s_b),this.environmentInjector=(0,h.f3M)(h.lqb),this.inputBinder=(0,h.f3M)(Oo,{optional:!0}),this.supportsBindingToComponentInputs=!0,this.config=(0,h.f3M)(di),this.navCtrl=(0,h.f3M)(co),this.nativeEl=It.nativeElement,this.name=D||me.eC,this.tabsPrefix="true"===A?gr(Yn,tr):void 0,this.stackCtrl=new rs(this.tabsPrefix,this.nativeEl,Yn,this.navCtrl,pi,G),this.parentContexts.onChildOutletCreated(this.name,this)}get activatedComponentRef(){return this.activated}set animation(D){this.nativeEl.animation=D}set animated(D){this.nativeEl.animated=D}set swipeGesture(D){this._swipeGesture=D,this.nativeEl.swipeHandler=D?{canStart:()=>this.stackCtrl.canGoBack(1)&&!this.stackCtrl.hasRunningTask(),onStart:()=>this.stackCtrl.startBackTransition(),onEnd:A=>this.stackCtrl.endBackTransition(A)}:void 0}ngOnDestroy(){this.stackCtrl.destroy(),this.inputBinder?.unsubscribeFromRouteData(this)}getContext(){return this.parentContexts.getContext(this.name)}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(!this.activated){const D=this.getContext();D?.route&&this.activateWith(D.route,D.injector)}new Promise(D=>(0,Be.c)(this.nativeEl,D)).then(()=>{void 0===this._swipeGesture&&(this.swipeGesture=this.config.getBoolean("swipeBackEnabled","ios"===this.nativeEl.mode))})}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){throw new Error("incompatible reuse strategy")}attach(D,A){throw new Error("incompatible reuse strategy")}deactivate(){if(this.activated){if(this.activatedView){const A=this.getContext();this.activatedView.savedData=new Map(A.children.contexts);const G=this.activatedView.savedData.get("primary");if(G&&A.route&&(G.route={...A.route}),this.activatedView.savedExtras={},A.route){const It=A.route.snapshot;this.activatedView.savedExtras.queryParams=It.queryParams,this.activatedView.savedExtras.fragment=It.fragment}}const D=this.component;this.activatedView=null,this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(D)}}activateWith(D,A){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=D;let G,It=this.stackCtrl.getExistingView(D);if(It){G=this.activated=It.ref;const pi=It.savedData;pi&&(this.getContext().children.contexts=pi),this.updateActivatedRouteProxy(G.instance,D)}else{const pi=D._futureSnapshot,tr=this.parentContexts.getOrCreateContext(this.name).children,Zr=new Y.X(null),Mo=this.createActivatedRouteProxy(Zr,D),oa=new bo(Mo,tr,this.location.injector);G=this.activated=this.location.createComponent(pi.routeConfig.component??pi.component,{index:this.location.length,injector:oa,environmentInjector:A??this.environmentInjector}),Zr.next(G.instance),It=this.stackCtrl.createView(this.activated,D),this.proxyMap.set(G.instance,Mo),this.currentActivatedRoute$.next({component:G.instance,activatedRoute:D})}this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activatedView=It,this.navCtrl.setTopOutlet(this);const Yn=this.stackCtrl.getActiveView();this.stackWillChange.emit({enteringView:It,tabSwitch:li(It,Yn)}),this.stackCtrl.setActive(It).then(pi=>{this.activateEvents.emit(G.instance),this.stackDidChange.emit(pi)})}canGoBack(D=1,A){return this.stackCtrl.canGoBack(D,A)}pop(D=1,A){return this.stackCtrl.pop(D,A)}getLastUrl(D){const A=this.stackCtrl.getLastUrl(D);return A?A.url:void 0}getLastRouteView(D){return this.stackCtrl.getLastUrl(D)}getRootView(D){return this.stackCtrl.getRootUrl(D)}getActiveStackId(){return this.stackCtrl.getActiveStackId()}createActivatedRouteProxy(D,A){const G=new me.gz;return G._futureSnapshot=A._futureSnapshot,G._routerState=A._routerState,G.snapshot=A.snapshot,G.outlet=A.outlet,G.component=A.component,G._paramMap=this.proxyObservable(D,"paramMap"),G._queryParamMap=this.proxyObservable(D,"queryParamMap"),G.url=this.proxyObservable(D,"url"),G.params=this.proxyObservable(D,"params"),G.queryParams=this.proxyObservable(D,"queryParams"),G.fragment=this.proxyObservable(D,"fragment"),G.data=this.proxyObservable(D,"data"),G}proxyObservable(D,A){return D.pipe((0,Le.h)(G=>!!G),(0,ye.w)(G=>this.currentActivatedRoute$.pipe((0,Le.h)(It=>null!==It&&It.component===G),(0,ye.w)(It=>It&&It.activatedRoute[A]),(0,gt.x)())))}updateActivatedRouteProxy(D,A){const G=this.proxyMap.get(D);if(!G)throw new Error("Could not find activated route proxy for view");G._futureSnapshot=A._futureSnapshot,G._routerState=A._routerState,G.snapshot=A.snapshot,G.outlet=A.outlet,G.component=A.component,this.currentActivatedRoute$.next({component:D,activatedRoute:A})}}return v.\u0275fac=function(D){return new(D||v)(h.$8M("name"),h.$8M("tabs"),h.Y36(Te.Ye),h.Y36(h.SBq),h.Y36(me.F0),h.Y36(h.R0b),h.Y36(me.gz),h.Y36(v,12))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-router-outlet"]],inputs:{animated:"animated",animation:"animation",mode:"mode",swipeGesture:"swipeGesture",name:"name"},outputs:{stackWillChange:"stackWillChange",stackDidChange:"stackDidChange",activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),v})();class bo{constructor(M,D,A){this.route=M,this.childContexts=D,this.parent=A}get(M,D){return M===me.gz?this.route:M===me.y6?this.childContexts:this.parent.get(M,D)}}const Oo=new h.OlP("");let Ti=(()=>{class v{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(D){this.unsubscribeFromRouteData(D),this.subscribeToRouteData(D)}unsubscribeFromRouteData(D){this.outletDataSubscriptions.get(D)?.unsubscribe(),this.outletDataSubscriptions.delete(D)}subscribeToRouteData(D){const{activatedRoute:A}=D,G=(0,E.a)([A.queryParams,A.params,A.data]).pipe((0,ye.w)(([It,Yn,pi],tr)=>(pi={...It,...Yn,...pi},0===tr?(0,Ne.of)(pi):Promise.resolve(pi)))).subscribe(It=>{if(!D.isActivated||!D.activatedComponentRef||D.activatedRoute!==A||null===A.component)return void this.unsubscribeFromRouteData(D);const Yn=(0,h.qFp)(A.component);if(Yn)for(const{templateName:pi}of Yn.inputs)D.activatedComponentRef.setInput(pi,It[pi]);else this.unsubscribeFromRouteData(D)});this.outletDataSubscriptions.set(D,G)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})(),Xo=(()=>{class v{constructor(D,A,G){this.routerOutlet=D,this.navCtrl=A,this.config=G}onClick(D){const A=this.defaultHref||this.config.get("backButtonDefaultHref");this.routerOutlet?.canGoBack()?(this.navCtrl.setDirection("back",void 0,void 0,this.routerAnimation),this.routerOutlet.pop(),D.preventDefault()):null!=A&&(this.navCtrl.navigateBack(A,{animation:this.routerAnimation}),D.preventDefault())}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(br,8),h.Y36(co),h.Y36(di))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-back-button"]],hostBindings:function(D,A){1&D&&h.NdJ("click",function(It){return A.onClick(It)})},inputs:{defaultHref:"defaultHref",routerAnimation:"routerAnimation"}}),v})(),Br=(()=>{class v{constructor(D,A,G,It,Yn){this.locationStrategy=D,this.navCtrl=A,this.elementRef=G,this.router=It,this.routerLink=Yn,this.routerDirection="forward"}ngOnInit(){this.updateTargetUrlAndHref()}ngOnChanges(){this.updateTargetUrlAndHref()}updateTargetUrlAndHref(){if(this.routerLink?.urlTree){const D=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));this.elementRef.nativeElement.href=D}}onClick(D){this.navCtrl.setDirection(this.routerDirection,void 0,void 0,this.routerAnimation),D.preventDefault()}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(Te.S$),h.Y36(co),h.Y36(h.SBq),h.Y36(me.F0),h.Y36(me.rH,8))},v.\u0275dir=h.lG2({type:v,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(D,A){1&D&&h.NdJ("click",function(It){return A.onClick(It)})},inputs:{routerDirection:"routerDirection",routerAnimation:"routerAnimation"},features:[h.TTD]}),v})();const Ho={provide:y.Cf,useExisting:(0,h.Gpc)(()=>hr),multi:!0};let hr=(()=>{class v extends y.Fd{}return v.\u0275fac=function(){let M;return function(A){return(M||(M=h.n5z(v)))(A||v)}}(),v.\u0275dir=h.lG2({type:v,selectors:[["ion-input","type","number","max","","formControlName",""],["ion-input","type","number","max","","formControl",""],["ion-input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(D,A){2&D&&h.uIk("max",A._enabled?A.max:null)},features:[h._Bn([Ho]),h.qOj]}),v})();const Ps={provide:y.Cf,useExisting:(0,h.Gpc)(()=>Qo),multi:!0};let Qo=(()=>{class v extends y.qQ{}return v.\u0275fac=function(){let M;return function(A){return(M||(M=h.n5z(v)))(A||v)}}(),v.\u0275dir=h.lG2({type:v,selectors:[["ion-input","type","number","min","","formControlName",""],["ion-input","type","number","min","","formControl",""],["ion-input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(D,A){2&D&&h.uIk("min",A._enabled?A.min:null)},features:[h._Bn([Ps]),h.qOj]}),v})();class hs{constructor(M){this.ctrl=M}create(M){return this.ctrl.create(M||{})}dismiss(M,D,A){return this.ctrl.dismiss(M,D,A)}getTop(){return this.ctrl.getTop()}}let Cs=(()=>{class v extends hs{constructor(){super(et.b)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})(),or=(()=>{class v extends hs{constructor(){super(et.a)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})(),Qa=(()=>{class v extends hs{constructor(){super(et.l)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})(),Ur=(()=>{class v extends hs{constructor(){super(et.m),this.angularDelegate=(0,h.f3M)(ds),this.injector=(0,h.f3M)(h.zs3),this.environmentInjector=(0,h.f3M)(h.lqb)}create(D){return super.create({...D,delegate:this.angularDelegate.create(this.environmentInjector,this.injector,"modal")})}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})(),fs=(()=>{class v extends hs{constructor(){super(et.c),this.angularDelegate=(0,h.f3M)(ds),this.injector=(0,h.f3M)(h.zs3),this.environmentInjector=(0,h.f3M)(h.lqb)}create(D){return super.create({...D,delegate:this.angularDelegate.create(this.environmentInjector,this.injector,"popover")})}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})(),Do=(()=>{class v extends hs{constructor(){super(et.t)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();class yo{shouldDetach(M){return!1}shouldAttach(M){return!1}store(M,D){}retrieve(M){return null}shouldReuseRoute(M,D){if(M.routeConfig!==D.routeConfig)return!1;const A=M.params,G=D.params,It=Object.keys(A),Yn=Object.keys(G);if(It.length!==Yn.length)return!1;for(const pi of It)if(G[pi]!==A[pi])return!1;return!0}}const ra=(v,M,D)=>()=>{if(M.defaultView&&typeof window<"u"){(0,Ie.s)({...v,_zoneGate:It=>D.run(It)});const G="__zone_symbol__addEventListener"in M.body?"__zone_symbol__addEventListener":"addEventListener";return function Pe(){var v=[];if(typeof window<"u"){var M=window;(!M.customElements||M.Element&&(!M.Element.prototype.closest||!M.Element.prototype.matches||!M.Element.prototype.remove||!M.Element.prototype.getRootNode))&&v.push(k.e(6748).then(k.t.bind(k,3342,23))),("function"!=typeof Object.assign||!Object.entries||!Array.prototype.find||!Array.prototype.includes||!String.prototype.startsWith||!String.prototype.endsWith||M.NodeList&&!M.NodeList.prototype.forEach||!M.fetch||!function(){try{var A=new URL("b","http://a");return A.pathname="c%20d","http://a/c%20d"===A.href&&A.searchParams}catch{return!1}}()||typeof WeakMap>"u")&&v.push(k.e(2214).then(k.t.bind(k,2668,23)))}return Promise.all(v)}().then(()=>((v,M)=>{if(!(typeof window>"u"))return Ae(),(0,ct.b)(JSON.parse('[["ion-menu_3",[[33,"ion-menu-button",{"color":[513],"disabled":[4],"menu":[1],"autoHide":[4,"auto-hide"],"type":[1],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]],[33,"ion-menu",{"contentId":[513,"content-id"],"menuId":[513,"menu-id"],"type":[1025],"disabled":[1028],"side":[513],"swipeGesture":[4,"swipe-gesture"],"maxEdgeStart":[2,"max-edge-start"],"isPaneVisible":[32],"isEndSide":[32],"isOpen":[64],"isActive":[64],"open":[64],"close":[64],"toggle":[64],"setOpen":[64]},[[16,"ionSplitPaneVisible","onSplitPaneChanged"],[2,"click","onBackdropClick"],[0,"keydown","onKeydown"]]],[1,"ion-menu-toggle",{"menu":[1],"autoHide":[4,"auto-hide"],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]]]],["ion-fab_3",[[33,"ion-fab-button",{"color":[513],"activated":[4],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1],"show":[4],"translucent":[4],"type":[1],"size":[1],"closeIcon":[1,"close-icon"]}],[1,"ion-fab",{"horizontal":[1],"vertical":[1],"edge":[4],"activated":[1028],"close":[64],"toggle":[64]}],[1,"ion-fab-list",{"activated":[4],"side":[1]}]]],["ion-refresher_2",[[0,"ion-refresher-content",{"pullingIcon":[1025,"pulling-icon"],"pullingText":[1,"pulling-text"],"refreshingSpinner":[1025,"refreshing-spinner"],"refreshingText":[1,"refreshing-text"]}],[32,"ion-refresher",{"pullMin":[2,"pull-min"],"pullMax":[2,"pull-max"],"closeDuration":[1,"close-duration"],"snapbackDuration":[1,"snapback-duration"],"pullFactor":[2,"pull-factor"],"disabled":[4],"nativeRefresher":[32],"state":[32],"complete":[64],"cancel":[64],"getProgress":[64]}]]],["ion-back-button",[[33,"ion-back-button",{"color":[513],"defaultHref":[1025,"default-href"],"disabled":[516],"icon":[1],"text":[1],"type":[1],"routerAnimation":[16]}]]],["ion-toast",[[33,"ion-toast",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"color":[513],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"duration":[2],"header":[1],"layout":[1],"message":[1],"keyboardClose":[4,"keyboard-close"],"position":[1],"buttons":[16],"translucent":[4],"animated":[4],"icon":[1],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"revealContentToScreenReader":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-card_5",[[33,"ion-card",{"color":[513],"button":[4],"type":[1],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}],[32,"ion-card-content"],[33,"ion-card-header",{"color":[513],"translucent":[4]}],[33,"ion-card-subtitle",{"color":[513]}],[33,"ion-card-title",{"color":[513]}]]],["ion-item-option_3",[[33,"ion-item-option",{"color":[513],"disabled":[4],"download":[1],"expandable":[4],"href":[1],"rel":[1],"target":[1],"type":[1]}],[32,"ion-item-options",{"side":[1],"fireSwipeEvent":[64]}],[0,"ion-item-sliding",{"disabled":[4],"state":[32],"getOpenAmount":[64],"getSlidingRatio":[64],"open":[64],"close":[64],"closeOpened":[64]}]]],["ion-accordion_2",[[49,"ion-accordion",{"value":[1],"disabled":[4],"readonly":[4],"toggleIcon":[1,"toggle-icon"],"toggleIconSlot":[1,"toggle-icon-slot"],"state":[32],"isNext":[32],"isPrevious":[32]}],[33,"ion-accordion-group",{"animated":[4],"multiple":[4],"value":[1025],"disabled":[4],"readonly":[4],"expand":[1],"requestAccordionToggle":[64],"getAccordions":[64]},[[0,"keydown","onKeydown"]]]]],["ion-infinite-scroll_2",[[32,"ion-infinite-scroll-content",{"loadingSpinner":[1025,"loading-spinner"],"loadingText":[1,"loading-text"]}],[0,"ion-infinite-scroll",{"threshold":[1],"disabled":[4],"position":[1],"isLoading":[32],"complete":[64]}]]],["ion-reorder_2",[[33,"ion-reorder",null,[[2,"click","onClick"]]],[0,"ion-reorder-group",{"disabled":[4],"state":[32],"complete":[64]}]]],["ion-segment_2",[[33,"ion-segment-button",{"disabled":[1028],"layout":[1],"type":[1],"value":[8],"checked":[32],"setFocus":[64]}],[33,"ion-segment",{"color":[513],"disabled":[4],"scrollable":[4],"swipeGesture":[4,"swipe-gesture"],"value":[1032],"selectOnFocus":[4,"select-on-focus"],"activated":[32]},[[0,"keydown","onKeyDown"]]]]],["ion-tab-bar_2",[[33,"ion-tab-button",{"disabled":[4],"download":[1],"href":[1],"rel":[1],"layout":[1025],"selected":[1028],"tab":[1],"target":[1]},[[8,"ionTabBarChanged","onTabBarChanged"]]],[33,"ion-tab-bar",{"color":[513],"selectedTab":[1,"selected-tab"],"translucent":[4],"keyboardVisible":[32]}]]],["ion-chip",[[1,"ion-chip",{"color":[513],"outline":[4],"disabled":[4]}]]],["ion-datetime-button",[[33,"ion-datetime-button",{"color":[513],"disabled":[516],"datetime":[1],"datetimePresentation":[32],"dateText":[32],"timeText":[32],"datetimeActive":[32],"selectedButton":[32]}]]],["ion-input",[[38,"ion-input",{"color":[513],"accept":[1],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"clearOnEdit":[4,"clear-on-edit"],"counter":[4],"counterFormatter":[16],"debounce":[2],"disabled":[4],"enterkeyhint":[1],"errorText":[1,"error-text"],"fill":[1],"inputmode":[1],"helperText":[1,"helper-text"],"label":[1],"labelPlacement":[1,"label-placement"],"legacy":[4],"max":[8],"maxlength":[2],"min":[8],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"shape":[1],"spellcheck":[4],"step":[1],"size":[2],"type":[1],"value":[1032],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-searchbar",[[34,"ion-searchbar",{"color":[513],"animated":[4],"autocomplete":[1],"autocorrect":[1],"cancelButtonIcon":[1,"cancel-button-icon"],"cancelButtonText":[1,"cancel-button-text"],"clearIcon":[1,"clear-icon"],"debounce":[2],"disabled":[4],"inputmode":[1],"enterkeyhint":[1],"name":[1],"placeholder":[1],"searchIcon":[1,"search-icon"],"showCancelButton":[1,"show-cancel-button"],"showClearButton":[1,"show-clear-button"],"spellcheck":[4],"type":[1],"value":[1025],"focused":[32],"noAnimate":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-toggle",[[33,"ion-toggle",{"color":[513],"name":[1],"checked":[1028],"disabled":[4],"value":[1],"enableOnOffLabels":[4,"enable-on-off-labels"],"labelPlacement":[1,"label-placement"],"legacy":[4],"justify":[1],"activated":[32]}]]],["ion-nav_2",[[1,"ion-nav",{"delegate":[16],"swipeGesture":[1028,"swipe-gesture"],"animated":[4],"animation":[16],"rootParams":[16],"root":[1],"push":[64],"insert":[64],"insertPages":[64],"pop":[64],"popTo":[64],"popToRoot":[64],"removeIndex":[64],"setRoot":[64],"setPages":[64],"setRouteId":[64],"getRouteId":[64],"getActive":[64],"getByIndex":[64],"canGoBack":[64],"getPrevious":[64]}],[0,"ion-nav-link",{"component":[1],"componentProps":[16],"routerDirection":[1,"router-direction"],"routerAnimation":[16]}]]],["ion-textarea",[[38,"ion-textarea",{"color":[513],"autocapitalize":[1],"autofocus":[4],"clearOnEdit":[4,"clear-on-edit"],"debounce":[2],"disabled":[4],"fill":[1],"inputmode":[1],"enterkeyhint":[1],"maxlength":[2],"minlength":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"cols":[2],"rows":[2],"wrap":[1],"autoGrow":[516,"auto-grow"],"value":[1025],"counter":[4],"counterFormatter":[16],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"label":[1],"labelPlacement":[1,"label-placement"],"legacy":[4],"shape":[1],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-backdrop",[[33,"ion-backdrop",{"visible":[4],"tappable":[4],"stopPropagation":[4,"stop-propagation"]},[[2,"click","onMouseDown"]]]]],["ion-loading",[[34,"ion-loading",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"message":[1],"cssClass":[1,"css-class"],"duration":[2],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"spinner":[1025],"translucent":[4],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-breadcrumb_2",[[33,"ion-breadcrumb",{"collapsed":[4],"last":[4],"showCollapsedIndicator":[4,"show-collapsed-indicator"],"color":[1],"active":[4],"disabled":[4],"download":[1],"href":[1],"rel":[1],"separator":[4],"target":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16]}],[33,"ion-breadcrumbs",{"color":[513],"maxItems":[2,"max-items"],"itemsBeforeCollapse":[2,"items-before-collapse"],"itemsAfterCollapse":[2,"items-after-collapse"],"collapsed":[32],"activeChanged":[32]},[[0,"collapsedClick","onCollapsedClick"]]]]],["ion-modal",[[33,"ion-modal",{"hasController":[4,"has-controller"],"overlayIndex":[2,"overlay-index"],"delegate":[16],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"breakpoints":[16],"initialBreakpoint":[2,"initial-breakpoint"],"backdropBreakpoint":[2,"backdrop-breakpoint"],"handle":[4],"handleBehavior":[1,"handle-behavior"],"component":[1],"componentProps":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"animated":[4],"presentingElement":[16],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"keepContentsMounted":[4,"keep-contents-mounted"],"canDismiss":[4,"can-dismiss"],"presented":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64],"setCurrentBreakpoint":[64],"getCurrentBreakpoint":[64]}]]],["ion-route_4",[[0,"ion-route",{"url":[1],"component":[1],"componentProps":[16],"beforeLeave":[16],"beforeEnter":[16]}],[0,"ion-route-redirect",{"from":[1],"to":[1]}],[0,"ion-router",{"root":[1],"useHash":[4,"use-hash"],"canTransition":[64],"push":[64],"back":[64],"printDebug":[64],"navChanged":[64]},[[8,"popstate","onPopState"],[4,"ionBackButton","onBackButton"]]],[1,"ion-router-link",{"color":[513],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}]]],["ion-avatar_3",[[33,"ion-avatar"],[33,"ion-badge",{"color":[513]}],[1,"ion-thumbnail"]]],["ion-col_3",[[1,"ion-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]],[1,"ion-grid",{"fixed":[4]}],[1,"ion-row"]]],["ion-tab_2",[[1,"ion-tab",{"active":[1028],"delegate":[16],"tab":[1],"component":[1],"setActive":[64]}],[1,"ion-tabs",{"useRouter":[1028,"use-router"],"selectedTab":[32],"select":[64],"getTab":[64],"getSelected":[64],"setRouteId":[64],"getRouteId":[64]}]]],["ion-img",[[1,"ion-img",{"alt":[1],"src":[1],"loadSrc":[32],"loadError":[32]}]]],["ion-progress-bar",[[33,"ion-progress-bar",{"type":[1],"reversed":[4],"value":[2],"buffer":[2],"color":[513]}]]],["ion-range",[[33,"ion-range",{"color":[513],"debounce":[2],"name":[1],"label":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"pinFormatter":[16],"snaps":[4],"step":[2],"ticks":[4],"activeBarStart":[1026,"active-bar-start"],"disabled":[4],"value":[1026],"labelPlacement":[1,"label-placement"],"legacy":[4],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]]],["ion-split-pane",[[33,"ion-split-pane",{"contentId":[513,"content-id"],"disabled":[4],"when":[8],"visible":[32]}]]],["ion-text",[[1,"ion-text",{"color":[513]}]]],["ion-item_8",[[33,"ion-item-divider",{"color":[513],"sticky":[4]}],[32,"ion-item-group"],[1,"ion-skeleton-text",{"animated":[4]}],[32,"ion-list",{"lines":[1],"inset":[4],"closeSlidingItems":[64]}],[33,"ion-list-header",{"color":[513],"lines":[1]}],[49,"ion-item",{"color":[513],"button":[4],"detail":[4],"detailIcon":[1,"detail-icon"],"disabled":[4],"download":[1],"fill":[1],"shape":[1],"href":[1],"rel":[1],"lines":[1],"counter":[4],"routerAnimation":[16],"routerDirection":[1,"router-direction"],"target":[1],"type":[1],"counterFormatter":[16],"multipleInputs":[32],"focusable":[32],"counterString":[32]},[[0,"ionInput","handleIonInput"],[0,"ionColor","labelColorChanged"],[0,"ionStyle","itemStyle"]]],[34,"ion-label",{"color":[513],"position":[1],"noAnimate":[32]}],[33,"ion-note",{"color":[513]}]]],["ion-select_3",[[33,"ion-select",{"cancelText":[1,"cancel-text"],"color":[513],"compareWith":[1,"compare-with"],"disabled":[4],"fill":[1],"interface":[1],"interfaceOptions":[8,"interface-options"],"justify":[1],"label":[1],"labelPlacement":[1,"label-placement"],"legacy":[4],"multiple":[4],"name":[1],"okText":[1,"ok-text"],"placeholder":[1],"selectedText":[1,"selected-text"],"toggleIcon":[1,"toggle-icon"],"expandedIcon":[1,"expanded-icon"],"shape":[1],"value":[1032],"isExpanded":[32],"open":[64]}],[1,"ion-select-option",{"disabled":[4],"value":[8]}],[34,"ion-select-popover",{"header":[1],"subHeader":[1,"sub-header"],"message":[1],"multiple":[4],"options":[16]}]]],["ion-picker-internal",[[33,"ion-picker-internal",{"exitInputMode":[64]},[[1,"touchstart","preventTouchStartPropagation"]]]]],["ion-datetime_3",[[33,"ion-datetime",{"color":[1],"name":[1],"disabled":[4],"readonly":[4],"isDateEnabled":[16],"min":[1025],"max":[1025],"presentation":[1],"cancelText":[1,"cancel-text"],"doneText":[1,"done-text"],"clearText":[1,"clear-text"],"yearValues":[8,"year-values"],"monthValues":[8,"month-values"],"dayValues":[8,"day-values"],"hourValues":[8,"hour-values"],"minuteValues":[8,"minute-values"],"locale":[1],"firstDayOfWeek":[2,"first-day-of-week"],"titleSelectedDatesFormatter":[16],"multiple":[4],"highlightedDates":[16],"value":[1025],"showDefaultTitle":[4,"show-default-title"],"showDefaultButtons":[4,"show-default-buttons"],"showClearButton":[4,"show-clear-button"],"showDefaultTimeLabel":[4,"show-default-time-label"],"hourCycle":[1,"hour-cycle"],"size":[1],"preferWheel":[4,"prefer-wheel"],"showMonthAndYear":[32],"activeParts":[32],"workingParts":[32],"isTimePopoverOpen":[32],"confirm":[64],"reset":[64],"cancel":[64]}],[34,"ion-picker",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"columns":[16],"cssClass":[1,"css-class"],"duration":[2],"showBackdrop":[4,"show-backdrop"],"backdropDismiss":[4,"backdrop-dismiss"],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"presented":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64],"getColumn":[64]}],[32,"ion-picker-column",{"col":[16]}]]],["ion-radio_2",[[33,"ion-radio",{"color":[513],"name":[1],"disabled":[4],"value":[8],"labelPlacement":[1,"label-placement"],"legacy":[4],"justify":[1],"checked":[32],"buttonTabindex":[32],"setFocus":[64],"setButtonTabindex":[64]}],[0,"ion-radio-group",{"allowEmptySelection":[4,"allow-empty-selection"],"name":[1],"value":[1032]},[[4,"keydown","onKeydown"]]]]],["ion-ripple-effect",[[1,"ion-ripple-effect",{"type":[1],"addRipple":[64]}]]],["ion-button_2",[[33,"ion-button",{"color":[513],"buttonType":[1025,"button-type"],"disabled":[516],"expand":[513],"fill":[1537],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"download":[1],"href":[1],"rel":[1],"shape":[513],"size":[513],"strong":[4],"target":[1],"type":[1],"form":[1]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]}]]],["ion-action-sheet",[[34,"ion-action-sheet",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"header":[1],"subHeader":[1,"sub-header"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-alert",[[34,"ion-alert",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"header":[1],"subHeader":[1,"sub-header"],"message":[1],"buttons":[16],"inputs":[1040],"backdropDismiss":[4,"backdrop-dismiss"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]},[[4,"keydown","onKeydown"]]]]],["ion-app_8",[[0,"ion-app",{"setFocus":[64]}],[1,"ion-content",{"color":[513],"fullscreen":[4],"forceOverscroll":[1028,"force-overscroll"],"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"scrollEvents":[4,"scroll-events"],"getScrollElement":[64],"getBackgroundElement":[64],"scrollToTop":[64],"scrollToBottom":[64],"scrollByPoint":[64],"scrollToPoint":[64]},[[8,"appload","onAppLoad"],[9,"resize","onResize"]]],[36,"ion-footer",{"collapse":[1],"translucent":[4],"keyboardVisible":[32]}],[36,"ion-header",{"collapse":[1],"translucent":[4]}],[1,"ion-router-outlet",{"mode":[1025],"delegate":[16],"animated":[4],"animation":[16],"swipeHandler":[16],"commit":[64],"setRouteId":[64],"getRouteId":[64]}],[33,"ion-title",{"color":[513],"size":[1]}],[33,"ion-toolbar",{"color":[513]},[[0,"ionStyle","childrenStyle"]]],[34,"ion-buttons",{"collapse":[4]}]]],["ion-picker-column-internal",[[33,"ion-picker-column-internal",{"items":[16],"value":[1032],"color":[513],"numericInput":[4,"numeric-input"],"isActive":[32],"scrollActiveItemIntoView":[64],"setValue":[64]}]]],["ion-popover",[[33,"ion-popover",{"hasController":[4,"has-controller"],"delegate":[16],"overlayIndex":[2,"overlay-index"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"keyboardClose":[4,"keyboard-close"],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"event":[8],"showBackdrop":[4,"show-backdrop"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"triggerAction":[1,"trigger-action"],"trigger":[1],"size":[1],"dismissOnSelect":[4,"dismiss-on-select"],"reference":[1],"side":[1],"alignment":[1025],"arrow":[4],"isOpen":[4,"is-open"],"keyboardEvents":[4,"keyboard-events"],"keepContentsMounted":[4,"keep-contents-mounted"],"presented":[32],"presentFromTrigger":[64],"present":[64],"dismiss":[64],"getParentPopover":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-checkbox",[[33,"ion-checkbox",{"color":[513],"name":[1],"checked":[1028],"indeterminate":[1028],"disabled":[4],"value":[8],"labelPlacement":[1,"label-placement"],"justify":[1],"legacy":[4]}]]],["ion-spinner",[[1,"ion-spinner",{"color":[513],"duration":[2],"name":[1],"paused":[4]}]]]]'),M)})(0,{exclude:["ion-tabs","ion-tab"],syncQueue:!0,raf:Fe,jmp:It=>D.runOutsideAngular(It),ael(It,Yn,pi,tr){It[G](Yn,pi,tr)},rel(It,Yn,pi,tr){It.removeEventListener(Yn,pi,tr)}}))}};let ki=(()=>{class v{static forRoot(D){return{ngModule:v,providers:[{provide:Ai,useValue:D},{provide:h.ip1,useFactory:ra,multi:!0,deps:[Ai,Te.K0,h.R0b]},{provide:Oo,useFactory:Ws,deps:[me.F0]}]}}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275mod=h.oAB({type:v}),v.\u0275inj=h.cJS({providers:[ds,Ur,fs],imports:[Te.ez]}),v})();function Ws(v){return v?.componentInputBindingEnabled?new Ti:null}},3999:(Nn,yt,k)=>{"use strict";k.d(yt,{Zw:()=>Ie,aw:()=>Je,X$:()=>De,sK:()=>qt});var x=k(1180),h=k(2029),y=k(2096),s=k(2664),J=k(9315),ie=k(5211),Y=k(4911),E=k(8180),Ne=k(8645),me=k(4552);class he extends Ne.x{constructor(Fe=1/0,St=1/0,Ce=me.l){super(),this._bufferSize=Fe,this._windowTime=St,this._timestampProvider=Ce,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=St===1/0,this._bufferSize=Math.max(1,Fe),this._windowTime=Math.max(1,St)}next(Fe){const{isStopped:St,_buffer:Ce,_infiniteTimeWindow:Rt,_timestampProvider:Qt,_windowTime:Gt}=this;St||(Ce.push(Fe),!Rt&&Ce.push(Qt.now()+Gt)),this._trimBuffer(),super.next(Fe)}_subscribe(Fe){this._throwIfClosed(),this._trimBuffer();const St=this._innerSubscribe(Fe),{_infiniteTimeWindow:Ce,_buffer:Rt}=this,Qt=Rt.slice();for(let Gt=0;Gtnew he(Ce,Fe,St),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:Rt})}var ae=k(7398),oe=k(6328),Be=k(4664);class Ie{}let Ee=(()=>{var Re;class Fe extends Ie{getTranslation(Ce){return(0,y.of)({})}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(){let St;return function(Rt){return(St||(St=h.n5z(Re)))(Rt||Re)}}()),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();class Ue{}let et=(()=>{var Re;class Fe{handle(Ce){return Ce.key}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)}),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();function le(Re,Fe){if(Re===Fe)return!0;if(null===Re||null===Fe)return!1;if(Re!=Re&&Fe!=Fe)return!0;let Rt,Qt,Gt,St=typeof Re;if(St==typeof Fe&&"object"==St){if(!Array.isArray(Re)){if(Array.isArray(Fe))return!1;for(Qt in Gt=Object.create(null),Re){if(!le(Re[Qt],Fe[Qt]))return!1;Gt[Qt]=!0}for(Qt in Fe)if(!(Qt in Gt)&&typeof Fe[Qt]<"u")return!1;return!0}if(!Array.isArray(Fe))return!1;if((Rt=Re.length)==Fe.length){for(Qt=0;Qt{ct(Fe[Ce])?Ce in Re?St[Ce]=ht(Re[Ce],Fe[Ce]):Object.assign(St,{[Ce]:Fe[Ce]}):Object.assign(St,{[Ce]:Fe[Ce]})}),St}class Le{}let ye=(()=>{var Re;class Fe extends Le{constructor(...Ce){super(...Ce),(0,x.Z)(this,"templateMatcher",/{{\s?([^{}\s]*)\s?}}/g)}interpolate(Ce,Rt){let Qt;return Qt="string"==typeof Ce?this.interpolateString(Ce,Rt):"function"==typeof Ce?this.interpolateFunction(Ce,Rt):Ce,Qt}getValue(Ce,Rt){let Qt="string"==typeof Rt?Rt.split("."):[Rt];Rt="";do{Rt+=Qt.shift(),!ue(Ce)||!ue(Ce[Rt])||"object"!=typeof Ce[Rt]&&Qt.length?Qt.length?Rt+=".":Ce=void 0:(Ce=Ce[Rt],Rt="")}while(Qt.length);return Ce}interpolateFunction(Ce,Rt){return Ce(Rt)}interpolateString(Ce,Rt){return Rt?Ce.replace(this.templateMatcher,(Qt,Gt)=>{let Zt=this.getValue(Rt,Gt);return ue(Zt)?Zt:Qt}):Ce}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(){let St;return function(Rt){return(St||(St=h.n5z(Re)))(Rt||Re)}}()),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();class gt{}let Te=(()=>{var Re;class Fe extends gt{compile(Ce,Rt){return Ce}compileTranslations(Ce,Rt){return Ce}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(){let St;return function(Rt){return(St||(St=h.n5z(Re)))(Rt||Re)}}()),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();class Pe{constructor(){(0,x.Z)(this,"defaultLang",void 0),(0,x.Z)(this,"currentLang",this.defaultLang),(0,x.Z)(this,"translations",{}),(0,x.Z)(this,"langs",[]),(0,x.Z)(this,"onTranslationChange",new h.vpe),(0,x.Z)(this,"onLangChange",new h.vpe),(0,x.Z)(this,"onDefaultLangChange",new h.vpe)}}const Ae=new h.OlP("USE_STORE"),Ye=new h.OlP("USE_DEFAULT_LANG"),_t=new h.OlP("DEFAULT_LANGUAGE"),hn=new h.OlP("USE_EXTEND");let qt=(()=>{var Re;class Fe{get onTranslationChange(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange}get onLangChange(){return this.isolate?this._onLangChange:this.store.onLangChange}get onDefaultLangChange(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange}get defaultLang(){return this.isolate?this._defaultLang:this.store.defaultLang}set defaultLang(Ce){this.isolate?this._defaultLang=Ce:this.store.defaultLang=Ce}get currentLang(){return this.isolate?this._currentLang:this.store.currentLang}set currentLang(Ce){this.isolate?this._currentLang=Ce:this.store.currentLang=Ce}get langs(){return this.isolate?this._langs:this.store.langs}set langs(Ce){this.isolate?this._langs=Ce:this.store.langs=Ce}get translations(){return this.isolate?this._translations:this.store.translations}set translations(Ce){this.isolate?this._translations=Ce:this.store.translations=Ce}constructor(Ce,Rt,Qt,Gt,Zt,Jt=!0,kt=!1,dt=!1,Ot){(0,x.Z)(this,"store",void 0),(0,x.Z)(this,"currentLoader",void 0),(0,x.Z)(this,"compiler",void 0),(0,x.Z)(this,"parser",void 0),(0,x.Z)(this,"missingTranslationHandler",void 0),(0,x.Z)(this,"useDefaultLang",void 0),(0,x.Z)(this,"isolate",void 0),(0,x.Z)(this,"extend",void 0),(0,x.Z)(this,"loadingTranslations",void 0),(0,x.Z)(this,"pending",!1),(0,x.Z)(this,"_onTranslationChange",new h.vpe),(0,x.Z)(this,"_onLangChange",new h.vpe),(0,x.Z)(this,"_onDefaultLangChange",new h.vpe),(0,x.Z)(this,"_defaultLang",void 0),(0,x.Z)(this,"_currentLang",void 0),(0,x.Z)(this,"_langs",[]),(0,x.Z)(this,"_translations",{}),(0,x.Z)(this,"_translationRequests",{}),this.store=Ce,this.currentLoader=Rt,this.compiler=Qt,this.parser=Gt,this.missingTranslationHandler=Zt,this.useDefaultLang=Jt,this.isolate=kt,this.extend=dt,Ot&&this.setDefaultLang(Ot)}setDefaultLang(Ce){if(Ce===this.defaultLang)return;let Rt=this.retrieveTranslations(Ce);typeof Rt<"u"?(null==this.defaultLang&&(this.defaultLang=Ce),Rt.pipe((0,E.q)(1)).subscribe(Qt=>{this.changeDefaultLang(Ce)})):this.changeDefaultLang(Ce)}getDefaultLang(){return this.defaultLang}use(Ce){if(Ce===this.currentLang)return(0,y.of)(this.translations[Ce]);let Rt=this.retrieveTranslations(Ce);return typeof Rt<"u"?(this.currentLang||(this.currentLang=Ce),Rt.pipe((0,E.q)(1)).subscribe(Qt=>{this.changeLang(Ce)}),Rt):(this.changeLang(Ce),(0,y.of)(this.translations[Ce]))}retrieveTranslations(Ce){let Rt;return(typeof this.translations[Ce]>"u"||this.extend)&&(this._translationRequests[Ce]=this._translationRequests[Ce]||this.getTranslation(Ce),Rt=this._translationRequests[Ce]),Rt}getTranslation(Ce){this.pending=!0;const Rt=this.currentLoader.getTranslation(Ce).pipe(ee(1),(0,E.q)(1));return this.loadingTranslations=Rt.pipe((0,ae.U)(Qt=>this.compiler.compileTranslations(Qt,Ce)),ee(1),(0,E.q)(1)),this.loadingTranslations.subscribe({next:Qt=>{this.translations[Ce]=this.extend&&this.translations[Ce]?{...Qt,...this.translations[Ce]}:Qt,this.updateLangs(),this.pending=!1},error:Qt=>{this.pending=!1}}),Rt}setTranslation(Ce,Rt,Qt=!1){Rt=this.compiler.compileTranslations(Rt,Ce),this.translations[Ce]=(Qt||this.extend)&&this.translations[Ce]?ht(this.translations[Ce],Rt):Rt,this.updateLangs(),this.onTranslationChange.emit({lang:Ce,translations:this.translations[Ce]})}getLangs(){return this.langs}addLangs(Ce){Ce.forEach(Rt=>{-1===this.langs.indexOf(Rt)&&this.langs.push(Rt)})}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResult(Ce,Rt,Qt){let Gt;if(Rt instanceof Array){let Zt={},Jt=!1;for(let kt of Rt)Zt[kt]=this.getParsedResult(Ce,kt,Qt),(0,s.b)(Zt[kt])&&(Jt=!0);if(Jt){const kt=Rt.map(dt=>(0,s.b)(Zt[dt])?Zt[dt]:(0,y.of)(Zt[dt]));return(0,J.D)(kt).pipe((0,ae.U)(dt=>{let Ot={};return dt.forEach((pt,Yt)=>{Ot[Rt[Yt]]=pt}),Ot}))}return Zt}if(Ce&&(Gt=this.parser.interpolate(this.parser.getValue(Ce,Rt),Qt)),typeof Gt>"u"&&null!=this.defaultLang&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(Gt=this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang],Rt),Qt)),typeof Gt>"u"){let Zt={key:Rt,translateService:this};typeof Qt<"u"&&(Zt.interpolateParams=Qt),Gt=this.missingTranslationHandler.handle(Zt)}return typeof Gt<"u"?Gt:Rt}get(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');if(this.pending)return this.loadingTranslations.pipe((0,oe.b)(Qt=>(Qt=this.getParsedResult(Qt,Ce,Rt),(0,s.b)(Qt)?Qt:(0,y.of)(Qt))));{let Qt=this.getParsedResult(this.translations[this.currentLang],Ce,Rt);return(0,s.b)(Qt)?Qt:(0,y.of)(Qt)}}getStreamOnTranslationChange(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');return(0,ie.z)((0,Y.P)(()=>this.get(Ce,Rt)),this.onTranslationChange.pipe((0,Be.w)(Qt=>{const Gt=this.getParsedResult(Qt.translations,Ce,Rt);return"function"==typeof Gt.subscribe?Gt:(0,y.of)(Gt)})))}stream(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');return(0,ie.z)((0,Y.P)(()=>this.get(Ce,Rt)),this.onLangChange.pipe((0,Be.w)(Qt=>{const Gt=this.getParsedResult(Qt.translations,Ce,Rt);return(0,s.b)(Gt)?Gt:(0,y.of)(Gt)})))}instant(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');let Qt=this.getParsedResult(this.translations[this.currentLang],Ce,Rt);if((0,s.b)(Qt)){if(Ce instanceof Array){let Gt={};return Ce.forEach((Zt,Jt)=>{Gt[Ce[Jt]]=Ce[Jt]}),Gt}return Ce}return Qt}set(Ce,Rt,Qt=this.currentLang){this.translations[Qt][Ce]=this.compiler.compile(Rt,Qt),this.updateLangs(),this.onTranslationChange.emit({lang:Qt,translations:this.translations[Qt]})}changeLang(Ce){this.currentLang=Ce,this.onLangChange.emit({lang:Ce,translations:this.translations[Ce]}),null==this.defaultLang&&this.changeDefaultLang(Ce)}changeDefaultLang(Ce){this.defaultLang=Ce,this.onDefaultLangChange.emit({lang:Ce,translations:this.translations[Ce]})}reloadLang(Ce){return this.resetLang(Ce),this.getTranslation(Ce)}resetLang(Ce){this._translationRequests[Ce]=void 0,this.translations[Ce]=void 0}getBrowserLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let Ce=window.navigator.languages?window.navigator.languages[0]:null;return Ce=Ce||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,typeof Ce>"u"?void 0:(-1!==Ce.indexOf("-")&&(Ce=Ce.split("-")[0]),-1!==Ce.indexOf("_")&&(Ce=Ce.split("_")[0]),Ce)}getBrowserCultureLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let Ce=window.navigator.languages?window.navigator.languages[0]:null;return Ce=Ce||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,Ce}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)(h.LFG(Pe),h.LFG(Ie),h.LFG(gt),h.LFG(Le),h.LFG(Ue),h.LFG(Ye),h.LFG(Ae),h.LFG(hn),h.LFG(_t))}),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})(),De=(()=>{var Re;class Fe{constructor(Ce,Rt){(0,x.Z)(this,"translate",void 0),(0,x.Z)(this,"_ref",void 0),(0,x.Z)(this,"value",""),(0,x.Z)(this,"lastKey",null),(0,x.Z)(this,"lastParams",[]),(0,x.Z)(this,"onTranslationChange",void 0),(0,x.Z)(this,"onLangChange",void 0),(0,x.Z)(this,"onDefaultLangChange",void 0),this.translate=Ce,this._ref=Rt}updateValue(Ce,Rt,Qt){let Gt=Zt=>{this.value=void 0!==Zt?Zt:Ce,this.lastKey=Ce,this._ref.markForCheck()};if(Qt){let Zt=this.translate.getParsedResult(Qt,Ce,Rt);(0,s.b)(Zt.subscribe)?Zt.subscribe(Gt):Gt(Zt)}this.translate.get(Ce,Rt).subscribe(Gt)}transform(Ce,...Rt){if(!Ce||!Ce.length)return Ce;if(le(Ce,this.lastKey)&&le(Rt,this.lastParams))return this.value;let Qt;if(ue(Rt[0])&&Rt.length)if("string"==typeof Rt[0]&&Rt[0].length){let Gt=Rt[0].replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g,'"$2":').replace(/:(\s)?(\')(.*?)(\')/g,':"$3"');try{Qt=JSON.parse(Gt)}catch{throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${Rt[0]}`)}}else"object"==typeof Rt[0]&&!Array.isArray(Rt[0])&&(Qt=Rt[0]);return this.lastKey=Ce,this.lastParams=Rt,this.updateValue(Ce,Qt),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(Gt=>{this.lastKey&&Gt.lang===this.translate.currentLang&&(this.lastKey=null,this.updateValue(Ce,Qt,Gt.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(Gt=>{this.lastKey&&(this.lastKey=null,this.updateValue(Ce,Qt,Gt.translations))})),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(Ce,Qt))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onDefaultLangChange<"u"&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)}ngOnDestroy(){this._dispose()}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)(h.Y36(qt,16),h.Y36(h.sBO,16))}),(0,x.Z)(Fe,"\u0275pipe",h.Yjl({name:"translate",type:Re,pure:!1})),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})(),Je=(()=>{var Re;class Fe{static forRoot(Ce={}){return{ngModule:Fe,providers:[Ce.loader||{provide:Ie,useClass:Ee},Ce.compiler||{provide:gt,useClass:Te},Ce.parser||{provide:Le,useClass:ye},Ce.missingTranslationHandler||{provide:Ue,useClass:et},Pe,{provide:Ae,useValue:Ce.isolate},{provide:Ye,useValue:Ce.useDefaultLang},{provide:hn,useValue:Ce.extend},{provide:_t,useValue:Ce.defaultLanguage},qt]}}static forChild(Ce={}){return{ngModule:Fe,providers:[Ce.loader||{provide:Ie,useClass:Ee},Ce.compiler||{provide:gt,useClass:Te},Ce.parser||{provide:Le,useClass:ye},Ce.missingTranslationHandler||{provide:Ue,useClass:et},{provide:Ae,useValue:Ce.isolate},{provide:Ye,useValue:Ce.useDefaultLang},{provide:hn,useValue:Ce.extend},{provide:_t,useValue:Ce.defaultLanguage},qt]}}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)}),(0,x.Z)(Fe,"\u0275mod",h.oAB({type:Re})),(0,x.Z)(Fe,"\u0275inj",h.cJS({})),Fe})()},5861:(Nn,yt,k)=>{"use strict";function x(y,s,J,ie,Y,E,Ne){try{var me=y[E](Ne),he=me.value}catch(_e){return void J(_e)}me.done?s(he):Promise.resolve(he).then(ie,Y)}function h(y){return function(){var s=this,J=arguments;return new Promise(function(ie,Y){var E=y.apply(s,J);function Ne(he){x(E,ie,Y,Ne,me,"next",he)}function me(he){x(E,ie,Y,Ne,me,"throw",he)}Ne(void 0)})}}k.d(yt,{Z:()=>h})},1180:(Nn,yt,k)=>{"use strict";function x(J){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(ie){return typeof ie}:function(ie){return ie&&"function"==typeof Symbol&&ie.constructor===Symbol&&ie!==Symbol.prototype?"symbol":typeof ie})(J)}function s(J,ie,Y){return(ie=function y(J){var ie=function h(J,ie){if("object"!==x(J)||null===J)return J;var Y=J[Symbol.toPrimitive];if(void 0!==Y){var E=Y.call(J,ie||"default");if("object"!==x(E))return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===ie?String:Number)(J)}(J,"string");return"symbol"===x(ie)?ie:String(ie)}(ie))in J?Object.defineProperty(J,ie,{value:Y,enumerable:!0,configurable:!0,writable:!0}):J[ie]=Y,J}k.d(yt,{Z:()=>s})},7582:(Nn,yt,k)=>{"use strict";function J(De,Je,Re,Fe){var Rt,St=arguments.length,Ce=St<3?Je:null===Fe?Fe=Object.getOwnPropertyDescriptor(Je,Re):Fe;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)Ce=Reflect.decorate(De,Je,Re,Fe);else for(var Qt=De.length-1;Qt>=0;Qt--)(Rt=De[Qt])&&(Ce=(St<3?Rt(Ce):St>3?Rt(Je,Re,Ce):Rt(Je,Re))||Ce);return St>3&&Ce&&Object.defineProperty(Je,Re,Ce),Ce}function _e(De,Je,Re,Fe){return new(Re||(Re=Promise))(function(Ce,Rt){function Qt(Jt){try{Zt(Fe.next(Jt))}catch(kt){Rt(kt)}}function Gt(Jt){try{Zt(Fe.throw(Jt))}catch(kt){Rt(kt)}}function Zt(Jt){Jt.done?Ce(Jt.value):function St(Ce){return Ce instanceof Re?Ce:new Re(function(Rt){Rt(Ce)})}(Jt.value).then(Qt,Gt)}Zt((Fe=Fe.apply(De,Je||[])).next())})}function le(De){return this instanceof le?(this.v=De,this):new le(De)}function ue(De,Je,Re){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var St,Fe=Re.apply(De,Je||[]),Ce=[];return St={},Rt("next"),Rt("throw"),Rt("return"),St[Symbol.asyncIterator]=function(){return this},St;function Rt(dt){Fe[dt]&&(St[dt]=function(Ot){return new Promise(function(pt,Yt){Ce.push([dt,Ot,pt,Yt])>1||Qt(dt,Ot)})})}function Qt(dt,Ot){try{!function Gt(dt){dt.value instanceof le?Promise.resolve(dt.value.v).then(Zt,Jt):kt(Ce[0][2],dt)}(Fe[dt](Ot))}catch(pt){kt(Ce[0][3],pt)}}function Zt(dt){Qt("next",dt)}function Jt(dt){Qt("throw",dt)}function kt(dt,Ot){dt(Ot),Ce.shift(),Ce.length&&Qt(Ce[0][0],Ce[0][1])}}function ht(De){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Re,Je=De[Symbol.asyncIterator];return Je?Je.call(De):(De=function Be(De){var Je="function"==typeof Symbol&&Symbol.iterator,Re=Je&&De[Je],Fe=0;if(Re)return Re.call(De);if(De&&"number"==typeof De.length)return{next:function(){return De&&Fe>=De.length&&(De=void 0),{value:De&&De[Fe++],done:!De}}};throw new TypeError(Je?"Object is not iterable.":"Symbol.iterator is not defined.")}(De),Re={},Fe("next"),Fe("throw"),Fe("return"),Re[Symbol.asyncIterator]=function(){return this},Re);function Fe(Ce){Re[Ce]=De[Ce]&&function(Rt){return new Promise(function(Qt,Gt){!function St(Ce,Rt,Qt,Gt){Promise.resolve(Gt).then(function(Zt){Ce({value:Zt,done:Qt})},Rt)}(Qt,Gt,(Rt=De[Ce](Rt)).done,Rt.value)})}}}k.d(yt,{FC:()=>ue,KL:()=>ht,gn:()=>J,mG:()=>_e,qq:()=>le}),"function"==typeof SuppressedError&&SuppressedError}},Nn=>{Nn(Nn.s=3108)}]); \ No newline at end of file diff --git a/main.819383d819882ebf.js b/main.819383d819882ebf.js deleted file mode 100644 index a2e87afd..00000000 --- a/main.819383d819882ebf.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkapp=self.webpackChunkapp||[]).push([[179],{6091:(Nn,yt,k)=>{"use strict";k.d(yt,{Ar:()=>_e,N0:()=>Ne});var x=k(2029),h=k(6814),y=k(7398),s=k(1631),J=k(4911),ie=k(2096),Y=k(9862);const C=new x.OlP("JWT_OPTIONS");let Ne=(()=>{class ee{constructor(oe=null){this.tokenGetter=oe&&oe.tokenGetter||function(){}}urlBase64Decode(oe){let Be=oe.replace(/-/g,"+").replace(/_/g,"/");switch(Be.length%4){case 0:break;case 2:Be+="==";break;case 3:Be+="=";break;default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(Be)}b64decode(oe){let Ie="";if((oe=String(oe).replace(/=+$/,"")).length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let Ue,et,Ee=0,le=0;et=oe.charAt(le++);~et&&(Ue=Ee%4?64*Ue+et:et,Ee++%4)?Ie+=String.fromCharCode(255&Ue>>(-2*Ee&6)):0)et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(et);return Ie}b64DecodeUnicode(oe){return decodeURIComponent(Array.prototype.map.call(this.b64decode(oe),Be=>"%"+("00"+Be.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(oe=this.tokenGetter()){return oe instanceof Promise?oe.then(Be=>this._decodeToken(Be)):this._decodeToken(oe)}_decodeToken(oe){if(!oe||""===oe)return null;const Be=oe.split(".");if(3!==Be.length)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");const Ie=this.urlBase64Decode(Be[1]);if(!Ie)throw new Error("Cannot decode the token.");return JSON.parse(Ie)}getTokenExpirationDate(oe=this.tokenGetter()){return oe instanceof Promise?oe.then(Be=>this._getTokenExpirationDate(Be)):this._getTokenExpirationDate(oe)}_getTokenExpirationDate(oe){let Be;if(Be=this.decodeToken(oe),!Be||!Be.hasOwnProperty("exp"))return null;const Ie=new Date(0);return Ie.setUTCSeconds(Be.exp),Ie}isTokenExpired(oe=this.tokenGetter(),Be){return oe instanceof Promise?oe.then(Ie=>this._isTokenExpired(Ie,Be)):this._isTokenExpired(oe,Be)}_isTokenExpired(oe,Be){if(!oe||""===oe)return!0;const Ie=this.getTokenExpirationDate(oe);return Be=Be||0,null!==Ie&&!(Ie.valueOf()>(new Date).valueOf()+1e3*Be)}getAuthScheme(oe,Be){return"function"==typeof oe?oe(Be):oe}}return ee.\u0275fac=function(oe){return new(oe||ee)(x.LFG(C))},ee.\u0275prov=x.Yz7({token:ee,factory:ee.\u0275fac}),ee})();const me=ee=>ee instanceof Promise?(0,J.P)(()=>ee):(0,ie.of)(ee);let he=(()=>{class ee{constructor(oe,Be,Ie){this.jwtHelper=Be,this.document=Ie,this.standardPorts=["80","443"],this.tokenGetter=oe.tokenGetter,this.headerName=oe.headerName||"Authorization",this.authScheme=oe.authScheme||""===oe.authScheme?oe.authScheme:"Bearer ",this.allowedDomains=oe.allowedDomains||[],this.disallowedRoutes=oe.disallowedRoutes||[],this.throwNoTokenError=oe.throwNoTokenError||!1,this.skipWhenExpired=oe.skipWhenExpired}isAllowedDomain(oe){const Be=new URL(oe.url,this.document.location.origin);if(Be.host===this.document.location.host)return!0;const Ie=`${Be.hostname}${Be.port&&!this.standardPorts.includes(Be.port)?":"+Be.port:""}`;return this.allowedDomains.findIndex(Ee=>"string"==typeof Ee?Ee===Ie:Ee instanceof RegExp&&Ee.test(Ie))>-1}isDisallowedRoute(oe){const Be=new URL(oe.url,this.document.location.origin);return this.disallowedRoutes.findIndex(Ie=>{if("string"==typeof Ie){const Ee=new URL(Ie,this.document.location.origin);return Ee.hostname===Be.hostname&&Ee.pathname===Be.pathname}return Ie instanceof RegExp&&Ie.test(oe.url)})>-1}handleInterception(oe,Be,Ie){const Ee=this.jwtHelper.getAuthScheme(this.authScheme,Be);if(!oe&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let Ue=(0,ie.of)(!1);return this.skipWhenExpired&&(Ue=oe?me(this.jwtHelper.isTokenExpired(oe)):(0,ie.of)(!0)),oe?Ue.pipe((0,y.U)(et=>et&&this.skipWhenExpired?Be.clone():Be.clone({setHeaders:{[this.headerName]:`${Ee}${oe}`}})),(0,s.z)(et=>Ie.handle(et))):Ie.handle(Be)}intercept(oe,Be){if(!this.isAllowedDomain(oe)||this.isDisallowedRoute(oe))return Be.handle(oe);const Ie=this.tokenGetter(oe);return me(Ie).pipe((0,s.z)(Ee=>this.handleInterception(Ee,oe,Be)))}}return ee.\u0275fac=function(oe){return new(oe||ee)(x.LFG(C),x.LFG(Ne),x.LFG(h.K0))},ee.\u0275prov=x.Yz7({token:ee,factory:ee.\u0275fac}),ee})(),_e=(()=>{class ee{constructor(oe){if(oe)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(oe){return{ngModule:ee,providers:[{provide:Y.TP,useClass:he,multi:!0},oe.jwtOptionsProvider||{provide:C,useValue:oe.config},Ne]}}}return ee.\u0275fac=function(oe){return new(oe||ee)(x.LFG(ee,12))},ee.\u0275mod=x.oAB({type:ee}),ee.\u0275inj=x.cJS({}),ee})()},2726:(Nn,yt,k)=>{"use strict";k.d(yt,{Uw:()=>Ie,fo:()=>ae});var x=k(5861);typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"&&global;var C=function(Pe){return Pe.Unimplemented="UNIMPLEMENTED",Pe.Unavailable="UNAVAILABLE",Pe}(C||{});class Ne extends Error{constructor(Ae,Ye,_t){super(Ae),this.message=Ae,this.code=Ye,this.data=_t}}const he=Pe=>{var Ae,Ye,_t,hn,qt;const Ht=Pe.CapacitorCustomPlatform||null,Te=Pe.Capacitor||{},Je=Te.Plugins=Te.Plugins||{},Re=Pe.CapacitorPlatforms,St=(null===(Ae=Re?.currentPlatform)||void 0===Ae?void 0:Ae.getPlatform)||(()=>null!==Ht?Ht.name:(Pe=>{var Ae,Ye;return Pe?.androidBridge?"android":null!==(Ye=null===(Ae=Pe?.webkit)||void 0===Ae?void 0:Ae.messageHandlers)&&void 0!==Ye&&Ye.bridge?"ios":"web"})(Pe)),Rt=(null===(Ye=Re?.currentPlatform)||void 0===Ye?void 0:Ye.isNativePlatform)||(()=>"web"!==St()),Gt=(null===(_t=Re?.currentPlatform)||void 0===_t?void 0:_t.isPluginAvailable)||(Ut=>{const ii=Ot.get(Ut);return!(!ii?.platforms.has(St())&&!Jt(Ut))}),Jt=(null===(hn=Re?.currentPlatform)||void 0===hn?void 0:hn.getPluginHeader)||(Ut=>{var ii;return null===(ii=Te.PluginHeaders)||void 0===ii?void 0:ii.find(gn=>gn.name===Ut)}),Ot=new Map,Yt=(null===(qt=Re?.currentPlatform)||void 0===qt?void 0:qt.registerPlugin)||((Ut,ii={})=>{const gn=Ot.get(Ut);if(gn)return console.warn(`Capacitor plugin "${Ut}" already registered. Cannot register plugins twice.`),gn.proxy;const Ft=St(),Jn=Jt(Ut);let Wt;const wt=function(){var Fi=(0,x.Z)(function*(){return!Wt&&Ft in ii?Wt=Wt="function"==typeof ii[Ft]?yield ii[Ft]():ii[Ft]:null!==Ht&&!Wt&&"web"in ii&&(Wt=Wt="function"==typeof ii.web?yield ii.web():ii.web),Wt});return function(){return Fi.apply(this,arguments)}}(),ln=Fi=>{let Cn;const Mn=(...qn)=>{const yn=wt().then(_n=>{const Hi=((Fi,Cn)=>{var Mn,qn;if(!Jn){if(Fi)return null===(qn=Fi[Cn])||void 0===qn?void 0:qn.bind(Fi);throw new Ne(`"${Ut}" plugin is not implemented on ${Ft}`,C.Unimplemented)}{const yn=Jn?.methods.find(_n=>Cn===_n.name);if(yn)return"promise"===yn.rtype?_n=>Te.nativePromise(Ut,Cn.toString(),_n):(_n,Hi)=>Te.nativeCallback(Ut,Cn.toString(),_n,Hi);if(Fi)return null===(Mn=Fi[Cn])||void 0===Mn?void 0:Mn.bind(Fi)}})(_n,Fi);if(Hi){const nt=Hi(...qn);return Cn=nt?.remove,nt}throw new Ne(`"${Ut}.${Fi}()" is not implemented on ${Ft}`,C.Unimplemented)});return"addListener"===Fi&&(yn.remove=(0,x.Z)(function*(){return Cn()})),yn};return Mn.toString=()=>`${Fi.toString()}() { [capacitor code] }`,Object.defineProperty(Mn,"name",{value:Fi,writable:!1,configurable:!1}),Mn},ni=ln("addListener"),er=ln("removeListener"),lr=(Fi,Cn)=>{const Mn=ni({eventName:Fi},Cn),qn=function(){var _n=(0,x.Z)(function*(){const Hi=yield Mn;er({eventName:Fi,callbackId:Hi},Cn)});return function(){return _n.apply(this,arguments)}}(),yn=new Promise(_n=>Mn.then(()=>_n({remove:qn})));return yn.remove=(0,x.Z)(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield qn()}),yn},mi=new Proxy({},{get(Fi,Cn){switch(Cn){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return Jn?lr:ni;case"removeListener":return er;default:return ln(Cn)}}});return Je[Ut]=mi,Ot.set(Ut,{name:Ut,proxy:mi,platforms:new Set([...Object.keys(ii),...Jn?[Ft]:[]])}),mi});return Te.convertFileSrc||(Te.convertFileSrc=Ut=>Ut),Te.getPlatform=St,Te.handleError=Ut=>Pe.console.error(Ut),Te.isNativePlatform=Rt,Te.isPluginAvailable=Gt,Te.pluginMethodNoop=(Ut,ii,gn)=>Promise.reject(`${gn} does not have an implementation of "${ii}".`),Te.registerPlugin=Yt,Te.Exception=Ne,Te.DEBUG=!!Te.DEBUG,Te.isLoggingEnabled=!!Te.isLoggingEnabled,Te.platform=Te.getPlatform(),Te.isNative=Te.isNativePlatform(),Te},ee=(Pe=>Pe.Capacitor=he(Pe))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),ae=ee.registerPlugin;class Ie{constructor(Ae){this.listeners={},this.windowListeners={},Ae&&(console.warn(`Capacitor WebPlugin "${Ae.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=Ae)}addListener(Ae,Ye){var _t=this;this.listeners[Ae]||(this.listeners[Ae]=[]),this.listeners[Ae].push(Ye);const qt=this.windowListeners[Ae];qt&&!qt.registered&&this.addWindowListener(qt);const Ht=function(){var Je=(0,x.Z)(function*(){return _t.removeListener(Ae,Ye)});return function(){return Je.apply(this,arguments)}}(),Te=Promise.resolve({remove:Ht});return Object.defineProperty(Te,"remove",{value:(Je=(0,x.Z)(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Ht()}),function(){return Je.apply(this,arguments)})}),Te;var Je}removeAllListeners(){var Ae=this;return(0,x.Z)(function*(){Ae.listeners={};for(const Ye in Ae.windowListeners)Ae.removeWindowListener(Ae.windowListeners[Ye]);Ae.windowListeners={}})()}notifyListeners(Ae,Ye){const _t=this.listeners[Ae];_t&&_t.forEach(hn=>hn(Ye))}hasListeners(Ae){return!!this.listeners[Ae].length}registerWindowListener(Ae,Ye){this.windowListeners[Ye]={registered:!1,windowEventName:Ae,pluginEventName:Ye,handler:_t=>{this.notifyListeners(Ye,_t)}}}unimplemented(Ae="not implemented"){return new ee.Exception(Ae,C.Unimplemented)}unavailable(Ae="not available"){return new ee.Exception(Ae,C.Unavailable)}removeListener(Ae,Ye){var _t=this;return(0,x.Z)(function*(){const hn=_t.listeners[Ae];if(!hn)return;const qt=hn.indexOf(Ye);_t.listeners[Ae].splice(qt,1),_t.listeners[Ae].length||_t.removeWindowListener(_t.windowListeners[Ae])})()}addWindowListener(Ae){window.addEventListener(Ae.windowEventName,Ae.handler),Ae.registered=!0}removeWindowListener(Ae){Ae&&(window.removeEventListener(Ae.windowEventName,Ae.handler),Ae.registered=!1)}}const Ue=Pe=>encodeURIComponent(Pe).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),et=Pe=>Pe.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class le extends Ie{getCookies(){return(0,x.Z)(function*(){const Ae=document.cookie,Ye={};return Ae.split(";").forEach(_t=>{if(_t.length<=0)return;let[hn,qt]=_t.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");hn=et(hn).trim(),qt=et(qt).trim(),Ye[hn]=qt}),Ye})()}setCookie(Ae){return(0,x.Z)(function*(){try{const Ye=Ue(Ae.key),_t=Ue(Ae.value),hn=`; expires=${(Ae.expires||"").replace("expires=","")}`,qt=(Ae.path||"/").replace("path=",""),Ht=null!=Ae.url&&Ae.url.length>0?`domain=${Ae.url}`:"";document.cookie=`${Ye}=${_t||""}${hn}; path=${qt}; ${Ht};`}catch(Ye){return Promise.reject(Ye)}})()}deleteCookie(Ae){return(0,x.Z)(function*(){try{document.cookie=`${Ae.key}=; Max-Age=0`}catch(Ye){return Promise.reject(Ye)}})()}clearCookies(){return(0,x.Z)(function*(){try{const Ae=document.cookie.split(";")||[];for(const Ye of Ae)document.cookie=Ye.replace(/^ +/,"").replace(/=.*/,`=;expires=${(new Date).toUTCString()};path=/`)}catch(Ae){return Promise.reject(Ae)}})()}clearAllCookies(){var Ae=this;return(0,x.Z)(function*(){try{yield Ae.clearCookies()}catch(Ye){return Promise.reject(Ye)}})()}}ae("CapacitorCookies",{web:()=>new le});const ct=function(){var Pe=(0,x.Z)(function*(Ae){return new Promise((Ye,_t)=>{const hn=new FileReader;hn.onload=()=>{const qt=hn.result;Ye(qt.indexOf(",")>=0?qt.split(",")[1]:qt)},hn.onerror=qt=>_t(qt),hn.readAsDataURL(Ae)})});return function(Ye){return Pe.apply(this,arguments)}}();class gt extends Ie{request(Ae){return(0,x.Z)(function*(){const Ye=((Pe,Ae={})=>{const Ye=Object.assign({method:Pe.method||"GET",headers:Pe.headers},Ae),hn=((Pe={})=>{const Ae=Object.keys(Pe);return Object.keys(Pe).map(hn=>hn.toLocaleLowerCase()).reduce((hn,qt,Ht)=>(hn[qt]=Pe[Ae[Ht]],hn),{})})(Pe.headers)["content-type"]||"";if("string"==typeof Pe.data)Ye.body=Pe.data;else if(hn.includes("application/x-www-form-urlencoded")){const qt=new URLSearchParams;for(const[Ht,Te]of Object.entries(Pe.data||{}))qt.set(Ht,Te);Ye.body=qt.toString()}else if(hn.includes("multipart/form-data")){const qt=new FormData;if(Pe.data instanceof FormData)Pe.data.forEach((Te,Je)=>{qt.append(Je,Te)});else for(const Te of Object.keys(Pe.data))qt.append(Te,Pe.data[Te]);Ye.body=qt;const Ht=new Headers(Ye.headers);Ht.delete("content-type"),Ye.headers=Ht}else(hn.includes("application/json")||"object"==typeof Pe.data)&&(Ye.body=JSON.stringify(Pe.data));return Ye})(Ae,Ae.webFetchExtra),_t=((Pe,Ae=!0)=>Pe?Object.entries(Pe).reduce((_t,hn)=>{const[qt,Ht]=hn;let Te,Je;return Array.isArray(Ht)?(Je="",Ht.forEach(Re=>{Te=Ae?encodeURIComponent(Re):Re,Je+=`${qt}=${Te}&`}),Je.slice(0,-1)):(Te=Ae?encodeURIComponent(Ht):Ht,Je=`${qt}=${Te}`),`${_t}&${Je}`},"").substr(1):null)(Ae.params,Ae.shouldEncodeUrlParams),hn=_t?`${Ae.url}?${_t}`:Ae.url,qt=yield fetch(hn,Ye),Ht=qt.headers.get("content-type")||"";let Je,Re,{responseType:Te="text"}=qt.ok?Ae:{};switch(Ht.includes("application/json")&&(Te="json"),Te){case"arraybuffer":case"blob":Re=yield qt.blob(),Je=yield ct(Re);break;case"json":Je=yield qt.json();break;default:Je=yield qt.text()}const Fe={};return qt.headers.forEach((St,Ce)=>{Fe[Ce]=St}),{data:Je,headers:Fe,status:qt.status,url:qt.url}})()}get(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"GET"}))})()}post(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"POST"}))})()}put(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"PUT"}))})()}patch(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"PATCH"}))})()}delete(Ae){var Ye=this;return(0,x.Z)(function*(){return Ye.request(Object.assign(Object.assign({},Ae),{method:"DELETE"}))})()}}ae("CapacitorHttp",{web:()=>new gt})},1774:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>Be});var x=k(6225),h=k(839);let y;const J=Ie=>Ie.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ie=Ie=>(void 0===y&&(y=void 0===Ie.style.animationName&&void 0!==Ie.style.webkitAnimationName?"-webkit-":""),y),Y=(Ie,Ee,Ue)=>{const et=Ee.startsWith("animation")?ie(Ie):"";Ie.style.setProperty(et+Ee,Ue)},C=(Ie,Ee)=>{const Ue=Ee.startsWith("animation")?ie(Ie):"";Ie.style.removeProperty(Ue+Ee)},he=[],oe=(Ie=[],Ee)=>{if(void 0!==Ee){const Ue=Array.isArray(Ee)?Ee:[Ee];return[...Ie,...Ue]}return Ie},Be=Ie=>{let Ee,Ue,et,le,ue,ct,De,Te,Je,Re,Fe,Qt,Gt,ht=[],Le=[],ye=[],gt=!1,Pe={},Ae=[],Ye=[],_t={},hn=0,qt=!1,Ht=!1,St=!0,Ce=!1,Rt=!0,Zt=!1;const Jt=Ie,kt=[],dt=[],Ot=[],pt=[],Yt=[],Ut=[],ii=[],gn=[],Ft=[],Jn=[],Wt="function"==typeof AnimationEffect||void 0!==x.w&&"function"==typeof x.w.AnimationEffect,wt="function"==typeof Element&&"function"==typeof Element.prototype.animate&&Wt,ln=()=>Jn,Fi=(fe,je)=>((je?.oneTimeCallback?dt:kt).push({c:fe,o:je}),Gt),Mn=()=>{if(wt)Jn.forEach(fe=>{fe.cancel()}),Jn.length=0;else{const fe=Ot.slice();(0,h.r)(()=>{fe.forEach(je=>{C(je,"animation-name"),C(je,"animation-duration"),C(je,"animation-timing-function"),C(je,"animation-iteration-count"),C(je,"animation-delay"),C(je,"animation-play-state"),C(je,"animation-fill-mode"),C(je,"animation-direction")})})}},qn=()=>{Yt.forEach(fe=>{fe?.parentNode&&fe.parentNode.removeChild(fe)}),Yt.length=0},Xt=()=>void 0!==ue?ue:De?De.getFill():"both",Sn=()=>void 0!==Je?Je:void 0!==ct?ct:De?De.getDirection():"normal",zn=()=>qt?"linear":void 0!==et?et:De?De.getEasing():"linear",pe=()=>Ht?0:void 0!==Re?Re:void 0!==Ue?Ue:De?De.getDuration():0,ze=()=>void 0!==le?le:De?De.getIterations():1,xe=()=>void 0!==Fe?Fe:void 0!==Ee?Ee:De?De.getDelay():0,ti=()=>{0!==hn&&(hn--,0===hn&&((()=>{yr(),gn.forEach(Vt=>Vt()),Ft.forEach(Vt=>Vt());const fe=St?1:0,je=Ae,lt=Ye,an=_t;Ot.forEach(Vt=>{const vn=Vt.classList;je.forEach(Dn=>vn.add(Dn)),lt.forEach(Dn=>vn.remove(Dn));for(const Dn in an)an.hasOwnProperty(Dn)&&Y(Vt,Dn,an[Dn])}),kt.forEach(Vt=>Vt.c(fe,Gt)),dt.forEach(Vt=>Vt.c(fe,Gt)),dt.length=0,Rt=!0,St&&(Ce=!0),St=!0})(),De&&De.animationFinish()))},gi=(fe=!0)=>{qn();const je=(Ie=>(Ie.forEach(Ee=>{for(const Ue in Ee)if(Ee.hasOwnProperty(Ue)){const et=Ee[Ue];if("easing"===Ue)Ee["animation-timing-function"]=et,delete Ee[Ue];else{const le=J(Ue);le!==Ue&&(Ee[le]=et,delete Ee[Ue])}}}),Ie))(ht);Ot.forEach(lt=>{if(je.length>0){const an=((Ie=[])=>Ie.map(Ee=>{const Ue=Ee.offset,et=[];for(const le in Ee)Ee.hasOwnProperty(le)&&"offset"!==le&&et.push(`${le}: ${Ee[le]};`);return`${100*Ue}% { ${et.join(" ")} }`}).join(" "))(je);Qt=void 0!==Ie?Ie:(Ie=>{let Ee=he.indexOf(Ie);return Ee<0&&(Ee=he.push(Ie)-1),`ion-animation-${Ee}`})(an);const Vt=((Ie,Ee,Ue)=>{var et;const le=(Ie=>{const Ee=void 0!==Ie.getRootNode?Ie.getRootNode():Ie;return Ee.head||Ee})(Ue),ue=ie(Ue),ct=le.querySelector("#"+Ie);if(ct)return ct;const ht=(null!==(et=Ue.ownerDocument)&&void 0!==et?et:document).createElement("style");return ht.id=Ie,ht.textContent=`@${ue}keyframes ${Ie} { ${Ee} } @${ue}keyframes ${Ie}-alt { ${Ee} }`,le.appendChild(ht),ht})(Qt,an,lt);Yt.push(Vt),Y(lt,"animation-duration",`${pe()}ms`),Y(lt,"animation-timing-function",zn()),Y(lt,"animation-delay",`${xe()}ms`),Y(lt,"animation-fill-mode",Xt()),Y(lt,"animation-direction",Sn());const vn=ze()===1/0?"infinite":ze().toString();Y(lt,"animation-iteration-count",vn),Y(lt,"animation-play-state","paused"),fe&&Y(lt,"animation-name",`${Vt.id}-alt`),(0,h.r)(()=>{Y(lt,"animation-name",Vt.id||null)})}})},Li=(fe=!0)=>{(()=>{Ut.forEach(an=>an()),ii.forEach(an=>an());const fe=Le,je=ye,lt=Pe;Ot.forEach(an=>{const Vt=an.classList;fe.forEach(vn=>Vt.add(vn)),je.forEach(vn=>Vt.remove(vn));for(const vn in lt)lt.hasOwnProperty(vn)&&Y(an,vn,lt[vn])})})(),ht.length>0&&(wt?(Ot.forEach(fe=>{const je=fe.animate(ht,{id:Jt,delay:xe(),duration:pe(),easing:zn(),iterations:ze(),fill:Xt(),direction:Sn()});je.pause(),Jn.push(je)}),Jn.length>0&&(Jn[0].onfinish=()=>{ti()})):gi(fe)),gt=!0},bi=fe=>{if(fe=Math.min(Math.max(fe,0),.9999),wt)Jn.forEach(je=>{je.currentTime=je.effect.getComputedTiming().delay+pe()*fe,je.pause()});else{const je=`-${pe()*fe}ms`;Ot.forEach(lt=>{ht.length>0&&(Y(lt,"animation-delay",je),Y(lt,"animation-play-state","paused"))})}},ir=fe=>{Jn.forEach(je=>{je.effect.updateTiming({delay:xe(),duration:pe(),easing:zn(),iterations:ze(),fill:Xt(),direction:Sn()})}),void 0!==fe&&bi(fe)},Dr=(fe=!0,je)=>{(0,h.r)(()=>{Ot.forEach(lt=>{Y(lt,"animation-name",Qt||null),Y(lt,"animation-duration",`${pe()}ms`),Y(lt,"animation-timing-function",zn()),Y(lt,"animation-delay",void 0!==je?`-${je*pe()}ms`:`${xe()}ms`),Y(lt,"animation-fill-mode",Xt()||null),Y(lt,"animation-direction",Sn()||null);const an=ze()===1/0?"infinite":ze().toString();Y(lt,"animation-iteration-count",an),fe&&Y(lt,"animation-name",`${Qt}-alt`),(0,h.r)(()=>{Y(lt,"animation-name",Qt||null)})})})},vi=(fe=!1,je=!0,lt)=>(fe&&pt.forEach(an=>{an.update(fe,je,lt)}),wt?ir(lt):Dr(je,lt),Gt),Kt=()=>{gt&&(wt?Jn.forEach(fe=>{fe.pause()}):Ot.forEach(fe=>{Y(fe,"animation-play-state","paused")}),Zt=!0)},rr=()=>{Te=void 0,ti()},yr=()=>{Te&&clearTimeout(Te)},to=fe=>new Promise(je=>{fe?.sync&&(Ht=!0,Fi(()=>Ht=!1,{oneTimeCallback:!0})),gt||Li(),Ce&&(wt?(bi(0),ir()):Dr(),Ce=!1),Rt&&(hn=pt.length+1,Rt=!1),Fi(()=>je(),{oneTimeCallback:!0}),pt.forEach(lt=>{lt.play()}),wt?(Jn.forEach(fe=>{fe.play()}),(0===ht.length||0===Ot.length)&&ti()):(()=>{if(yr(),(0,h.r)(()=>{Ot.forEach(fe=>{ht.length>0&&Y(fe,"animation-play-state","running")})}),0===ht.length||0===Ot.length)ti();else{const fe=xe()||0,je=pe()||0,lt=ze()||1;isFinite(lt)&&(Te=setTimeout(rr,fe+je*lt+100)),((Ie,Ee)=>{let Ue;const et={passive:!0},ue=ct=>{Ie===ct.target&&(Ue&&Ue(),yr(),(0,h.r)(()=>{Ot.forEach(fe=>{C(fe,"animation-duration"),C(fe,"animation-delay"),C(fe,"animation-play-state")}),(0,h.r)(ti)}))};Ie&&(Ie.addEventListener("webkitAnimationEnd",ue,et),Ie.addEventListener("animationend",ue,et),Ue=()=>{Ie.removeEventListener("webkitAnimationEnd",ue,et),Ie.removeEventListener("animationend",ue,et)})})(Ot[0])}})(),Zt=!1}),Ei=(fe,je)=>{const lt=ht[0];return void 0===lt||void 0!==lt.offset&&0!==lt.offset?ht=[{offset:0,[fe]:je},...ht]:lt[fe]=je,Gt};return Gt={parentAnimation:De,elements:Ot,childAnimations:pt,id:Jt,animationFinish:ti,from:Ei,to:(fe,je)=>{const lt=ht[ht.length-1];return void 0===lt||void 0!==lt.offset&&1!==lt.offset?ht=[...ht,{offset:1,[fe]:je}]:lt[fe]=je,Gt},fromTo:(fe,je,lt)=>Ei(fe,je).to(fe,lt),parent:fe=>(De=fe,Gt),play:to,pause:()=>(pt.forEach(fe=>{fe.pause()}),Kt(),Gt),stop:()=>{pt.forEach(fe=>{fe.stop()}),gt&&(Mn(),gt=!1),qt=!1,Ht=!1,Rt=!0,Je=void 0,Re=void 0,Fe=void 0,hn=0,Ce=!1,St=!0,Zt=!1},destroy:fe=>(pt.forEach(je=>{je.destroy(fe)}),(fe=>{Mn(),fe&&qn()})(fe),Ot.length=0,pt.length=0,ht.length=0,kt.length=0,dt.length=0,gt=!1,Rt=!0,Gt),keyframes:fe=>{const je=ht!==fe;return ht=fe,je&&(fe=>{wt?ln().forEach(je=>{if(je.effect.setKeyframes)je.effect.setKeyframes(fe);else{const lt=new KeyframeEffect(je.effect.target,fe,je.effect.getTiming());je.effect=lt}}):gi()})(ht),Gt},addAnimation:fe=>{if(null!=fe)if(Array.isArray(fe))for(const je of fe)je.parent(Gt),pt.push(je);else fe.parent(Gt),pt.push(fe);return Gt},addElement:fe=>{if(null!=fe)if(1===fe.nodeType)Ot.push(fe);else if(fe.length>=0)for(let je=0;je(ue=fe,vi(!0),Gt),direction:fe=>(ct=fe,vi(!0),Gt),iterations:fe=>(le=fe,vi(!0),Gt),duration:fe=>(!wt&&0===fe&&(fe=1),Ue=fe,vi(!0),Gt),easing:fe=>(et=fe,vi(!0),Gt),delay:fe=>(Ee=fe,vi(!0),Gt),getWebAnimations:ln,getKeyframes:()=>ht,getFill:Xt,getDirection:Sn,getDelay:xe,getIterations:ze,getEasing:zn,getDuration:pe,afterAddRead:fe=>(gn.push(fe),Gt),afterAddWrite:fe=>(Ft.push(fe),Gt),afterClearStyles:(fe=[])=>{for(const je of fe)_t[je]="";return Gt},afterStyles:(fe={})=>(_t=fe,Gt),afterRemoveClass:fe=>(Ye=oe(Ye,fe),Gt),afterAddClass:fe=>(Ae=oe(Ae,fe),Gt),beforeAddRead:fe=>(Ut.push(fe),Gt),beforeAddWrite:fe=>(ii.push(fe),Gt),beforeClearStyles:(fe=[])=>{for(const je of fe)Pe[je]="";return Gt},beforeStyles:(fe={})=>(Pe=fe,Gt),beforeRemoveClass:fe=>(ye=oe(ye,fe),Gt),beforeAddClass:fe=>(Le=oe(Le,fe),Gt),onFinish:Fi,isRunning:()=>0!==hn&&!Zt,progressStart:(fe=!1,je)=>(pt.forEach(lt=>{lt.progressStart(fe,je)}),Kt(),qt=fe,gt||Li(),vi(!1,!0,je),Gt),progressStep:fe=>(pt.forEach(je=>{je.progressStep(fe)}),bi(fe),Gt),progressEnd:(fe,je,lt)=>(qt=!1,pt.forEach(an=>{an.progressEnd(fe,je,lt)}),void 0!==lt&&(Re=lt),Ce=!1,St=!0,0===fe?(Je="reverse"===Sn()?"normal":"reverse","reverse"===Je&&(St=!1),wt?(vi(),bi(1-je)):(Fe=(1-je)*pe()*-1,vi(!1,!1))):1===fe&&(wt?(vi(),bi(je)):(Fe=je*pe()*-1,vi(!1,!1))),void 0!==fe&&(Fi(()=>{Re=void 0,Je=void 0,Fe=void 0},{oneTimeCallback:!0}),De||to()),Gt)}}},3365:(Nn,yt,k)=>{"use strict";k.d(yt,{E:()=>me,a:()=>x,s:()=>C});const x=he=>{try{if(he instanceof Y)return he.value;if(!s()||"string"!=typeof he||""===he)return he;if(he.includes("onload="))return"";const _e=document.createDocumentFragment(),ee=document.createElement("div");_e.appendChild(ee),ee.innerHTML=he,ie.forEach(Ie=>{const Ee=_e.querySelectorAll(Ie);for(let Ue=Ee.length-1;Ue>=0;Ue--){const et=Ee[Ue];et.parentNode?et.parentNode.removeChild(et):_e.removeChild(et);const le=y(et);for(let ue=0;ue{if(he.nodeType&&1!==he.nodeType)return;if(typeof NamedNodeMap<"u"&&!(he.attributes instanceof NamedNodeMap))return void he.remove();for(let ee=he.attributes.length-1;ee>=0;ee--){const ae=he.attributes.item(ee),oe=ae.name;if(!J.includes(oe.toLowerCase())){he.removeAttribute(oe);continue}const Be=ae.value,Ie=he[oe];(null!=Be&&Be.toLowerCase().includes("javascript:")||null!=Ie&&Ie.toLowerCase().includes("javascript:"))&&he.removeAttribute(oe)}const _e=y(he);for(let ee=0;ee<_e.length;ee++)h(_e[ee])},y=he=>null!=he.children?he.children:he.childNodes,s=()=>{var he;const _e=window,ee=null===(he=_e?.Ionic)||void 0===he?void 0:he.config;return!ee||(ee.get?ee.get("sanitizerEnabled",!0):!0===ee.sanitizerEnabled||void 0===ee.sanitizerEnabled)},J=["class","id","href","src","name","slot"],ie=["script","style","iframe","meta","link","object","embed"];class Y{constructor(_e){this.value=_e}}const C=he=>{const _e=window,ee=_e.Ionic;if(!ee||!ee.config||"Object"===ee.config.constructor.name)return _e.Ionic=_e.Ionic||{},_e.Ionic.config=Object.assign(Object.assign({},_e.Ionic.config),he),_e.Ionic.config},me=!1},1042:(Nn,yt,k)=>{"use strict";k.d(yt,{C:()=>J,a:()=>y,d:()=>s});var x=k(5861),h=k(839);const y=function(){var ie=(0,x.Z)(function*(Y,C,Ne,me,he,_e){var ee;if(Y)return Y.attachViewToDom(C,Ne,he,me);if(!(_e||"string"==typeof Ne||Ne instanceof HTMLElement))throw new Error("framework delegate is missing");const ae="string"==typeof Ne?null===(ee=C.ownerDocument)||void 0===ee?void 0:ee.createElement(Ne):Ne;return me&&me.forEach(oe=>ae.classList.add(oe)),he&&Object.assign(ae,he),C.appendChild(ae),yield new Promise(oe=>(0,h.c)(ae,oe)),ae});return function(C,Ne,me,he,_e,ee){return ie.apply(this,arguments)}}(),s=(ie,Y)=>{if(Y){if(ie)return ie.removeViewFromDom(Y.parentElement,Y);Y.remove()}return Promise.resolve()},J=()=>{let ie,Y;return{attachViewToDom:function(){var me=(0,x.Z)(function*(he,_e,ee={},ae=[]){var oe,Be;if(ie=he,_e){const Ee="string"==typeof _e?null===(oe=ie.ownerDocument)||void 0===oe?void 0:oe.createElement(_e):_e;ae.forEach(Ue=>Ee.classList.add(Ue)),Object.assign(Ee,ee),ie.appendChild(Ee),yield new Promise(Ue=>(0,h.c)(Ee,Ue))}else if(ie.children.length>0&&("ION-MODAL"===ie.tagName||"ION-POPOVER"===ie.tagName)&&!ie.children[0].classList.contains("ion-delegate-host")){const Ue=null===(Be=ie.ownerDocument)||void 0===Be?void 0:Be.createElement("div");Ue.classList.add("ion-delegate-host"),ae.forEach(et=>Ue.classList.add(et)),Ue.append(...ie.children),ie.appendChild(Ue)}const Ie=document.querySelector("ion-app")||document.body;return Y=document.createComment("ionic teleport"),ie.parentNode.insertBefore(Y,ie),Ie.appendChild(ie),ie});return function(_e,ee){return me.apply(this,arguments)}}(),removeViewFromDom:()=>(ie&&Y&&(Y.parentNode.insertBefore(ie,Y),Y.remove()),Promise.resolve())}}},619:(Nn,yt,k)=>{"use strict";k.d(yt,{G:()=>J});class h{constructor(Y,C,Ne,me,he){this.id=C,this.name=Ne,this.disableScroll=he,this.priority=1e6*me+C,this.ctrl=Y}canStart(){return!!this.ctrl&&this.ctrl.canStart(this.name)}start(){return!!this.ctrl&&this.ctrl.start(this.name,this.id,this.priority)}capture(){if(!this.ctrl)return!1;const Y=this.ctrl.capture(this.name,this.id,this.priority);return Y&&this.disableScroll&&this.ctrl.disableScroll(this.id),Y}release(){this.ctrl&&(this.ctrl.release(this.id),this.disableScroll&&this.ctrl.enableScroll(this.id))}destroy(){this.release(),this.ctrl=void 0}}class y{constructor(Y,C,Ne,me){this.id=C,this.disable=Ne,this.disableScroll=me,this.ctrl=Y}block(){if(this.ctrl){if(this.disable)for(const Y of this.disable)this.ctrl.disableGesture(Y,this.id);this.disableScroll&&this.ctrl.disableScroll(this.id)}}unblock(){if(this.ctrl){if(this.disable)for(const Y of this.disable)this.ctrl.enableGesture(Y,this.id);this.disableScroll&&this.ctrl.enableScroll(this.id)}}destroy(){this.unblock(),this.ctrl=void 0}}const s="backdrop-no-scroll",J=new class x{constructor(){this.gestureId=0,this.requestedStart=new Map,this.disabledGestures=new Map,this.disabledScroll=new Set}createGesture(Y){var C;return new h(this,this.newID(),Y.name,null!==(C=Y.priority)&&void 0!==C?C:0,!!Y.disableScroll)}createBlocker(Y={}){return new y(this,this.newID(),Y.disable,!!Y.disableScroll)}start(Y,C,Ne){return this.canStart(Y)?(this.requestedStart.set(C,Ne),!0):(this.requestedStart.delete(C),!1)}capture(Y,C,Ne){if(!this.start(Y,C,Ne))return!1;const me=this.requestedStart;let he=-1e4;if(me.forEach(_e=>{he=Math.max(he,_e)}),he===Ne){this.capturedId=C,me.clear();const _e=new CustomEvent("ionGestureCaptured",{detail:{gestureName:Y}});return document.dispatchEvent(_e),!0}return me.delete(C),!1}release(Y){this.requestedStart.delete(Y),this.capturedId===Y&&(this.capturedId=void 0)}disableGesture(Y,C){let Ne=this.disabledGestures.get(Y);void 0===Ne&&(Ne=new Set,this.disabledGestures.set(Y,Ne)),Ne.add(C)}enableGesture(Y,C){const Ne=this.disabledGestures.get(Y);void 0!==Ne&&Ne.delete(C)}disableScroll(Y){this.disabledScroll.add(Y),1===this.disabledScroll.size&&document.body.classList.add(s)}enableScroll(Y){this.disabledScroll.delete(Y),0===this.disabledScroll.size&&document.body.classList.remove(s)}canStart(Y){return!(void 0!==this.capturedId||this.isDisabled(Y))}isCaptured(){return void 0!==this.capturedId}isScrollDisabled(){return this.disabledScroll.size>0}isDisabled(Y){const C=this.disabledGestures.get(Y);return!!(C&&C.size>0)}newID(){return this.gestureId++,this.gestureId}}},2124:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{MENU_BACK_BUTTON_PRIORITY:()=>J,OVERLAY_BACK_BUTTON_PRIORITY:()=>s,blockHardwareBackButton:()=>h,startHardwareBackButton:()=>y});var x=k(5861);const h=()=>{document.addEventListener("backbutton",()=>{})},y=()=>{const ie=document;let Y=!1;ie.addEventListener("backbutton",()=>{if(Y)return;let C=0,Ne=[];const me=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register(ee,ae){Ne.push({priority:ee,handler:ae,id:C++})}}});ie.dispatchEvent(me);const he=function(){var ee=(0,x.Z)(function*(ae){try{if(ae?.handler){const oe=ae.handler(_e);null!=oe&&(yield oe)}}catch(oe){console.error(oe)}});return function(oe){return ee.apply(this,arguments)}}(),_e=()=>{if(Ne.length>0){let ee={priority:Number.MIN_SAFE_INTEGER,handler:()=>{},id:-1};Ne.forEach(ae=>{ae.priority>=ee.priority&&(ee=ae)}),Y=!0,Ne=Ne.filter(ae=>ae.id!==ee.id),he(ee).then(()=>Y=!1)}};_e()})},s=100,J=99},839:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>C,b:()=>Ne,c:()=>y,d:()=>Be,e:()=>oe,f:()=>ae,g:()=>me,h:()=>ee,i:()=>Y,j:()=>ue,k:()=>J,l:()=>Ie,m:()=>s,n:()=>_e,o:()=>Ee,p:()=>le,q:()=>ct,r:()=>he,s:()=>ht,t:()=>x,u:()=>Ue,v:()=>et});const x=(Le,ye=0)=>new Promise(gt=>{h(Le,ye,gt)}),h=(Le,ye=0,gt)=>{let De,Pe;const Ae={passive:!0},_t=()=>{De&&De()},hn=qt=>{(void 0===qt||Le===qt.target)&&(_t(),gt(qt))};return Le&&(Le.addEventListener("webkitTransitionEnd",hn,Ae),Le.addEventListener("transitionend",hn,Ae),Pe=setTimeout(hn,ye+500),De=()=>{Pe&&(clearTimeout(Pe),Pe=void 0),Le.removeEventListener("webkitTransitionEnd",hn,Ae),Le.removeEventListener("transitionend",hn,Ae)}),_t},y=(Le,ye)=>{Le.componentOnReady?Le.componentOnReady().then(gt=>ye(gt)):he(()=>ye(Le))},s=Le=>void 0!==Le.componentOnReady,J=(Le,ye=[])=>{const gt={};return ye.forEach(De=>{Le.hasAttribute(De)&&(null!==Le.getAttribute(De)&&(gt[De]=Le.getAttribute(De)),Le.removeAttribute(De))}),gt},ie=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],Y=(Le,ye)=>{let gt=ie;return ye&&ye.length>0&&(gt=gt.filter(De=>!ye.includes(De))),J(Le,gt)},C=(Le,ye,gt,De)=>{var Pe;if(typeof window<"u"){const Ae=window,Ye=null===(Pe=Ae?.Ionic)||void 0===Pe?void 0:Pe.config;if(Ye){const _t=Ye.get("_ael");if(_t)return _t(Le,ye,gt,De);if(Ye._ael)return Ye._ael(Le,ye,gt,De)}}return Le.addEventListener(ye,gt,De)},Ne=(Le,ye,gt,De)=>{var Pe;if(typeof window<"u"){const Ae=window,Ye=null===(Pe=Ae?.Ionic)||void 0===Pe?void 0:Pe.config;if(Ye){const _t=Ye.get("_rel");if(_t)return _t(Le,ye,gt,De);if(Ye._rel)return Ye._rel(Le,ye,gt,De)}}return Le.removeEventListener(ye,gt,De)},me=(Le,ye=Le)=>Le.shadowRoot||ye,he=Le=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(Le):"function"==typeof requestAnimationFrame?requestAnimationFrame(Le):setTimeout(Le),_e=Le=>!!Le.shadowRoot&&!!Le.attachShadow,ee=Le=>{const ye=Le.closest("ion-item");return ye?ye.querySelector("ion-label"):null},ae=Le=>{if(Le.focus(),Le.classList.contains("ion-focusable")){const ye=Le.closest("ion-app");ye&&ye.setFocus([Le])}},oe=(Le,ye)=>{let gt;const De=Le.getAttribute("aria-labelledby"),Pe=Le.id;let Ae=null!==De&&""!==De.trim()?De:ye+"-lbl",Ye=null!==De&&""!==De.trim()?document.getElementById(De):ee(Le);return Ye?(null===De&&(Ye.id=Ae),gt=Ye.textContent,Ye.setAttribute("aria-hidden","true")):""!==Pe.trim()&&(Ye=document.querySelector(`label[for="${Pe}"]`),Ye&&(""!==Ye.id?Ae=Ye.id:Ye.id=Ae=`${Pe}-lbl`,gt=Ye.textContent)),{label:Ye,labelId:Ae,labelText:gt}},Be=(Le,ye,gt,De,Pe)=>{if(Le||_e(ye)){let Ae=ye.querySelector("input.aux-input");Ae||(Ae=ye.ownerDocument.createElement("input"),Ae.type="hidden",Ae.classList.add("aux-input"),ye.appendChild(Ae)),Ae.disabled=Pe,Ae.name=gt,Ae.value=De||""}},Ie=(Le,ye,gt)=>Math.max(Le,Math.min(ye,gt)),Ee=(Le,ye)=>{if(!Le){const gt="ASSERT: "+ye;throw console.error(gt),new Error(gt)}},Ue=Le=>Le.timeStamp||Date.now(),et=Le=>{if(Le){const ye=Le.changedTouches;if(ye&&ye.length>0){const gt=ye[0];return{x:gt.clientX,y:gt.clientY}}if(void 0!==Le.pageX)return{x:Le.pageX,y:Le.pageY}}return{x:0,y:0}},le=Le=>{const ye="rtl"===document.dir;switch(Le){case"start":return ye;case"end":return!ye;default:throw new Error(`"${Le}" is not a valid value for [side]. Use "start" or "end" instead.`)}},ue=(Le,ye)=>{const gt=Le._original||Le;return{_original:Le,emit:ct(gt.emit.bind(gt),ye)}},ct=(Le,ye=0)=>{let gt;return(...De)=>{clearTimeout(gt),gt=setTimeout(Le,ye,...De)}},ht=(Le,ye)=>{if(Le??(Le={}),ye??(ye={}),Le===ye)return!0;const gt=Object.keys(Le);if(gt.length!==Object.keys(ye).length)return!1;for(const De of gt)if(!(De in ye)||Le[De]!==ye[De])return!1;return!0}},6710:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>h,b:()=>y,p:()=>x});const x=(s,...J)=>console.warn(`[Ionic Warning]: ${s}`,...J),h=(s,...J)=>console.error(`[Ionic Error]: ${s}`,...J),y=(s,...J)=>console.error(`<${s.tagName.toLowerCase()}> must be used inside ${J.join(" or ")}.`)},1651:(Nn,yt,k)=>{"use strict";k.d(yt,{L:()=>s,a:()=>J,b:()=>ie,c:()=>Y,d:()=>C,e:()=>Le,g:()=>De,l:()=>ct,s:()=>ye,t:()=>he,w:()=>ht});var x=k(5861),h=k(1688),y=k(839);const s="ionViewWillEnter",J="ionViewDidEnter",ie="ionViewWillLeave",Y="ionViewDidLeave",C="ionViewWillUnload",he=Pe=>new Promise((Ae,Ye)=>{(0,h.w)(()=>{_e(Pe),ee(Pe).then(_t=>{_t.animation&&_t.animation.destroy(),ae(Pe),Ae(_t)},_t=>{ae(Pe),Ye(_t)})})}),_e=Pe=>{const Ae=Pe.enteringEl,Ye=Pe.leavingEl;gt(Ae,Ye,Pe.direction),Pe.showGoBack?Ae.classList.add("can-go-back"):Ae.classList.remove("can-go-back"),ye(Ae,!1),Ae.style.setProperty("pointer-events","none"),Ye&&(ye(Ye,!1),Ye.style.setProperty("pointer-events","none"))},ee=function(){var Pe=(0,x.Z)(function*(Ae){const Ye=yield oe(Ae);return Ye&&h.B.isBrowser?Be(Ye,Ae):Ie(Ae)});return function(Ye){return Pe.apply(this,arguments)}}(),ae=Pe=>{const Ae=Pe.enteringEl,Ye=Pe.leavingEl;Ae.classList.remove("ion-page-invisible"),Ae.style.removeProperty("pointer-events"),void 0!==Ye&&(Ye.classList.remove("ion-page-invisible"),Ye.style.removeProperty("pointer-events"))},oe=function(){var Pe=(0,x.Z)(function*(Ae){return Ae.leavingEl&&Ae.animated&&0!==Ae.duration?Ae.animationBuilder?Ae.animationBuilder:"ios"===Ae.mode?(yield Promise.resolve().then(k.bind(k,2650))).iosTransitionAnimation:(yield Promise.resolve().then(k.bind(k,1904))).mdTransitionAnimation:void 0});return function(Ye){return Pe.apply(this,arguments)}}(),Be=function(){var Pe=(0,x.Z)(function*(Ae,Ye){yield Ee(Ye,!0);const _t=Ae(Ye.baseEl,Ye);le(Ye.enteringEl,Ye.leavingEl);const hn=yield et(_t,Ye);return Ye.progressCallback&&Ye.progressCallback(void 0),hn&&ue(Ye.enteringEl,Ye.leavingEl),{hasCompleted:hn,animation:_t}});return function(Ye,_t){return Pe.apply(this,arguments)}}(),Ie=function(){var Pe=(0,x.Z)(function*(Ae){const Ye=Ae.enteringEl,_t=Ae.leavingEl;return yield Ee(Ae,!1),le(Ye,_t),ue(Ye,_t),{hasCompleted:!0}});return function(Ye){return Pe.apply(this,arguments)}}(),Ee=function(){var Pe=(0,x.Z)(function*(Ae,Ye){(void 0!==Ae.deepWait?Ae.deepWait:Ye)&&(yield Promise.all([Le(Ae.enteringEl),Le(Ae.leavingEl)])),yield Ue(Ae.viewIsReady,Ae.enteringEl)});return function(Ye,_t){return Pe.apply(this,arguments)}}(),Ue=function(){var Pe=(0,x.Z)(function*(Ae,Ye){Ae&&(yield Ae(Ye))});return function(Ye,_t){return Pe.apply(this,arguments)}}(),et=(Pe,Ae)=>{const Ye=Ae.progressCallback,_t=new Promise(hn=>{Pe.onFinish(qt=>hn(1===qt))});return Ye?(Pe.progressStart(!0),Ye(Pe)):Pe.play(),_t},le=(Pe,Ae)=>{ct(Ae,ie),ct(Pe,s)},ue=(Pe,Ae)=>{ct(Pe,J),ct(Ae,Y)},ct=(Pe,Ae)=>{if(Pe){const Ye=new CustomEvent(Ae,{bubbles:!1,cancelable:!1});Pe.dispatchEvent(Ye)}},ht=()=>new Promise(Pe=>(0,y.r)(()=>(0,y.r)(()=>Pe()))),Le=function(){var Pe=(0,x.Z)(function*(Ae){const Ye=Ae;if(Ye){if(null!=Ye.componentOnReady){if(null!=(yield Ye.componentOnReady()))return}else if(null!=Ye.__registerHost)return void(yield new Promise(hn=>(0,y.r)(hn)));yield Promise.all(Array.from(Ye.children).map(Le))}});return function(Ye){return Pe.apply(this,arguments)}}(),ye=(Pe,Ae)=>{Ae?(Pe.setAttribute("aria-hidden","true"),Pe.classList.add("ion-page-hidden")):(Pe.hidden=!1,Pe.removeAttribute("aria-hidden"),Pe.classList.remove("ion-page-hidden"))},gt=(Pe,Ae,Ye)=>{void 0!==Pe&&(Pe.style.zIndex="back"===Ye?"99":"101"),void 0!==Ae&&(Ae.style.zIndex="100")},De=Pe=>Pe.classList.contains("ion-page")?Pe:Pe.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||Pe},6225:(Nn,yt,k)=>{"use strict";k.d(yt,{d:()=>h,w:()=>x});const x=typeof window<"u"?window:void 0,h=typeof document<"u"?document:void 0},1688:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>he,H:()=>_t,a:()=>Kt,b:()=>wi,c:()=>Ce,d:()=>Zt,e:()=>Ei,f:()=>Gt,g:()=>Rt,h:()=>Ae,i:()=>Et,j:()=>_e,r:()=>ti,w:()=>Si});var x=k(5861);let y,s,J,ie=!1,Y=!1,C=!1,Ne=!1,me=!1;const he={isDev:!1,isBrowser:!0,isServer:!1,isTesting:!1},_e=we=>{const fe=new URL(we,Bi.$resourcesUrl$);return fe.origin!==Ar.location.origin?fe.href:fe.pathname},Ue="s-id",et="sty-id",ct="http://www.w3.org/1999/xlink",ht={},De=we=>"object"==(we=typeof we)||"function"===we;function Pe(we){var fe,je,lt;return null!==(lt=null===(je=null===(fe=we.head)||void 0===fe?void 0:fe.querySelector('meta[name="csp-nonce"]'))||void 0===je?void 0:je.getAttribute("content"))&&void 0!==lt?lt:void 0}const Ae=(we,fe,...je)=>{let lt=null,an=null,Vt=null,vn=!1,Dn=!1;const In=[],Fn=Ai=>{for(let Ni=0;NiAi[Ni]).join(" "))}}if("function"==typeof we)return we(null===fe?{}:fe,In,qt);const di=Ye(we,null);return di.$attrs$=fe,In.length>0&&(di.$children$=In),di.$key$=an,di.$name$=Vt,di},Ye=(we,fe)=>({$flags$:0,$tag$:we,$text$:fe,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null}),_t={},qt={forEach:(we,fe)=>we.map(Ht).forEach(fe),map:(we,fe)=>we.map(Ht).map(fe).map(Te)},Ht=we=>({vattrs:we.$attrs$,vchildren:we.$children$,vkey:we.$key$,vname:we.$name$,vtag:we.$tag$,vtext:we.$text$}),Te=we=>{if("function"==typeof we.vtag){const je=Object.assign({},we.vattrs);return we.vkey&&(je.key=we.vkey),we.vname&&(je.name=we.vname),Ae(we.vtag,je,...we.vchildren||[])}const fe=Ye(we.vtag,we.vtext);return fe.$attrs$=we.vattrs,fe.$children$=we.vchildren,fe.$key$=we.vkey,fe.$name$=we.vname,fe},Re=(we,fe,je,lt,an,Vt,vn)=>{let Dn,In,Fn,di;if(1===Vt.nodeType){for(Dn=Vt.getAttribute("c-id"),Dn&&(In=Dn.split("."),(In[0]===vn||"0"===In[0])&&(Fn={$flags$:0,$hostId$:In[0],$nodeId$:In[1],$depth$:In[2],$index$:In[3],$tag$:Vt.tagName.toLowerCase(),$elm$:Vt,$attrs$:null,$children$:null,$key$:null,$name$:null,$text$:null},fe.push(Fn),Vt.removeAttribute("c-id"),we.$children$||(we.$children$=[]),we.$children$[Fn.$index$]=Fn,we=Fn,lt&&"0"===Fn.$depth$&&(lt[Fn.$index$]=Fn.$elm$))),di=Vt.childNodes.length-1;di>=0;di--)Re(we,fe,je,lt,an,Vt.childNodes[di],vn);if(Vt.shadowRoot)for(di=Vt.shadowRoot.childNodes.length-1;di>=0;di--)Re(we,fe,je,lt,an,Vt.shadowRoot.childNodes[di],vn)}else if(8===Vt.nodeType)In=Vt.nodeValue.split("."),(In[1]===vn||"0"===In[1])&&(Dn=In[0],Fn={$flags$:0,$hostId$:In[1],$nodeId$:In[2],$depth$:In[3],$index$:In[4],$elm$:Vt,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},"t"===Dn?(Fn.$elm$=Vt.nextSibling,Fn.$elm$&&3===Fn.$elm$.nodeType&&(Fn.$text$=Fn.$elm$.textContent,fe.push(Fn),Vt.remove(),we.$children$||(we.$children$=[]),we.$children$[Fn.$index$]=Fn,lt&&"0"===Fn.$depth$&&(lt[Fn.$index$]=Fn.$elm$))):Fn.$hostId$===vn&&("s"===Dn?(Fn.$tag$="slot",Vt["s-sn"]=In[5]?Fn.$name$=In[5]:"",Vt["s-sr"]=!0,lt&&(Fn.$elm$=qi.createElement(Fn.$tag$),Fn.$name$&&Fn.$elm$.setAttribute("name",Fn.$name$),Vt.parentNode.insertBefore(Fn.$elm$,Vt),Vt.remove(),"0"===Fn.$depth$&&(lt[Fn.$index$]=Fn.$elm$)),je.push(Fn),we.$children$||(we.$children$=[]),we.$children$[Fn.$index$]=Fn):"r"===Dn&&(lt?Vt.remove():(an["s-cr"]=Vt,Vt["s-cn"]=!0))));else if(we&&"style"===we.$tag$){const Ai=Ye(null,Vt.textContent);Ai.$elm$=Vt,Ai.$index$="0",we.$children$=[Ai]}},Fe=(we,fe)=>{if(1===we.nodeType){let je=0;for(;jevi.push(we),Rt=we=>En(we).$modeName$,Gt=we=>En(we).$hostElement$,Zt=(we,fe,je)=>{const lt=Gt(we);return{emit:an=>Jt(lt,fe,{bubbles:!!(4&je),composed:!!(2&je),cancelable:!!(1&je),detail:an})}},Jt=(we,fe,je)=>{const lt=Bi.ce(fe,je);return we.dispatchEvent(lt),lt},kt=new WeakMap,dt=(we,fe,je)=>{let lt=Dr.get(we);yr&&je?(lt=lt||new CSSStyleSheet,"string"==typeof lt?lt=fe:lt.replaceSync(fe)):lt=fe,Dr.set(we,lt)},Ot=(we,fe,je)=>{var lt;const an=Yt(fe,je),Vt=Dr.get(an);if(we=11===we.nodeType?we:qi,Vt)if("string"==typeof Vt){let Dn,vn=kt.get(we=we.head||we);if(vn||kt.set(we,vn=new Set),!vn.has(an)){if(we.host&&(Dn=we.querySelector(`[${et}="${an}"]`)))Dn.innerHTML=Vt;else{Dn=qi.createElement("style"),Dn.innerHTML=Vt;const In=null!==(lt=Bi.$nonce$)&&void 0!==lt?lt:Pe(qi);null!=In&&Dn.setAttribute("nonce",In),we.insertBefore(Dn,we.querySelector("link"))}vn&&vn.add(an)}}else we.adoptedStyleSheets.includes(Vt)||(we.adoptedStyleSheets=[...we.adoptedStyleSheets,Vt]);return an},Yt=(we,fe)=>"sc-"+(fe&&32&we.$flags$?we.$tagName$+"-"+fe:we.$tagName$),Ut=we=>we.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),ii=(we,fe,je,lt,an,Vt)=>{if(je!==lt){let vn=_i(we,fe),Dn=fe.toLowerCase();if("class"===fe){const In=we.classList,Fn=Ft(je),di=Ft(lt);In.remove(...Fn.filter(Ai=>Ai&&!di.includes(Ai))),In.add(...di.filter(Ai=>Ai&&!Fn.includes(Ai)))}else if("style"===fe){for(const In in je)(!lt||null==lt[In])&&(In.includes("-")?we.style.removeProperty(In):we.style[In]="");for(const In in lt)(!je||lt[In]!==je[In])&&(In.includes("-")?we.style.setProperty(In,lt[In]):we.style[In]=lt[In])}else if("key"!==fe)if("ref"===fe)lt&<(we);else if(vn||"o"!==fe[0]||"n"!==fe[1]){const In=De(lt);if((vn||In&&null!==lt)&&!an)try{if(we.tagName.includes("-"))we[fe]=lt;else{const di=lt??"";"list"===fe?vn=!1:(null==je||we[fe]!=di)&&(we[fe]=di)}}catch{}let Fn=!1;Dn!==(Dn=Dn.replace(/^xlink\:?/,""))&&(fe=Dn,Fn=!0),null==lt||!1===lt?(!1!==lt||""===we.getAttribute(fe))&&(Fn?we.removeAttributeNS(ct,fe):we.removeAttribute(fe)):(!vn||4&Vt||an)&&!In&&(lt=!0===lt?"":lt,Fn?we.setAttributeNS(ct,fe,lt):we.setAttribute(fe,lt))}else fe="-"===fe[2]?fe.slice(3):_i(Ar,Dn)?Dn.slice(2):Dn[2]+fe.slice(3),je&&Bi.rel(we,fe,je,!1),lt&&Bi.ael(we,fe,lt,!1)}},gn=/\s/,Ft=we=>we?we.split(gn):[],Jn=(we,fe,je,lt)=>{const an=11===fe.$elm$.nodeType&&fe.$elm$.host?fe.$elm$.host:fe.$elm$,Vt=we&&we.$attrs$||ht,vn=fe.$attrs$||ht;for(lt in Vt)lt in vn||ii(an,lt,Vt[lt],void 0,je,fe.$flags$);for(lt in vn)ii(an,lt,Vt[lt],vn[lt],je,fe.$flags$)},Wt=(we,fe,je,lt)=>{const an=fe.$children$[je];let vn,Dn,In,Vt=0;if(ie||(C=!0,"slot"===an.$tag$&&(y&<.classList.add(y+"-s"),an.$flags$|=an.$children$?2:1)),null!==an.$text$)vn=an.$elm$=qi.createTextNode(an.$text$);else if(1&an.$flags$)vn=an.$elm$=qi.createTextNode("");else{if(Ne||(Ne="svg"===an.$tag$),vn=an.$elm$=qi.createElementNS(Ne?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&an.$flags$?"slot-fb":an.$tag$),Ne&&"foreignObject"===an.$tag$&&(Ne=!1),Jn(null,an,Ne),(we=>null!=we)(y)&&vn["s-si"]!==y&&vn.classList.add(vn["s-si"]=y),an.$children$)for(Vt=0;Vt{Bi.$flags$|=1;const je=we.childNodes;for(let lt=je.length-1;lt>=0;lt--){const an=je[lt];an["s-hn"]!==J&&an["s-ol"]&&(mi(an).insertBefore(an,lr(an)),an["s-ol"].remove(),an["s-ol"]=void 0,C=!0),fe&&wt(an,fe)}Bi.$flags$&=-2},vt=(we,fe,je,lt,an,Vt)=>{let Dn,vn=we["s-cr"]&&we["s-cr"].parentNode||we;for(vn.shadowRoot&&vn.tagName===J&&(vn=vn.shadowRoot);an<=Vt;++an)lt[an]&&(Dn=Wt(null,je,an,we),Dn&&(lt[an].$elm$=Dn,vn.insertBefore(Dn,lr(fe))))},ln=(we,fe,je)=>{for(let lt=fe;lt<=je;++lt){const an=we[lt];if(an){const Vt=an.$elm$;_n(an),Vt&&(Y=!0,Vt["s-ol"]?Vt["s-ol"].remove():wt(Vt,!0),Vt.remove())}}},er=(we,fe)=>we.$tag$===fe.$tag$&&("slot"===we.$tag$?we.$name$===fe.$name$:we.$key$===fe.$key$),lr=we=>we&&we["s-ol"]||we,mi=we=>(we["s-ol"]?we["s-ol"]:we).parentNode,Fi=(we,fe)=>{const je=fe.$elm$=we.$elm$,lt=we.$children$,an=fe.$children$,Vt=fe.$tag$,vn=fe.$text$;let Dn;null===vn?(Ne="svg"===Vt||"foreignObject"!==Vt&&Ne,"slot"===Vt||Jn(we,fe,Ne),null!==lt&&null!==an?((we,fe,je,lt)=>{let go,Nr,an=0,Vt=0,vn=0,Dn=0,In=fe.length-1,Fn=fe[0],di=fe[In],Ai=lt.length-1,Ni=lt[0],vr=lt[Ai];for(;an<=In&&Vt<=Ai;)if(null==Fn)Fn=fe[++an];else if(null==di)di=fe[--In];else if(null==Ni)Ni=lt[++Vt];else if(null==vr)vr=lt[--Ai];else if(er(Fn,Ni))Fi(Fn,Ni),Fn=fe[++an],Ni=lt[++Vt];else if(er(di,vr))Fi(di,vr),di=fe[--In],vr=lt[--Ai];else if(er(Fn,vr))("slot"===Fn.$tag$||"slot"===vr.$tag$)&&wt(Fn.$elm$.parentNode,!1),Fi(Fn,vr),we.insertBefore(Fn.$elm$,di.$elm$.nextSibling),Fn=fe[++an],vr=lt[--Ai];else if(er(di,Ni))("slot"===Fn.$tag$||"slot"===vr.$tag$)&&wt(di.$elm$.parentNode,!1),Fi(di,Ni),we.insertBefore(di.$elm$,Fn.$elm$),di=fe[--In],Ni=lt[++Vt];else{for(vn=-1,Dn=an;Dn<=In;++Dn)if(fe[Dn]&&null!==fe[Dn].$key$&&fe[Dn].$key$===Ni.$key$){vn=Dn;break}vn>=0?(Nr=fe[vn],Nr.$tag$!==Ni.$tag$?go=Wt(fe&&fe[Vt],je,vn,we):(Fi(Nr,Ni),fe[vn]=void 0,go=Nr.$elm$),Ni=lt[++Vt]):(go=Wt(fe&&fe[Vt],je,Vt,we),Ni=lt[++Vt]),go&&mi(Fn.$elm$).insertBefore(go,lr(Fn.$elm$))}an>In?vt(we,null==lt[Ai+1]?null:lt[Ai+1].$elm$,je,lt,Vt,Ai):Vt>Ai&&ln(fe,an,In)})(je,lt,fe,an):null!==an?(null!==we.$text$&&(je.textContent=""),vt(je,null,fe,an,0,an.length-1)):null!==lt&&ln(lt,0,lt.length-1),Ne&&"svg"===Vt&&(Ne=!1)):(Dn=je["s-cr"])?Dn.parentNode.textContent=vn:we.$text$!==vn&&(je.data=vn)},Cn=we=>{const fe=we.childNodes;let je,lt,an,Vt,vn,Dn;for(lt=0,an=fe.length;lt{let fe,je,lt,an,Vt,vn,Dn=0;const In=we.childNodes,Fn=In.length;for(;Dn=0;vn--)je=lt[vn],!je["s-cn"]&&!je["s-nr"]&&je["s-hn"]!==fe["s-hn"]&&(yn(je,an)?(Vt=Mn.find(di=>di.$nodeToRelocate$===je),Y=!0,je["s-sn"]=je["s-sn"]||an,Vt?Vt.$slotRefNode$=fe:Mn.push({$slotRefNode$:fe,$nodeToRelocate$:je}),je["s-sr"]&&Mn.map(di=>{yn(di.$nodeToRelocate$,je["s-sn"])&&(Vt=Mn.find(Ai=>Ai.$nodeToRelocate$===je),Vt&&!di.$slotRefNode$&&(di.$slotRefNode$=Vt.$slotRefNode$))})):Mn.some(di=>di.$nodeToRelocate$===je)||Mn.push({$nodeToRelocate$:je}));1===fe.nodeType&&qn(fe)}},yn=(we,fe)=>1===we.nodeType?null===we.getAttribute("slot")&&""===fe||we.getAttribute("slot")===fe:we["s-sn"]===fe||""===fe,_n=we=>{we.$attrs$&&we.$attrs$.ref&&we.$attrs$.ref(null),we.$children$&&we.$children$.map(_n)},nt=(we,fe)=>{fe&&!we.$onRenderResolve$&&fe["s-p"]&&fe["s-p"].push(new Promise(je=>we.$onRenderResolve$=je))},ge=(we,fe)=>{if(we.$flags$|=16,!(4&we.$flags$))return nt(we,we.$ancestorComponent$),Si(()=>ve(we,fe));we.$flags$|=512},ve=(we,fe)=>{const lt=we.$lazyInstance$;let an;return fe&&(we.$flags$|=256,we.$queuedListeners$&&(we.$queuedListeners$.map(([Vt,vn])=>Sn(lt,Vt,vn)),we.$queuedListeners$=void 0),an=Sn(lt,"componentWillLoad")),an=Xe(an,()=>Sn(lt,"componentWillRender")),Xe(an,()=>Ct(we,lt,fe))},Xe=(we,fe)=>ft(we)?we.then(fe):fe(),ft=we=>we instanceof Promise||we&&we.then&&"function"==typeof we.then,Ct=function(){var we=(0,x.Z)(function*(fe,je,lt){var an;const Vt=fe.$hostElement$,Dn=Vt["s-rc"];lt&&(we=>{const fe=we.$cmpMeta$,je=we.$hostElement$,lt=fe.$flags$,Vt=Ot(je.shadowRoot?je.shadowRoot:je.getRootNode(),fe,we.$modeName$);10<&&(je["s-sc"]=Vt,je.classList.add(Vt+"-h"),2<&&je.classList.add(Vt+"-s"))})(fe);Bt(fe,je,Vt,lt),Dn&&(Dn.map(Fn=>Fn()),Vt["s-rc"]=void 0);{const Fn=null!==(an=Vt["s-p"])&&void 0!==an?an:[],di=()=>jt(fe);0===Fn.length?di():(Promise.all(Fn).then(di),fe.$flags$|=4,Fn.length=0)}});return function(je,lt,an){return we.apply(this,arguments)}}(),Bt=(we,fe,je,lt)=>{try{fe=fe.render&&fe.render(),we.$flags$&=-17,we.$flags$|=2,((we,fe,je=!1)=>{const lt=we.$hostElement$,an=we.$cmpMeta$,Vt=we.$vnode$||Ye(null,null),vn=(we=>we&&we.$tag$===_t)(fe)?fe:Ae(null,null,fe);if(J=lt.tagName,an.$attrsToReflect$&&(vn.$attrs$=vn.$attrs$||{},an.$attrsToReflect$.map(([Dn,In])=>vn.$attrs$[In]=lt[Dn])),je&&vn.$attrs$)for(const Dn of Object.keys(vn.$attrs$))lt.hasAttribute(Dn)&&!["key","ref","style","class"].includes(Dn)&&(vn.$attrs$[Dn]=lt[Dn]);if(vn.$tag$=null,vn.$flags$|=4,we.$vnode$=vn,vn.$elm$=Vt.$elm$=lt.shadowRoot||lt,y=lt["s-sc"],s=lt["s-cr"],ie=0!=(1&an.$flags$),Y=!1,Fi(Vt,vn),Bi.$flags$|=1,C){qn(vn.$elm$);let Dn,In,Fn,di,Ai,Ni,vr=0;for(;vr{const je=we.$hostElement$,an=we.$lazyInstance$,Vt=we.$ancestorComponent$;Sn(an,"componentDidRender"),64&we.$flags$?Sn(an,"componentDidUpdate"):(we.$flags$|=64,zn(je),Sn(an,"componentDidLoad"),we.$onReadyResolve$(je),Vt||Xt()),we.$onInstanceResolve$(je),we.$onRenderResolve$&&(we.$onRenderResolve$(),we.$onRenderResolve$=void 0),512&we.$flags$&&Xn(()=>ge(we,!1)),we.$flags$&=-517},Et=we=>{{const fe=En(we),je=fe.$hostElement$.isConnected;return je&&2==(18&fe.$flags$)&&ge(fe,!1),je}},Xt=we=>{zn(qi.documentElement),Xn(()=>Jt(Ar,"appload",{detail:{namespace:"ionic"}}))},Sn=(we,fe,je)=>{if(we&&we[fe])try{return we[fe](je)}catch(lt){Li(lt)}},zn=we=>we.classList.add("hydrated"),xe=(we,fe,je)=>{if(fe.$members$){we.watchers&&(fe.$watchers$=we.watchers);const lt=Object.entries(fe.$members$),an=we.prototype;if(lt.map(([Vt,[vn]])=>{31&vn||2&je&&32&vn?Object.defineProperty(an,Vt,{get(){return((we,fe)=>En(this).$instanceValues$.get(fe))(0,Vt)},set(Dn){((we,fe,je,lt)=>{const an=En(we),Vt=an.$hostElement$,vn=an.$instanceValues$.get(fe),Dn=an.$flags$,In=an.$lazyInstance$;je=((we,fe)=>null==we||De(we)?we:4&fe?"false"!==we&&(""===we||!!we):2&fe?parseFloat(we):1&fe?String(we):we)(je,lt.$members$[fe][0]);const Fn=Number.isNaN(vn)&&Number.isNaN(je);if((!(8&Dn)||void 0===vn)&&je!==vn&&!Fn&&(an.$instanceValues$.set(fe,je),In)){if(lt.$watchers$&&128&Dn){const Ai=lt.$watchers$[fe];Ai&&Ai.map(Ni=>{try{In[Ni](je,vn,fe)}catch(vr){Li(vr,Vt)}})}2==(18&Dn)&&ge(an,!1)}})(this,Vt,Dn,fe)},configurable:!0,enumerable:!0}):1&je&&64&vn&&Object.defineProperty(an,Vt,{value(...Dn){const In=En(this);return In.$onInstancePromise$.then(()=>In.$lazyInstance$[Vt](...Dn))}})}),1&je){const Vt=new Map;an.attributeChangedCallback=function(vn,Dn,In){Bi.jmp(()=>{const Fn=Vt.get(vn);if(this.hasOwnProperty(Fn))In=this[Fn],delete this[Fn];else if(an.hasOwnProperty(Fn)&&"number"==typeof this[Fn]&&this[Fn]==In)return;this[Fn]=(null!==In||"boolean"!=typeof this[Fn])&&In})},we.observedAttributes=lt.filter(([vn,Dn])=>15&Dn[0]).map(([vn,Dn])=>{const In=Dn[1]||vn;return Vt.set(In,vn),512&Dn[0]&&fe.$attrsToReflect$.push([vn,In]),In})}}return we},be=function(){var we=(0,x.Z)(function*(fe,je,lt,an,Vt){if(!(32&je.$flags$)){je.$flags$|=32;{if((Vt=ir(lt)).then){const Fn=()=>{};Vt=yield Vt,Fn()}Vt.isProxied||(lt.$watchers$=Vt.watchers,xe(Vt,lt,2),Vt.isProxied=!0);const In=()=>{};je.$flags$|=8;try{new Vt(je)}catch(Fn){Li(Fn)}je.$flags$&=-9,je.$flags$|=128,In(),Ze(je.$lazyInstance$)}if(Vt.style){let In=Vt.style;"string"!=typeof In&&(In=In[je.$modeName$=(we=>vi.map(fe=>fe(we)).find(fe=>!!fe))(fe)]);const Fn=Yt(lt,je.$modeName$);if(!Dr.has(Fn)){const di=()=>{};dt(Fn,In,!!(1<.$flags$)),di()}}}const vn=je.$ancestorComponent$,Dn=()=>ge(je,!0);vn&&vn["s-rc"]?vn["s-rc"].push(Dn):Dn()});return function(je,lt,an,Vt,vn){return we.apply(this,arguments)}}(),Ze=we=>{Sn(we,"connectedCallback")},bn=we=>{const fe=we["s-cr"]=qi.createComment("");fe["s-cn"]=!0,we.insertBefore(fe,we.firstChild)},Kn=we=>{Sn(we,"disconnectedCallback")},Ci=function(){var we=(0,x.Z)(function*(fe){if(!(1&Bi.$flags$)){const je=En(fe);je.$rmListeners$&&(je.$rmListeners$.map(lt=>lt()),je.$rmListeners$=void 0),je?.$lazyInstance$?Kn(je.$lazyInstance$):je?.$onReadyPromise$&&je.$onReadyPromise$.then(()=>Kn(je.$lazyInstance$))}});return function(je){return we.apply(this,arguments)}}(),wi=(we,fe={})=>{var je;const an=[],Vt=fe.exclude||[],vn=Ar.customElements,Dn=qi.head,In=Dn.querySelector("meta[charset]"),Fn=qi.createElement("style"),di=[],Ai=qi.querySelectorAll(`[${et}]`);let Ni,vr=!0,go=0;for(Object.assign(Bi,fe),Bi.$resourcesUrl$=new URL(fe.resourcesUrl||"./",qi.baseURI).href,Bi.$flags$|=2;go{Nr[1].map(co=>{const uo={$flags$:co[0],$tagName$:co[1],$members$:co[2],$listeners$:co[3]};uo.$members$=co[2],uo.$listeners$=co[3],uo.$attrsToReflect$=[],uo.$watchers$={};const Jr=uo.$tagName$,kr=class extends HTMLElement{constructor(To){super(To),gi(To=this,uo),1&uo.$flags$&&To.attachShadow({mode:"open",delegatesFocus:!!(16&uo.$flags$)})}connectedCallback(){Ni&&(clearTimeout(Ni),Ni=null),vr?di.push(this):Bi.jmp(()=>(we=>{if(!(1&Bi.$flags$)){const fe=En(we),je=fe.$cmpMeta$,lt=()=>{};if(1&fe.$flags$)cr(we,fe,je.$listeners$),fe?.$lazyInstance$?Ze(fe.$lazyInstance$):fe?.$onReadyPromise$&&fe.$onReadyPromise$.then(()=>Ze(fe.$lazyInstance$));else{let an;if(fe.$flags$|=1,an=we.getAttribute(Ue),an){if(1&je.$flags$){const Vt=Ot(we.shadowRoot,je,we.getAttribute("s-mode"));we.classList.remove(Vt+"-h",Vt+"-s")}((we,fe,je,lt)=>{const Vt=we.shadowRoot,vn=[],In=Vt?[]:null,Fn=lt.$vnode$=Ye(fe,null);Bi.$orgLocNodes$||Fe(qi.body,Bi.$orgLocNodes$=new Map),we[Ue]=je,we.removeAttribute(Ue),Re(Fn,vn,[],In,we,we,je),vn.map(di=>{const Ai=di.$hostId$+"."+di.$nodeId$,Ni=Bi.$orgLocNodes$.get(Ai),vr=di.$elm$;Ni&&Wi&&""===Ni["s-en"]&&Ni.parentNode.insertBefore(vr,Ni.nextSibling),Vt||(vr["s-hn"]=fe,Ni&&(vr["s-ol"]=Ni,vr["s-ol"]["s-nr"]=vr)),Bi.$orgLocNodes$.delete(Ai)}),Vt&&In.map(di=>{di&&Vt.appendChild(di)})})(we,je.$tagName$,an,fe)}an||12&je.$flags$&&bn(we);{let Vt=we;for(;Vt=Vt.parentNode||Vt.host;)if(1===Vt.nodeType&&Vt.hasAttribute("s-id")&&Vt["s-p"]||Vt["s-p"]){nt(fe,fe.$ancestorComponent$=Vt);break}}je.$members$&&Object.entries(je.$members$).map(([Vt,[vn]])=>{if(31&vn&&we.hasOwnProperty(Vt)){const Dn=we[Vt];delete we[Vt],we[Vt]=Dn}}),be(we,fe,je)}lt()}})(this))}disconnectedCallback(){Bi.jmp(()=>Ci(this))}componentOnReady(){return En(this).$onReadyPromise$}};uo.$lazyBundleId$=Nr[0],!Vt.includes(Jr)&&!vn.get(Jr)&&(an.push(Jr),vn.define(Jr,xe(kr,uo,1)))})});{Fn.innerHTML=an+"{visibility:hidden}.hydrated{visibility:inherit}",Fn.setAttribute("data-styles","");const Nr=null!==(je=Bi.$nonce$)&&void 0!==je?je:Pe(qi);null!=Nr&&Fn.setAttribute("nonce",Nr),Dn.insertBefore(Fn,In?In.nextSibling:Dn.firstChild)}vr=!1,di.length?di.map(Nr=>Nr.connectedCallback()):Bi.jmp(()=>Ni=setTimeout(Xt,30))},cr=(we,fe,je,lt)=>{je&&je.map(([an,Vt,vn])=>{const Dn=Lt(we,an),In=Ui(fe,vn),Fn=st(an);Bi.ael(Dn,Vt,In,Fn),(fe.$rmListeners$=fe.$rmListeners$||[]).push(()=>Bi.rel(Dn,Vt,In,Fn))})},Ui=(we,fe)=>je=>{try{256&we.$flags$?we.$lazyInstance$[fe](je):(we.$queuedListeners$=we.$queuedListeners$||[]).push([fe,je])}catch(lt){Li(lt)}},Lt=(we,fe)=>4&fe?qi:8&fe?Ar:16&fe?qi.body:we,st=we=>0!=(2&we),mn=new WeakMap,En=we=>mn.get(we),ti=(we,fe)=>mn.set(fe.$lazyInstance$=we,fe),gi=(we,fe)=>{const je={$flags$:0,$hostElement$:we,$cmpMeta$:fe,$instanceValues$:new Map};return je.$onInstancePromise$=new Promise(lt=>je.$onInstanceResolve$=lt),je.$onReadyPromise$=new Promise(lt=>je.$onReadyResolve$=lt),we["s-p"]=[],we["s-rc"]=[],cr(we,je,fe.$listeners$),mn.set(we,je)},_i=(we,fe)=>fe in we,Li=(we,fe)=>(0,console.error)(we,fe),bi=new Map,ir=(we,fe,je)=>{const lt=we.$tagName$.replace(/-/g,"_"),an=we.$lazyBundleId$,Vt=bi.get(an);return Vt?Vt[lt]:k(863)(`./${an}.entry.js`).then(vn=>(bi.set(an,vn),vn[lt]),Li)},Dr=new Map,vi=[],Ar=typeof window<"u"?window:{},qi=Ar.document||{head:{}},Bi={$flags$:0,$resourcesUrl$:"",jmp:we=>we(),raf:we=>requestAnimationFrame(we),ael:(we,fe,je,lt)=>we.addEventListener(fe,je,lt),rel:(we,fe,je,lt)=>we.removeEventListener(fe,je,lt),ce:(we,fe)=>new CustomEvent(we,fe)},Kt=we=>{Object.assign(Bi,we)},Wi=!0,yr=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch{}return!1})(),xr=[],Sr=[],Go=(we,fe)=>je=>{we.push(je),me||(me=!0,fe&&4&Bi.$flags$?Xn(to):Bi.raf(to))},Eo=we=>{for(let fe=0;fe{Eo(xr),Eo(Sr),(me=xr.length>0)&&Bi.raf(to)},Xn=we=>Promise.resolve(void 0).then(we),Ei=Go(xr,!1),Si=Go(Sr,!0)},5662:(Nn,yt,k)=>{"use strict";k.d(yt,{m:()=>he});var x=k(5861),h=k(2124),y=k(839),s=k(2085),J=k(1774);const ie=_e=>(0,J.c)().duration(_e?400:300),Y=_e=>{let ee,ae;const oe=_e.width+8,Be=(0,J.c)(),Ie=(0,J.c)();_e.isEndSide?(ee=oe+"px",ae="0px"):(ee=-oe+"px",ae="0px"),Be.addElement(_e.menuInnerEl).fromTo("transform",`translateX(${ee})`,`translateX(${ae})`);const Ue="ios"===(0,s.b)(_e),et=Ue?.2:.25;return Ie.addElement(_e.backdropEl).fromTo("opacity",.01,et),ie(Ue).addAnimation([Be,Ie])},C=_e=>{let ee,ae;const oe=(0,s.b)(_e),Be=_e.width;_e.isEndSide?(ee=-Be+"px",ae=Be+"px"):(ee=Be+"px",ae=-Be+"px");const Ie=(0,J.c)().addElement(_e.menuInnerEl).fromTo("transform",`translateX(${ae})`,"translateX(0px)"),Ee=(0,J.c)().addElement(_e.contentEl).fromTo("transform","translateX(0px)",`translateX(${ee})`),Ue=(0,J.c)().addElement(_e.backdropEl).fromTo("opacity",.01,.32);return ie("ios"===oe).addAnimation([Ie,Ee,Ue])},Ne=_e=>{const ee=(0,s.b)(_e),ae=_e.width*(_e.isEndSide?-1:1)+"px",oe=(0,J.c)().addElement(_e.contentEl).fromTo("transform","translateX(0px)",`translateX(${ae})`);return ie("ios"===ee).addAnimation(oe)},he=(()=>{const _e=new Map,ee=[],ae=function(){var Te=(0,x.Z)(function*(Je){const Re=yield le(Je);return!!Re&&Re.open()});return function(Re){return Te.apply(this,arguments)}}(),oe=function(){var Te=(0,x.Z)(function*(Je){const Re=yield void 0!==Je?le(Je):ue();return void 0!==Re&&Re.close()});return function(Re){return Te.apply(this,arguments)}}(),Be=function(){var Te=(0,x.Z)(function*(Je){const Re=yield le(Je);return!!Re&&Re.toggle()});return function(Re){return Te.apply(this,arguments)}}(),Ie=function(){var Te=(0,x.Z)(function*(Je,Re){const Fe=yield le(Re);return Fe&&(Fe.disabled=!Je),Fe});return function(Re,Fe){return Te.apply(this,arguments)}}(),Ee=function(){var Te=(0,x.Z)(function*(Je,Re){const Fe=yield le(Re);return Fe&&(Fe.swipeGesture=Je),Fe});return function(Re,Fe){return Te.apply(this,arguments)}}(),Ue=function(){var Te=(0,x.Z)(function*(Je){if(null!=Je){const Re=yield le(Je);return void 0!==Re&&Re.isOpen()}return void 0!==(yield ue())});return function(Re){return Te.apply(this,arguments)}}(),et=function(){var Te=(0,x.Z)(function*(Je){const Re=yield le(Je);return!!Re&&!Re.disabled});return function(Re){return Te.apply(this,arguments)}}(),le=function(){var Te=(0,x.Z)(function*(Je){return yield Ht(),"start"===Je||"end"===Je?qt(St=>St.side===Je&&!St.disabled)||qt(St=>St.side===Je):null!=Je?qt(Fe=>Fe.menuId===Je):qt(Fe=>!Fe.disabled)||(ee.length>0?ee[0].el:void 0)});return function(Re){return Te.apply(this,arguments)}}(),ue=function(){var Te=(0,x.Z)(function*(){return yield Ht(),Ye()});return function(){return Te.apply(this,arguments)}}(),ct=function(){var Te=(0,x.Z)(function*(){return yield Ht(),_t()});return function(){return Te.apply(this,arguments)}}(),ht=function(){var Te=(0,x.Z)(function*(){return yield Ht(),hn()});return function(){return Te.apply(this,arguments)}}(),Le=(Te,Je)=>{_e.set(Te,Je)},De=Te=>{const Je=Te.side;ee.filter(Re=>Re.side===Je&&Re!==Te).forEach(Re=>Re.disabled=!0)},Pe=function(){var Te=(0,x.Z)(function*(Je,Re,Fe){if(hn())return!1;if(Re){const St=yield ue();St&&Je.el!==St&&(yield St.setOpen(!1,!1))}return Je._setOpen(Re,Fe)});return function(Re,Fe,St){return Te.apply(this,arguments)}}(),Ye=()=>qt(Te=>Te._isOpen),_t=()=>ee.map(Te=>Te.el),hn=()=>ee.some(Te=>Te.isAnimating),qt=Te=>{const Je=ee.find(Te);if(void 0!==Je)return Je.el},Ht=()=>Promise.all(Array.from(document.querySelectorAll("ion-menu")).map(Te=>new Promise(Je=>(0,y.c)(Te,Je))));return Le("reveal",Ne),Le("push",C),Le("overlay",Y),typeof document<"u"&&document.addEventListener("ionBackButton",Te=>{const Je=Ye();Je&&Te.detail.register(h.MENU_BACK_BUTTON_PRIORITY,()=>Je.close())}),{registerAnimation:Le,get:le,getMenus:ct,getOpen:ue,isEnabled:et,swipeGesture:Ee,isAnimating:ht,isOpen:Ue,enable:Ie,toggle:Be,close:oe,open:ae,_getOpenSync:Ye,_createAnimation:(Te,Je)=>{const Re=_e.get(Te);if(!Re)throw new Error("animation not registered");return Re(Je)},_register:Te=>{ee.indexOf(Te)<0&&(Te.disabled||De(Te),ee.push(Te))},_unregister:Te=>{const Je=ee.indexOf(Te);Je>-1&&ee.splice(Je,1)},_setOpen:Pe,_setActiveMenu:De}})()},9203:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{GESTURE_CONTROLLER:()=>x.G,createGesture:()=>Ne});var x=k(619);const h=(ee,ae,oe,Be)=>{const Ie=y(ee)?{capture:!!Be.capture,passive:!!Be.passive}:!!Be.capture;let Ee,Ue;return ee.__zone_symbol__addEventListener?(Ee="__zone_symbol__addEventListener",Ue="__zone_symbol__removeEventListener"):(Ee="addEventListener",Ue="removeEventListener"),ee[Ee](ae,oe,Ie),()=>{ee[Ue](ae,oe,Ie)}},y=ee=>{if(void 0===s)try{const ae=Object.defineProperty({},"passive",{get:()=>{s=!0}});ee.addEventListener("optsTest",()=>{},ae)}catch{s=!1}return!!s};let s;const Y=ee=>ee instanceof Document?ee:ee.ownerDocument,Ne=ee=>{let ae=!1,oe=!1,Be=!0,Ie=!1;const Ee=Object.assign({disableScroll:!1,direction:"x",gesturePriority:0,passive:!0,maxAngle:40,threshold:10},ee),Ue=Ee.canStart,et=Ee.onWillStart,le=Ee.onStart,ue=Ee.onEnd,ct=Ee.notCaptured,ht=Ee.onMove,Le=Ee.threshold,ye=Ee.passive,gt=Ee.blurOnStart,De={type:"pan",startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,event:void 0,data:void 0},Pe=((ee,ae,oe)=>{const Be=oe*(Math.PI/180),Ie="x"===ee,Ee=Math.cos(Be),Ue=ae*ae;let et=0,le=0,ue=!1,ct=0;return{start(ht,Le){et=ht,le=Le,ct=0,ue=!0},detect(ht,Le){if(!ue)return!1;const ye=ht-et,gt=Le-le,De=ye*ye+gt*gt;if(DeEe?1:Ae<-Ee?-1:0,ue=!1,!0},isGesture:()=>0!==ct,getDirection:()=>ct}})(Ee.direction,Ee.threshold,Ee.maxAngle),Ae=x.G.createGesture({name:ee.gestureName,priority:ee.gesturePriority,disableScroll:ee.disableScroll}),hn=()=>{ae&&(Ie=!1,ht&&ht(De))},qt=()=>!!Ae.capture()&&(ae=!0,Be=!1,De.startX=De.currentX,De.startY=De.currentY,De.startTime=De.currentTime,et?et(De).then(Te):Te(),!0),Te=()=>{gt&&(()=>{if(typeof document<"u"){const Ce=document.activeElement;Ce?.blur&&Ce.blur()}})(),le&&le(De),Be=!0},Je=()=>{ae=!1,oe=!1,Ie=!1,Be=!0,Ae.release()},Re=Ce=>{const Rt=ae,Qt=Be;if(Je(),Qt){if(me(De,Ce),Rt)return void(ue&&ue(De));ct&&ct(De)}},Fe=((ee,ae,oe,Be,Ie)=>{let Ee,Ue,et,le,ue,ct,ht,Le=0;const ye=Ht=>{Le=Date.now()+2e3,ae(Ht)&&(!Ue&&oe&&(Ue=h(ee,"touchmove",oe,Ie)),et||(et=h(Ht.target,"touchend",De,Ie)),le||(le=h(Ht.target,"touchcancel",De,Ie)))},gt=Ht=>{Le>Date.now()||ae(Ht)&&(!ct&&oe&&(ct=h(Y(ee),"mousemove",oe,Ie)),ht||(ht=h(Y(ee),"mouseup",Pe,Ie)))},De=Ht=>{Ae(),Be&&Be(Ht)},Pe=Ht=>{Ye(),Be&&Be(Ht)},Ae=()=>{Ue&&Ue(),et&&et(),le&&le(),Ue=et=le=void 0},Ye=()=>{ct&&ct(),ht&&ht(),ct=ht=void 0},_t=()=>{Ae(),Ye()},hn=(Ht=!0)=>{Ht?(Ee||(Ee=h(ee,"touchstart",ye,Ie)),ue||(ue=h(ee,"mousedown",gt,Ie))):(Ee&&Ee(),ue&&ue(),Ee=ue=void 0,_t())};return{enable:hn,stop:_t,destroy:()=>{hn(!1),Be=oe=ae=void 0}}})(Ee.el,Ce=>{const Rt=_e(Ce);return!(oe||!Be||(he(Ce,De),De.startX=De.currentX,De.startY=De.currentY,De.startTime=De.currentTime=Rt,De.velocityX=De.velocityY=De.deltaX=De.deltaY=0,De.event=Ce,Ue&&!1===Ue(De))||(Ae.release(),!Ae.start()))&&(oe=!0,0===Le?qt():(Pe.start(De.startX,De.startY),!0))},Ce=>{ae?!Ie&&Be&&(Ie=!0,me(De,Ce),requestAnimationFrame(hn)):(me(De,Ce),Pe.detect(De.currentX,De.currentY)&&(!Pe.isGesture()||!qt())&&St())},Re,{capture:!1,passive:ye}),St=()=>{Je(),Fe.stop(),ct&&ct(De)};return{enable(Ce=!0){Ce||(ae&&Re(void 0),Je()),Fe.enable(Ce)},destroy(){Ae.destroy(),Fe.destroy()}}},me=(ee,ae)=>{if(!ae)return;const oe=ee.currentX,Be=ee.currentY,Ie=ee.currentTime;he(ae,ee);const Ee=ee.currentX,Ue=ee.currentY,le=(ee.currentTime=_e(ae))-Ie;if(le>0&&le<100){const ct=(Ue-Be)/le;ee.velocityX=(Ee-oe)/le*.7+.3*ee.velocityX,ee.velocityY=.7*ct+.3*ee.velocityY}ee.deltaX=Ee-ee.startX,ee.deltaY=Ue-ee.startY,ee.event=ae},he=(ee,ae)=>{let oe=0,Be=0;if(ee){const Ie=ee.changedTouches;if(Ie&&Ie.length>0){const Ee=Ie[0];oe=Ee.clientX,Be=Ee.clientY}else void 0!==ee.pageX&&(oe=ee.pageX,Be=ee.pageY)}ae.currentX=oe,ae.currentY=Be},_e=ee=>ee.timeStamp||Date.now()},2085:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>he,b:()=>hn,c:()=>y,g:()=>me,i:()=>qt});var x=k(1688);class h{constructor(){this.m=new Map}reset(Te){this.m=new Map(Object.entries(Te))}get(Te,Je){const Re=this.m.get(Te);return void 0!==Re?Re:Je}getBoolean(Te,Je=!1){const Re=this.m.get(Te);return void 0===Re?Je:"string"==typeof Re?"true"===Re:!!Re}getNumber(Te,Je){const Re=parseFloat(this.m.get(Te));return isNaN(Re)?void 0!==Je?Je:NaN:Re}set(Te,Je){this.m.set(Te,Je)}}const y=new h,C="ionic:",Ne="ionic-persist-config",me=Ht=>_e(Ht),he=(Ht,Te)=>("string"==typeof Ht&&(Te=Ht,Ht=void 0),me(Ht).includes(Te)),_e=(Ht=window)=>{if(typeof Ht>"u")return[];Ht.Ionic=Ht.Ionic||{};let Te=Ht.Ionic.platforms;return null==Te&&(Te=Ht.Ionic.platforms=ee(Ht),Te.forEach(Je=>Ht.document.documentElement.classList.add(`plt-${Je}`))),Te},ee=Ht=>{const Te=y.get("platform");return Object.keys(Ye).filter(Je=>{const Re=Te?.[Je];return"function"==typeof Re?Re(Ht):Ye[Je](Ht)})},oe=Ht=>!!(Pe(Ht,/iPad/i)||Pe(Ht,/Macintosh/i)&&ue(Ht)),Ee=Ht=>Pe(Ht,/android|sink/i),ue=Ht=>Ae(Ht,"(any-pointer:coarse)"),ht=Ht=>Le(Ht)||ye(Ht),Le=Ht=>!!(Ht.cordova||Ht.phonegap||Ht.PhoneGap),ye=Ht=>{const Te=Ht.Capacitor;return!!Te?.isNative},Pe=(Ht,Te)=>Te.test(Ht.navigator.userAgent),Ae=(Ht,Te)=>{var Je;return null===(Je=Ht.matchMedia)||void 0===Je?void 0:Je.call(Ht,Te).matches},Ye={ipad:oe,iphone:Ht=>Pe(Ht,/iPhone/i),ios:Ht=>Pe(Ht,/iPhone|iPod/i)||oe(Ht),android:Ee,phablet:Ht=>{const Te=Ht.innerWidth,Je=Ht.innerHeight,Re=Math.min(Te,Je),Fe=Math.max(Te,Je);return Re>390&&Re<520&&Fe>620&&Fe<800},tablet:Ht=>{const Te=Ht.innerWidth,Je=Ht.innerHeight,Re=Math.min(Te,Je),Fe=Math.max(Te,Je);return oe(Ht)||(Ht=>Ee(Ht)&&!Pe(Ht,/mobile/i))(Ht)||Re>460&&Re<820&&Fe>780&&Fe<1400},cordova:Le,capacitor:ye,electron:Ht=>Pe(Ht,/electron/i),pwa:Ht=>{var Te;return!!(null!==(Te=Ht.matchMedia)&&void 0!==Te&&Te.call(Ht,"(display-mode: standalone)").matches||Ht.navigator.standalone)},mobile:ue,mobileweb:Ht=>ue(Ht)&&!ht(Ht),desktop:Ht=>!ue(Ht),hybrid:ht};let _t;const hn=Ht=>Ht&&(0,x.g)(Ht)||_t,qt=(Ht={})=>{if(typeof window>"u")return;const Te=window.document,Je=window,Re=Je.Ionic=Je.Ionic||{},Fe={};Ht._ael&&(Fe.ael=Ht._ael),Ht._rel&&(Fe.rel=Ht._rel),Ht._ce&&(Fe.ce=Ht._ce),(0,x.a)(Fe);const St=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(Ht=>{try{const Te=Ht.sessionStorage.getItem(Ne);return null!==Te?JSON.parse(Te):{}}catch{return{}}})(Je)),{persistConfig:!1}),Re.config),(Ht=>{const Te={};return Ht.location.search.slice(1).split("&").map(Je=>Je.split("=")).map(([Je,Re])=>[decodeURIComponent(Je),decodeURIComponent(Re)]).filter(([Je])=>((Ht,Te)=>Ht.substr(0,Te.length)===Te)(Je,C)).map(([Je,Re])=>[Je.slice(6),Re]).forEach(([Je,Re])=>{Te[Je]=Re}),Te})(Je)),Ht);y.reset(St),y.getBoolean("persistConfig")&&((Ht,Te)=>{try{Ht.sessionStorage.setItem(Ne,JSON.stringify(Te))}catch{return}})(Je,St),_e(Je),Re.config=y,Re.mode=_t=y.get("mode",Te.documentElement.getAttribute("mode")||(he(Je,"ios")?"ios":"md")),y.set("mode",_t),Te.documentElement.setAttribute("mode",_t),Te.documentElement.classList.add(_t),y.getBoolean("_testing")&&y.set("animated",!1);const Ce=Qt=>{var Gt;return null===(Gt=Qt.tagName)||void 0===Gt?void 0:Gt.startsWith("ION-")},Rt=Qt=>["ios","md"].includes(Qt);(0,x.c)(Qt=>{for(;Qt;){const Gt=Qt.mode||Qt.getAttribute("mode");if(Gt){if(Rt(Gt))return Gt;Ce(Qt)&&console.warn('Invalid ionic mode: "'+Gt+'", expected: "ios" or "md"')}Qt=Qt.parentElement}return _t})}},2650:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{iosTransitionAnimation:()=>ee,shadow:()=>Y});var x=k(1774),h=k(1651);k(6225),k(1688);const ie=ae=>document.querySelector(`${ae}.ion-cloned-element`),Y=ae=>ae.shadowRoot||ae,C=ae=>{const oe="ION-TABS"===ae.tagName?ae:ae.querySelector("ion-tabs"),Be="ion-content ion-header:not(.header-collapse-condense-inactive) ion-title.title-large";if(null!=oe){const Ie=oe.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");return null!=Ie?Ie.querySelector(Be):null}return ae.querySelector(Be)},Ne=(ae,oe)=>{const Be="ION-TABS"===ae.tagName?ae:ae.querySelector("ion-tabs");let Ie=[];if(null!=Be){const Ee=Be.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");null!=Ee&&(Ie=Ee.querySelectorAll("ion-buttons"))}else Ie=ae.querySelectorAll("ion-buttons");for(const Ee of Ie){const Ue=Ee.closest("ion-header"),et=Ue&&!Ue.classList.contains("header-collapse-condense-inactive"),le=Ee.querySelector("ion-back-button"),ue=Ee.classList.contains("buttons-collapse");if(null!==le&&("start"===Ee.slot||""===Ee.slot)&&(ue&&et&&oe||!ue))return le}return null},he=(ae,oe,Be,Ie,Ee,Ue)=>{const et=oe?`calc(100% - ${Ue.right+4}px)`:Ue.left-4+"px",le=oe?"7px":"-7px",ue=oe?"-4px":"4px",ct=oe?"-4px":"4px",ht=oe?"right":"left",Le=oe?"left":"right",De=Be?[{offset:0,opacity:1,transform:`translate3d(${ue}, ${Ue.top-46}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${le}, ${Ee.top-40}px, 0) scale(2.1)`}]:[{offset:0,opacity:0,transform:`translate3d(${le}, ${Ee.top-40}px, 0) scale(2.1)`},{offset:1,opacity:1,transform:`translate3d(${ue}, ${Ue.top-46}px, 0) scale(1)`}],Ye=Be?[{offset:0,opacity:1,transform:`translate3d(${ct}, ${Ue.top-46}px, 0) scale(1)`},{offset:.2,opacity:0,transform:`translate3d(${ct}, ${Ue.top-41}px, 0) scale(0.6)`},{offset:1,opacity:0,transform:`translate3d(${ct}, ${Ue.top-41}px, 0) scale(0.6)`}]:[{offset:0,opacity:0,transform:`translate3d(${ct}, ${Ue.top-41}px, 0) scale(0.6)`},{offset:1,opacity:1,transform:`translate3d(${ct}, ${Ue.top-46}px, 0) scale(1)`}],_t=(0,x.c)(),hn=(0,x.c)(),qt=ie("ion-back-button"),Ht=Y(qt).querySelector(".button-text"),Te=Y(qt).querySelector("ion-icon");qt.text=Ie.text,qt.mode=Ie.mode,qt.icon=Ie.icon,qt.color=Ie.color,qt.disabled=Ie.disabled,qt.style.setProperty("display","block"),qt.style.setProperty("position","fixed"),hn.addElement(Te),_t.addElement(Ht),_t.beforeStyles({"transform-origin":`${ht} center`}).beforeAddWrite(()=>{Ie.style.setProperty("display","none"),qt.style.setProperty(ht,et)}).afterAddWrite(()=>{Ie.style.setProperty("display",""),qt.style.setProperty("display","none"),qt.style.removeProperty(ht)}).keyframes(De),hn.beforeStyles({"transform-origin":`${Le} center`}).keyframes(Ye),ae.addAnimation([_t,hn])},_e=(ae,oe,Be,Ie,Ee,Ue)=>{const et=oe?`calc(100% - ${Ee.right}px)`:`${Ee.left}px`,le=oe?"-18px":"18px",ue=oe?"right":"left",Le=Be?[{offset:0,opacity:0,transform:`translate3d(${le}, ${Ue.top-4}px, 0) scale(0.49)`},{offset:.1,opacity:0},{offset:1,opacity:1,transform:`translate3d(0, ${Ee.top-2}px, 0) scale(1)`}]:[{offset:0,opacity:.99,transform:`translate3d(0, ${Ee.top-2}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${le}, ${Ue.top-4}px, 0) scale(0.5)`}],ye=ie("ion-title"),gt=(0,x.c)();ye.innerText=Ie.innerText,ye.size=Ie.size,ye.color=Ie.color,gt.addElement(ye),gt.beforeStyles({"transform-origin":`${ue} center`,height:"46px",display:"",position:"relative",[ue]:et}).beforeAddWrite(()=>{Ie.style.setProperty("display","none")}).afterAddWrite(()=>{Ie.style.setProperty("display",""),ye.style.setProperty("display","none")}).keyframes(Le),ae.addAnimation(gt)},ee=(ae,oe)=>{var Be;try{const Ie="cubic-bezier(0.32,0.72,0,1)",Ee="opacity",Ue="transform",et="0%",ue="rtl"===ae.ownerDocument.dir,ct=ue?"-99.5%":"99.5%",ht=ue?"33%":"-33%",Le=oe.enteringEl,ye=oe.leavingEl,gt="back"===oe.direction,De=Le.querySelector(":scope > ion-content"),Pe=Le.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *"),Ae=Le.querySelectorAll(":scope > ion-header > ion-toolbar"),Ye=(0,x.c)(),_t=(0,x.c)();if(Ye.addElement(Le).duration((null!==(Be=oe.duration)&&void 0!==Be?Be:0)||540).easing(oe.easing||Ie).fill("both").beforeRemoveClass("ion-page-invisible"),ye&&null!=ae){const Te=(0,x.c)();Te.addElement(ae),Ye.addAnimation(Te)}if(De||0!==Ae.length||0!==Pe.length?(_t.addElement(De),_t.addElement(Pe)):_t.addElement(Le.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),Ye.addAnimation(_t),gt?_t.beforeClearStyles([Ee]).fromTo("transform",`translateX(${ht})`,`translateX(${et})`).fromTo(Ee,.8,1):_t.beforeClearStyles([Ee]).fromTo("transform",`translateX(${ct})`,`translateX(${et})`),De){const Te=Y(De).querySelector(".transition-effect");if(Te){const Je=Te.querySelector(".transition-cover"),Re=Te.querySelector(".transition-shadow"),Fe=(0,x.c)(),St=(0,x.c)(),Ce=(0,x.c)();Fe.addElement(Te).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),St.addElement(Je).beforeClearStyles([Ee]).fromTo(Ee,0,.1),Ce.addElement(Re).beforeClearStyles([Ee]).fromTo(Ee,.03,.7),Fe.addAnimation([St,Ce]),_t.addAnimation([Fe])}}const hn=Le.querySelector("ion-header.header-collapse-condense"),{forward:qt,backward:Ht}=((ae,oe,Be,Ie,Ee)=>{const Ue=Ne(Ie,Be),et=C(Ee),le=C(Ie),ue=Ne(Ee,Be),ct=null!==Ue&&null!==et&&!Be,ht=null!==le&&null!==ue&&Be;if(ct){const Le=et.getBoundingClientRect(),ye=Ue.getBoundingClientRect();_e(ae,oe,Be,et,Le,ye),he(ae,oe,Be,Ue,Le,ye)}else if(ht){const Le=le.getBoundingClientRect(),ye=ue.getBoundingClientRect();_e(ae,oe,Be,le,Le,ye),he(ae,oe,Be,ue,Le,ye)}return{forward:ct,backward:ht}})(Ye,ue,gt,Le,ye);if(Ae.forEach(Te=>{const Je=(0,x.c)();Je.addElement(Te),Ye.addAnimation(Je);const Re=(0,x.c)();Re.addElement(Te.querySelector("ion-title"));const Fe=(0,x.c)(),St=Array.from(Te.querySelectorAll("ion-buttons,[menuToggle]")),Ce=Te.closest("ion-header"),Rt=Ce?.classList.contains("header-collapse-condense-inactive");let Qt;Qt=St.filter(gt?dt=>{const Ot=dt.classList.contains("buttons-collapse");return Ot&&!Rt||!Ot}:dt=>!dt.classList.contains("buttons-collapse")),Fe.addElement(Qt);const Gt=(0,x.c)();Gt.addElement(Te.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])"));const Zt=(0,x.c)();Zt.addElement(Y(Te).querySelector(".toolbar-background"));const Jt=(0,x.c)(),kt=Te.querySelector("ion-back-button");if(kt&&Jt.addElement(kt),Je.addAnimation([Re,Fe,Gt,Zt,Jt]),Fe.fromTo(Ee,.01,1),Gt.fromTo(Ee,.01,1),gt)Rt||Re.fromTo("transform",`translateX(${ht})`,`translateX(${et})`).fromTo(Ee,.01,1),Gt.fromTo("transform",`translateX(${ht})`,`translateX(${et})`),Jt.fromTo(Ee,.01,1);else if(hn||Re.fromTo("transform",`translateX(${ct})`,`translateX(${et})`).fromTo(Ee,.01,1),Gt.fromTo("transform",`translateX(${ct})`,`translateX(${et})`),Zt.beforeClearStyles([Ee,"transform"]),Ce?.translucent?Zt.fromTo("transform",ue?"translateX(-100%)":"translateX(100%)","translateX(0px)"):Zt.fromTo(Ee,.01,"var(--opacity)"),qt||Jt.fromTo(Ee,.01,1),kt&&!qt){const Ot=(0,x.c)();Ot.addElement(Y(kt).querySelector(".button-text")).fromTo("transform",ue?"translateX(-100px)":"translateX(100px)","translateX(0px)"),Je.addAnimation(Ot)}}),ye){const Te=(0,x.c)(),Je=ye.querySelector(":scope > ion-content"),Re=ye.querySelectorAll(":scope > ion-header > ion-toolbar"),Fe=ye.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *");if(Je||0!==Re.length||0!==Fe.length?(Te.addElement(Je),Te.addElement(Fe)):Te.addElement(ye.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),Ye.addAnimation(Te),gt){Te.beforeClearStyles([Ee]).fromTo("transform",`translateX(${et})`,ue?"translateX(-100%)":"translateX(100%)");const St=(0,h.g)(ye);Ye.afterAddWrite(()=>{"normal"===Ye.getDirection()&&St.style.setProperty("display","none")})}else Te.fromTo("transform",`translateX(${et})`,`translateX(${ht})`).fromTo(Ee,1,.8);if(Je){const St=Y(Je).querySelector(".transition-effect");if(St){const Ce=St.querySelector(".transition-cover"),Rt=St.querySelector(".transition-shadow"),Qt=(0,x.c)(),Gt=(0,x.c)(),Zt=(0,x.c)();Qt.addElement(St).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),Gt.addElement(Ce).beforeClearStyles([Ee]).fromTo(Ee,.1,0),Zt.addElement(Rt).beforeClearStyles([Ee]).fromTo(Ee,.7,.03),Qt.addAnimation([Gt,Zt]),Te.addAnimation([Qt])}}Re.forEach(St=>{const Ce=(0,x.c)();Ce.addElement(St);const Rt=(0,x.c)();Rt.addElement(St.querySelector("ion-title"));const Qt=(0,x.c)(),Gt=St.querySelectorAll("ion-buttons,[menuToggle]"),Zt=St.closest("ion-header"),Jt=Zt?.classList.contains("header-collapse-condense-inactive"),kt=Array.from(Gt).filter(ii=>{const gn=ii.classList.contains("buttons-collapse");return gn&&!Jt||!gn});Qt.addElement(kt);const dt=(0,x.c)(),Ot=St.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])");Ot.length>0&&dt.addElement(Ot);const pt=(0,x.c)();pt.addElement(Y(St).querySelector(".toolbar-background"));const Yt=(0,x.c)(),Ut=St.querySelector("ion-back-button");if(Ut&&Yt.addElement(Ut),Ce.addAnimation([Rt,Qt,dt,Yt,pt]),Ye.addAnimation(Ce),Yt.fromTo(Ee,.99,0),Qt.fromTo(Ee,.99,0),dt.fromTo(Ee,.99,0),gt){if(Jt||Rt.fromTo("transform",`translateX(${et})`,ue?"translateX(-100%)":"translateX(100%)").fromTo(Ee,.99,0),dt.fromTo("transform",`translateX(${et})`,ue?"translateX(-100%)":"translateX(100%)"),pt.beforeClearStyles([Ee,"transform"]),Zt?.translucent?pt.fromTo("transform","translateX(0px)",ue?"translateX(-100%)":"translateX(100%)"):pt.fromTo(Ee,"var(--opacity)",0),Ut&&!Ht){const gn=(0,x.c)();gn.addElement(Y(Ut).querySelector(".button-text")).fromTo("transform",`translateX(${et})`,`translateX(${(ue?-124:124)+"px"})`),Ce.addAnimation(gn)}}else Jt||Rt.fromTo("transform",`translateX(${et})`,`translateX(${ht})`).fromTo(Ee,.99,0).afterClearStyles([Ue,Ee]),dt.fromTo("transform",`translateX(${et})`,`translateX(${ht})`).afterClearStyles([Ue,Ee]),Yt.afterClearStyles([Ee]),Rt.afterClearStyles([Ee]),Qt.afterClearStyles([Ee])})}return Ye}catch(Ie){throw Ie}}},1904:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{mdTransitionAnimation:()=>J});var x=k(1774),h=k(1651);k(6225),k(1688);const J=(ie,Y)=>{var C,Ne,me;const ee="back"===Y.direction,oe=Y.leavingEl,Be=(0,h.g)(Y.enteringEl),Ie=Be.querySelector("ion-toolbar"),Ee=(0,x.c)();if(Ee.addElement(Be).fill("both").beforeRemoveClass("ion-page-invisible"),ee?Ee.duration((null!==(C=Y.duration)&&void 0!==C?C:0)||200).easing("cubic-bezier(0.47,0,0.745,0.715)"):Ee.duration((null!==(Ne=Y.duration)&&void 0!==Ne?Ne:0)||280).easing("cubic-bezier(0.36,0.66,0.04,1)").fromTo("transform","translateY(40px)","translateY(0px)").fromTo("opacity",.01,1),Ie){const Ue=(0,x.c)();Ue.addElement(Ie),Ee.addAnimation(Ue)}if(oe&&ee){Ee.duration((null!==(me=Y.duration)&&void 0!==me?me:0)||200).easing("cubic-bezier(0.47,0,0.745,0.715)");const Ue=(0,x.c)();Ue.addElement((0,h.g)(oe)).onFinish(et=>{1===et&&Ue.elements.length>0&&Ue.elements[0].style.setProperty("display","none")}).fromTo("transform","translateY(0px)","translateY(40px)").fromTo("opacity",1,0),Ee.addAnimation(Ue)}return Ee}},4988:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>Ce,G:()=>Rt,a:()=>he,b:()=>_e,c:()=>Be,d:()=>Qt,e:()=>Gt,f:()=>Ye,g:()=>hn,h:()=>Te,i:()=>Re,j:()=>Ee,k:()=>Ue,l:()=>ee,m:()=>ae,n:()=>Ne,o:()=>ue,q:()=>Pe,s:()=>St,t:()=>Ie});var x=k(5861),h=k(2085),y=k(1042),s=k(2124),J=k(839),ie=k(6710);let Y=0,C=0;const Ne=new WeakMap,me=Zt=>({create:Jt=>et(Zt,Jt),dismiss:(Jt,kt,dt)=>gt(document,Jt,kt,Zt,dt),getTop:()=>(0,x.Z)(function*(){return Pe(document,Zt)})()}),he=me("ion-alert"),_e=me("ion-action-sheet"),ee=me("ion-loading"),ae=me("ion-modal"),Be=me("ion-popover"),Ie=me("ion-toast"),Ee=Zt=>{typeof document<"u"&&ye(document);const Jt=Y++;Zt.overlayIndex=Jt},Ue=Zt=>(Zt.hasAttribute("id")||(Zt.id="ion-overlay-"+ ++C),Zt.id),et=(Zt,Jt)=>typeof window<"u"&&typeof window.customElements<"u"?window.customElements.whenDefined(Zt).then(()=>{const kt=document.createElement(Zt);return kt.classList.add("overlay-hidden"),Object.assign(kt,Object.assign(Object.assign({},Jt),{hasController:!0})),qt(document).appendChild(kt),new Promise(dt=>(0,J.c)(kt,dt))}):Promise.resolve(),le='[tabindex]:not([tabindex^="-"]):not([hidden]):not([disabled]), input:not([type=hidden]):not([tabindex^="-"]):not([hidden]):not([disabled]), textarea:not([tabindex^="-"]):not([hidden]):not([disabled]), button:not([tabindex^="-"]):not([hidden]):not([disabled]), select:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable[disabled="false"]:not([tabindex^="-"]):not([hidden])',ue=(Zt,Jt)=>{let kt=Zt.querySelector(le);const dt=kt?.shadowRoot;dt&&(kt=dt.querySelector(le)||kt),kt?(0,J.f)(kt):Jt.focus()},ht=(Zt,Jt)=>{const kt=Array.from(Zt.querySelectorAll(le));let dt=kt.length>0?kt[kt.length-1]:null;const Ot=dt?.shadowRoot;Ot&&(dt=Ot.querySelector(le)||dt),dt?dt.focus():Jt.focus()},ye=Zt=>{0===Y&&(Y=1,Zt.addEventListener("focus",Jt=>{((Zt,Jt)=>{const kt=Pe(Jt,"ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover"),dt=Zt.target;kt&&dt&&!kt.classList.contains("ion-disable-focus-trap")&&(kt.shadowRoot?(()=>{if(kt.contains(dt))kt.lastFocus=dt;else{const Yt=kt.lastFocus;ue(kt,kt),Yt===Jt.activeElement&&ht(kt,kt),kt.lastFocus=Jt.activeElement}})():(()=>{if(kt===dt)kt.lastFocus=void 0;else{const Yt=(0,J.g)(kt);if(!Yt.contains(dt))return;const Ut=Yt.querySelector(".ion-overlay-wrapper");if(!Ut)return;if(Ut.contains(dt)||dt===Yt.querySelector("ion-backdrop"))kt.lastFocus=dt;else{const ii=kt.lastFocus;ue(Ut,kt),ii===Jt.activeElement&&ht(Ut,kt),kt.lastFocus=Jt.activeElement}}})())})(Jt,Zt)},!0),Zt.addEventListener("ionBackButton",Jt=>{const kt=Pe(Zt);kt?.backdropDismiss&&Jt.detail.register(s.OVERLAY_BACK_BUTTON_PRIORITY,()=>kt.dismiss(void 0,Ce))}),Zt.addEventListener("keydown",Jt=>{if("Escape"===Jt.key){const kt=Pe(Zt);kt?.backdropDismiss&&kt.dismiss(void 0,Ce)}}))},gt=(Zt,Jt,kt,dt,Ot)=>{const pt=Pe(Zt,dt,Ot);return pt?pt.dismiss(Jt,kt):Promise.reject("overlay does not exist")},Pe=(Zt,Jt,kt)=>{const dt=((Zt,Jt)=>(void 0===Jt&&(Jt="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(Zt.querySelectorAll(Jt)).filter(kt=>kt.overlayIndex>0)))(Zt,Jt).filter(Ot=>!(Zt=>Zt.classList.contains("overlay-hidden"))(Ot));return void 0===kt?dt[dt.length-1]:dt.find(Ot=>Ot.id===kt)},Ae=(Zt=!1)=>{const kt=qt(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");kt&&(Zt?kt.setAttribute("aria-hidden","true"):kt.removeAttribute("aria-hidden"))},Ye=function(){var Zt=(0,x.Z)(function*(Jt,kt,dt,Ot,pt){var Yt,Ut;if(Jt.presented)return;Ae(!0),Jt.presented=!0,Jt.willPresent.emit(),null===(Yt=Jt.willPresentShorthand)||void 0===Yt||Yt.emit();const ii=(0,h.b)(Jt),gn=Jt.enterAnimation?Jt.enterAnimation:h.c.get(kt,"ios"===ii?dt:Ot);(yield Ht(Jt,gn,Jt.el,pt))&&(Jt.didPresent.emit(),null===(Ut=Jt.didPresentShorthand)||void 0===Ut||Ut.emit()),"ION-TOAST"!==Jt.el.tagName&&_t(Jt.el),Jt.keyboardClose&&(null===document.activeElement||!Jt.el.contains(document.activeElement))&&Jt.el.focus()});return function(kt,dt,Ot,pt,Yt){return Zt.apply(this,arguments)}}(),_t=function(){var Zt=(0,x.Z)(function*(Jt){let kt=document.activeElement;if(!kt)return;const dt=kt?.shadowRoot;dt&&(kt=dt.querySelector(le)||kt),yield Jt.onDidDismiss(),kt.focus()});return function(kt){return Zt.apply(this,arguments)}}(),hn=function(){var Zt=(0,x.Z)(function*(Jt,kt,dt,Ot,pt,Yt,Ut){var ii,gn;if(!Jt.presented)return!1;Ae(!1),Jt.presented=!1;try{Jt.el.style.setProperty("pointer-events","none"),Jt.willDismiss.emit({data:kt,role:dt}),null===(ii=Jt.willDismissShorthand)||void 0===ii||ii.emit({data:kt,role:dt});const Ft=(0,h.b)(Jt),Jn=Jt.leaveAnimation?Jt.leaveAnimation:h.c.get(Ot,"ios"===Ft?pt:Yt);dt!==Rt&&(yield Ht(Jt,Jn,Jt.el,Ut)),Jt.didDismiss.emit({data:kt,role:dt}),null===(gn=Jt.didDismissShorthand)||void 0===gn||gn.emit({data:kt,role:dt}),Ne.delete(Jt),Jt.el.classList.add("overlay-hidden"),Jt.el.style.removeProperty("pointer-events"),void 0!==Jt.el.lastFocus&&(Jt.el.lastFocus=void 0)}catch(Ft){console.error(Ft)}return Jt.el.remove(),!0});return function(kt,dt,Ot,pt,Yt,Ut,ii){return Zt.apply(this,arguments)}}(),qt=Zt=>Zt.querySelector("ion-app")||Zt.body,Ht=function(){var Zt=(0,x.Z)(function*(Jt,kt,dt,Ot){dt.classList.remove("overlay-hidden");const Yt=kt(Jt.el,Ot);(!Jt.animated||!h.c.getBoolean("animated",!0))&&Yt.duration(0),Jt.keyboardClose&&Yt.beforeAddWrite(()=>{const ii=dt.ownerDocument.activeElement;ii?.matches("input,ion-input, ion-textarea")&&ii.blur()});const Ut=Ne.get(Jt)||[];return Ne.set(Jt,[...Ut,Yt]),yield Yt.play(),!0});return function(kt,dt,Ot,pt){return Zt.apply(this,arguments)}}(),Te=(Zt,Jt)=>{let kt;const dt=new Promise(Ot=>kt=Ot);return Je(Zt,Jt,Ot=>{kt(Ot.detail)}),dt},Je=(Zt,Jt,kt)=>{const dt=Ot=>{(0,J.b)(Zt,Jt,dt),kt(Ot)};(0,J.a)(Zt,Jt,dt)},Re=Zt=>"cancel"===Zt||Zt===Ce,Fe=Zt=>Zt(),St=(Zt,Jt)=>{if("function"==typeof Zt)return h.c.get("_zoneGate",Fe)(()=>{try{return Zt(Jt)}catch(dt){throw dt}})},Ce="backdrop",Rt="gesture",Qt=Zt=>{let kt,Jt=!1;const dt=(0,y.C)(),Ot=(Ut=!1)=>{if(kt&&!Ut)return{delegate:kt,inline:Jt};const{el:ii,hasController:gn,delegate:Ft}=Zt;return Jt=null!==ii.parentNode&&!gn,kt=Jt?Ft||dt:Ft,{inline:Jt,delegate:kt}};return{attachViewToDom:function(){var Ut=(0,x.Z)(function*(ii){const{delegate:gn}=Ot(!0);if(gn)return yield gn.attachViewToDom(Zt.el,ii);const{hasController:Ft}=Zt;if(Ft&&void 0!==ii)throw new Error("framework delegate is missing");return null});return function(gn){return Ut.apply(this,arguments)}}(),removeViewFromDom:()=>{const{delegate:Ut}=Ot();Ut&&void 0!==Zt.el&&Ut.removeViewFromDom(Zt.el.parentElement,Zt.el)}}},Gt=()=>{let Zt;const Jt=()=>{Zt&&(Zt(),Zt=void 0)};return{addClickListener:(dt,Ot)=>{Jt();const pt=void 0!==Ot?document.getElementById(Ot):null;pt?Zt=((Ut,ii)=>{const gn=()=>{ii.present()};return Ut.addEventListener("click",gn),()=>{Ut.removeEventListener("click",gn)}})(pt,dt):(0,ie.p)(`A trigger element with the ID "${Ot}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on an overlay component.`,dt)},removeClickListener:Jt}}},1163:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>ee});var x=k(1180),h=k(2029),y=k(866),s=k(6814),J=k(9843);function ie(ae,oe){if(1&ae&&(h.TgZ(0,"ion-badge",7),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.Quantity," x")}}function Y(ae,oe){if(1&ae&&(h.TgZ(0,"strong"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.PowerKW," kW ")}}function C(ae,oe){if(1&ae&&(h.TgZ(0,"div"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",null==Be.CurrentType?null:Be.CurrentType.Title," ")}}function Ne(ae,oe){if(1&ae&&(h.TgZ(0,"span"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.Amps,"A ")}}function me(ae,oe){if(1&ae&&(h.TgZ(0,"span"),h._uU(1),h.qZA()),2&ae){const Be=h.oxw().$implicit;h.xp6(1),h.hij("",Be.Voltage,"V ")}}function he(ae,oe){if(1&ae){const Be=h.EpF();h.TgZ(0,"ion-col")(1,"ion-button",8),h.NdJ("click",function(){h.CHM(Be);const Ee=h.oxw().$implicit,Ue=h.oxw();return h.KtG(Ue.editConnection(Ee))}),h._UZ(2,"ion-icon",9),h.qZA(),h._UZ(3,"br"),h.TgZ(4,"ion-button",10),h.NdJ("click",function(){h.CHM(Be);const Ee=h.oxw().$implicit,Ue=h.oxw();return h.KtG(Ue.deleteConnection(Ee))}),h._UZ(5,"ion-icon",11),h.qZA()()}}function _e(ae,oe){if(1&ae&&(h.TgZ(0,"ion-row")(1,"ion-col")(2,"ion-row")(3,"ion-col",1),h._UZ(4,"img",2),h.YNc(5,ie,2,1,"ion-badge",3),h.TgZ(6,"div",4),h._uU(7),h.qZA()(),h.TgZ(8,"ion-col")(9,"ion-row")(10,"ion-col")(11,"ion-note")(12,"div")(13,"strong",5),h._uU(14),h.qZA()(),h.YNc(15,Y,2,1,"strong",6),h.YNc(16,C,2,1,"div",6),h.qZA(),h.TgZ(17,"ion-note"),h.YNc(18,Ne,2,1,"span",6),h.YNc(19,me,2,1,"span",6),h.qZA()()(),h.TgZ(20,"ion-row")(21,"ion-col",4),h._uU(22),h.qZA(),h.TgZ(23,"ion-col",4),h._uU(24),h.qZA()()(),h.YNc(25,he,6,0,"ion-col",6),h.qZA()()()),2&ae){const Be=oe.$implicit,Ie=h.oxw();h.xp6(4),h.Q6J("src",Ie.getConnectorTypeIcon(Be.ConnectionTypeID),h.LSH),h.xp6(1),h.Q6J("ngIf",Be.Quantity),h.xp6(2),h.Oqu(null==Be.StatusType?null:Be.StatusType.Title),h.xp6(6),h.s9C("title",null==Be.ConnectionType?null:Be.ConnectionType.FormalName),h.xp6(1),h.hij("",null==Be.ConnectionType?null:Be.ConnectionType.Title," "),h.xp6(1),h.Q6J("ngIf",Be.PowerKW),h.xp6(1),h.Q6J("ngIf",Be.CurrentTypeID),h.xp6(2),h.Q6J("ngIf",Be.Amps),h.xp6(1),h.Q6J("ngIf",Be.Voltage),h.xp6(3),h.Oqu(Be.Reference),h.xp6(2),h.Oqu(Be.Comments),h.xp6(1),h.Q6J("ngIf",Ie.enableEdit)}}let ee=(()=>{var ae;class oe{constructor(){(0,x.Z)(this,"item",void 0),(0,x.Z)(this,"enableEdit",!1),(0,x.Z)(this,"onEdit",new h.vpe),(0,x.Z)(this,"onDelete",new h.vpe)}ngOnInit(){}editConnection(Ie){this.onEdit.emit(Ie)}deleteConnection(Ie){this.onDelete.emit(Ie)}getConnectorTypeIcon(Ie){return y.c.getIconForConnector(Ie)}}return ae=oe,(0,x.Z)(oe,"\u0275fac",function(Ie){return new(Ie||ae)}),(0,x.Z)(oe,"\u0275cmp",h.Xpm({type:ae,selectors:[["app-equipment-details"]],inputs:{item:"item",enableEdit:"enableEdit"},outputs:{onEdit:"onEdit",onDelete:"onDelete"},decls:2,vars:1,consts:[[4,"ngFor","ngForOf"],["size","3"],[2,"max-width","64px",3,"src"],["color","primary",4,"ngIf"],[1,"info"],[3,"title"],[4,"ngIf"],["color","primary"],["size","small","color","secondary",3,"click"],["name","create","slot","icon-only"],["size","small","color","danger",3,"click"],["name","trash","slot","icon-only"]],template:function(Ie,Ee){1&Ie&&(h.TgZ(0,"ion-grid"),h.YNc(1,_e,26,12,"ion-row",0),h.qZA()),2&Ie&&(h.xp6(1),h.Q6J("ngForOf",Ee.item.Connections))},dependencies:[s.sg,s.O5,J.yp,J.YG,J.wI,J.jY,J.gu,J.uN,J.Nd]})),oe})()},6086:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>Ie});var x=k(5861),h=k(1180),y=k(2029),s=k(9159),J=k(6814),ie=k(9843),Y=k(6223);function C(Ee,Ue){if(1&Ee&&(y.TgZ(0,"ion-select-option",5),y._uU(1),y.qZA()),2&Ee){const et=Ue.$implicit;y.Q6J("value",et.ID),y.xp6(1),y.Oqu(et.Title)}}function Ne(Ee,Ue){1&Ee&&(y.TgZ(0,"ion-select-option",6),y._uU(1,"Other..."),y.qZA())}function me(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-item")(1,"ion-label",1),y._uU(2,"Network Operator"),y.qZA(),y.TgZ(3,"ion-select",2),y.NdJ("ngModelChange",function(ue){y.CHM(et);const ct=y.oxw();return y.KtG(ct.operatorId=ue)})("ionChange",function(){y.CHM(et);const ue=y.oxw();return y.KtG(ue.onOperatorChange())}),y.YNc(4,C,2,2,"ion-select-option",3),y.YNc(5,Ne,2,0,"ion-select-option",4),y.qZA()()}if(2&Ee){const et=y.oxw();y.xp6(3),y.Q6J("ngModel",et.operatorId),y.xp6(1),y.Q6J("ngForOf",et.operators),y.xp6(1),y.Q6J("ngIf",et.useFilteredOperators)}}function he(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-item")(1,"ion-label"),y._uU(2,"Network Operator"),y.qZA(),y.TgZ(3,"ion-searchbar",7),y.NdJ("ionCancel",function(){y.CHM(et);const ue=y.oxw();return y.KtG(ue.cancelOperatorLookup())})("ngModelChange",function(ue){y.CHM(et);const ct=y.oxw();return y.KtG(ct.operatorSearchKeyword=ue)})("ionInput",function(ue){y.CHM(et);const ct=y.oxw();return y.KtG(ct.searchOperators(ue))}),y.qZA()()}if(2&Ee){const et=y.oxw();y.xp6(3),y.Q6J("ngModel",et.operatorSearchKeyword)}}function _e(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-item",9),y.NdJ("click",function(){const ct=y.CHM(et).$implicit,ht=y.oxw(2);return y.KtG(ht.onOperatorChange(ct))}),y.TgZ(1,"ion-avatar",10),y._UZ(2,"ion-icon",11),y.qZA(),y.TgZ(3,"ion-label")(4,"p"),y._uU(5),y.qZA(),y.TgZ(6,"p"),y._uU(7),y.qZA()()()}if(2&Ee){const et=Ue.$implicit;y.xp6(5),y.Oqu(et.Title),y.xp6(2),y.Oqu(et.WebsiteURL)}}function ee(Ee,Ue){if(1&Ee&&(y.ynx(0),y.TgZ(1,"ion-list"),y.YNc(2,_e,8,2,"ion-item",8),y.qZA(),y.BQk()),2&Ee){const et=y.oxw();y.xp6(2),y.Q6J("ngForOf",et.operatorSearchResults)}}function ae(Ee,Ue){if(1&Ee){const et=y.EpF();y.ynx(0),y.TgZ(1,"ion-item")(2,"ion-avatar",10),y._UZ(3,"ion-icon",12),y.qZA(),y.TgZ(4,"ion-label")(5,"p"),y._uU(6),y.qZA(),y.TgZ(7,"p"),y._uU(8),y.qZA(),y.TgZ(9,"ion-button",9),y.NdJ("click",function(){y.CHM(et);const ue=y.oxw();return y.KtG(ue.selectedOperator=null)}),y._uU(10,"Change"),y.qZA()()(),y.BQk()}if(2&Ee){const et=y.oxw();y.xp6(6),y.Oqu(et.selectedOperator.Title),y.xp6(2),y.Oqu(et.selectedOperator.WebsiteURL)}}function oe(Ee,Ue){if(1&Ee){const et=y.EpF();y.TgZ(0,"ion-chip")(1,"ion-label"),y._uU(2),y.qZA(),y.TgZ(3,"ion-icon",14),y.NdJ("click",function(){const ct=y.CHM(et).$implicit,ht=y.oxw(2);return y.KtG(ht.removeOperator(ct))}),y.qZA()()}if(2&Ee){const et=Ue.$implicit,le=y.oxw(2);y.xp6(2),y.Oqu(le.getOperatorInfo(et).Title)}}function Be(Ee,Ue){if(1&Ee&&(y.ynx(0),y.YNc(1,oe,4,1,"ion-chip",13),y.BQk()),2&Ee){const et=y.oxw();y.xp6(1),y.Q6J("ngForOf",et.operatorList)}}let Ie=(()=>{var Ee;class Ue{get operators(){return this.referenceDataManager.getNetworkOperators(this.useFilteredOperators)}constructor(le,ue){(0,h.Z)(this,"referenceDataManager",void 0),(0,h.Z)(this,"changeDetector",void 0),(0,h.Z)(this,"operatorId",null),(0,h.Z)(this,"operatorList",null),(0,h.Z)(this,"mode","single"),(0,h.Z)(this,"useFilteredOperators",null),(0,h.Z)(this,"operatorChanged",new y.vpe),(0,h.Z)(this,"operatorRemoved",new y.vpe),(0,h.Z)(this,"operatorCache",[]),(0,h.Z)(this,"operatorSearchResults",[]),(0,h.Z)(this,"operatorSearchKeyword",""),(0,h.Z)(this,"selectedOperator",null),this.referenceDataManager=le,this.changeDetector=ue}ngOnInit(){this.operatorCache=this.referenceDataManager.getNetworkOperators(!1),null!=this.operatorId&&(this.selectedOperator=this.operatorCache.find(le=>le.ID==this.operatorId))}searchOperators(){this.operatorSearchResults=[],0!=this.operatorSearchKeyword.length&&(this.operatorSearchResults=this.operatorCache?this.operatorCache.filter(le=>le.Title.toLowerCase().startsWith(this.operatorSearchKeyword.toLowerCase())||le.Title.toLowerCase().startsWith("("+this.operatorSearchKeyword.toLowerCase())).slice(0,10):[])}getOperatorInfo(le){if(this.operatorCache)return this.operatorCache.find(ue=>ue.ID==le)}onOperatorChange(le=null){var ue=this;return(0,x.Z)(function*(){null==le&&ue.operatorId&&(le=ue.operatorCache.find(ct=>ct.ID==ue.operatorId)),null!=le&&(ue.operatorSearchResults=[],ue.selectedOperator=le,ue.operatorId=le.ID),ue.operatorId?(ue.operatorChanged.emit(ue.selectedOperator),"single"!=ue.mode&&(ue.selectedOperator=null,ue.operatorSearchKeyword="")):ue.useFilteredOperators=!1})()}removeOperator(le){var ue=this;return(0,x.Z)(function*(){ue.operatorId=null,ue.operatorRemoved.emit(le)})()}cancelOperatorLookup(){this.selectedOperator=null}}return Ee=Ue,(0,h.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(y.Y36(s.W),y.Y36(y.sBO))}),(0,h.Z)(Ue,"\u0275cmp",y.Xpm({type:Ee,selectors:[["app-operator-lookup"]],inputs:{operatorId:"operatorId",operatorList:"operatorList",mode:"mode",useFilteredOperators:"useFilteredOperators"},outputs:{operatorChanged:"operatorChanged",operatorRemoved:"operatorRemoved"},decls:5,vars:5,consts:[[4,"ngIf"],["position","floating"],[3,"ngModel","ngModelChange","ionChange"],[3,"value",4,"ngFor","ngForOf"],["value","",4,"ngIf"],[3,"value"],["value",""],["placeholder","Search by network name (in any country)","showCancelButton","focus","autocomplete","on",3,"ngModel","ionCancel","ngModelChange","ionInput"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["item-left",""],["name","card"],["name","locate"],[4,"ngFor","ngForOf"],["name","close-circle",3,"click"]],template:function(le,ue){1&le&&(y.YNc(0,me,6,3,"ion-item",0),y.YNc(1,he,4,1,"ion-item",0),y.YNc(2,ee,3,1,"ng-container",0),y.YNc(3,ae,11,2,"ng-container",0),y.YNc(4,Be,2,1,"ng-container",0)),2&le&&(y.Q6J("ngIf",ue.useFilteredOperators&&!ue.selectedOperator),y.xp6(1),y.Q6J("ngIf",!ue.useFilteredOperators&&!ue.selectedOperator),y.xp6(1),y.Q6J("ngIf",ue.operatorSearchResults.length>0),y.xp6(1),y.Q6J("ngIf",null!=ue.selectedOperator),y.xp6(1),y.Q6J("ngIf",(null==ue.operatorList?null:ue.operatorList.length)>0))},dependencies:[J.sg,J.O5,ie.BJ,ie.YG,ie.hM,ie.gu,ie.Ie,ie.Q$,ie.q_,ie.VI,ie.t9,ie.n0,ie.QI,ie.j9,Y.JJ,Y.On]})),Ue})()},5460:(Nn,yt,k)=>{"use strict";k.d(yt,{v:()=>ee});var x=k(5861),h=k(1180),y=k(9127),s=k(2029),J=k(9903),ie=k(9843),Y=k(9862),C=k(5957),Ne=k(6814);function me(ae,oe){1&ae&&(s.TgZ(0,"div"),s._UZ(1,"ion-spinner"),s.qZA())}function he(ae,oe){if(1&ae){const Be=s.EpF();s.TgZ(0,"ion-item",5),s.NdJ("click",function(){const Ue=s.CHM(Be).$implicit,et=s.oxw(2);return s.KtG(et.placeSelected(Ue))}),s.TgZ(1,"ion-avatar",6),s._UZ(2,"ion-icon",7),s.qZA(),s.TgZ(3,"ion-label")(4,"p"),s._uU(5),s.qZA()()()}if(2&ae){const Be=oe.$implicit;s.xp6(5),s.Oqu(Be.Address)}}function _e(ae,oe){if(1&ae&&(s.TgZ(0,"div",1),s.YNc(1,me,2,0,"div",2),s.TgZ(2,"ion-list"),s.YNc(3,he,6,1,"ion-item",3),s.TgZ(4,"ion-item")(5,"p",4),s._uU(6),s.qZA()()()()),2&ae){const Be=s.oxw();s.xp6(1),s.Q6J("ngIf",Be.searchInProgress),s.xp6(2),s.Q6J("ngForOf",Be.placeList),s.xp6(3),s.hij(" ",Be.placeAttribution," ")}}let ee=(()=>{var ae;class oe{constructor(Ie,Ee,Ue,et,le){(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"changeDetector",void 0),(0,h.Z)(this,"platform",void 0),(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"placeSearchType",void 0),(0,h.Z)(this,"placeList",void 0),(0,h.Z)(this,"searchInProgress",!1),(0,h.Z)(this,"searchKeyword",void 0),(0,h.Z)(this,"placeSearchFocused",void 0),(0,h.Z)(this,"placeSearchActive",!1),(0,h.Z)(this,"placeAttribution",""),(0,h.Z)(this,"selectedPlace",void 0),(0,h.Z)(this,"placeChanged",new s.vpe),(0,h.Z)(this,"mapService",void 0),this.logging=Ie,this.changeDetector=Ee,this.platform=Ue,this.http=et,this.events=le,this.searchKeyword="",this.searchInProgress=!1,this.mapService=new J.k(le,Ie,et)}ngOnInit(){var Ie=this;return(0,x.Z)(function*(){yield Ie.platform.ready(),Ie.mapService.initAPI()})()}onSearchFocus(){this.placeSearchFocused=!0}onSearchBlur(){this.placeSearchFocused=!1}onSearchCancel(){}getPlacesAutoComplete(Ie,Ee){var Ue=this;return(0,x.Z)(function*(){Ue.placeSearchType=Ee;let et=Ie.target.value;if(et&&et.length>3){Ue.logging.log("Starting place lookup for:"+et),Ue.placeSearchActive=!0,Ue.searchInProgress=!0,Ue.searchInProgress=!1,Ue.placeSearchActive=!0;try{Ue.placeList=yield Ue.mapService.placeSearch(et),Ue.placeList&&Ue.placeList.length>0&&(Ue.placeAttribution=Ue.placeList[0].Attribution)}catch{}Ue.searchInProgress=!1,Ue.placeSearchActive=!0}else Ue.searchInProgress=!1,Ue.placeSearchActive=!1})()}placeSelected(Ie){this.logging.log("Looking up place details:"+Ie.Title+"::"+Ie.ReferenceID),this.selectedPlace=Ie,this.placeChanged.emit(Ie),this.placeSearchActive=!1}}return ae=oe,(0,h.Z)(oe,"\u0275fac",function(Ie){return new(Ie||ae)(s.Y36(y.z),s.Y36(s.sBO),s.Y36(ie.t4),s.Y36(Y.eN),s.Y36(C.z))}),(0,h.Z)(oe,"\u0275cmp",s.Xpm({type:ae,selectors:[["place-search"]],inputs:{searchKeyword:"searchKeyword"},outputs:{selectedPlace:"selectedPlace",placeChanged:"placeChanged"},decls:1,vars:1,consts:[["class","place-search",4,"ngIf"],[1,"place-search"],[4,"ngIf"],[3,"click",4,"ngFor","ngForOf"],[1,"place-attribution"],[3,"click"],["item-left",""],["name","locate"]],template:function(Ie,Ee){1&Ie&&s.YNc(0,_e,7,3,"div",0),2&Ie&&s.Q6J("ngIf",Ee.placeSearchActive)},dependencies:[Ne.sg,Ne.O5,ie.BJ,ie.gu,ie.Ie,ie.Q$,ie.q_,ie.PQ],styles:[".place-search[_ngcontent-%COMP%]{position:absolute;z-index:1000}.place-attribution[_ngcontent-%COMP%]{font-size:9px;color:#dcdcdc;max-width:100%}"]})),oe})()},8696:(Nn,yt,k)=>{"use strict";k.d(yt,{o:()=>Ne});var x=k(1180),h=k(2029),y=k(866),s=k(6814),J=k(9843);function ie(me,he){if(1&me){const _e=h.EpF();h.TgZ(0,"ion-button",5),h.NdJ("click",function(){h.CHM(_e);const ae=h.oxw().$implicit,oe=h.oxw();return h.KtG(oe.onCopyCommand(ae))}),h._uU(1,"Copy"),h.qZA()}}function Y(me,he){if(1&me){const _e=h.EpF();h.TgZ(0,"ion-button",5),h.NdJ("click",function(){h.CHM(_e);const ae=h.oxw().$implicit,oe=h.oxw();return h.KtG(oe.onEditCommand(ae))}),h._uU(1,"Edit"),h.qZA()}}function C(me,he){if(1&me&&(h.TgZ(0,"ion-item",1)(1,"ion-grid")(2,"ion-row")(3,"ion-col"),h._uU(4),h.qZA()(),h.TgZ(5,"ion-row")(6,"ion-col",2)(7,"p"),h._UZ(8,"img",3),h.qZA(),h.TgZ(9,"ion-note"),h._uU(10),h.qZA(),h.YNc(11,ie,2,0,"ion-button",4),h.YNc(12,Y,2,0,"ion-button",4),h.qZA(),h.TgZ(13,"ion-col")(14,"ion-row")(15,"ion-col")(16,"p"),h._uU(17),h.qZA(),h.TgZ(18,"ion-note"),h._uU(19),h.qZA()()(),h.TgZ(20,"ion-row")(21,"ion-col"),h._uU(22),h.qZA(),h.TgZ(23,"ion-col"),h._uU(24),h.qZA()()()()()()),2&me){const _e=he.$implicit,ee=h.oxw();h.xp6(4),h.hij(" ",_e.AddressInfo.Title," "),h.xp6(4),h.Q6J("src",ee.getIconForPOI(_e),h.LSH),h.xp6(2),h.hij(" ",ee.getFormattedDistance(_e)," "),h.xp6(1),h.Q6J("ngIf",ee.enableCopyOption),h.xp6(1),h.Q6J("ngIf",ee.enableEditOption),h.xp6(5),h.hij(" ",ee.getFormattedAddress(_e)," "),h.xp6(2),h.hij(" ",ee.getFormattedConnectorList(_e)," "),h.xp6(3),h.hij(" ",null==_e.UsageType?null:_e.UsageType.Title," "),h.xp6(2),h.hij(" ",null==_e.OperatorInfo?null:_e.OperatorInfo.Title," ")}}let Ne=(()=>{var me;class he{constructor(){(0,x.Z)(this,"enableCopyOption",!1),(0,x.Z)(this,"enableEditOption",!1),(0,x.Z)(this,"poiList",[]),(0,x.Z)(this,"onCopy",new h.vpe),(0,x.Z)(this,"onEdit",new h.vpe)}ngOnInit(){}onCopyCommand(ee){this.onCopy.emit(ee)}onEditCommand(ee){this.onEdit.emit(ee)}getFormattedAddress(ee){let ae="";return ae+=ee.AddressInfo.Title!=ee.AddressInfo.AddressLine1?ee.AddressInfo.Title:ee.AddressInfo.Town,ae}getFormattedConnectorList(ee){if(!ee.Connections)return;let ae=[];for(let oe of ee.Connections)null!=oe.ConnectionType&&(ae.find(Be=>Be==oe.ConnectionType.Title)||ae.push(oe.ConnectionType.Title));return ae.join(", ")}getIconForPOI(ee){return y.c.getIconForPOI(ee)}getFormattedDistance(ee){return y.c.getFormattedDistance(ee)}}return me=he,(0,x.Z)(he,"\u0275fac",function(ee){return new(ee||me)}),(0,x.Z)(he,"\u0275cmp",h.Xpm({type:me,selectors:[["app-poi-list"]],inputs:{enableCopyOption:"enableCopyOption",enableEditOption:"enableEditOption",poiList:"poiList"},outputs:{onCopy:"onCopy",onEdit:"onEdit"},decls:2,vars:1,consts:[["style","max-width:400px;",4,"ngFor","ngForOf"],[2,"max-width","400px"],["size","3"],[2,"width","24px",3,"src"],["size","small",3,"click",4,"ngIf"],["size","small",3,"click"]],template:function(ee,ae){1&ee&&(h.TgZ(0,"ion-list"),h.YNc(1,C,25,9,"ion-item",0),h.qZA()),2&ee&&(h.xp6(1),h.Q6J("ngForOf",ae.poiList))},dependencies:[s.sg,s.O5,J.YG,J.wI,J.jY,J.Ie,J.q_,J.uN,J.Nd]})),he})()},5086:(Nn,yt,k)=>{"use strict";k.d(yt,{e:()=>Y});var x=k(1180),h=k(6814),y=k(9843),s=k(6223),J=k(3999),ie=k(2029);let Y=(()=>{var C;class Ne{}return C=Ne,(0,x.Z)(Ne,"\u0275fac",function(he){return new(he||C)}),(0,x.Z)(Ne,"\u0275mod",ie.oAB({type:C})),(0,x.Z)(Ne,"\u0275inj",ie.cJS({providers:[h.JJ],imports:[h.ez,y.Pc,s.u5,J.aw]})),Ne})()},7777:(Nn,yt,k)=>{"use strict";k.d(yt,{X:()=>y});var x=k(1180),h=k(553);class y{constructor(){(0,x.Z)(this,"baseURL",void 0),(0,x.Z)(this,"loginProviderRedirectBaseURL",void 0),(0,x.Z)(this,"loginProviderRedirectURL",void 0),(0,x.Z)(this,"enableLiveMapQuerying",void 0),(0,x.Z)(this,"googleMapsAPIKey",void 0),(0,x.Z)(this,"enableStaticMaps",void 0),this.baseURL="https://map.openchargemap.io",this.loginProviderRedirectBaseURL="https://openchargemap.org/site/loginprovider/?_mode=silent&_forceLogin=true&_redirectURL=",this.loginProviderRedirectURL=this.loginProviderRedirectBaseURL+this.baseURL,this.enableLiveMapQuerying=!0,this.googleMapsAPIKey=h.N.googleMapsKey,this.enableStaticMaps=h.N.enableStaticMaps}}},866:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>y});var x=k(1180),h=k(553);let y=(()=>{class s{static isFeatureEnabled(ie){return!!h.N.enabledFeatures.find(Y=>Y===ie)}static getClientHeight(){const ie=document.body,Y=document.documentElement;return Math.max(ie.scrollHeight,ie.offsetHeight,Y.clientHeight,Y.scrollHeight,Y.offsetHeight)}static getClientWidth(){const ie=document.body,Y=document.documentElement;return Math.max(ie.scrollWidth,ie.offsetWidth,Y.clientWidth,Y.scrollWidth,Y.offsetWidth)}static getMaxLevelOfPOI(ie){let Y=0;if(null!=ie.Connections)for(let C=0;CY&&(Y=ie.Connections[C].Level.ID);return 4===Y&&(Y=2),Y>4&&(Y=3),Y}static getIconForPOI(ie){let C="assets/images/icons/map/level"+s.getMaxLevelOfPOI(ie);return null!=ie.UsageType&&ie.UsageType.Title.indexOf("Private")>-1?C+="_private":C+=null!=ie.StatusType&&!0!==ie.StatusType.IsOperational?"_nonoperational":"_operational",C+="_icon.png",C}static getColorForPOI(ie){const Y=s.getMaxLevelOfPOI(ie);let C="#c0c0c0";return null!=ie.UsageType&&ie.UsageType.Title.indexOf("Private")>-1?C="#FF0000":null!=ie.StatusType&&!0!==ie.StatusType.IsOperational?C="#a0a0a0":2==Y?C="#72EB0D":3==Y&&(C="#EB800D"),C}static getIconForConnector(ie){let Y="assets/images/icons/connectors/";return Y+=1===ie?"Type1_J1772.svg":2===ie?"Chademo_type4.svg":25===ie?"Type2_socket.svg":32===ie?"Type1_CCS.svg":33===ie?"Type2_CCS.svg":1036===ie?"Type2_tethered.svg":26===ie?"Type3c.svg":28===ie?"schuko.svg":"Unknown.svg",Y}static getFormattedDistance(ie){return ie&&ie.AddressInfo&&ie.AddressInfo.Distance?ie.AddressInfo.Distance.toFixed(1)+" "+(1===ie.AddressInfo.DistanceUnit?"km":"miles"):""}static fixJSONDate(ie){if(null==ie)return null;if(0==ie.indexOf("/")){let C=/Date\(([^)]+)\)/.exec(ie);ie=new Date(parseFloat(C[1]))}else ie=new Date(ie);return ie}static formatMapLinkFromPosition(ie,Y,C,Ne,me){return'Map ('+Math.ceil(Ne)+" "+me+")"}static formatSystemWebLink(ie,Y){return""+Y+""}static formatMapLink(ie,Y,C){return C?device&&"WinCE"==device.platform?this.formatSystemWebLink("maps:"+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude,Y):device&&"iOS"===device.platform?this.formatSystemWebLink("https://maps.apple.com/?q="+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude,Y):this.formatSystemWebLink("https://maps.google.com/maps?q="+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude,Y):''+Y+""}static formatURL(ie,Y=null){return null==ie||""==ie?"":(-1==ie.indexOf("http")&&(ie="https://"+ie),''+(Y??ie)+"")}static formatString(ie){return null==ie?"":ie.toString()}static formatTextField(ie,Y=null,C=!1,Ne=!1,me=null){if(null==ie||""==ie||null==ie)return"";let he=(null!=Y?""+Y+": ":"")+(C?"
":"")+ie.toString().replace("\n","
")+"
";return 1==Ne&&(he="

"+he+"

"),he}static formatEmailAddress(ie){return null!=ie&&null!=ie&&""!=ie?" '+ie+"
":""}static formatPhone(ie,Y=null){return null!=ie&&null!=ie&&""!=ie?(null==Y?Y=" ":Y+=": ",Y+''+ie+"
"):""}static formatPOIDetails(ie,Y){let Ne=new Date;null==Y&&(Y=!1);let me=this.formatPOIAddress(ie,!1),he="";he+=this.formatPhone(ie.AddressInfo.ContactTelephone1),he+=this.formatPhone(ie.AddressInfo.ContactTelephone2),he+=this.formatEmailAddress(ie.AddressInfo.ContactEmail);let _e="";if(null!=ie.AddressInfo.Distance){let Ee="https://maps.google.com/maps?saddr=&daddr="+ie.AddressInfo.Latitude+","+ie.AddressInfo.Longitude;_e+="Distance: "+ie.AddressInfo.Distance.toFixed(1)+" "+(2==ie.AddressInfo.DistanceUnit?"Miles":"KM")+"",_e+="

"+this.formatSystemWebLink(Ee,"Get Directions")+"

"}if(null!=ie.AddressInfo.RelatedURL&&""!=ie.AddressInfo.RelatedURL){let Ee=ie.AddressInfo.RelatedURL;Ee=Ee.replace(/.*?:\/\//g,""),Ee.length>40&&(Ee=Ee.substr(0,40)+".."),he+=" "+this.formatSystemWebLink(ie.AddressInfo.RelatedURL,""+Ee+"")}he+="

";const ee=this.formatTextField(ie.GeneralComments,null,!1,!0)+this.formatTextField(ie.AddressInfo.AccessComments,"Access",!0,!0,"details.accessComments");let ae="";null!=ie.NumberOfPoints&&(ae+=this.formatTextField(ie.NumberOfPoints,"Bays",!1,!0,"details.numberOfPoints")),null!=ie.UsageType&&(ae+=this.formatTextField(ie.UsageType.Title,"Usage",!1,!0,"details.usageType")),null!=ie.UsageCost&&(ae+=this.formatTextField(ie.UsageCost,"Usage Cost",!1,!0,"details.usageCost")),null!=ie.OperatorInfo&&1!=ie.OperatorInfo.ID&&(ae+=this.formatTextField(ie.OperatorInfo.Title,"Operator",!1,!0,"details.operatorTitle"),null!=ie.OperatorInfo.WebsiteURL&&(ae+=this.formatTextField(this.formatURL(ie.OperatorInfo.WebsiteURL),"Operator Website",!0,!0,"details.operatorWebsite")));let oe="";if(null!=ie.StatusType&&(oe+=this.formatTextField(ie.StatusType.Title,"Status",!1,!0,"details.operationalStatus"),null!=ie.DateLastStatusUpdate&&(oe+=this.formatTextField(Math.round((Ne-this.fixJSONDate(ie.DateLastStatusUpdate))/864e5)+" days ago","Last Updated",!1,!0,"details.lastUpdated"))),null!=ie.Connections&&ie.Connections.length>0){oe+="",oe+="";for(let Ee=0;Ee"}oe+="
ConnectionPower LevelStatus
"+(null!=Ue.ConnectionType?Ue.ConnectionType.Title:"")+""+(null!=Ue.Level?""+Ue.Level.Title+"
":"")+(null!=Ue.Amps?this.formatString(Ue.Amps)+"A/ ":"")+(null!=Ue.Voltage?this.formatString(Ue.Voltage)+"V/ ":"")+(null!=Ue.PowerKW?this.formatString(Ue.PowerKW)+"kW
":"")+(null!=Ue.CurrentType?Ue.CurrentType.Title:"")+"
"+(null!=Ue.Quantity?this.formatString(Ue.Quantity):"1")+" Present
"+(null!=Ue.StatusType?Ue.StatusType.Title:"-")+"
"}let Be="";return Be+=this.formatTextField("OCM-"+ie.ID+"","OpenChargeMap Ref",!1,!0,"details.refNumber"),null!=ie.DataProvider&&(Be+=this.formatTextField(ie.DataProvider.Title,"Data Provider",!1,!0,"details.dataProviderTitle"),null!=ie.DataProvider.WebsiteURL&&(Be+=this.formatTextField(this.formatURL(ie.DataProvider.WebsiteURL),"Website",!1,!0,"details.dataProviderWebsite")),Be+=this.formatTextField(ie.AddressInfo.Latitude,"Latitude",!1,!0,null),Be+=this.formatTextField(ie.AddressInfo.Longitude,"Longitude",!1,!0,null)),{address:me,drivingInfo:_e,contactInfo:he,additionalInfo:ee+ae+oe,advancedInfo:Be}}static debounce(ie,Y,C){let Ne;return function(){let me=this,he=arguments,ee=C&&!Ne;clearTimeout(Ne),Ne=setTimeout(function(){Ne=null,C||ie.apply(me,he)},Y),ee&&ie.apply(me,he)}}static getRandomInt(ie){return Math.floor(Math.random()*Math.floor(ie))}}return(0,x.Z)(s,"formatPOIAddress",function(J,ie=!0){let Y="";return Y=ie?""+this.formatTextField(J.AddressInfo.AddressLine1)+this.formatTextField(J.AddressInfo.AddressLine2)+this.formatTextField(J.AddressInfo.Town)+this.formatTextField(J.AddressInfo.StateOrProvince)+this.formatTextField(J.AddressInfo.Postcode)+(null!=J.AddressInfo.Country?this.formatTextField(J.AddressInfo.Country.Title):""):this.formatStringArray([J.AddressInfo.AddressLine1,J.AddressInfo.AddressLine2,J.AddressInfo.Town,J.AddressInfo.StateOrProvince,J.AddressInfo.Postcode,null!=J.AddressInfo.Country?J.AddressInfo.Country.Title:""]),Y}),(0,x.Z)(s,"formatStringArray",function(J,ie=", "){if(null==J)return"";let Y="";for(let C=0;C{"use strict";k.d(yt,{Qp:()=>s.Qp,wC:()=>ie.wC,jR:()=>ie.jR,fw:()=>s.fw,vw:()=>s.vw,be:()=>C.b,nS:()=>J,Nm:()=>Y.N,aX:()=>h,qO:()=>y,kA:()=>s.kA});var x=k(1180);class h{constructor(me,he){(0,x.Z)(this,"ID",void 0),(0,x.Z)(this,"SubmissionType",void 0),(0,x.Z)(this,"Data",void 0),(0,x.Z)(this,"Attempts",void 0),(0,x.Z)(this,"DateQueued",void 0),(0,x.Z)(this,"IsSubmitted",void 0),(0,x.Z)(this,"IsInProgress",void 0),(0,x.Z)(this,"IsCancelled",void 0),(0,x.Z)(this,"IsFailure",void 0),(0,x.Z)(this,"FailureReason",void 0),this.SubmissionType=me,this.Data=he,this.DateQueued=new Date,this.IsSubmitted=!1,this.IsInProgress=!1,this.IsCancelled=!1,this.IsFailure=!1,this.Attempts=0,this.ID=new Date+"_"+100*Math.random()}}var y=function(Ne){return Ne[Ne.POI=0]="POI",Ne[Ne.Comment=1]="Comment",Ne[Ne.Media=2]="Media",Ne}(y||{}),s=k(7430);class J{constructor(){(0,x.Z)(this,"Location",void 0),(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"Address",void 0),(0,x.Z)(this,"Type",void 0),(0,x.Z)(this,"ReferenceID",void 0),(0,x.Z)(this,"Attribution",void 0),(0,x.Z)(this,"AddressInfo",void 0)}}var ie=k(3052),Y=k(4783),C=k(4677)},3052:(Nn,yt,k)=>{"use strict";k.d(yt,{LL:()=>s,jR:()=>y,wC:()=>h});var x=k(1180);class h{constructor(ie=null,Y=null){(0,x.Z)(this,"altitudeAccuracy",void 0),(0,x.Z)(this,"longitude",void 0),(0,x.Z)(this,"latitude",void 0),(0,x.Z)(this,"speed",void 0),(0,x.Z)(this,"heading",void 0),(0,x.Z)(this,"altitude",void 0),(0,x.Z)(this,"accuracy",void 0),this.latitude=ie,this.longitude=Y}}class y{constructor(ie=null,Y=null){(0,x.Z)(this,"coords",void 0),(0,x.Z)(this,"timestamp",void 0),(0,x.Z)(this,"attribution",void 0),this.coords=new h,this.coords.latitude=ie,this.coords.longitude=Y}static fromPosition(ie){return new y(ie.coords.latitude,ie.coords.longitude)}}class s{constructor(ie,Y){(0,x.Z)(this,"northEast",void 0),(0,x.Z)(this,"southWest",void 0),this.northEast=ie,this.southWest=Y}}},7430:(Nn,yt,k)=>{"use strict";k.d(yt,{Qp:()=>s,fw:()=>Y,JJ:()=>Ne,eN:()=>C,vw:()=>ie,kA:()=>J});var x=k(1180);class h{constructor(he,_e){(0,x.Z)(this,"itemType",void 0),(0,x.Z)(this,"itemId",void 0),(0,x.Z)(this,"version",void 0),(0,x.Z)(this,"schemaVersion",void 0),(0,x.Z)(this,"syncTimeStamp",void 0),this.itemType=he,this.itemId=h.getNewItemId(),this.version=1,this.schemaVersion=_e,this.syncTimeStamp=h.getNewSyncTimeStamp()}static getNewSyncTimeStamp(){return Date.now().toString()}static getNewItemId(){return"_syncitem_"+Date.now().toString()}}class y{constructor(he,_e){(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"Notes",void 0),(0,x.Z)(this,"_sync",void 0),this._sync=new h(he,_e)}}class s extends y{constructor(...he){super(...he),(0,x.Z)(this,"PoiID",void 0),(0,x.Z)(this,"Type",void 0),(0,x.Z)(this,"Poi",void 0),(0,x.Z)(this,"Photos",void 0)}}class J extends y{constructor(){super("waypoint",1),(0,x.Z)(this,"Stage",void 0),(0,x.Z)(this,"Position",void 0),(0,x.Z)(this,"PoiIDs",void 0),(0,x.Z)(this,"PoiList",void 0)}}class ie extends y{constructor(){super("journey_stage",1),(0,x.Z)(this,"WayPoints",void 0),this.WayPoints=[]}}class Y extends y{constructor(){super("journey",1),(0,x.Z)(this,"ID",void 0),(0,x.Z)(this,"Stages",void 0),this.ID=""+Date.now(),this.Stages=[]}}class C{constructor(){(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"DistanceKM",void 0),(0,x.Z)(this,"DurationMinutes",void 0),(0,x.Z)(this,"StartElevation",void 0),(0,x.Z)(this,"EndElevation",void 0),(0,x.Z)(this,"EnergyConsumptionkWh",void 0)}}class Ne{constructor(){(0,x.Z)(this,"Title",void 0),(0,x.Z)(this,"JourneyRouteLegs",void 0),(0,x.Z)(this,"TotalDistanceKM",void 0),(0,x.Z)(this,"TotalDurationMinutes",void 0),(0,x.Z)(this,"TotalEnergykWh",void 0)}}},4677:(Nn,yt,k)=>{"use strict";k.d(yt,{b:()=>h});var x=k(1180);class h{constructor(){(0,x.Z)(this,"poiIdList",null),(0,x.Z)(this,"countryCode",null),(0,x.Z)(this,"latitude",null),(0,x.Z)(this,"longitude",null),(0,x.Z)(this,"locationTitle",null),(0,x.Z)(this,"distance",null),(0,x.Z)(this,"distanceUnit",null),(0,x.Z)(this,"connectionTypeIdList",null),(0,x.Z)(this,"operatorIdList",null),(0,x.Z)(this,"levelIdList",null),(0,x.Z)(this,"countryIdList",null),(0,x.Z)(this,"usageTypeIdList",null),(0,x.Z)(this,"statusTypeIdList",null),(0,x.Z)(this,"minPowerKW",null),(0,x.Z)(this,"maxPowerKW",null),(0,x.Z)(this,"submissionStatusTypeIdList",null),(0,x.Z)(this,"maxResults",500),(0,x.Z)(this,"additionalParams",null),(0,x.Z)(this,"includeComments",!1),(0,x.Z)(this,"compact",!0),(0,x.Z)(this,"enableCaching",!0),(0,x.Z)(this,"levelOfDetail",1),(0,x.Z)(this,"polyline",null),(0,x.Z)(this,"boundingbox",null)}}},4783:(Nn,yt,k)=>{"use strict";k.d(yt,{N:()=>y,U:()=>h});var x=k(1180);const h=650;class y{constructor(){(0,x.Z)(this,"OperatorList",void 0),(0,x.Z)(this,"ConnectionTypeList",void 0),(0,x.Z)(this,"CountryList",void 0),(0,x.Z)(this,"UsageTypeList",void 0),(0,x.Z)(this,"StatusTypeList",void 0),(0,x.Z)(this,"MinPowerKW",void 0),(0,x.Z)(this,"MaxPowerKW",void 0),(0,x.Z)(this,"UseDistanceInKM",void 0),(0,x.Z)(this,"HasActiveFilters",void 0),(0,x.Z)(this,"LastSearchPosition",void 0),(0,x.Z)(this,"StartSearchPosition",void 0),(0,x.Z)(this,"StartViewPoiId",void 0),(0,x.Z)(this,"Language",void 0),(0,x.Z)(this,"FilterOptionsByCountryId",void 0),(0,x.Z)(this,"MapType",void 0),(0,x.Z)(this,"EnableAdvancedEditorFeatures",void 0),(0,x.Z)(this,"EnablePOIPendingApproval",void 0),(0,x.Z)(this,"MaxResults",void 0),this.OperatorList=[],this.ConnectionTypeList=[],this.CountryList=[],this.UsageTypeList=[],this.StatusTypeList=[],this.MaxPowerKW=null,this.MinPowerKW=null,this.HasActiveFilters=!1,this.FilterOptionsByCountryId=null,this.UseDistanceInKM=!0,this.MapType="ROADMAP",this.EnableAdvancedEditorFeatures=!1,this.EnablePOIPendingApproval=!1,this.MaxResults=500}LoadSettings(){}SaveSettings(){}ClearActiveFilters(){this.OperatorList=[],this.ConnectionTypeList=[],this.CountryList=[],this.UsageTypeList=[],this.StatusTypeList=[],this.MinPowerKW=null,this.MaxPowerKW=null}CheckForActiveFilters(){return this.HasActiveFilters=this.OperatorList.length>0||this.ConnectionTypeList.length>0||this.CountryList.length>0||this.UsageTypeList.length>0||this.StatusTypeList.length>0||this.MinPowerKW>0||this.MaxPowerKW>0||null!=this.MaxPowerKW&&this.MaxPowerKW{"use strict";k.r(yt),k.d(yt,{AboutPageModule:()=>he});var x=k(1180),h=k(6814),y=k(6223),s=k(9843),J=k(6800),ie=k(9236),Y=k(2029);const C=[{path:"",component:ie.t}];let Ne=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[J.Bz.forChild(C),J.Bz]})),ee})();var me=k(3999);let he=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[h.ez,y.u5,s.Pc,me.aw,Ne]})),ee})()},9236:(Nn,yt,k)=>{"use strict";k.d(yt,{t:()=>ie});var x=k(1180),h=k(553),y=k(2029),s=k(9843),J=k(3999);let ie=(()=>{var Y;class C{constructor(me){(0,x.Z)(this,"modalController",void 0),this.modalController=me}get appVersion(){return h.N.version}get apiUrl(){return h.N.apiBase}ngOnInit(){}close(){this.modalController.dismiss()}}return Y=C,(0,x.Z)(C,"\u0275fac",function(me){return new(me||Y)(y.Y36(s.IN))}),(0,x.Z)(C,"\u0275cmp",y.Xpm({type:Y,selectors:[["app-about"]],decls:46,vars:5,consts:[[1,"ion-padding"],["size","2"],["src","assets/images/icons/branding/AppIcon_128x128.png"],["href","https://openchargemap.org","target","_blank"],["href","https://community.openchargemap.org","target","_blank"],["href","https://webprofusion.com","target","_blank"],["href","https://openchargemap.org/site/about/datasharing","target","_blank"],["slot","end"],[3,"click"],["name","close","slot","start"]],template:function(me,he){1&me&&(y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),y._uU(3),y.ALo(4,"translate"),y.qZA()()(),y.TgZ(5,"ion-content",0)(6,"ion-grid")(7,"ion-row")(8,"ion-col",1),y._UZ(9,"img",2),y.qZA(),y.TgZ(10,"ion-col")(11,"h1"),y._uU(12,"Open Charge Map"),y.qZA()()()(),y.TgZ(13,"p")(14,"strong"),y._uU(15,"Open Charge Map is the worlds largest Open Data registry of electric vehicle charging locations."),y.qZA(),y._uU(16," By adding and editing the information within Open Charge Map you are improving the data for an unlimited amount of other apps and services which can use the data for free. "),y.qZA(),y.TgZ(17,"p")(18,"a",3),y._uU(19,"openchargemap.org"),y.qZA()(),y.TgZ(20,"p"),y._uU(21,"Join our community discussions: "),y.TgZ(22,"a",4),y._uU(23,"community.openchargemap.org"),y.qZA()(),y.TgZ(24,"p"),y._uU(25,"Software development and service hosting by "),y.TgZ(26,"a",5),y._uU(27,"webprofusion.com"),y.qZA()(),y.TgZ(28,"p"),y._uU(29,"Our service is run by volunteers, our data is largely crowdsourced by you. Some data is imported from public Open Data sources."),y.qZA(),y.TgZ(30,"p"),y._uU(31,"Network operators can "),y.TgZ(32,"a",6),y._uU(33,"provide us with an OCPI data feed"),y.qZA(),y._uU(34," to freely promote their network and ensure information accuracy. "),y.qZA(),y.TgZ(35,"ion-note")(36,"p"),y._uU(37),y.qZA(),y.TgZ(38,"p"),y._uU(39),y.qZA()()(),y.TgZ(40,"ion-footer")(41,"ion-toolbar")(42,"ion-buttons",7)(43,"ion-button",8),y.NdJ("click",function(){return he.close()}),y._UZ(44,"ion-icon",9),y._uU(45," Close "),y.qZA()()()()),2&me&&(y.xp6(3),y.hij("",y.lcZ(4,3,"ocm.general.about")," Open Charge Map"),y.xp6(34),y.hij("App Version: ",he.appVersion,""),y.xp6(2),y.hij("API: ",he.apiUrl,""))},dependencies:[s.YG,s.Sm,s.wI,s.W2,s.fr,s.jY,s.Gu,s.gu,s.uN,s.Nd,s.wd,s.sr,J.X$]})),C})()},9192:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{JourneysModule:()=>me});var x=k(1180),h=k(4292),y=k(5086),s=k(3999),J=k(6814),ie=k(6223),Y=k(9843),C=k(6800),Ne=k(2029);let me=(()=>{var he;class _e{}return he=_e,(0,x.Z)(_e,"\u0275fac",function(ae){return new(ae||he)}),(0,x.Z)(_e,"\u0275mod",Ne.oAB({type:he})),(0,x.Z)(_e,"\u0275inj",Ne.cJS({imports:[J.ez,ie.u5,Y.Pc,s.aw,y.e,C.Bz.forChild([{path:"",component:h.g}])]})),_e})()},4292:(Nn,yt,k)=>{"use strict";k.d(yt,{g:()=>le});var x=k(1180),h=k(989),y=k(439),s=k(6470),J=k(7518),ie=k(9723),Y=k(2029),C=k(9843),Ne=k(6814);function me(ue,ct){1&ue&&(Y.TgZ(0,"p"),Y._uU(1," You have no journeys yet. Start by browsing to a charging location, then add it as Favourite to start a new Journey. "),Y.qZA())}function he(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.AddressLine1,"")}}function _e(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.AddressLine2,"")}}function ee(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.Town,"")}}function ae(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.StateOrProvince,"")}}function oe(ue,ct){if(1&ue&&(Y.TgZ(0,"p"),Y._uU(1),Y.qZA()),2&ue){const ht=Y.oxw(2).$implicit;Y.xp6(1),Y.hij(" ",ht.Poi.AddressInfo.Postcode,"")}}function Be(ue,ct){if(1&ue){const ht=Y.EpF();Y.TgZ(0,"div")(1,"div",18),Y.NdJ("click",function(){Y.CHM(ht);const ye=Y.oxw().$implicit,gt=Y.oxw(4);return Y.KtG(gt.viewPOIDetails(ye.Poi))}),Y.YNc(2,he,2,1,"p",4),Y.YNc(3,_e,2,1,"p",4),Y.YNc(4,ee,2,1,"p",4),Y.YNc(5,ae,2,1,"p",4),Y.YNc(6,oe,2,1,"p",4),Y.qZA(),Y.TgZ(7,"ion-button",19),Y.NdJ("click",function(){Y.CHM(ht);const ye=Y.oxw().$implicit,gt=Y.oxw(4);return Y.KtG(gt.launchNavigation(ye.Poi))}),Y._UZ(8,"ion-icon",20),Y._uU(9," Navigate "),Y.qZA()()}if(2&ue){const ht=Y.oxw().$implicit;Y.xp6(2),Y.Q6J("ngIf",ht.Poi.AddressInfo.AddressLine1),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.AddressLine2),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.Town),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.StateOrProvince),Y.xp6(1),Y.Q6J("ngIf",ht.Poi.AddressInfo.Postcode)}}function Ie(ue,ct){if(1&ue&&(Y.TgZ(0,"div",17),Y.YNc(1,Be,10,5,"div",4),Y.qZA()),2&ue){const ht=ct.$implicit;Y.xp6(1),Y.Q6J("ngIf",ht.Poi)}}function Ee(ue,ct){if(1&ue&&(Y.TgZ(0,"ion-item")(1,"h2"),Y._uU(2),Y.qZA(),Y.TgZ(3,"ion-thumbnail",0),Y._UZ(4,"ion-icon",15),Y.qZA(),Y.TgZ(5,"p"),Y._uU(6),Y.qZA(),Y.YNc(7,Ie,2,1,"div",16),Y.qZA()),2&ue){const ht=ct.$implicit;Y.xp6(2),Y.Oqu(ht.Title),Y.xp6(4),Y.Oqu(ht.Notes),Y.xp6(1),Y.Q6J("ngForOf",ht.PoiList)}}function Ue(ue,ct){if(1&ue&&(Y.TgZ(0,"ion-list")(1,"ion-list-header",11),Y._uU(2),Y._UZ(3,"ion-icon",12),Y._uU(4," -- "),Y._UZ(5,"ion-icon",13),Y._uU(6," -- "),Y._UZ(7,"ion-icon",14),Y._uU(8," -- "),Y.qZA(),Y.YNc(9,Ee,8,3,"ion-item",5),Y.qZA()),2&ue){const ht=ct.$implicit;Y.xp6(2),Y.hij(" ",ht.Title," "),Y.xp6(7),Y.Q6J("ngForOf",ht.WayPoints)}}function et(ue,ct){if(1&ue){const ht=Y.EpF();Y.TgZ(0,"ion-card")(1,"ion-card-content")(2,"ion-toolbar",8)(3,"ion-title"),Y._uU(4),Y.qZA(),Y.TgZ(5,"ion-buttons",9)(6,"ion-button",1),Y.NdJ("click",function(){const gt=Y.CHM(ht).$implicit,De=Y.oxw();return Y.KtG(De.deleteJourney(gt.ID))}),Y._UZ(7,"ion-icon",10),Y.qZA()()(),Y.TgZ(8,"p"),Y._uU(9),Y.qZA(),Y.YNc(10,Ue,10,2,"ion-list",5),Y.qZA()()}if(2&ue){const ht=ct.$implicit;Y.xp6(4),Y.hij(" ",ht.Title,""),Y.xp6(5),Y.Oqu(ht.Notes),Y.xp6(1),Y.Q6J("ngForOf",ht.Stages)}}let le=(()=>{var ue;class ct{constructor(Le,ye,gt,De,Pe){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"api",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"alertController",void 0),this.appManager=Le,this.journeyManager=ye,this.api=gt,this.modalController=De,this.alertController=Pe}dismiss(){this.modalController.dismiss()}discoverImages(){this.journeyManager.journeys.forEach(Le=>{Le.Stages.forEach(ye=>{ye.WayPoints.forEach(gt=>{null!=gt.PoiList&>.PoiList.forEach(De=>{De.Poi&&this.api.getPanoramioLocationPhotos(new J.wC(De.Poi.AddressInfo.Latitude,De.Poi.AddressInfo.Longitude)).then(Pe=>{De.Photos=Pe})})})})})}getJson(Le){return JSON.stringify(Le,null,4)}viewPOIDetails(Le){this.modalController.create({component:ie.H,componentProps:{item:Le}}).then(ye=>ye.present())}get staticMapSize(){return"60x60"}getStaticMapURL(Le){return"https://maps.googleapis.com/maps/api/staticmap?center="+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude+"&zoom=13&scale=2&size="+this.staticMapSize+"&maptype=roadmap&format=jpg&visual_refresh=true&markers=size:small%7Ccolor:0xff0000%7Clabel:%7C"+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude}deleteJourney(Le){this.alertController.create({header:"Delete this Journey?",message:"Are you sure you want to delete this Journey?",buttons:[{text:"No",handler:()=>{}},{text:"Delete",handler:()=>{this.journeyManager.deleteJourney(Le)}}]}).then(ye=>ye.present())}launchNavigation(Le){let ye="https://maps.google.com/?q="+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude;this.appManager.platform.is("ios")&&(ye="https://maps.apple.com?q="+Le.AddressInfo.Latitude+","+Le.AddressInfo.Longitude),window.open(ye,"_system")}}return ue=ct,(0,x.Z)(ct,"\u0275fac",function(Le){return new(Le||ue)(Y.Y36(s.c),Y.Y36(h.i),Y.Y36(y.l),Y.Y36(C.IN),Y.Y36(C.Br))}),(0,x.Z)(ct,"\u0275cmp",Y.Xpm({type:ue,selectors:[["ng-component"]],decls:18,vars:2,consts:[["slot","start"],[3,"click"],[1,"journeys-page"],[1,"ion-padding"],[4,"ngIf"],[4,"ngFor","ngForOf"],["slot","end"],["name","close","slot","start"],["primary",""],["slot","primary"],["name","close","slot","icon-only"],[2,"font-size","1.5rem"],["name","car"],["name","time"],["name","flash"],["name","caret-down",2,"font-size","4rem"],["style","text-align:right;width:100%;",4,"ngFor","ngForOf"],[2,"text-align","right","width","100%"],["tappable","",3,"click"],["clear","","item-right","",3,"click"],["name","navigate","slot","start"]],template:function(Le,ye){1&Le&&(Y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-buttons",0)(3,"ion-back-button",1),Y.NdJ("click",function(){return ye.dismiss()}),Y.qZA()(),Y.TgZ(4,"ion-title"),Y._uU(5," Journeys "),Y.qZA()()(),Y.TgZ(6,"ion-content",2)(7,"div",3)(8,"p"),Y._uU(9," You can create and plan journeys to group your favourite charging routes together. "),Y.qZA(),Y.YNc(10,me,2,0,"p",4),Y.qZA(),Y.YNc(11,et,11,3,"ion-card",5),Y.qZA(),Y.TgZ(12,"ion-footer")(13,"ion-toolbar")(14,"ion-buttons",6)(15,"ion-button",1),Y.NdJ("click",function(){return ye.dismiss()}),Y._UZ(16,"ion-icon",7),Y._uU(17," Close "),Y.qZA()()()()),2&Le&&(Y.xp6(10),Y.Q6J("ngIf",null==ye.journeyManager.journeys||0==ye.journeyManager.journeys.length),Y.xp6(1),Y.Q6J("ngForOf",ye.journeyManager.journeys))},dependencies:[Ne.sg,Ne.O5,C.oU,C.YG,C.Sm,C.PM,C.FN,C.W2,C.fr,C.Gu,C.gu,C.Ie,C.q_,C.yh,C.Bs,C.wd,C.sr,C.cs],encapsulation:2})),ct})()},2309:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{LayerEditorPageModule:()=>he});var x=k(1180),h=k(6814),y=k(6223),s=k(9843),J=k(6800),ie=k(8062),Y=k(2029);const C=[{path:"",component:ie.A}];let Ne=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[J.Bz.forChild(C),J.Bz]})),ee})();var me=k(5086);let he=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Y.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Y.cJS({imports:[h.ez,y.u5,s.Pc,Ne,me.e]})),ee})()},8062:(Nn,yt,k)=>{"use strict";k.d(yt,{A:()=>Ne});var x=k(5861),h=k(1180),y=k(9159),s=k(2029),J=k(9843),ie=k(6814),Y=k(8696);function C(me,he){if(1&me&&(s.TgZ(0,"div"),s._uU(1),s._UZ(2,"app-poi-list",10),s.qZA()),2&me){const _e=s.oxw();s.xp6(1),s.hij(" Items Parsed: ",_e.fileData.length," "),s.xp6(1),s.Q6J("poiList",_e.fileData)}}let Ne=(()=>{var me;class he{constructor(ee,ae){(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"refData",void 0),(0,h.Z)(this,"fileData",void 0),this.modalController=ee,this.refData=ae}ngOnInit(){}previewFile(){var ee=this;return(0,x.Z)(function*(){yield ee.loadFile(!1)})()}cancel(){var ee=this;return(0,x.Z)(function*(){yield ee.modalController.dismiss(ee.fileData)})()}loadFile(ee=!0){var ae=this;return(0,x.Z)(function*(){const oe=new FileReader;oe.onload=()=>{let Ie=JSON.parse(oe.result),Ee=5e6;for(let Ue of Ie)(null==Ue.ID||""==Ue.ID)&&(Ue.ID=Ee.toString()),Ue.ID="imp_"+Ue.ID,Ee++;ae.fileData=ae.refData.hydrateCompactPOIList(Ie),ee&&ae.modalController.dismiss(ae.fileData)},oe.onerror=()=>{},oe.readAsText(document.getElementById("file-upload").files[0])})()}add(){var ee=this;return(0,x.Z)(function*(){ee.modalController.dismiss(ee.fileData)})()}}return me=he,(0,h.Z)(he,"\u0275fac",function(ee){return new(ee||me)(s.Y36(J.IN),s.Y36(y.W))}),(0,h.Z)(he,"\u0275cmp",s.Xpm({type:me,selectors:[["app-layer-editor"]],decls:27,vars:1,consts:[[1,"ion-padding"],[1,"upload"],["name","file","aria-label","file","slot","start"],["type","file","required","","id","file-upload",3,"change"],[4,"ngIf"],["slot","secondary"],[3,"click"],["name","close","slot","start"],["slot","primary"],["name","checkmark-circle-outline","slot","end"],[3,"poiList"]],template:function(ee,ae){1&ee&&(s.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),s._uU(3," Edit Layer "),s.qZA()()(),s.TgZ(4,"ion-content",0)(5,"p"),s._uU(6,"POI layers are used to preview data from other Open Data sources. "),s.qZA(),s.TgZ(7,"p"),s._uU(8,"Select a POI layer JSON file: "),s.qZA(),s.TgZ(9,"div")(10,"label",1)(11,"ion-button"),s._UZ(12,"ion-icon",2),s.TgZ(13,"ion-label"),s._uU(14,"Choose File.."),s.qZA()(),s.TgZ(15,"input",3),s.NdJ("change",function(){return ae.previewFile()}),s.qZA()()(),s.YNc(16,C,3,2,"div",4),s.qZA(),s.TgZ(17,"ion-footer")(18,"ion-toolbar")(19,"ion-buttons",5)(20,"ion-button",6),s.NdJ("click",function(){return ae.cancel()}),s._UZ(21,"ion-icon",7),s._uU(22," Cancel "),s.qZA()(),s.TgZ(23,"ion-buttons",8)(24,"ion-button",6),s.NdJ("click",function(){return ae.add()}),s._uU(25," Add "),s._UZ(26,"ion-icon",9),s.qZA()()()()),2&ee&&(s.xp6(16),s.Q6J("ngIf",ae.fileData&&ae.fileData.length>0))},dependencies:[ie.O5,J.YG,J.Sm,J.W2,J.fr,J.Gu,J.gu,J.Q$,J.wd,J.sr,Y.o],styles:[".upload[_ngcontent-%COMP%] input[type=file][_ngcontent-%COMP%]{position:fixed;top:-1000px}"]})),he})()},9723:(Nn,yt,k)=>{"use strict";k.d(yt,{H:()=>zn});var x=k(1180),h=k(6470),y=k(2029),s=k(9843),J=k(5861),ie=k(989),Y=k(7430),C=k(6814),Ne=k(6223);function me(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",13),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",xe.ID),y.xp6(1),y.Oqu(xe.Title)}}function he(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",16),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",ze.index),y.xp6(1),y.Oqu(xe.Title)}}function _e(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"ion-item")(1,"ion-label",2),y._uU(2,"Journey Stage"),y.qZA(),y.TgZ(3,"ion-select",3),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.selectedStageIndex=Ze)}),y.TgZ(4,"ion-select-option",14),y._uU(5,"Create a Journey Stage"),y.qZA(),y.YNc(6,he,2,2,"ion-select-option",15),y.qZA()()}if(2&pe){const xe=y.oxw();y.xp6(3),y.Q6J("ngModel",xe.selectedStageIndex),y.xp6(3),y.Q6J("ngForOf",xe.journeyManager.getJourneyStages(xe.selectedJourneyID))}}function ee(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"ion-item")(1,"ion-label",2),y._uU(2,"New Journey Name"),y.qZA(),y.TgZ(3,"ion-input",7),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.newJourneyName=Ze)}),y.qZA()()}if(2&pe){const xe=y.oxw();y.xp6(3),y.Q6J("ngModel",xe.newJourneyName)}}let ae=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"selectedJourneyID",void 0),(0,x.Z)(this,"selectedStageIndex",void 0),(0,x.Z)(this,"newJourneyName",void 0),(0,x.Z)(this,"waypoint",void 0),(0,x.Z)(this,"poi",void 0),this.appManager=be,this.navParams=Ze,this.journeyManager=Pt,this.modalController=bn,this.poi=this.navParams.get("poi"),this.waypoint=new Y.kA,this.waypoint.Title=this.poi.AddressInfo.Title,this.waypoint.PoiIDs=[this.poi.ID],this.waypoint.PoiList=[];const Kn=new Y.Qp("charging",1);Kn.Poi=this.poi,Kn.PoiID=this.poi.ID,this.waypoint.PoiList.push(Kn),this.newJourneyName="Trip to "+this.poi.AddressInfo.Title}cancel(){this.modalController.dismiss()}add(){if(null!=this.selectedJourneyID&&""!==this.selectedJourneyID)this.journeyManager.addJourneyWaypoint(this.selectedJourneyID,this.selectedStageIndex,this.waypoint);else{const be=new Y.fw;be.ID=Date.now().toString(),""===this.newJourneyName&&(this.newJourneyName="New Journey"),be.Title=this.newJourneyName,this.journeyManager.addJourney(be,this.waypoint)}this.journeyManager.saveJourneys(),this.modalController.dismiss()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(h.c),y.Y36(s.X1),y.Y36(ie.i),y.Y36(s.IN))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:39,vars:8,consts:[[1,"journeys-page","ion-padding"],[1,"banner"],["position","stacked"],[3,"ngModel","ngModelChange"],["value","","checked",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["type","text",3,"ngModel","ngModelChange"],["slot","secondary"],[3,"click"],["name","close","slot","start"],["slot","primary"],["name","add","slot","end"],[3,"value"],["value",""],["checked","",3,"value",4,"ngFor","ngForOf"],["checked","",3,"value"]],template:function(be,Ze){1&be&&(y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),y._uU(3," Edit Favourite "),y.qZA()()(),y.TgZ(4,"ion-content",0)(5,"div",1)(6,"h1"),y._uU(7),y.qZA(),y.TgZ(8,"p"),y._uU(9),y.qZA()(),y.TgZ(10,"p"),y._uU(11," Add Charging Location as a Journey Waypoint "),y.qZA(),y.TgZ(12,"ion-item")(13,"ion-label",2),y._uU(14,"Add to a Journey"),y.qZA(),y.TgZ(15,"ion-select",3),y.NdJ("ngModelChange",function(bn){return Ze.selectedJourneyID=bn}),y.TgZ(16,"ion-select-option",4),y._uU(17,"Create a New Journey"),y.qZA(),y.YNc(18,me,2,2,"ion-select-option",5),y.qZA()(),y.YNc(19,_e,7,2,"ion-item",6),y.YNc(20,ee,4,1,"ion-item",6),y.TgZ(21,"ion-item")(22,"ion-label",2),y._uU(23,"Name for this step of your journey"),y.qZA(),y.TgZ(24,"ion-input",7),y.NdJ("ngModelChange",function(bn){return Ze.waypoint.Title=bn}),y.qZA()(),y.TgZ(25,"ion-item")(26,"ion-label",2),y._uU(27,"Other Notes"),y.qZA(),y.TgZ(28,"ion-textarea",3),y.NdJ("ngModelChange",function(bn){return Ze.waypoint.Notes=bn}),y.qZA()()(),y.TgZ(29,"ion-footer")(30,"ion-toolbar")(31,"ion-buttons",8)(32,"ion-button",9),y.NdJ("click",function(){return Ze.cancel()}),y._UZ(33,"ion-icon",10),y._uU(34," Cancel "),y.qZA()(),y.TgZ(35,"ion-buttons",11)(36,"ion-button",9),y.NdJ("click",function(){return Ze.add()}),y._uU(37," Add "),y._UZ(38,"ion-icon",12),y.qZA()()()()),2&be&&(y.xp6(7),y.Oqu(Ze.poi.AddressInfo.Title),y.xp6(2),y.Oqu(Ze.poi.AddressInfo.AddressLine1),y.xp6(6),y.Q6J("ngModel",Ze.selectedJourneyID),y.xp6(3),y.Q6J("ngForOf",Ze.journeyManager.journeys),y.xp6(1),y.Q6J("ngIf",Ze.selectedJourneyID),y.xp6(1),y.Q6J("ngIf",!Ze.selectedJourneyID),y.xp6(4),y.Q6J("ngModel",Ze.waypoint.Title),y.xp6(4),y.Q6J("ngModel",Ze.waypoint.Notes))},dependencies:[C.sg,C.O5,Ne.JJ,Ne.On,s.YG,s.Sm,s.W2,s.fr,s.Gu,s.gu,s.pK,s.Ie,s.Q$,s.t9,s.n0,s.g2,s.wd,s.sr,s.QI,s.j9],encapsulation:2})),ze})();var oe=k(9127);function Be(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"ion-card")(1,"ion-toolbar")(2,"ion-title",14),y._uU(3,"Preview"),y.qZA(),y.TgZ(4,"ion-buttons",15)(5,"ion-button",4),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.rotateImage())}),y._UZ(6,"ion-icon",16),y.TgZ(7,"ion-label"),y._uU(8,"Rotate"),y.qZA()()()(),y.TgZ(9,"ion-card-content")(10,"ion-list")(11,"ion-item")(12,"ion-label",17),y._uU(13,"Comment"),y.qZA(),y.TgZ(14,"ion-input",18),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.comment=Ze)}),y.qZA()()(),y._UZ(15,"img",19),y.qZA()()}if(2&pe){const xe=y.oxw();y.xp6(14),y.Q6J("ngModel",xe.comment)}}let Ie=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn){(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"mode",void 0),(0,x.Z)(this,"processingQuality",void 0),(0,x.Z)(this,"imgData",void 0),(0,x.Z)(this,"targetWidth",void 0),(0,x.Z)(this,"targetHeight",void 0),(0,x.Z)(this,"comment",void 0),(0,x.Z)(this,"chargePointId",void 0),(0,x.Z)(this,"poi",void 0),this.navParams=be,this.appManager=Ze,this.nav=Pt,this.modalController=bn,this.logging=Kn,this.processingQuality=.8,this.targetWidth=1024,this.targetHeight=800,this.mode=Ze.platformMode,this.chargePointId=this.navParams.get("id"),this.poi=this.navParams.get("poi"),this.comment=""}processNativeImageSource(be){let Ze=be;const Pt=document.getElementById("img-upload-canvas"),bn=Pt.getContext("2d"),Kn=new Image;Kn.onload=()=>{this.logging.log("img load:"+Kn.width),Pt.width=Kn.width,Pt.height=Kn.height,bn.fillStyle="rgb(0,0,0)",bn.fillRect(0,0,Pt.width,Pt.height),bn.drawImage(Kn,0,0,Pt.width,Pt.height),this.imgData=Pt.toDataURL("image/png"),this.processImage()},Kn.src=Ze}loadCameraOrLibraryImage(be=!1){this.logging.log("PWA mode: fetching image");const Ze=new FileReader;Ze.onload=()=>{this.imgData=Ze.result,this.processImage()},Ze.onerror=()=>{},Ze.readAsDataURL(document.getElementById("img-upload-media").files[0])}isBrowserMode(){return this.appManager.isPlatform("desktop")||this.appManager.isPlatform("hybrid")}processImage(){if(null!=this.imgData){const Ze=document.getElementById("img-upload-canvas"),Pt=Ze.getContext("2d"),bn=new Image;bn.onload=()=>{Ze.width=bn.width,Ze.height=bn.height,Pt.fillStyle="rgb(0,0,0)",Pt.fillRect(0,0,Ze.width,Ze.height),Pt.drawImage(bn,0,0,Ze.width,Ze.height),this.refreshImageFromCanvas()},bn.src=this.imgData}else this.logging.log("processImage: nothing to process.")}refreshImageFromCanvas(){const be=document.getElementById("img-upload-canvas");this.imgData=be.toDataURL("image/jpeg",.8),document.getElementById("preview").src=this.imgData}rotateImage(){const be=document.getElementById("img-upload-canvas");let Ze=new Image;Ze.src=be.toDataURL(),Ze.onload=()=>{let Pt=be.height,bn=be.width;be.width=Pt,be.height=bn,Pt=be.height,bn=be.width;const Kn=be.getContext("2d");Kn.save(),Kn.translate(bn,Pt/bn),Kn.rotate(Math.PI/2),Kn.drawImage(Ze,0,0),Kn.restore(),Ze=null,this.refreshImageFromCanvas()}}performUpload(){var be=this;return(0,J.Z)(function*(){if(!be.imgData)return void(yield be.appManager.showToastNotification("Select an image to upload."));const Ze={chargePointID:be.chargePointId,comment:be.comment,imageDataBase64:be.imgData};yield be.appManager.showLoadingProgress("Uploading photo..");try{yield be.appManager.submitMediaItem(Ze),be.appManager.dismissLoadingProgress().then(()=>{be.appManager.showToastNotification("Upload completed"),be.modalController.dismiss()}),be.appManager.analytics.appEvent("MediaUpload","Completed")}catch{yield be.appManager.dismissLoadingProgress(),yield be.appManager.showToastNotification("Upload failed, please try again."),be.appManager.analytics.appEvent("MediaUpload","Failed")}})()}cancel(){var be=this;return(0,J.Z)(function*(){yield be.modalController.dismiss()})()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(s.X1),y.Y36(h.c),y.Y36(s.SH),y.Y36(s.IN),y.Y36(oe.z))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:32,vars:3,consts:[[1,"media-upload"],[1,"ion-padding"],[1,"banner"],[1,"upload"],[3,"click"],["name","camera","aria-label","camera","slot","start"],["type","file","required","","id","img-upload-media",3,"change"],["inputFile",""],["id","img-upload-canvas",2,"display","none","width","500","height","500","border","1px solid red"],[4,"ngIf"],["slot","secondary"],["name","close","slot","start"],["slot","primary"],["name","send","slot","end"],["slot","start"],["slot","end"],["name","refresh","slot","start"],["position","floating"],["type","text","placeholder","(optional comment)",3,"ngModel","ngModelChange"],["id","preview",2,"max-width","500px"]],template:function(be,Ze){if(1&be){const Pt=y.EpF();y.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),y._uU(3," Share Photo "),y.qZA()()(),y.TgZ(4,"ion-content",0)(5,"div",1)(6,"div",2)(7,"h1"),y._uU(8),y.qZA(),y.TgZ(9,"p"),y._uU(10),y.qZA()(),y.TgZ(11,"p"),y._uU(12,"You can upload a photo from your device or take a new photo: "),y.qZA(),y.TgZ(13,"div",3)(14,"ion-button",4),y.NdJ("click",function(){y.CHM(Pt);const Kn=y.MAs(19);return y.KtG(Kn.click())}),y._UZ(15,"ion-icon",5),y.TgZ(16,"ion-label"),y._uU(17,"Choose Photo.."),y.qZA()(),y.TgZ(18,"input",6,7),y.NdJ("change",function(){return Ze.loadCameraOrLibraryImage()}),y.qZA()(),y._UZ(20,"canvas",8),y.YNc(21,Be,16,1,"ion-card",9),y.qZA()(),y.TgZ(22,"ion-footer")(23,"ion-toolbar")(24,"ion-buttons",10)(25,"ion-button",4),y.NdJ("click",function(){return Ze.cancel()}),y._UZ(26,"ion-icon",11),y._uU(27," Cancel "),y.qZA()(),y.TgZ(28,"ion-buttons",12)(29,"ion-button",4),y.NdJ("click",function(){return Ze.performUpload()}),y._uU(30," Upload "),y._UZ(31,"ion-icon",13),y.qZA()()()()}2&be&&(y.xp6(8),y.Oqu(Ze.poi.AddressInfo.Title),y.xp6(2),y.Oqu(Ze.poi.AddressInfo.AddressLine1),y.xp6(11),y.Q6J("ngIf",null!=Ze.imgData))},dependencies:[C.O5,Ne.JJ,Ne.On,s.YG,s.Sm,s.PM,s.FN,s.W2,s.fr,s.Gu,s.gu,s.pK,s.Ie,s.Q$,s.q_,s.wd,s.sr,s.j9],styles:[".upload[_ngcontent-%COMP%] input[type=file][_ngcontent-%COMP%]{position:fixed;top:-1000px}"]})),ze})();var Ee=k(6800);function Ue(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",19),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",xe.ID),y.xp6(1),y.Oqu(xe.Title)}}function et(pe,ze){if(1&pe&&(y.TgZ(0,"ion-select-option",19),y._uU(1),y.qZA()),2&pe){const xe=ze.$implicit;y.Q6J("value",xe.ID),y.xp6(1),y.Oqu(xe.Title)}}let le=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn,Ci,wi,cr){(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"zone",void 0),(0,x.Z)(this,"loadingController",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"router",void 0),(0,x.Z)(this,"commentModel",void 0),(0,x.Z)(this,"poi",void 0),(0,x.Z)(this,"commentTypes",void 0),(0,x.Z)(this,"checkinTypes",void 0),this.navParams=be,this.appManager=Ze,this.nav=Pt,this.zone=bn,this.loadingController=Kn,this.modalController=Ci,this.logging=wi,this.router=cr,this.commentModel={ChargePointID:this.navParams.get("id"),Comment:"",CheckinStatusTypeID:10,CommentTypeID:10,Rating:null},this.poi=this.navParams.get("poi"),this.commentTypes=Ze.referenceDataManager.getCommentTypes(!0,!0),this.checkinTypes=Ze.referenceDataManager.getCheckinStatusTypes(!0,!0)}onPageWillEnter(){}cancel(){this.modalController.dismiss()}add(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.loadingController.create({message:"Sending .."});yield Ze.present(),(yield be.appManager.submitComment(be.commentModel).catch(bn=>{be.appManager.showToastNotification("There was a problem submitting your comment."),be.loadingController.dismiss(),be.appManager.analytics.appEvent("Comment","Failed")}))&&(be.logging.log("Comment submitted"),yield Ze.dismiss(),yield be.modalController.dismiss(),be.appManager.analytics.appEvent("Comment","Submitted"))})()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(s.X1),y.Y36(h.c),y.Y36(s.SH),y.Y36(y.R0b),y.Y36(s.HT),y.Y36(s.IN),y.Y36(oe.z),y.Y36(Ee.F0))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:53,vars:8,consts:[["color","primary"],[1,"comment-page","ion-padding"],[1,"banner"],[1,"ion-padding"],["position","stacked"],[3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["type","text","placeholder","(optional comment)",3,"ngModel","ngModelChange"],["value","5"],["value","4"],["value","3"],["value","2"],["value","1"],["value",""],["slot","secondary"],[3,"click"],["name","close","slot","start"],["slot","primary"],["name","send","slot","end"],[3,"value"]],template:function(be,Ze){1&be&&(y.TgZ(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-title"),y._uU(3," Add Comment "),y.qZA()()(),y.TgZ(4,"ion-content",1)(5,"div",2)(6,"h1"),y._uU(7),y.qZA(),y.TgZ(8,"p"),y._uU(9),y.qZA()(),y.TgZ(10,"p",3),y._uU(11,"Recent Check-ins are a big help to other drivers when planning their journey. Tell everyone what you thought about this charging location. "),y.qZA(),y.TgZ(12,"ion-list")(13,"ion-item")(14,"ion-label",4),y._uU(15,"Comment Type"),y.qZA(),y.TgZ(16,"ion-select",5),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.CommentTypeID=bn}),y.YNc(17,Ue,2,2,"ion-select-option",6),y.qZA()(),y.TgZ(18,"ion-item")(19,"ion-label",4),y._uU(20,"What Did You Think?"),y.qZA(),y.TgZ(21,"ion-input",7),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.Comment=bn}),y.qZA()(),y.TgZ(22,"ion-item")(23,"ion-label",4),y._uU(24,"Did You Successfully Charge?"),y.qZA(),y.TgZ(25,"ion-select",5),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.CheckinStatusTypeID=bn}),y.YNc(26,et,2,2,"ion-select-option",6),y.qZA()(),y.TgZ(27,"ion-item")(28,"ion-label",4),y._uU(29,"Your Rating"),y.qZA(),y.TgZ(30,"ion-select",5),y.NdJ("ngModelChange",function(bn){return Ze.commentModel.Rating=bn}),y.TgZ(31,"ion-select-option",8),y._uU(32,"5 - Excellent"),y.qZA(),y.TgZ(33,"ion-select-option",9),y._uU(34,"4 - Good"),y.qZA(),y.TgZ(35,"ion-select-option",10),y._uU(36,"3 - Average"),y.qZA(),y.TgZ(37,"ion-select-option",11),y._uU(38,"2 - Not Good"),y.qZA(),y.TgZ(39,"ion-select-option",12),y._uU(40,"1 - Bad"),y.qZA(),y.TgZ(41,"ion-select-option",13),y._uU(42,"Not Rated"),y.qZA()()()()(),y.TgZ(43,"ion-footer")(44,"ion-toolbar")(45,"ion-buttons",14)(46,"ion-button",15),y.NdJ("click",function(){return Ze.cancel()}),y._UZ(47,"ion-icon",16),y._uU(48," Cancel "),y.qZA()(),y.TgZ(49,"ion-buttons",17)(50,"ion-button",15),y.NdJ("click",function(){return Ze.add()}),y._uU(51," Submit "),y._UZ(52,"ion-icon",18),y.qZA()()()()),2&be&&(y.xp6(7),y.Oqu(Ze.poi.AddressInfo.Title),y.xp6(2),y.Oqu(Ze.poi.AddressInfo.AddressLine1),y.xp6(7),y.Q6J("ngModel",Ze.commentModel.CommentTypeID),y.xp6(1),y.Q6J("ngForOf",Ze.commentTypes),y.xp6(4),y.Q6J("ngModel",Ze.commentModel.Comment),y.xp6(4),y.Q6J("ngModel",Ze.commentModel.CheckinStatusTypeID),y.xp6(1),y.Q6J("ngForOf",Ze.checkinTypes),y.xp6(4),y.Q6J("ngModel",Ze.commentModel.Rating))},dependencies:[C.sg,Ne.JJ,Ne.On,s.YG,s.Sm,s.W2,s.fr,s.Gu,s.gu,s.pK,s.Ie,s.Q$,s.q_,s.t9,s.n0,s.wd,s.sr,s.QI,s.j9],encapsulation:2})),ze})();var ue=k(7777),ct=k(4669),ht=k(8767),Le=k(6662),ye=k(866),gt=k(3999),De=k(1163);function Pe(pe,ze){if(1&pe&&(y.TgZ(0,"div")(1,"small"),y._uU(2),y.qZA()()),2&pe){const xe=y.oxw(2);y.xp6(2),y.Oqu(xe.connectionSummary)}}function Ae(pe,ze){if(1&pe&&(y.TgZ(0,"div")(1,"small"),y._uU(2),y.qZA()()),2&pe){const xe=y.oxw(2);y.xp6(2),y.Oqu(xe.poi.OperatorInfo.Title)}}function Ye(pe,ze){1&pe&&(y.TgZ(0,"div")(1,"small"),y._uU(2,"[Submission Awaiting Review]"),y.qZA()())}function _t(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",28),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.addFavourite())}),y._UZ(2,"ion-icon",29),y.TgZ(3,"ion-label"),y._uU(4,"Favourite"),y.qZA()(),y.TgZ(5,"ion-button",13),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.edit())}),y._UZ(6,"ion-icon",30),y.TgZ(7,"ion-label"),y._uU(8,"Edit"),y.qZA()(),y.BQk()}}function hn(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",31),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.launchNavigation())}),y._UZ(2,"ion-icon",32),y.TgZ(3,"ion-label"),y._uU(4,"Navigate"),y.qZA()(),y.BQk()}}function qt(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",33),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.addComment())}),y._UZ(2,"ion-icon",34),y.TgZ(3,"ion-label"),y._uU(4,"Add Comment"),y.qZA()(),y.BQk()}}function Ht(pe,ze){if(1&pe){const xe=y.EpF();y.ynx(0),y.TgZ(1,"ion-button",35),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(2);return y.KtG(Ze.addMedia())}),y._UZ(2,"ion-icon",36),y.TgZ(3,"ion-label"),y._uU(4," Add Photo"),y.qZA()(),y.BQk()}}function Te(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.AddressLine1,"")}}function Je(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.AddressLine2,"")}}function Re(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.Town,"")}}function Fe(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.StateOrProvince,"")}}function St(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.Postcode,"")}}function Ce(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.Country.Title,"")}}function Rt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(1),y.hij(" ",xe.poi.AddressInfo.AccessComments," ")}}function Qt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",48),y.TgZ(2,"span",45),y._uU(3),y.qZA()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.Oqu(xe.poi.AddressInfo.ContactTelephone1)}}function Gt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",48),y.TgZ(2,"span",45),y._uU(3),y.qZA()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.Oqu(xe.poi.AddressInfo.ContactTelephone2)}}function Zt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",49),y.TgZ(2,"span",45),y._uU(3),y.qZA()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.Oqu(xe.poi.AddressInfo.ContactEmail)}}function Jt(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",50),y.TgZ(2,"span",45)(3,"a",51),y._uU(4),y.qZA()()()),2&pe){const xe=y.oxw(4);y.xp6(3),y.s9C("href",xe.poi.AddressInfo.RelatedURL,y.LSH),y.xp6(1),y.Oqu(xe.poi.AddressInfo.RelatedURL)}}function kt(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card")(1,"ion-card-header"),y._UZ(2,"ion-icon",43),y._uU(3),y.ALo(4,"translate"),y.qZA(),y.TgZ(5,"ion-card-content")(6,"ion-grid")(7,"ion-row")(8,"ion-col")(9,"ion-label",44),y._uU(10),y.ALo(11,"translate"),y.qZA(),y.TgZ(12,"div",45),y.YNc(13,Te,2,1,"div",0),y.YNc(14,Je,2,1,"div",0),y.YNc(15,Re,2,1,"div",0),y.YNc(16,Fe,2,1,"div",0),y.YNc(17,St,2,1,"div",0),y.YNc(18,Ce,2,1,"div",0),y.qZA()(),y.TgZ(19,"ion-col"),y.YNc(20,Rt,2,1,"p",0),y.YNc(21,Qt,4,1,"p",0),y.YNc(22,Gt,4,1,"p",0),y.YNc(23,Zt,4,1,"p",0),y.YNc(24,Jt,5,2,"p",0),y.qZA()(),y.TgZ(25,"ion-row")(26,"ion-col"),y._UZ(27,"ion-icon",46),y.TgZ(28,"ion-label",47),y._uU(29),y.ALo(30,"number"),y.ALo(31,"number"),y.qZA()()()()()()),2&pe){const xe=y.oxw(3);y.xp6(3),y.hij(" ",y.lcZ(4,15,"ocm.details.location.sectionTitle")," "),y.xp6(7),y.hij(" ",y.lcZ(11,17,"ocm.details.location.address"),""),y.xp6(3),y.Q6J("ngIf",xe.poi.AddressInfo.AddressLine1),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.AddressLine2),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.Town),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.StateOrProvince),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.Postcode),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.Country),y.xp6(2),y.Q6J("ngIf",xe.poi.AddressInfo.AccessComments),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.ContactTelephone1),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.ContactTelephone2),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.ContactEmail),y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo.RelatedURL),y.xp6(5),y.AsE(" ",y.xi3(30,19,xe.poi.AddressInfo.Latitude,"1.1-13")," , ",y.xi3(31,22,xe.poi.AddressInfo.Longitude,"1.1-13")," ")}}function dt(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",45),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.numberOfPoints"),":"),y.xp6(3),y.Oqu(xe.poi.NumberOfPoints)}}function Ot(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",45),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.operationalStatus"),":"),y.xp6(3),y.hij(" ",xe.poi.StatusType.Title," ")}}function pt(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",45),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.usageType"),":"),y.xp6(3),y.Oqu(xe.poi.UsageType.Title)}}function Yt(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"span",45),y._uU(5),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.usageCost"),":"),y.xp6(3),y.hij(" ",xe.poi.UsageCost,"")}}function Ut(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"br"),y._uU(2),y.ALo(3,"translate"),y._UZ(4,"br"),y.TgZ(5,"span",45),y._uU(6),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij("",y.lcZ(3,2,"ocm.details.generalComments"),": "),y.xp6(4),y.Oqu(xe.poi.GeneralComments)}}function ii(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",54),y._uU(2),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(2),y.hij(" ",xe.poi.OperatorInfo.WebsiteURL," ")}}function gn(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",49),y._uU(2),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(2),y.hij(" ",xe.poi.OperatorInfo.ContactEmail," ")}}function Ft(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y._UZ(1,"ion-icon",49),y._uU(2),y.qZA()),2&pe){const xe=y.oxw(4);y.xp6(2),y.hij(" ",xe.poi.OperatorInfo.FaultReportEmail," ")}}function Jn(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card")(1,"ion-card-header"),y._UZ(2,"ion-icon",52),y._uU(3),y.ALo(4,"translate"),y.qZA(),y.TgZ(5,"ion-card-content")(6,"div",45)(7,"p",53),y._uU(8),y.qZA(),y.YNc(9,ii,3,1,"p",0),y.YNc(10,gn,3,1,"p",0),y.YNc(11,Ft,3,1,"p",0),y.qZA()()()),2&pe){const xe=y.oxw(3);y.xp6(3),y.hij(" ",y.lcZ(4,5,"ocm.details.operator.sectionTitle")," "),y.xp6(5),y.hij(" ",xe.poi.OperatorInfo.Title," "),y.xp6(1),y.Q6J("ngIf",xe.poi.OperatorInfo.WebsiteURL),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.OperatorInfo.ContactEmail),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.OperatorInfo.FaultReportEmail&&xe.poi.OperatorInfo.FaultReportEmail!=xe.poi.OperatorInfo.ContactEmail)}}function Wt(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"a",56),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw(4);return y.KtG(Ze.launchURL(Ze.poi.DataProvider.WebsiteURL))}),y._uU(1),y.qZA()}if(2&pe){const xe=y.oxw(4);y.xp6(1),y.Oqu(xe.poi.DataProvider.WebsiteURL)}}function wt(pe,ze){if(1&pe&&(y.TgZ(0,"div",45)(1,"h3"),y._uU(2),y.ALo(3,"translate"),y.qZA(),y.TgZ(4,"p"),y._uU(5),y.qZA(),y.YNc(6,Wt,2,1,"a",55),y.TgZ(7,"p"),y._uU(8),y.qZA()()),2&pe){const xe=y.oxw(3);y.xp6(2),y.hij(" ",y.lcZ(3,4,"ocm.details.dataProvider.sectionTitle")," "),y.xp6(3),y.Oqu(null==xe.poi.DataProvider?null:xe.poi.DataProvider.Title),y.xp6(1),y.Q6J("ngIf",xe.poi.DataProvider.WebsiteURL),y.xp6(2),y.Oqu(null==xe.poi.DataProvider?null:xe.poi.DataProvider.License)}}function vt(pe,ze){if(1&pe&&(y.TgZ(0,"div",37),y.YNc(1,kt,32,25,"ion-card",0),y.TgZ(2,"ion-card")(3,"ion-card-header"),y._UZ(4,"ion-icon",38),y._uU(5),y.ALo(6,"translate"),y.qZA(),y.TgZ(7,"ion-card-content"),y.YNc(8,dt,6,4,"p",0),y._UZ(9,"app-equipment-details",39),y.qZA()(),y.TgZ(10,"ion-card")(11,"ion-card-header"),y._UZ(12,"ion-icon",40),y._uU(13," Usage Restrictions "),y.qZA(),y.TgZ(14,"ion-card-content"),y.YNc(15,Ot,6,4,"p",0),y.YNc(16,pt,6,4,"p",0),y.YNc(17,Yt,6,4,"p",0),y.YNc(18,Ut,7,4,"p",0),y.qZA()(),y.YNc(19,Jn,12,7,"ion-card",0),y.TgZ(20,"ion-card")(21,"ion-card-header"),y._UZ(22,"ion-icon",41),y._uU(23),y.ALo(24,"translate"),y.qZA(),y.TgZ(25,"ion-card-content"),y.YNc(26,wt,9,6,"div",42),y.qZA()()()),2&pe){const xe=y.oxw(2);y.xp6(1),y.Q6J("ngIf",xe.poi.AddressInfo),y.xp6(4),y.hij(" ",y.lcZ(6,11,"ocm.details.equipment.sectionTitle")," "),y.xp6(3),y.Q6J("ngIf",null!=xe.poi.NumberOfPoints),y.xp6(1),y.Q6J("item",xe.poi),y.xp6(6),y.Q6J("ngIf",null!=xe.poi.StatusType),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.UsageType),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.UsageCost),y.xp6(1),y.Q6J("ngIf",null!=xe.poi.GeneralComments),y.xp6(1),y.Q6J("ngIf",xe.poi.OperatorInfo),y.xp6(4),y.hij(" ",y.lcZ(24,13,"ocm.details.advancedDetails")," "),y.xp6(3),y.Q6J("ngIf",xe.poi.DataProvider)}}function ln(pe,ze){if(1&pe&&y._UZ(0,"img",60),2&pe){const xe=y.oxw().$implicit;y.s9C("src",null==xe.User?null:xe.User.ProfileImageURL,y.LSH)}}function ni(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.User.Username)}}function er(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.Username)}}function lr(pe,ze){if(1&pe&&(y.TgZ(0,"p",45),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.hij(" ",null==xe.CommentType?null:xe.CommentType.Title," ")}}function mi(pe,ze){if(1&pe&&(y.TgZ(0,"p")(1,"span",44),y._uU(2,"Rating:"),y.qZA(),y.TgZ(3,"span",45),y._uU(4),y.qZA()()),2&pe){const xe=y.oxw().$implicit;y.xp6(4),y.hij("",xe.Rating," out of 5")}}function Fi(pe,ze){1&pe&&(y.ynx(0),y._UZ(1,"ion-icon",61),y.BQk())}function Cn(pe,ze){1&pe&&(y.ynx(0),y._UZ(1,"ion-icon",62),y.BQk())}function Mn(pe,ze){if(1&pe&&(y.TgZ(0,"p"),y.YNc(1,Fi,2,0,"ng-container",0),y.YNc(2,Cn,2,0,"ng-container",0),y._uU(3),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Q6J("ngIf",!0===xe.CheckinStatusType.IsPositive),y.xp6(1),y.Q6J("ngIf",!1===xe.CheckinStatusType.IsPositive),y.xp6(1),y.hij(" ",xe.CheckinStatusType.Title," ")}}function qn(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card")(1,"ion-item")(2,"ion-avatar",19),y.YNc(3,ln,1,1,"img",59),y.qZA(),y.TgZ(4,"ion-label"),y.YNc(5,ni,2,1,"span",0),y.YNc(6,er,2,1,"span",0),y.qZA(),y.TgZ(7,"ion-label",20),y._uU(8),y.ALo(9,"date"),y.qZA()(),y.TgZ(10,"ion-card-content")(11,"p"),y._uU(12),y.qZA(),y.YNc(13,lr,2,1,"p",42),y.YNc(14,mi,5,1,"p",0),y.YNc(15,Mn,4,3,"p",0),y.qZA()()),2&pe){const xe=ze.$implicit;y.xp6(3),y.Q6J("ngIf",xe.User&&xe.User.ProfileImageURL),y.xp6(2),y.Q6J("ngIf",xe.User),y.xp6(1),y.Q6J("ngIf",!xe.User),y.xp6(2),y.hij(" ",y.lcZ(9,8,xe.DateCreated)," "),y.xp6(4),y.Oqu(xe.Comment),y.xp6(1),y.Q6J("ngIf",10!=xe.CommentTypeID),y.xp6(1),y.Q6J("ngIf",xe.Rating),y.xp6(1),y.Q6J("ngIf",xe.CheckinStatusType)}}function yn(pe,ze){if(1&pe&&(y.ynx(0),y.YNc(1,qn,16,10,"ion-card",58),y.BQk()),2&pe){const xe=y.oxw(3);y.xp6(1),y.Q6J("ngForOf",xe.poi.UserComments)}}function _n(pe,ze){1&pe&&(y.TgZ(0,"p",21),y._uU(1),y.ALo(2,"translate"),y.qZA()),2&pe&&(y.xp6(1),y.hij(" ",y.lcZ(2,1,"ocm.details.commentsAndRatings.zeroComments")," "))}function Hi(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y.YNc(1,yn,2,1,"ng-container",0),y.YNc(2,_n,3,3,"p",57),y.qZA()),2&pe){const xe=y.oxw(2);y.xp6(1),y.Q6J("ngIf",1==xe.poi._hasComments),y.xp6(1),y.Q6J("ngIf",0==xe.poi._hasComments)}}function nt(pe,ze){if(1&pe&&y._UZ(0,"img",60),2&pe){const xe=y.oxw().$implicit;y.s9C("src",null==xe.User?null:xe.User.ProfileImageURL,y.LSH)}}function ge(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.User.Username)}}function ve(pe,ze){if(1&pe&&(y.TgZ(0,"span"),y._uU(1),y.qZA()),2&pe){const xe=y.oxw().$implicit;y.xp6(1),y.Oqu(xe.Username)}}function Xe(pe,ze){if(1&pe&&(y.TgZ(0,"ion-card"),y._UZ(1,"img",60),y.TgZ(2,"ion-item")(3,"ion-avatar",19),y.YNc(4,nt,1,1,"img",59),y.qZA(),y.TgZ(5,"ion-label"),y.YNc(6,ge,2,1,"span",0),y.YNc(7,ve,2,1,"span",0),y.qZA(),y.TgZ(8,"ion-label",20),y._uU(9),y.ALo(10,"date"),y.qZA()(),y.TgZ(11,"ion-card-content")(12,"p"),y._uU(13),y.qZA()()()),2&pe){const xe=ze.$implicit;y.xp6(1),y.s9C("src",xe.ItemMediumURL,y.LSH),y.xp6(3),y.Q6J("ngIf",xe.User&&xe.User.ProfileImageURL),y.xp6(2),y.Q6J("ngIf",xe.User),y.xp6(1),y.Q6J("ngIf",!xe.User),y.xp6(2),y.hij(" ",y.lcZ(10,6,xe.DateCreated)," "),y.xp6(4),y.Oqu(xe.Comment)}}function ft(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y.YNc(1,Xe,14,8,"ion-card",58),y.qZA()),2&pe){const xe=y.oxw(3);y.xp6(1),y.Q6J("ngForOf",xe.poi.MediaItems)}}function Ct(pe,ze){1&pe&&(y.TgZ(0,"div",21)(1,"p",63),y._uU(2),y.ALo(3,"translate"),y.qZA()()),2&pe&&(y.xp6(2),y.hij(" ",y.lcZ(3,1,"ocm.details.mediaItems.addPrompt"),""))}function Bt(pe,ze){if(1&pe&&(y.TgZ(0,"div"),y.YNc(1,ft,2,1,"div",0),y.YNc(2,Ct,4,3,"div",57),y.qZA()),2&pe){const xe=y.oxw(2);y.xp6(1),y.Q6J("ngIf",xe.poi._hasPhotos),y.xp6(1),y.Q6J("ngIf",!xe.poi._hasPhotos)}}function jt(pe,ze){if(1&pe&&(y.TgZ(0,"p",64),y._uU(1),y.qZA()),2&pe){const xe=y.oxw(2);y.xp6(1),y.hij(" ",xe.json,"")}}function Et(pe,ze){if(1&pe){const xe=y.EpF();y.TgZ(0,"div")(1,"div",1)(2,"div",2)(3,"h2"),y._uU(4),y.qZA(),y.TgZ(5,"div")(6,"small"),y._uU(7),y.qZA()(),y.YNc(8,Pe,3,1,"div",0),y.YNc(9,Ae,3,1,"div",0),y.YNc(10,Ye,3,0,"div",0),y.TgZ(11,"ion-badge",3),y._uU(12),y.ALo(13,"number"),y.qZA()(),y.TgZ(14,"ion-fab",4)(15,"ion-fab-button"),y._UZ(16,"ion-icon",5),y.qZA(),y.TgZ(17,"ion-fab-list",6)(18,"ion-fab-button",7),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.addComment())}),y._UZ(19,"ion-icon",8),y.qZA(),y.TgZ(20,"ion-fab-button",9),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.addMedia())}),y._UZ(21,"ion-icon",10),y.qZA(),y.TgZ(22,"ion-fab-button",11),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.addFavourite())}),y._UZ(23,"ion-icon",12),y.qZA(),y.TgZ(24,"ion-fab-button",13),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.edit())}),y._UZ(25,"ion-icon",14),y.qZA(),y.TgZ(26,"ion-fab-button",15),y.NdJ("click",function(){y.CHM(xe);const Ze=y.oxw();return y.KtG(Ze.refresh())}),y._UZ(27,"ion-icon",16),y.qZA()()()(),y.TgZ(28,"ion-refresher",17),y.NdJ("ionRefresh",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.refresh(Ze))}),y._UZ(29,"ion-refresher-content",18),y.qZA(),y.TgZ(30,"ion-toolbar")(31,"ion-buttons",19),y.YNc(32,_t,9,0,"ng-container",0),y.qZA(),y.TgZ(33,"ion-buttons",20),y.YNc(34,hn,5,0,"ng-container",0),y.YNc(35,qt,5,0,"ng-container",0),y.YNc(36,Ht,5,0,"ng-container",0),y.qZA()(),y.TgZ(37,"div",21)(38,"ion-segment",22),y.NdJ("ngModelChange",function(Ze){y.CHM(xe);const Pt=y.oxw();return y.KtG(Pt.selectedTab=Ze)}),y.TgZ(39,"ion-segment-button",23)(40,"ion-label"),y._uU(41," Details "),y.qZA()(),y.TgZ(42,"ion-segment-button",24)(43,"ion-label"),y._uU(44),y.qZA()(),y.TgZ(45,"ion-segment-button",25)(46,"ion-label"),y._uU(47),y.qZA()()()(),y.YNc(48,vt,27,15,"div",26),y.YNc(49,Hi,3,2,"div",0),y.YNc(50,Bt,3,2,"div",0),y.YNc(51,jt,2,1,"p",27),y.qZA()}if(2&pe){const xe=y.oxw();y.xp6(1),y.Udp("background-image",xe.backdropImage?"url("+xe.backdropImage+")":""),y.xp6(3),y.hij(" ",xe.poi.AddressInfo.Title," "),y.xp6(3),y.hij("OCM-",xe.poi.ID,""),y.xp6(1),y.Q6J("ngIf",xe.connectionSummary),y.xp6(1),y.Q6J("ngIf",xe.poi.OperatorInfo),y.xp6(1),y.Q6J("ngIf",1==xe.poi.SubmissionStatusTypeID),y.xp6(2),y.Oqu(y.xi3(13,19,xe.avgRating,"1.1-1")),y.xp6(20),y.Q6J("ngIf","location"==xe.selectedTab),y.xp6(2),y.Q6J("ngIf","location"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","comments"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","media"==xe.selectedTab),y.xp6(2),y.Q6J("ngModel",xe.selectedTab),y.xp6(6),y.hij("Comments (",xe.poi.UserComments?xe.poi.UserComments.length:0,")"),y.xp6(3),y.hij(" Photos (",xe.poi.MediaItems?xe.poi.MediaItems.length:0,")"),y.xp6(1),y.Q6J("ngIf","location"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","comments"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf","media"==xe.selectedTab),y.xp6(1),y.Q6J("ngIf",1==xe.appManager.isDebugMode)}}function Xt(pe,ze){1&pe&&(y.TgZ(0,"div")(1,"h2"),y._uU(2,"POI Not Found"),y.qZA(),y.TgZ(3,"p"),y._uU(4,"The POI details could not be loaded."),y.qZA()())}let Sn=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn,Ci,wi,cr){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"translate",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"actionSheetController",void 0),(0,x.Z)(this,"poiManager",void 0),(0,x.Z)(this,"router",void 0),(0,x.Z)(this,"poi",void 0),(0,x.Z)(this,"selectedTab",void 0),(0,x.Z)(this,"json",void 0),(0,x.Z)(this,"hasNavBar",!1),(0,x.Z)(this,"backdropImage",void 0),(0,x.Z)(this,"avgRating",void 0),(0,x.Z)(this,"connectionSummary",void 0),this.appManager=be,this.nav=Ze,this.translate=Pt,this.logging=bn,this.modalController=Kn,this.actionSheetController=Ci,this.poiManager=wi,this.router=cr}ngOnChanges(be){if(this.logging.log("In ngOnChanges of POI Details"),null!=this.poi&&null!=this.poi.AddressInfo){if(this.selectedTab="location",null!=this.poi.MediaItems&&this.poi.MediaItems.length>0){this.poi._hasPhotos=!0;for(let Ze of this.poi.MediaItems)Ze.ItemMediumURL=Ze.ItemThumbnailURL.replace(".thmb.",".medi.");this.backdropImage=this.poi.MediaItems[this.poi.MediaItems.length-1].ItemThumbnailURL.replace(".thmb.",".medi.")}else this.poi._hasPhotos=!1,this.backdropImage=null;if(null!=this.poi.UserComments&&this.poi.UserComments.length>0){this.poi._hasComments=!0;try{let Ze=this.poi.UserComments.filter(Pt=>Pt.Rating>0);if(Ze.length>0){let Pt=0;for(let bn of Ze)Pt+=bn.Rating;this.avgRating=Pt/Ze.length}else this.avgRating=null}catch{}}else this.poi._hasComments=!1;if(this.poi.Connections&&this.poi.Connections.length>0){let Ze="";for(let Pt of this.poi.Connections)-1==Ze.indexOf(Pt.ConnectionType.Title)&&(Ze+=(""!=Ze?", ":"")+Pt.ConnectionType.Title);this.connectionSummary=Ze}}}ngOnInit(){this.logging.log("In ngInit of POI Details")}get staticMapURL(){return"https://maps.googleapis.com/maps/api/staticmap?key="+(new ue.X).googleMapsAPIKey+"¢er="+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude+"&zoom=13&scale=2&size="+this.staticMapSize+"&maptype=roadmap&format=jpg&visual_refresh=true&markers=size:small%7Ccolor:0xff0000%7Clabel:%7C"+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude}get staticMapSize(){return 0===this.appManager.clientWidth?"240x100":this.appManager.clientWidth>=800?"640x100":this.appManager.clientWidth>=400?"400x100":"240x100"}continueAddComment(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.modalController.create({component:le,componentProps:{id:be.poi.ID,poi:be.poi}});setTimeout(()=>{be.refresh()},1e3),yield Ze.present()})()}addComment(){var be=this;return(0,J.Z)(function*(){if(be.appManager.isUserAuthenticated(!0))yield be.continueAddComment();else{const Ze=yield be.modalController.create({component:ht.F});Ze.onDidDismiss().then((0,J.Z)(function*(){be.appManager.isUserAuthenticated(!0)&&(yield be.continueAddComment())})),yield Ze.present()}})()}continueAddMedia(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.modalController.create({component:Ie,componentProps:{id:be.poi.ID,poi:be.poi}});Ze.onDidDismiss().then(()=>{setTimeout(()=>{be.refresh()},1e3)}),yield Ze.present()})()}addMedia(){var be=this;return(0,J.Z)(function*(){if(be.appManager.isUserAuthenticated(!0))yield be.continueAddMedia();else{const Ze=yield be.modalController.create({component:ht.F});Ze.onDidDismiss().then((0,J.Z)(function*(){be.appManager.isUserAuthenticated(!0)&&(yield be.continueAddMedia())})),yield Ze.present()}})()}addFavourite(){var be=this;return(0,J.Z)(function*(){yield(yield be.actionSheetController.create({header:"Add Favourite",buttons:[{text:"Add to Journey",handler:()=>{be.modalController.create({component:ae,componentProps:{poi:be.poi}}).then(Pt=>Pt.present())}},{text:"Cancel",role:"cancel",handler:()=>{}}]})).present()})()}launchNavigation(){this.appManager.isPlatform("ios")?this.appManager.launchWebPage("https://maps.apple.com/?ll="+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude):this.appManager.launchWebPage("https://maps.google.com/?q="+this.poi.AddressInfo.Latitude+","+this.poi.AddressInfo.Longitude)}launchURL(be){this.appManager.launchWebPage(be)}continueEdit(){var be=this;return(0,J.Z)(function*(){const Ze=yield be.modalController.create({component:Le.Y,componentProps:{id:be.poi.ID}});return Ze.onDidDismiss().then(Pt=>{be.refresh()}),yield Ze.present()})()}edit(){var be=this;return(0,J.Z)(function*(){if(ye.c.isFeatureEnabled("EDIT_POI"))if(be.appManager.isUserAuthenticated(!0))yield be.continueEdit();else{const Ze=yield be.modalController.create({component:ht.F});Ze.onDidDismiss().then((0,J.Z)(function*(){be.appManager.isUserAuthenticated(!0)&&(yield be.continueEdit())})),yield Ze.present()}else be.appManager.launchOCMWebPage("/poi/edit/"+be.poi.ID)})()}refresh(be=null){this.poi&&this.poiManager.getPOIById(this.poi.ID,!0,!0).then(Ze=>{Ze&&(this.poi=Ze,this.ngOnChanges(null)),be&&be.target.complete()})}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(h.c),y.Y36(s.SH),y.Y36(gt.sK),y.Y36(oe.z),y.Y36(s.IN),y.Y36(s.BX),y.Y36(ct.R),y.Y36(Ee.F0))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["poi-details"]],inputs:{poi:"poi"},features:[y.TTD],decls:2,vars:2,consts:[[4,"ngIf"],[1,"banner"],[1,"banner-content"],["color","primary","title","Average User Rating"],["vertical","top","horizontal","end","slot","fixed"],["name","add"],["side","bottom"],["title","Add a comment or charging check-in",3,"click"],["name","chatbubbles"],["title","Add a Photo",3,"click"],["name","camera"],["title","Add to Favourites",3,"click"],["name","star"],["title","Submit an Edit",3,"click"],["name","create"],["title","Refresh",3,"click"],["name","refresh"],["slot","fixed",3,"ionRefresh"],["pullingIcon","caret-down","pullingText","Pull to refresh","refreshingSpinner","circles","refreshingText","Refreshing..."],["slot","start"],["slot","end"],[1,"ion-padding"],[3,"ngModel","ngModelChange"],["value","location","selected",""],["value","comments"],["value","media"],["class","address-details",4,"ngIf"],["style","white-space: pre-wrap;",4,"ngIf"],["size","small","title","Add to Favourites",3,"click"],["name","star","slot","start"],["name","create","slot","start"],[3,"click"],["name","navigate","slot","start"],["size","small","title","Add a comment or charging check-in",3,"click"],["name","chatbubbles","slot","start"],["size","small","title","Add a Photo",3,"click"],["name","camera","slot","start"],[1,"address-details"],["name","battery-charging"],[3,"item"],["name","book"],["name","information-circle"],["class","details",4,"ngIf"],["name","map"],[1,"label"],[1,"details"],["name","pin"],[1,"details-minor"],["name","call"],["name","mail"],["name","globe"],["target","_system",3,"href"],["name","help-circle"],[1,"ion-padding-left"],["name","link"],["href","javascript:void(0)",3,"click",4,"ngIf"],["href","javascript:void(0)",3,"click"],["class","ion-padding",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"src",4,"ngIf"],[3,"src"],["name","checkmark-circle","color","success",2,"font-size","2em"],["name","close-circle","color","danger"],[1,"subtle"],[2,"white-space","pre-wrap"]],template:function(be,Ze){1&be&&(y.YNc(0,Et,52,22,"div",0),y.YNc(1,Xt,5,0,"div",0)),2&be&&(y.Q6J("ngIf",null!=Ze.poi&&null!=Ze.poi.AddressInfo),y.xp6(1),y.Q6J("ngIf",null==Ze.poi||null==Ze.poi.AddressInfo))},dependencies:[C.sg,C.O5,s.BJ,s.yp,s.YG,s.Sm,s.PM,s.FN,s.Zi,s.wI,s.IJ,s.W4,s.zq,s.jY,s.gu,s.Ie,s.Q$,s.nJ,s.Wo,s.Nd,s.cJ,s.GO,s.sr,s.QI,Ne.JJ,Ne.On,De.B,C.JJ,C.uU,gt.X$],styles:[".banner[_ngcontent-%COMP%]{background-color:#4f712f;color:#ffffffec;padding:1em;text-shadow:#000 1px 1px 1px;min-height:180px;background-size:cover}.banner[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.banner-content[_ngcontent-%COMP%]{padding-right:48px}h3[_ngcontent-%COMP%]{font-weight:700}.label[_ngcontent-%COMP%]{color:#000;font-weight:700;font-size:12px}.details[_ngcontent-%COMP%]{color:#707d61;margin-left:1em;font-size:12px}.details-minor[_ngcontent-%COMP%]{color:#707d61;font-size:12px}p[_ngcontent-%COMP%]{display:block;padding:4px}ion-card-header[_ngcontent-%COMP%]{font-weight:700;padding-bottom:0}ion-card-content[_ngcontent-%COMP%]{padding-top:4px}"]})),ze})(),zn=(()=>{var pe;class ze{constructor(be,Ze,Pt){(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"navParams",void 0),(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"poi",void 0),(0,x.Z)(this,"hasNavbar",!1),this.modalController=be,this.navParams=Ze,this.appManager=Pt,this.poi=this.navParams.get("item"),this.appManager.analytics.viewEvent("POIDetails")}close(){this.modalController.dismiss()}}return pe=ze,(0,x.Z)(ze,"\u0275fac",function(be){return new(be||pe)(y.Y36(s.IN),y.Y36(s.X1),y.Y36(h.c))}),(0,x.Z)(ze,"\u0275cmp",y.Xpm({type:pe,selectors:[["ng-component"]],decls:11,vars:3,consts:[["color","primary"],["slot","start"],[3,"click"],["name","close","slot","icon-only"],[1,"poi-details"],[3,"poi"]],template:function(be,Ze){1&be&&(y.TgZ(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-title"),y._uU(3),y.TgZ(4,"small"),y._uU(5),y.qZA()(),y.TgZ(6,"ion-buttons",1)(7,"ion-button",2),y.NdJ("click",function(){return Ze.close()}),y._UZ(8,"ion-icon",3),y.qZA()()()(),y.TgZ(9,"ion-content",4),y._UZ(10,"poi-details",5),y.qZA()),2&be&&(y.xp6(3),y.hij(" ",Ze.poi.AddressInfo.Title," "),y.xp6(2),y.hij("OCM-",Ze.poi.ID,""),y.xp6(5),y.Q6J("poi",Ze.poi))},dependencies:[s.YG,s.Sm,s.W2,s.Gu,s.gu,s.wd,s.sr,Sn],styles:['.left-col[_ngcontent-%COMP%]{float:left;width:50%;overflow:auto}.right-col[_ngcontent-%COMP%]{float:right;width:50%;overflow:auto}.row[_ngcontent-%COMP%]:after{content:"";display:table;clear:both;overflow:auto}.row[_ngcontent-%COMP%]{margin-bottom:1em}.subtle[_ngcontent-%COMP%]{color:silver}@media screen and (max-width: 768px){.left-col[_ngcontent-%COMP%]{float:none;width:100%}.right-col[_ngcontent-%COMP%]{margin-top:1em;float:none;width:100%}}.address-details[_ngcontent-%COMP%] ion-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:200px;width:auto}ion-label[_ngcontent-%COMP%]{overflow:inherit}ion-title[_ngcontent-%COMP%] > small[_ngcontent-%COMP%]{color:#ffffffbf}']})),ze})()},5722:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{PoiEditorPageModule:()=>he});var x=k(1180),h=k(6814),y=k(6223),s=k(6800),J=k(9843),ie=k(6662),Y=k(3999),C=k(5086),Ne=k(2029);const me=[{path:"",component:ie.Y}];let he=(()=>{var _e;class ee{}return _e=ee,(0,x.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)}),(0,x.Z)(ee,"\u0275mod",Ne.oAB({type:_e})),(0,x.Z)(ee,"\u0275inj",Ne.cJS({imports:[h.ez,y.u5,J.Pc,Y.aw,C.e,s.Bz.forChild(me)]})),ee})()},6662:(Nn,yt,k)=>{"use strict";k.d(yt,{Y:()=>gn});var x=k(5861),h=k(1180),y=k(6470),s=k(7518),J=k(866),ie=k(4669),Y=k(1847),C=k(2029),Ne=k(3955),me=k(9903),he=k(9127),_e=k(5957),ee=k(9862),ae=k(6814),oe=k(9843);function Be(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.TgZ(1,"ion-note")(2,"p"),C._uU(3," The closest address to this position is: "),C.qZA(),C.TgZ(4,"p")(5,"strong"),C._uU(6),C.qZA(),C._UZ(7,"br"),C._uU(8),C._UZ(9,"br"),C.TgZ(10,"ion-button",3),C.NdJ("click",function(){C.CHM(Wt);const vt=C.oxw();return C.KtG(vt.useAddressSelection())}),C._uU(11,"Use this address below "),C._UZ(12,"ion-icon",4),C.qZA()()(),C.BQk()}if(2&Ft){const Wt=C.oxw();C.xp6(6),C.Oqu(Wt.suggestedAddress.AddressLine1),C.xp6(2),C.HOy(" ",Wt.suggestedAddress.AddressLine2," ",Wt.suggestedAddress.Town," ",Wt.suggestedAddress.StateOrProvince," ",Wt.suggestedAddress.Postcode," ")}}let Ie=(()=>{var Ft;class Jn{constructor(wt,vt,ln,ni,er){(0,h.Z)(this,"mapping",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"latitude",void 0),(0,h.Z)(this,"latitudeChange",new C.vpe),(0,h.Z)(this,"longitude",void 0),(0,h.Z)(this,"longitudeChange",new C.vpe),(0,h.Z)(this,"suggestedAddress",null),(0,h.Z)(this,"suggestedAddressChange",new C.vpe),(0,h.Z)(this,"onUseSuggestedAddress",new C.vpe),(0,h.Z)(this,"suggestedAddressAttribution",null),(0,h.Z)(this,"suggestedAddressAttributionChange",new C.vpe),(0,h.Z)(this,"originalMarkerPos",void 0),(0,h.Z)(this,"mapService",void 0),(0,h.Z)(this,"mapOptions",void 0),(0,h.Z)(this,"debouncedGecode",void 0),(0,h.Z)(this,"isMapInitialised",!1),this.mapping=wt,this.events=vt,this.logging=ln,this.http=ni,this.appManager=er}ngOnInit(){this.mapService=new me.k(this.events,this.logging,this.http),this.mapService.initAPI(),this.mapOptions=new Ne._,this.mapOptions.mapType=this.appManager.searchSettings.MapType,this.mapOptions.onMapMoveCompleted=()=>{let wt;wt=this.mapService.getMapCenter(),wt.subscribe(vt=>{vt&&(this.latitude=vt.coords.latitude,this.longitude=vt.coords.longitude,this.latitudeChange.emit(this.latitude),this.longitudeChange.emit(this.longitude),this.getAddressForCurrentLatLng())})}}ngAfterContentInit(){this.focusMap()}ngOnDestroy(){this.mapService.disposeMap()}focusMap(){0==this.isMapInitialised&&this.mapService&&0!=this.latitude&&0!=this.longitude&&(this.isMapInitialised=!0,this.mapService.initMap("editor-map",this.mapOptions,null),this.mapService.setMapCenter(new s.jR(this.latitude,this.longitude)),this.originalMarkerPos=new s.wC(this.latitude,this.longitude))}ngOnChanges(wt){this.focusMap()}getAddressForCurrentLatLng(){var wt=this;return(0,x.Z)(function*(){wt.latitude&&wt.longitude&&wt.appManager.api.fetchReverseGeocodeResult(wt.latitude,wt.longitude).then(vt=>{vt.AddressInfo&&(wt.suggestedAddress=vt.AddressInfo)})})()}useAddressSelection(){this.onUseSuggestedAddress.emit({suggestedAddress:this.suggestedAddress,attribution:this.suggestedAddressAttribution}),this.suggestedAddress=null,this.suggestedAddressAttribution=null}}return Ft=Jn,(0,h.Z)(Jn,"\u0275fac",function(wt){return new(wt||Ft)(C.Y36(Y.v),C.Y36(_e.z),C.Y36(he.z),C.Y36(ee.eN),C.Y36(y.c))}),(0,h.Z)(Jn,"\u0275cmp",C.Xpm({type:Ft,selectors:[["app-poi-location-editor"]],inputs:{latitude:"latitude",longitude:"longitude"},outputs:{latitudeChange:"latitudeChange",longitudeChange:"longitudeChange",suggestedAddressChange:"suggestedAddressChange",onUseSuggestedAddress:"onUseSuggestedAddress",suggestedAddressAttributionChange:"suggestedAddressAttributionChange"},features:[C.TTD],decls:4,vars:1,consts:[[1,"instruction"],["id","editor-map"],[4,"ngIf"],["size","small",3,"click"],["slot","end","name","copy"]],template:function(wt,vt){1&wt&&(C.TgZ(0,"p",0),C._uU(1,"Drag the map to center the marker on the charging location:"),C.qZA(),C._UZ(2,"div",1),C.YNc(3,Be,13,5,"ng-container",2)),2&wt&&(C.xp6(3),C.Q6J("ngIf",vt.suggestedAddress))},dependencies:[ae.O5,oe.YG,oe.gu,oe.uN],styles:["#editor-map[_ngcontent-%COMP%]{border:1px solid gainsboro;background-color:gray;width:100%;height:128px}"]})),Jn})();var Ee=k(9159),Ue=k(6223);function et(Ft,Jn){if(1&Ft&&(C.TgZ(0,"ion-select-option",14),C._uU(1),C.qZA()),2&Ft){const Wt=Jn.$implicit;C.Q6J("value",Wt.ID),C.xp6(1),C.Oqu(Wt.Title)}}function le(Ft,Jn){if(1&Ft&&(C.TgZ(0,"ion-select-option",14),C._uU(1),C.qZA()),2&Ft){const Wt=Jn.$implicit;C.Q6J("value",Wt.ID),C.xp6(1),C.Oqu(Wt.Title)}}function ue(Ft,Jn){if(1&Ft&&(C.TgZ(0,"ion-select-option",14),C._uU(1),C.qZA()),2&Ft){const Wt=Jn.$implicit;C.Q6J("value",Wt.ID),C.xp6(1),C.Oqu(Wt.Title)}}let ct=(()=>{var Ft;class Jn{constructor(wt,vt){(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"referenceDataManager",void 0),(0,h.Z)(this,"conn",void 0),(0,h.Z)(this,"useFilteredConnectionTypes",!0),(0,h.Z)(this,"useFilteredOperators",!0),this.modalController=wt,this.referenceDataManager=vt}get isAddMode(){return!(null!=this.conn&&this.conn.ID>0)}get connectionTypes(){return this.referenceDataManager.getConnectionTypes(this.useFilteredConnectionTypes)}get currentTypes(){return this.referenceDataManager.getOutputCurrentTypes()}get statusTypes(){return this.referenceDataManager.getStatusTypes().filter(wt=>1==wt.IsUserSelectable)}ngOnInit(){}save(){var wt=!0;null!=this.conn.Quantity&&(this.conn.Quantity<0||this.conn.Quantity>100||!Number.isInteger(this.conn.Quantity))&&(alert("Quantity must be a whole number, or leave it blank."),wt=!1),wt&&this.modalController.dismiss({item:this.conn})}cancel(){this.modalController.dismiss()}}return Ft=Jn,(0,h.Z)(Jn,"\u0275fac",function(wt){return new(wt||Ft)(C.Y36(oe.IN),C.Y36(Ee.W))}),(0,h.Z)(Jn,"\u0275cmp",C.Xpm({type:Ft,selectors:[["app-poi-equipment-editor"]],decls:60,vars:13,consts:[[1,"ion-padding"],["position","floating"],[3,"ngModel","ngModelChange"],["value","0"],[3,"value",4,"ngFor","ngForOf"],["type","number",3,"ngModel","ngModelChange"],["type","text","placeholder","(optional) other comments",3,"ngModel","ngModelChange"],["type","text",3,"ngModel","ngModelChange"],["slot","start"],[3,"click"],["name","close","slot","start"],["slot","end"],["color","success",3,"click"],["name","send","slot","end"],[3,"value"]],template:function(wt,vt){1&wt&&(C.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),C._uU(3),C.qZA()()(),C.TgZ(4,"ion-content",0)(5,"p"),C._uU(6,"Please provide as much information as you can about the equipment. If you don't know then leave the field blank. At a minimum you should include the Connection Type and approximate Power kW (max)."),C.qZA(),C.TgZ(7,"ion-item")(8,"ion-label",1),C._uU(9,"Connection Type"),C.qZA(),C.TgZ(10,"ion-select",2),C.NdJ("ngModelChange",function(ni){return vt.conn.ConnectionTypeID=ni}),C.TgZ(11,"ion-select-option",3),C._uU(12,"Unknown"),C.qZA(),C.YNc(13,et,2,2,"ion-select-option",4),C.qZA()(),C.TgZ(14,"ion-item")(15,"ion-label",1),C._uU(16,"Supply Type"),C.qZA(),C.TgZ(17,"ion-select",2),C.NdJ("ngModelChange",function(ni){return vt.conn.CurrentTypeID=ni}),C.TgZ(18,"ion-select-option",3),C._uU(19,"Unknown"),C.qZA(),C.YNc(20,le,2,2,"ion-select-option",4),C.qZA()(),C.TgZ(21,"ion-item")(22,"ion-label",1),C._uU(23,"Power (kW)"),C.qZA(),C.TgZ(24,"ion-input",5),C.NdJ("ngModelChange",function(ni){return vt.conn.PowerKW=ni}),C.qZA()(),C.TgZ(25,"ion-item")(26,"ion-label",1),C._uU(27,"Amps"),C.qZA(),C.TgZ(28,"ion-input",5),C.NdJ("ngModelChange",function(ni){return vt.conn.Amps=ni}),C.qZA()(),C.TgZ(29,"ion-item")(30,"ion-label",1),C._uU(31,"Voltage"),C.qZA(),C.TgZ(32,"ion-input",5),C.NdJ("ngModelChange",function(ni){return vt.conn.Voltage=ni}),C.qZA()(),C.TgZ(33,"ion-item")(34,"ion-label",1),C._uU(35,"Status"),C.qZA(),C.TgZ(36,"ion-select",2),C.NdJ("ngModelChange",function(ni){return vt.conn.StatusTypeID=ni}),C.YNc(37,ue,2,2,"ion-select-option",4),C.qZA()(),C.TgZ(38,"ion-item")(39,"ion-label",1),C._uU(40,"Quantity Available"),C.qZA(),C.TgZ(41,"ion-input",5),C.NdJ("ngModelChange",function(ni){return vt.conn.Quantity=ni}),C.qZA()(),C.TgZ(42,"ion-item")(43,"ion-label",1),C._uU(44,"Comment"),C.qZA(),C.TgZ(45,"ion-input",6),C.NdJ("ngModelChange",function(ni){return vt.conn.Comments=ni}),C.qZA()(),C.TgZ(46,"ion-item")(47,"ion-label",1),C._uU(48,"Operators Reference"),C.qZA(),C.TgZ(49,"ion-input",7),C.NdJ("ngModelChange",function(ni){return vt.conn.Reference=ni}),C.qZA()()(),C.TgZ(50,"ion-footer")(51,"ion-toolbar")(52,"ion-buttons",8)(53,"ion-button",9),C.NdJ("click",function(){return vt.cancel()}),C._UZ(54,"ion-icon",10),C._uU(55," Cancel "),C.qZA()(),C.TgZ(56,"ion-buttons",11)(57,"ion-button",12),C.NdJ("click",function(){return vt.save()}),C._uU(58," OK "),C._UZ(59,"ion-icon",13),C.qZA()()()()),2&wt&&(C.xp6(3),C.Oqu(vt.isAddMode?"Add Equipment":"Edit Equipment"),C.xp6(7),C.Q6J("ngModel",vt.conn.ConnectionTypeID),C.xp6(3),C.Q6J("ngForOf",vt.connectionTypes),C.xp6(4),C.Q6J("ngModel",vt.conn.CurrentTypeID),C.xp6(3),C.Q6J("ngForOf",vt.currentTypes),C.xp6(4),C.Q6J("ngModel",vt.conn.PowerKW),C.xp6(4),C.Q6J("ngModel",vt.conn.Amps),C.xp6(4),C.Q6J("ngModel",vt.conn.Voltage),C.xp6(4),C.Q6J("ngModel",vt.conn.StatusTypeID),C.xp6(1),C.Q6J("ngForOf",vt.statusTypes),C.xp6(4),C.Q6J("ngModel",vt.conn.Quantity),C.xp6(4),C.Q6J("ngModel",vt.conn.Comments),C.xp6(4),C.Q6J("ngModel",vt.conn.Reference))},dependencies:[ae.sg,oe.YG,oe.Sm,oe.W2,oe.fr,oe.Gu,oe.gu,oe.pK,oe.Ie,oe.Q$,oe.t9,oe.n0,oe.wd,oe.sr,oe.as,oe.QI,oe.j9,Ue.JJ,Ue.On]})),Jn})();var ht=function(Ft){return Ft[Ft.Unknown=0]="Unknown",Ft[Ft.CurrentlyAvailable=10]="CurrentlyAvailable",Ft[Ft.CurrentlyInUse=20]="CurrentlyInUse",Ft[Ft.TemporarilyUnavailable=30]="TemporarilyUnavailable",Ft[Ft.Operational=50]="Operational",Ft[Ft.PartlyOperational=75]="PartlyOperational",Ft[Ft.NotOperational=100]="NotOperational",Ft[Ft.PlannedForFutureDate=150]="PlannedForFutureDate",Ft[Ft.RemovedDecomissioned=200]="RemovedDecomissioned",Ft}(ht||{}),Le=function(Ft){return Ft[Ft.UnknownOperator=1]="UnknownOperator",Ft[Ft.SiteOwner=45]="SiteOwner",Ft}(Le||{}),De=k(8696),Pe=k(1163),Ae=k(6086);function Ye(Ft,Jn){1&Ft&&C._UZ(0,"ion-icon",13)}function _t(Ft,Jn){1&Ft&&C._UZ(0,"ion-icon",13)}function hn(Ft,Jn){1&Ft&&C._UZ(0,"ion-icon",13)}function qt(Ft,Jn){if(1&Ft&&(C.TgZ(0,"ion-select-option",27),C._uU(1),C.qZA()),2&Ft){const Wt=Jn.$implicit;C.Q6J("value",Wt.ID),C.xp6(1),C.Oqu(Wt.Title)}}function Ht(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.TgZ(1,"app-poi-location-editor",14,15),C.NdJ("latitudeChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.Latitude=vt)})("longitudeChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.Longitude=vt)})("onUseSuggestedAddress",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.useSuggestedAddress(vt))}),C.qZA(),C.TgZ(3,"ion-list")(4,"ion-item")(5,"ion-label",16),C._uU(6,"Location Name"),C.qZA(),C.TgZ(7,"ion-input",17),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.Title=vt)}),C.qZA()(),C.TgZ(8,"ion-item")(9,"ion-label",16),C._uU(10,"Address Line 1"),C.qZA(),C.TgZ(11,"ion-input",18),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.AddressLine1=vt)}),C.qZA()(),C.TgZ(12,"ion-item")(13,"ion-label",16),C._uU(14,"Address Line 2"),C.qZA(),C.TgZ(15,"ion-input",19),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.AddressLine2=vt)}),C.qZA()(),C.TgZ(16,"ion-item")(17,"ion-label",16),C._uU(18,"Town"),C.qZA(),C.TgZ(19,"ion-input",20),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.Town=vt)}),C.qZA()(),C.TgZ(20,"ion-item")(21,"ion-label",16),C._uU(22,"State or Province"),C.qZA(),C.TgZ(23,"ion-input",21),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.StateOrProvince=vt)}),C.qZA()(),C.TgZ(24,"ion-item")(25,"ion-label",16),C._uU(26,"Postal Code"),C.qZA(),C.TgZ(27,"ion-input",22),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.Postcode=vt)}),C.qZA()(),C.TgZ(28,"ion-item")(29,"ion-label",16),C._uU(30,"Country"),C.qZA(),C.TgZ(31,"ion-select",23),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.CountryID=vt)})("ionChange",function(){C.CHM(Wt);const vt=C.oxw(2);return C.KtG(vt.onCountryChange())}),C.YNc(32,qt,2,2,"ion-select-option",24),C.qZA()(),C.TgZ(33,"ion-item")(34,"ion-input",25),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.Latitude=vt)}),C.qZA()(),C.TgZ(35,"ion-item")(36,"ion-input",26),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.AddressInfo.Longitude=vt)}),C.qZA()()(),C.BQk()}if(2&Ft){const Wt=C.oxw(2);C.xp6(1),C.Q6J("latitude",Wt.item.AddressInfo.Latitude)("longitude",Wt.item.AddressInfo.Longitude),C.xp6(6),C.Q6J("ngModel",Wt.item.AddressInfo.Title),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.AddressLine1),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.AddressLine2),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.Town),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.StateOrProvince),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.Postcode),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.CountryID),C.xp6(1),C.Q6J("ngForOf",Wt.countries),C.xp6(2),C.Q6J("ngModel",Wt.item.AddressInfo.Latitude),C.xp6(2),C.Q6J("ngModel",Wt.item.AddressInfo.Longitude)}}function Te(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.TgZ(1,"h3"),C._uU(2,"Locations Nearby"),C.qZA(),C.TgZ(3,"p")(4,"strong"),C._uU(5,"The following locations already exist nearby."),C.qZA()(),C.TgZ(6,"div",28)(7,"p"),C._uU(8,"Ensure you are not adding a duplicate site unless it is for different equipment from another network operator."),C.qZA(),C.TgZ(9,"p"),C._uU(10,"You can edit any of these listings if required instead:"),C.qZA()(),C.TgZ(11,"app-poi-list",29),C.NdJ("onEdit",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.editPOI(vt))}),C.qZA(),C.BQk()}if(2&Ft){const Wt=C.oxw(2);C.xp6(11),C.Q6J("poiList",Wt.nearbySites)("enableEditOption",!0)}}function Je(Ft,Jn){if(1&Ft&&(C.ynx(0),C.YNc(1,Ht,37,12,"ng-container",9),C.YNc(2,Te,12,2,"ng-container",9),C.BQk()),2&Ft){const Wt=C.oxw();C.xp6(1),C.Q6J("ngIf","location"==Wt.step),C.xp6(1),C.Q6J("ngIf","poi-nearby"==Wt.step)}}function Re(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.TgZ(1,"p"),C._uU(2,"Copied the equipment configuration from:"),C.qZA(),C.TgZ(3,"ion-item")(4,"ion-label"),C._uU(5),C._UZ(6,"br"),C._uU(7),C._UZ(8,"br"),C._uU(9),C._UZ(10,"br"),C._uU(11),C._UZ(12,"br"),C._uU(13),C.qZA(),C.TgZ(14,"ion-button",31),C.NdJ("click",function(){C.CHM(Wt);const vt=C.oxw(5);return C.KtG(vt.changeTemplatePOI())}),C._uU(15,"Change.."),C.qZA()(),C.BQk()}if(2&Ft){const Wt=C.oxw(5);C.xp6(5),C.hij(" ",Wt.selectedTemplatePOI.AddressInfo.Title," "),C.xp6(2),C.hij(" ",Wt.selectedTemplatePOI.AddressInfo.AddressLine1," "),C.xp6(2),C.hij(" ",null==Wt.selectedTemplatePOI.Connections[0].ConnectionType?null:Wt.selectedTemplatePOI.Connections[0].ConnectionType.Title," "),C.xp6(2),C.hij(" ",Wt.selectedTemplatePOI.Connections[0].PowerKW," "),C.xp6(2),C.hij(" ",Wt.selectedTemplatePOI.DateCreated," ")}}function Fe(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.TgZ(1,"h4"),C._uU(2,"Similar Sites"),C.qZA(),C.TgZ(3,"app-poi-list",32),C.NdJ("onCopy",function(vt){C.CHM(Wt);const ln=C.oxw(6);return C.KtG(ln.useTemplatePOI(vt))}),C.qZA(),C.BQk()}if(2&Ft){const Wt=C.oxw(6);C.xp6(3),C.Q6J("enableCopyOption",!0)("poiList",Wt.templateSites)}}function St(Ft,Jn){1&Ft&&(C.ynx(0),C.TgZ(1,"p"),C._uU(2," There are no suggested sites to copy for this network operator. "),C.qZA(),C.BQk())}function Ce(Ft,Jn){if(1&Ft&&(C.ynx(0),C.YNc(1,Fe,4,2,"ng-container",9),C.YNc(2,St,3,0,"ng-container",9),C.BQk()),2&Ft){const Wt=C.oxw(5);C.xp6(1),C.Q6J("ngIf",Wt.templateSites.length>0),C.xp6(1),C.Q6J("ngIf",0==Wt.templateSites.length)}}function Rt(Ft,Jn){if(1&Ft&&(C.ynx(0),C.YNc(1,Re,16,5,"ng-container",9),C.YNc(2,Ce,3,2,"ng-container",9),C.BQk()),2&Ft){const Wt=C.oxw(4);C.xp6(1),C.Q6J("ngIf",Wt.selectedTemplatePOI),C.xp6(1),C.Q6J("ngIf",!Wt.selectedTemplatePOI)}}function Qt(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.TgZ(1,"p",28),C._uU(2,"You can copy the equipment settings from other sites operated by the same network operator or choose 'Next' to skip this step: "),C.qZA(),C.TgZ(3,"app-operator-lookup",30),C.NdJ("operatorChanged",function(vt){C.CHM(Wt);const ln=C.oxw(3);return C.KtG(ln.onOperatorChange(vt))}),C.qZA(),C.YNc(4,Rt,3,2,"ng-container",9),C.BQk()}if(2&Ft){const Wt=C.oxw(3);C.xp6(3),C.Q6J("operatorId",Wt.item.OperatorID),C.xp6(1),C.Q6J("ngIf",Wt.item.AddressInfo.CountryID&&Wt.item.OperatorID)}}function Gt(Ft,Jn){if(1&Ft&&(C.ynx(0),C.YNc(1,Qt,5,2,"ng-container",9),C.BQk()),2&Ft){const Wt=C.oxw(2);C.xp6(1),C.Q6J("ngIf",!Wt.skipPOICopy)}}function Zt(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.TgZ(1,"app-operator-lookup",33),C.NdJ("operatorChanged",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.onOperatorChange(vt))}),C.qZA(),C.TgZ(2,"ion-item")(3,"ion-input",34),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.item.NumberOfPoints=vt)}),C.qZA()(),C.TgZ(4,"h4"),C._uU(5,"Equipment"),C.qZA(),C.TgZ(6,"ion-button",35),C.NdJ("click",function(){C.CHM(Wt);const vt=C.oxw(2);return C.KtG(vt.addConnection())}),C._UZ(7,"ion-icon",36),C.qZA(),C.TgZ(8,"app-equipment-details",37),C.NdJ("onEdit",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.editConnection(vt))})("onDelete",function(vt){C.CHM(Wt);const ln=C.oxw(2);return C.KtG(ln.deleteConnection(vt))}),C.qZA(),C.BQk()}if(2&Ft){const Wt=C.oxw(2);C.xp6(1),C.Q6J("operatorId",Wt.item.OperatorID)("useFilteredOperators",!1),C.xp6(2),C.Q6J("ngModel",Wt.item.NumberOfPoints),C.xp6(5),C.Q6J("item",Wt.item)("enableEdit",!0)}}function Jt(Ft,Jn){if(1&Ft&&(C.ynx(0),C.YNc(1,Gt,2,1,"ng-container",9),C.YNc(2,Zt,9,5,"ng-container",9),C.BQk()),2&Ft){const Wt=C.oxw();C.xp6(1),C.Q6J("ngIf","copy-equipment"==Wt.step),C.xp6(1),C.Q6J("ngIf","edit-equipment"==Wt.step)}}function kt(Ft,Jn){if(1&Ft&&(C.TgZ(0,"p",44)(1,"strong"),C._uU(2,"Your changes cannot be saved until the following issues are resolved:"),C.qZA(),C.TgZ(3,"ion-label",45),C._uU(4),C.qZA()()),2&Ft){const Wt=C.oxw(2);C.xp6(4),C.hij(" ",Wt.validationMsg,"")}}function dt(Ft,Jn){if(1&Ft&&(C.TgZ(0,"ion-select-option",27),C._uU(1),C.qZA()),2&Ft){const Wt=Jn.$implicit;C.Q6J("value",Wt.ID),C.xp6(1),C.Oqu(Wt.Title)}}function Ot(Ft,Jn){if(1&Ft&&(C.TgZ(0,"ion-select-option",27),C._uU(1),C.qZA()),2&Ft){const Wt=Jn.$implicit;C.Q6J("value",Wt.ID),C.xp6(1),C.Oqu(Wt.Title)}}function pt(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.ynx(0),C.YNc(1,kt,5,1,"p",38),C.TgZ(2,"p"),C._uU(3,"Please provide any other facts related to this site. Additional comments (your charging experiences etc) can be added as check-in comments once the site is listed."),C.qZA(),C.TgZ(4,"ion-item")(5,"ion-label",16),C._uU(6,"Operational Status (All Equipment))"),C.qZA(),C.TgZ(7,"ion-select",39),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.StatusTypeID=vt)}),C.YNc(8,dt,2,2,"ion-select-option",24),C.qZA()(),C.TgZ(9,"ion-item")(10,"ion-label",16),C._uU(11,"Usage Type"),C.qZA(),C.TgZ(12,"ion-select",39),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.UsageTypeID=vt)}),C.YNc(13,Ot,2,2,"ion-select-option",24),C.qZA()(),C.TgZ(14,"ion-item")(15,"ion-label",16),C._uU(16,"Usage Cost"),C.qZA(),C.TgZ(17,"ion-input",21),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.UsageCost=vt)}),C.qZA()(),C.TgZ(18,"ion-item")(19,"ion-label",16),C._uU(20,"General Comments"),C.qZA(),C.TgZ(21,"ion-input",40),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.GeneralComments=vt)}),C.qZA()(),C.TgZ(22,"ion-item")(23,"ion-label",16),C._uU(24,"Main Telephone Number "),C.qZA(),C.TgZ(25,"ion-input",41),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.AddressInfo.ContactTelephone1=vt)}),C.qZA()(),C.TgZ(26,"ion-item")(27,"ion-label",16),C._uU(28,"Other Telephone Number "),C.qZA(),C.TgZ(29,"ion-input",41),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.AddressInfo.ContactTelephone2=vt)}),C.qZA()(),C.TgZ(30,"ion-item")(31,"ion-label",16),C._uU(32,"Access Comments"),C.qZA(),C.TgZ(33,"ion-input",42),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.AddressInfo.AccessComments=vt)}),C.qZA()(),C.TgZ(34,"ion-item")(35,"ion-label",16),C._uU(36,"Related Website"),C.qZA(),C.TgZ(37,"ion-input",43),C.NdJ("ngModelChange",function(vt){C.CHM(Wt);const ln=C.oxw();return C.KtG(ln.item.AddressInfo.RelatedURL=vt)}),C.qZA()(),C.BQk()}if(2&Ft){const Wt=C.oxw();C.xp6(1),C.Q6J("ngIf",Wt.validationMsg),C.xp6(6),C.Q6J("ngModel",Wt.item.StatusTypeID),C.xp6(1),C.Q6J("ngForOf",Wt.statusTypes),C.xp6(4),C.Q6J("ngModel",Wt.item.UsageTypeID),C.xp6(1),C.Q6J("ngForOf",Wt.usageTypes),C.xp6(4),C.Q6J("ngModel",Wt.item.UsageCost),C.xp6(4),C.Q6J("ngModel",Wt.item.GeneralComments),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.ContactTelephone1),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.ContactTelephone2),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.AccessComments),C.xp6(4),C.Q6J("ngModel",Wt.item.AddressInfo.RelatedURL)}}function Yt(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.TgZ(0,"ion-button",1),C.NdJ("click",function(){C.CHM(Wt);const vt=C.oxw();return C.KtG(vt.previous())}),C._uU(1," Previous "),C._UZ(2,"ion-icon",46),C.qZA()}}function Ut(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.TgZ(0,"ion-button",1),C.NdJ("click",function(){C.CHM(Wt);const vt=C.oxw();return C.KtG(vt.next())}),C._uU(1," Next "),C._UZ(2,"ion-icon",47),C.qZA()}}function ii(Ft,Jn){if(1&Ft){const Wt=C.EpF();C.TgZ(0,"ion-button",48),C.NdJ("click",function(){C.CHM(Wt);const vt=C.oxw();return C.KtG(vt.save())}),C._uU(1," Submit "),C._UZ(2,"ion-icon",49),C.qZA()}}let gn=(()=>{var Ft;class Jn{get countries(){return this.appManager.referenceDataManager.getCountries()}get usageTypes(){return this.appManager.referenceDataManager.getUsageTypes()}get statusTypes(){return this.appManager.referenceDataManager.getStatusTypes().filter(wt=>1==wt.IsUserSelectable)}get isAddMode(){return this.item.ID<=0}constructor(wt,vt,ln,ni,er,lr){(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"poiManager",void 0),(0,h.Z)(this,"mapping",void 0),(0,h.Z)(this,"loadingController",void 0),(0,h.Z)(this,"alertController",void 0),(0,h.Z)(this,"id",void 0),(0,h.Z)(this,"item",void 0),(0,h.Z)(this,"step",void 0),(0,h.Z)(this,"selectedTab",void 0),(0,h.Z)(this,"startPos",void 0),(0,h.Z)(this,"useFilteredConnectionTypes",!0),(0,h.Z)(this,"templateSites",[]),(0,h.Z)(this,"nearbySites",[]),(0,h.Z)(this,"selectedTemplatePOI",null),(0,h.Z)(this,"suggestedAddress",null),(0,h.Z)(this,"suggestedAddressAttribution",null),(0,h.Z)(this,"isNonDuplicateConfirmed",!1),(0,h.Z)(this,"skipPOICopy",!1),(0,h.Z)(this,"validationMsg",null),(0,h.Z)(this,"loading",void 0),(0,h.Z)(this,"editorMap",void 0),this.appManager=wt,this.modalController=vt,this.poiManager=ln,this.mapping=ni,this.loadingController=er,this.alertController=lr,this.initNewItem()}initNewItem(){this.item={ID:-1,DataProviderID:1,DataProvidersReference:null,OperatorsReference:null,OperatorID:1,UsageCost:null,UsageTypeID:4,NumberOfPoints:1,GeneralComments:null,DatePlanned:null,StatusTypeID:50,SubmissionStatusTypeID:null,Connections:[],MetadataValues:[],AddressInfo:{ID:-1,CountryID:18,Title:"",AddressLine1:"",Latitude:0,Longitude:0}},this.step="location",this.selectedTab="location"}get isReadyToSubmit(){return this.validate().isValid&&"info"==this.step}ngOnInit(){}presentLoadingUI(){var wt=this;return(0,x.Z)(function*(){wt.loading=yield wt.loadingController.create({message:"Please Wait.."}),yield wt.loading.present()})()}dismissLoadingUI(){var wt=this;return(0,x.Z)(function*(){wt.loading&&(yield wt.loading.dismiss())})()}ionViewDidEnter(){if(null!=this.id)this.editExistingPOI(this.id);else{let wt=localStorage.getItem("_editor-operatorid");wt&&(this.item.OperatorID=parseInt(wt,10)),this.startPos?(this.item.AddressInfo.Latitude=this.startPos.latitude,this.item.AddressInfo.Longitude=this.startPos.longitude):this.mapping&&this.mapping.getMapCenter().subscribe(vt=>{vt&&(this.item.AddressInfo.Latitude=vt.coords.latitude,this.item.AddressInfo.Longitude=vt.coords.longitude)})}this.refreshFilteredReferenceData()}previous(){var wt=this;return(0,x.Z)(function*(){switch(wt.step){case"info":wt.step="edit-equipment";break;case"edit-equipment":wt.step=wt.isAddMode?"copy-equipment":"location";break;case"copy-equipment":case"poi-nearby":wt.step="location"}yield wt.initCurrentStep(!1)})()}next(){var wt=this;return(0,x.Z)(function*(){if("poi-nearby"==wt.step&&wt.nearbySites.length>0&&!wt.isNonDuplicateConfirmed)return void(yield wt.alertController.create({header:"Confirm",message:"Please confirm you are not adding a duplicate site.",buttons:[{text:"Cancel",role:"cancel",cssClass:"secondary",handler:ni=>{}},{text:"Confirm",handler:()=>{wt.isNonDuplicateConfirmed=!0,wt.next()}}]})).present();const vt=wt.validate(wt.step);if(vt.isValid){switch(wt.step){case"location":wt.step=wt.isAddMode?"poi-nearby":"edit-equipment";break;case"poi-nearby":wt.step=wt.isAddMode?"copy-equipment":"edit-equipment";break;case"copy-equipment":wt.step="edit-equipment";break;case"edit-equipment":wt.step="info"}yield wt.initCurrentStep(!0)}else(yield wt.alertController.create({message:vt.msg})).present()})()}initCurrentStep(wt){var vt=this;return(0,x.Z)(function*(){"poi-nearby"==vt.step?(vt.selectedTab="location",0==(yield vt.refreshNearbySites())&&(wt?yield vt.next():yield vt.previous())):"location"==vt.step?vt.selectedTab="location":"copy-equipment"==vt.step?(vt.selectedTab="equipment",yield vt.refreshTemplateSites()):"edit-equipment"==vt.step?vt.selectedTab="equipment":"info"==vt.step&&(vt.selectedTab="info")})()}onCountryChange(){var wt=this;return(0,x.Z)(function*(){wt.refreshFilteredReferenceData()})()}onOperatorChange(wt=null){var vt=this;return(0,x.Z)(function*(){null!=wt&&vt.item.OperatorID!=wt.ID&&(vt.item.OperatorID=wt.ID,localStorage.setItem("_editor-operatorid",vt.item.OperatorID.toString()),yield vt.refreshTemplateSites())})()}useSuggestedAddress(wt=null){wt&&(this.suggestedAddress=wt.suggestedAddress,this.suggestedAddressAttribution=wt.suggestedAddressAttribution),Object.assign(this.item.AddressInfo,this.suggestedAddress),this.suggestedAddressAttribution&&(this.item.MetadataValues.find(vt=>4==vt.MetadataFieldID)||this.item.MetadataValues.push({ID:-1,MetadataFieldID:4,ItemValue:this.suggestedAddressAttribution,MetadataFieldOptionID:null,MetadataFieldOption:null}))}editConnection(wt){var vt=this;return(0,x.Z)(function*(){const ln=vt.item.Connections.find(lr=>lr.ID==wt.ID),ni=Object.assign({},ln),er=yield vt.modalController.create({component:ct,componentProps:{conn:ni}});return er.onWillDismiss().then(lr=>{lr&&lr.data&&lr.data.item&&vt.updateConnection(lr.data.item)}),yield er.present()})()}deleteConnection(wt){var vt=this;return(0,x.Z)(function*(){const ln=vt.item.Connections.find(er=>er.ID==wt.ID);(yield vt.alertController.create({header:"Confirm Delete",message:"Are you sure you want to delete this connection information?",buttons:[{text:"No",role:"cancel",cssClass:"secondary",handler:()=>{}},{text:"Yes",handler:()=>{vt.item.Connections=vt.item.Connections.filter(er=>er.ID!=ln.ID),vt.appManager.referenceDataManager.hydrateCompactPOI(vt.item,!0)}}]})).present()})()}addConnection(){var wt=this;return(0,x.Z)(function*(){const vt={ID:-J.c.getRandomInt(1e4),ConnectionTypeID:null,StatusTypeID:50,PowerKW:null,Quantity:1},ln=yield wt.modalController.create({component:ct,componentProps:{conn:vt}});return ln.onWillDismiss().then(ni=>{ni&&ni.data&&ni.data.item&&wt.updateConnection(ni.data.item)}),yield ln.present()})()}refreshFilteredReferenceData(){this.appManager.referenceDataManager.refreshFilteredReferenceData(this.appManager.api,{CountryIds:[this.item.AddressInfo.CountryID]})}updateConnection(wt){if(wt){let vt=this.item.Connections.find(ln=>ln.ID==wt.ID);vt?Object.assign(vt,wt):this.item.Connections.push(wt)}this.appManager.referenceDataManager.hydrateCompactPOI(this.item,!0)}validate(wt="all"){let vt=null;return("all"==wt||"location"==wt)&&((!this.item.AddressInfo.Latitude||!this.item.AddressInfo.Longitude)&&(vt="Location is required"),""==this.item.AddressInfo.Title&&(vt="A location title is required"),!this.item.AddressInfo.AddressLine1&&!this.item.AddressInfo.AddressLine2&&(vt="An approximate address is required."),this.item.AddressInfo.CountryID||(vt="A country selection is required"),(!this.item.AddressInfo.Latitude||!this.item.AddressInfo.Longitude)&&(vt="A location latitude and longitude is required")),("all"==wt||"poi-nearby"==wt)&&this.nearbySites.length>0&&!this.isNonDuplicateConfirmed&&(vt="Please confirm that the site is not a duplicate"),("all"==wt||"equipment"==wt)&&(this.item.OperatorID||(vt="Please confirm the charging network or equipment operator."),0==this.item.Connections.length&&(vt="Equipment information is required")),vt?(this.validationMsg=vt,{isValid:!1,msg:vt}):(this.validationMsg=null,{isValid:!0,msg:null})}save(){var wt=this;return(0,x.Z)(function*(){let vt=wt.validate();if(vt.isValid){yield wt.presentLoadingUI();try{yield wt.appManager.submitPOI(wt.item),yield wt.dismissLoadingUI(),wt.appManager.showToastNotification("You submission will be reviewed (if required) and published shortly."),wt.modalController.dismiss()}catch(ln){yield wt.dismissLoadingUI(),ln.error&&alert("Sorry, your submission could not be completed at this time. Please try again later.")}}else alert(vt.msg)})()}cancel(){var wt=this;return(0,x.Z)(function*(){wt.modalController.dismiss()})()}refreshTemplateSites(){var wt=this;return(0,x.Z)(function*(){if(wt.item.AddressInfo.CountryID&&wt.item.OperatorID){yield wt.presentLoadingUI(),wt.templateSites=[];let vt=new s.be;vt.countryIdList=[wt.item.AddressInfo.CountryID],vt.minPowerKW=1,vt.operatorIdList=[wt.item.OperatorID],vt.maxResults=10;let ln=yield wt.poiManager.fetchPOIList(vt);ln.sort((ni,er)=>new Date(ni.DateCreated).getTime()-new Date(er.DateCreated).getTime()),wt.templateSites=ln,wt.dismissLoadingUI()}})()}refreshNearbySites(){var wt=this;return(0,x.Z)(function*(){if(wt.item.AddressInfo.Latitude&&wt.item.AddressInfo.Longitude){yield wt.presentLoadingUI(),wt.nearbySites=[];let vt=new s.be;vt.latitude=wt.item.AddressInfo.Latitude,vt.longitude=wt.item.AddressInfo.Longitude,vt.distance=5,vt.distanceUnit="km",vt.maxResults=10;let ln=yield wt.poiManager.fetchPOIList(vt);return ln.sort((ni,er)=>ni.Distance-er.Distance),wt.nearbySites=ln,wt.dismissLoadingUI(),ln.length}return 0})()}confirmNonDuplicate(){this.isNonDuplicateConfirmed=!0,this.next()}changeTemplatePOI(){this.selectedTemplatePOI=null}editPOI(wt){this.editExistingPOI(wt.ID)}editExistingPOI(wt){var vt=this;return(0,x.Z)(function*(){vt.skipPOICopy=!0,vt.isNonDuplicateConfirmed=!0,yield vt.presentLoadingUI(),vt.poiManager.getPOIById(wt,!0,!0).then(ln=>{vt.item=Object.assign({},ln),null==vt.item.OperatorID&&(vt.item.OperatorID=Le.UnknownOperator),vt.refreshFilteredReferenceData(),vt.dismissLoadingUI()})})()}useTemplatePOI(wt){this.selectedTemplatePOI=wt,Object.assign(this.item.Connections,wt.Connections);for(let vt of this.item.Connections)vt.ID=-J.c.getRandomInt(1e4),vt.Reference=null,vt.Comments=null,vt.StatusTypeID=ht.Operational;this.item.UsageCost=wt.UsageCost,this.item.UsageTypeID=wt.UsageTypeID,this.appManager.referenceDataManager.hydrateCompactPOI(this.item)}skipCopyingPOI(){this.skipPOICopy=!0}}return Ft=Jn,(0,h.Z)(Jn,"\u0275fac",function(wt){return new(wt||Ft)(C.Y36(y.c),C.Y36(oe.IN),C.Y36(ie.R),C.Y36(Y.v),C.Y36(oe.HT),C.Y36(oe.Br))}),(0,h.Z)(Jn,"\u0275cmp",C.Xpm({type:Ft,selectors:[["app-poi-editor"]],viewQuery:function(wt,vt){if(1&wt&&C.Gf(Ie,5),2&wt){let ln;C.iGM(ln=C.CRH())&&(vt.editorMap=ln.first)}},decls:33,vars:14,consts:[["slot","end"],[3,"click"],["name","close","slot","start"],[1,"ion-padding"],[3,"ngModel"],["value","location","layout","icon-start",3,"disabled"],["name","caret-forward",4,"ngIf"],["value","equipment","layout","icon-start",3,"disabled"],["value","info","layout","icon-start",3,"disabled"],[4,"ngIf"],["slot","start"],[3,"click",4,"ngIf"],["color","success",3,"click",4,"ngIf"],["name","caret-forward"],[3,"latitude","longitude","latitudeChange","longitudeChange","onUseSuggestedAddress"],["editorMap",""],["position","floating"],["type","text","autocapitalize","words","placeholder","A title for this location",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","The nearest street address",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","Optional",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","Town or City",3,"ngModel","ngModelChange"],["type","text",3,"ngModel","ngModelChange"],["type","text","autocapitalize","words","placeholder","Optional Postal Code",3,"ngModel","ngModelChange"],[3,"ngModel","ngModelChange","ionChange"],[3,"value",4,"ngFor","ngForOf"],["label","Latitude","labelPlacement","floating","type","number","placeholder","Latitude (if entering manually)",3,"ngModel","ngModelChange"],["label","Longitude","labelPlacement","floating","type","number","placeholder","Longitude (if entering manually)",3,"ngModel","ngModelChange"],[3,"value"],[1,"instruction"],[3,"poiList","enableEditOption","onEdit"],[3,"operatorId","operatorChanged"],["slot","start","size","small",3,"click"],[3,"enableCopyOption","poiList","onCopy"],[3,"operatorId","useFilteredOperators","operatorChanged"],["label","Number of Stations or Parking Bays","labelPlacement","floating","min","1","type","number",3,"ngModel","ngModelChange"],["size","small",3,"click"],["name","add","slot","icon-only"],[3,"item","enableEdit","onEdit","onDelete"],["color","warning",4,"ngIf"],[3,"ngModel","ngModelChange"],["type","text","autocapitalize","sentences",3,"ngModel","ngModelChange"],["type","tel","placeholder","",3,"ngModel","ngModelChange"],["type","text","autocapitalize","sentences","placeholder","Instructions for access or tips for finding charging location",3,"ngModel","ngModelChange"],["type","url","placeholder","Website related to this site",3,"ngModel","ngModelChange"],["color","warning"],["color","danger"],["name","caret-back","slot","start"],["name","caret-forward","slot","end"],["color","success",3,"click"],["name","send","slot","end"]],template:function(wt,vt){1&wt&&(C.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),C._uU(3),C.qZA(),C.TgZ(4,"ion-buttons",0)(5,"ion-button",1),C.NdJ("click",function(){return vt.cancel()}),C._UZ(6,"ion-icon",2),C._uU(7," Cancel "),C.qZA()()()(),C.TgZ(8,"ion-content",3),C.ynx(9),C.TgZ(10,"ion-segment",4)(11,"ion-segment-button",5),C.YNc(12,Ye,1,0,"ion-icon",6),C.TgZ(13,"ion-label"),C._uU(14,"Location"),C.qZA()(),C.TgZ(15,"ion-segment-button",7),C.YNc(16,_t,1,0,"ion-icon",6),C.TgZ(17,"ion-label"),C._uU(18,"Equipment"),C.qZA()(),C.TgZ(19,"ion-segment-button",8),C.YNc(20,hn,1,0,"ion-icon",6),C.TgZ(21,"ion-label"),C._uU(22,"Info"),C.qZA()()(),C.YNc(23,Je,3,2,"ng-container",9),C.YNc(24,Jt,3,2,"ng-container",9),C.YNc(25,pt,38,11,"ng-container",9),C.BQk(),C.qZA(),C.TgZ(26,"ion-footer")(27,"ion-toolbar")(28,"ion-buttons",10),C.YNc(29,Yt,3,0,"ion-button",11),C.qZA(),C.TgZ(30,"ion-buttons",0),C.YNc(31,Ut,3,0,"ion-button",11),C.YNc(32,ii,3,0,"ion-button",12),C.qZA()()()),2&wt&&(C.xp6(3),C.Oqu(vt.isAddMode?"Add Location":"Edit Location"),C.xp6(7),C.Q6J("ngModel",vt.selectedTab),C.xp6(1),C.Q6J("disabled",!0),C.xp6(1),C.Q6J("ngIf","location"==vt.selectedTab),C.xp6(3),C.Q6J("disabled",!0),C.xp6(1),C.Q6J("ngIf","equipment"==vt.selectedTab),C.xp6(3),C.Q6J("disabled",!0),C.xp6(1),C.Q6J("ngIf","info"==vt.selectedTab),C.xp6(3),C.Q6J("ngIf","location"==vt.selectedTab),C.xp6(1),C.Q6J("ngIf","equipment"==vt.selectedTab),C.xp6(1),C.Q6J("ngIf","info"==vt.selectedTab),C.xp6(4),C.Q6J("ngIf","location"!=vt.step),C.xp6(2),C.Q6J("ngIf",!vt.isReadyToSubmit&&"info"!=vt.step),C.xp6(1),C.Q6J("ngIf",vt.isReadyToSubmit))},dependencies:[ae.sg,ae.O5,Ue.JJ,Ue.On,oe.YG,oe.Sm,oe.W2,oe.fr,oe.Gu,oe.gu,oe.pK,oe.Ie,oe.Q$,oe.q_,oe.cJ,oe.GO,oe.t9,oe.n0,oe.wd,oe.sr,oe.as,oe.QI,oe.j9,oe.yf,De.o,Pe.B,Ie,Ae.z],styles:['ul.breadcrumb[_ngcontent-%COMP%]{display:inline-flex;margin:0;padding:0}ul.breadcrumb[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline-flex;margin-right:6px;color:var(--ion-color-light-shade);font-size:10px}ul.breadcrumb[_ngcontent-%COMP%] li.active[_ngcontent-%COMP%]{color:var(--ion-color-dark-shade)}ul.breadcrumb[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:before{content:">";padding-right:4px}']})),Jn})()},3247:(Nn,yt,k)=>{"use strict";k.d(yt,{u:()=>Le});var x=k(1180),h=k(2029),y=k(9843),s=k(3052),J=k(989),ie=k(9127),Y=k(7430),C=k(9862);let Ne=(()=>{var ye;class gt{constructor(Pe,Ae){(0,x.Z)(this,"http",void 0),(0,x.Z)(this,"journeyManager",void 0),this.http=Pe,this.journeyManager=Ae}getDirections(Pe,Ae){return new Promise((Ye,_t)=>{(new google.maps.DirectionsService).route({origin:Pe,destination:Ae,travelMode:google.maps.TravelMode.DRIVING},(qt,Ht)=>{Ht===google.maps.DirectionsStatus.OK?Ye(qt):_t(Ht)})})}analyseRoutes(Pe,Ae){const Ye=new Array;return Pe.routes.forEach(_t=>{const hn=new Y.JJ;hn.Title=""+Ye.length+1,hn.JourneyRouteLegs=new Array,hn.TotalDistanceKM=0,hn.TotalDurationMinutes=0,hn.TotalEnergykWh=0,_t.legs.forEach(qt=>{const Ht=qt.duration.value,Te=qt.distance.value/1e3,Je=this.journeyManager.calculateEnergyConsumptionkWh(Te,0,null,Ae),Re=new Y.eN;Re.DistanceKM=Te,Re.DurationMinutes=Ht/60,Re.EnergyConsumptionkWh=Je,hn.JourneyRouteLegs.push(Re),hn.TotalDistanceKM+=Re.DistanceKM,hn.TotalDurationMinutes+=Re.DurationMinutes,hn.TotalEnergykWh=Re.EnergyConsumptionkWh}),Ye.push(hn)}),Ye}}return ye=gt,(0,x.Z)(gt,"\u0275fac",function(Pe){return new(Pe||ye)(h.LFG(C.eN),h.LFG(J.i))}),(0,x.Z)(gt,"\u0275prov",h.Yz7({token:ye,factory:ye.\u0275fac,providedIn:"root"})),gt})();var me=k(1847),he=k(6814),_e=k(6223),ee=k(5460);function ae(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"ion-item"),h._UZ(1,"ion-icon",12),h.TgZ(2,"ion-searchbar",13),h.NdJ("ngModelChange",function(Ae){h.CHM(De);const Ye=h.oxw();return h.KtG(Ye.routeStart=Ae)})("ionInput",function(Ae){h.CHM(De),h.oxw();const Ye=h.MAs(18);return h.KtG(Ye.getPlacesAutoComplete(Ae,"routeStart"))})("ionCancel",function(Ae){h.CHM(De);const Ye=h.oxw();return h.KtG(Ye.onPlaceSearchCancel(Ae))}),h.qZA()()}if(2&ye){const De=h.oxw();h.xp6(2),h.Q6J("ngModel",De.routeStart)("debounce",500)}}function oe(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"ion-item",14),h.NdJ("click",function(){h.CHM(De);const Ae=h.oxw();return h.KtG(Ae.clearRouteStart())}),h._UZ(1,"ion-icon",12),h.TgZ(2,"h2"),h._uU(3),h.qZA()()}if(2&ye){h.oxw();const De=h.MAs(18);h.xp6(3),h.Oqu(null==De.selectedPlace?null:De.selectedPlace.name)}}function Be(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"ion-item"),h._UZ(1,"ion-icon",15),h.TgZ(2,"ion-searchbar",16),h.NdJ("ngModelChange",function(Ae){h.CHM(De);const Ye=h.oxw();return h.KtG(Ye.routeDestination=Ae)})("ionInput",function(Ae){h.CHM(De),h.oxw();const Ye=h.MAs(20);return h.KtG(Ye.getPlacesAutoComplete(Ae,"routeDestination"))})("ionCancel",function(Ae){h.CHM(De);const Ye=h.oxw();return h.KtG(Ye.onPlaceSearchCancel(Ae))}),h.qZA()()}if(2&ye){const De=h.oxw();h.xp6(2),h.Q6J("ngModel",De.routeDestination)("debounce",500)}}function Ie(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"ion-item",14),h.NdJ("click",function(){h.CHM(De);const Ae=h.oxw();return h.KtG(Ae.clearRouteDestination())}),h._UZ(1,"ion-icon",15),h.TgZ(2,"h2"),h._uU(3),h.qZA()()}if(2&ye){h.oxw();const De=h.MAs(20);h.xp6(3),h.Oqu(null==De.selectedPlace?null:De.selectedPlace.name)}}function Ee(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"ion-button",14),h.NdJ("click",function(){h.CHM(De);const Ae=h.oxw();return h.KtG(Ae.clearRoute())}),h._UZ(1,"ion-icon",17),h._uU(2," Clear Route "),h.qZA()}}function Ue(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"ion-button",14),h.NdJ("click",function(){h.CHM(De);const Ae=h.oxw();return h.KtG(Ae.showSettings())}),h._uU(1," Show Settings "),h._UZ(2,"ion-icon",18),h.qZA()}}function et(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"ion-button",14),h.NdJ("click",function(){h.CHM(De);const Ae=h.oxw();return h.KtG(Ae.hideSettings())}),h._uU(1," Hide Settings "),h._UZ(2,"ion-icon",18),h.qZA()}}function le(ye,gt){1&ye&&(h.TgZ(0,"p",19),h._UZ(1,"ion-spinner",19),h._uU(2," Calculating Route.. "),h.qZA())}function ue(ye,gt){if(1&ye&&(h.TgZ(0,"ion-list")(1,"ion-list-header"),h._uU(2),h.ALo(3,"number"),h.ALo(4,"number"),h.qZA()()),2&ye){const De=h.oxw();h.xp6(2),h.lnq(" Total Distance ",h.xi3(3,3,De.selectedJourneyRoute.TotalDistanceKM,"1.0-2")," km, ",De.formatDuration(De.selectedJourneyRoute.TotalDurationMinutes),", ",h.xi3(4,6,De.selectedJourneyRoute.TotalEnergykWh,"1.0-2")," kWh ")}}function ct(ye,gt){if(1&ye){const De=h.EpF();h.TgZ(0,"div")(1,"ion-list")(2,"ion-list-header"),h._UZ(3,"ion-icon",20),h._uU(4," Route Settings "),h.qZA(),h.TgZ(5,"ion-item")(6,"ion-label",21),h._uU(7),h.qZA(),h.TgZ(8,"ion-range",22),h.NdJ("ngModelChange",function(Ae){h.CHM(De);const Ye=h.oxw();return h.KtG(Ye.routeSearchDistance=Ae)}),h._UZ(9,"ion-icon",23)(10,"ion-icon",24),h.qZA()(),h.TgZ(11,"ion-item")(12,"ion-label",21),h._uU(13,"Energy Efficiency (kWh Per km)"),h.qZA(),h.TgZ(14,"ion-input",25),h.NdJ("ngModelChange",function(Ae){h.CHM(De);const Ye=h.oxw();return h.KtG(Ye.kWhPerKM=Ae)}),h.qZA()()()()}if(2&ye){const De=h.oxw();h.xp6(7),h.hij("Search Distance (",De.routeSearchDistance,")"),h.xp6(1),h.Q6J("ngModel",De.routeSearchDistance),h.xp6(6),h.Q6J("ngModel",De.kWhPerKM)}}let ht=(()=>{var ye;class gt{constructor(Pe,Ae,Ye,_t,hn,qt){(0,x.Z)(this,"mapping",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"directions",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"changeDetector",void 0),(0,x.Z)(this,"numberPipe",void 0),(0,x.Z)(this,"routeSearchDistance",5),(0,x.Z)(this,"journeyRoutes",void 0),(0,x.Z)(this,"selectedJourneyRoute",void 0),(0,x.Z)(this,"routePolyline",void 0),(0,x.Z)(this,"kWhPerKM",void 0),(0,x.Z)(this,"routeStartPlace",void 0),(0,x.Z)(this,"routeDestinationPlace",void 0),(0,x.Z)(this,"routeCalcInProgress",!1),(0,x.Z)(this,"advancedSettingsMode",!1),(0,x.Z)(this,"routeStart",""),(0,x.Z)(this,"routeDestination",""),this.mapping=Pe,this.logging=Ae,this.directions=Ye,this.journeyManager=_t,this.changeDetector=hn,this.numberPipe=qt,this.kWhPerKM=.212}get isRouteSet(){return null!=this.routeStartPlace&&null!=this.routeDestinationPlace}showSettings(){this.advancedSettingsMode=!0}hideSettings(){this.advancedSettingsMode=!1}routeStartSelected(Pe){this.routeStartPlace=Pe,this.calculateRoute(),this.changeDetector.detectChanges()}routeDestinationSelected(Pe){this.routeDestinationPlace=Pe,this.calculateRoute(),this.changeDetector.detectChanges()}clearRouteStart(){this.routeStartPlace=null,this.changeDetector.detectChanges()}clearRouteDestination(){this.routeDestinationPlace=null,this.changeDetector.detectChanges()}clearRoute(){this.routeStartPlace=null,this.routeDestinationPlace=null,this.journeyManager.setRoutePolyline(null),this.mapping.clearPolyline()}formatDuration(Pe){if(Pe<=60)return this.numberPipe.transform(Pe,"1.0-2")+" mins";{const Ae=Math.round(Pe/60),Ye=Math.floor(Pe-60*Ae);return Ae+" hours "+(Ye>0?Ye+" mins":"")}}calculateRoute(){null!=this.routeStartPlace&&null!=this.routeDestinationPlace&&(this.logging.log("Fetching route directions.."),this.routeCalcInProgress=!0,this.directions.getDirections(this.routeStartPlace.Location.latitude+","+this.routeStartPlace.Location.longitude,this.routeDestinationPlace.Location.latitude+","+this.routeDestinationPlace.Location.longitude).then(Pe=>{if(null!=Pe.routes&&Pe.routes.length>0){this.logging.log("Got route directions, analysing.."),this.routePolyline=Pe.routes[0].overview_polyline;const Ae=Pe.routes[0].bounds.getSouthWest(),Ye=Pe.routes[0].bounds.getNorthEast(),_t=new s.wC(Ye.lat(),Ye.lng()),hn=new s.wC(Ae.lat(),Ae.lng()),qt=new s.LL(_t,hn);this.journeyRoutes=this.directions.analyseRoutes(Pe,this.kWhPerKM),this.journeyRoutes.length>0&&(this.selectedJourneyRoute=this.journeyRoutes[0]),this.journeyManager.setRoutePolyline(this.routePolyline),this.mapping.renderPolyline(this.routePolyline),this.mapping.moveToMapBounds(qt)}else this.logging.log("No route returned..");this.routeCalcInProgress=!1}))}}return ye=gt,(0,x.Z)(gt,"\u0275fac",function(Pe){return new(Pe||ye)(h.Y36(me.v),h.Y36(ie.z),h.Y36(Ne),h.Y36(J.i),h.Y36(h.sBO),h.Y36(he.JJ))}),(0,x.Z)(gt,"\u0275cmp",h.Xpm({type:ye,selectors:[["route-planner"]],decls:24,vars:10,consts:[[1,"route"],[1,"route-places"],["name","map","slot","start"],[4,"ngIf"],[3,"click",4,"ngIf"],["primary",""],["slot","secondary"],["slot","primary"],[3,"placeChanged"],["placeSearchRouteStart",""],["placeSearchRouteDestination",""],["class","ion-padding",4,"ngIf"],["name","ionic","item-left",""],["placeholder","Starting Point",3,"ngModel","debounce","ngModelChange","ionInput","ionCancel"],[3,"click"],["name","pin","item-left",""],["placeholder","Destination",3,"ngModel","debounce","ngModelChange","ionInput","ionCancel"],["name","close","slot","start"],["name","cog","slot","end"],[1,"ion-padding"],["name","cog"],["position","stacked"],["min","1","max","200","step","5","snaps","true","pin","true","light","",3,"ngModel","ngModelChange"],["slot","start","small","","name","map"],["slot","end","large","","name","map"],["type","number","min","0.1","max","1",3,"ngModel","ngModelChange"]],template:function(Pe,Ae){1&Pe&&(h.TgZ(0,"div",0)(1,"div",1)(2,"ion-list")(3,"ion-list-header"),h._UZ(4,"ion-icon",2),h.TgZ(5,"ion-label"),h._uU(6,"Plan Your Journey"),h.qZA()(),h.YNc(7,ae,3,2,"ion-item",3),h.YNc(8,oe,4,1,"ion-item",4),h.YNc(9,Be,3,2,"ion-item",3),h.YNc(10,Ie,4,1,"ion-item",4),h.qZA(),h.TgZ(11,"ion-toolbar",5)(12,"ion-buttons",6),h.YNc(13,Ee,3,0,"ion-button",4),h.qZA(),h.TgZ(14,"ion-buttons",7),h.YNc(15,Ue,3,0,"ion-button",4),h.YNc(16,et,3,0,"ion-button",4),h.qZA()()(),h.TgZ(17,"place-search",8,9),h.NdJ("placeChanged",function(_t){return Ae.routeStartSelected(_t)}),h.qZA(),h.TgZ(19,"place-search",8,10),h.NdJ("placeChanged",function(_t){return Ae.routeDestinationSelected(_t)}),h.qZA(),h.YNc(21,le,3,0,"p",11),h.YNc(22,ue,5,9,"ion-list",3),h.YNc(23,ct,15,3,"div",3),h.qZA()),2&Pe&&(h.xp6(7),h.Q6J("ngIf",null==Ae.routeStartPlace),h.xp6(1),h.Q6J("ngIf",null!=Ae.routeStartPlace),h.xp6(1),h.Q6J("ngIf",null==Ae.routeDestinationPlace),h.xp6(1),h.Q6J("ngIf",null!=Ae.routeDestinationPlace),h.xp6(3),h.Q6J("ngIf",Ae.isRouteSet),h.xp6(2),h.Q6J("ngIf",!Ae.advancedSettingsMode),h.xp6(1),h.Q6J("ngIf",Ae.advancedSettingsMode),h.xp6(5),h.Q6J("ngIf",Ae.routeCalcInProgress),h.xp6(1),h.Q6J("ngIf",null!=Ae.selectedJourneyRoute),h.xp6(1),h.Q6J("ngIf",Ae.advancedSettingsMode))},dependencies:[he.O5,y.YG,y.Sm,y.gu,y.pK,y.Ie,y.Q$,y.q_,y.yh,y.I_,y.VI,y.PQ,y.sr,y.as,y.QI,y.j9,y.yf,y.Uj,_e.JJ,_e.On,ee.v,he.JJ],encapsulation:2})),gt})(),Le=(()=>{var ye;class gt{constructor(Pe){(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"hasNavbar",!1),this.modalController=Pe}close(){this.modalController.dismiss()}}return ye=gt,(0,x.Z)(gt,"\u0275fac",function(Pe){return new(Pe||ye)(h.Y36(y.IN))}),(0,x.Z)(gt,"\u0275cmp",h.Xpm({type:ye,selectors:[["ng-component"]],decls:10,vars:0,consts:[["slot","end"],[3,"click"],["name","close","slot","end"],[1,"route-planner","ion-padding"]],template:function(Pe,Ae){1&Pe&&(h.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),h._uU(3," Route Planner "),h.qZA(),h.TgZ(4,"ion-buttons",0)(5,"ion-button",1),h.NdJ("click",function(){return Ae.close()}),h._UZ(6,"ion-icon",2),h._uU(7," Close "),h.qZA()()()(),h.TgZ(8,"ion-content",3),h._UZ(9,"route-planner"),h.qZA())},dependencies:[y.YG,y.Sm,y.W2,y.Gu,y.gu,y.wd,y.sr,ht],encapsulation:2})),gt})()},4606:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{SearchPageModule:()=>Jt});var x=k(1180),h=k(5086),y=k(3999),s=k(6814),J=k(6223),ie=k(9843),Y=k(6800),C=k(5861),Ne=k(553),me=k(7777),he=k(4119),_e=k(3247),ee=k(9723),ae=k(3052),oe=k(4677),Be=k(866),Ie=k(9127),Ee=k(989),Ue=k(1847),et=k(4669),le=k(6470),ue=k(5460),ct=k(2438),ht=k(7394);class Le extends ht.w0{constructor(dt,Ot){super()}schedule(dt,Ot=0){return this}}const ye={setInterval(kt,dt,...Ot){const{delegate:pt}=ye;return pt?.setInterval?pt.setInterval(kt,dt,...Ot):setInterval(kt,dt,...Ot)},clearInterval(kt){const{delegate:dt}=ye;return(dt?.clearInterval||clearInterval)(kt)},delegate:void 0};var gt=k(9039),Pe=k(4552);class Ae{constructor(dt,Ot=Ae.now){this.schedulerActionCtor=dt,this.now=Ot}schedule(dt,Ot=0,pt){return new this.schedulerActionCtor(this,dt).schedule(pt,Ot)}}Ae.now=Pe.l.now;const _t=new class Ye extends Ae{constructor(dt,Ot=Ae.now){super(dt,Ot),this.actions=[],this._active=!1}flush(dt){const{actions:Ot}=this;if(this._active)return void Ot.push(dt);let pt;this._active=!0;do{if(pt=dt.execute(dt.state,dt.delay))break}while(dt=Ot.shift());if(this._active=!1,pt){for(;dt=Ot.shift();)dt.unsubscribe();throw pt}}}(class De extends Le{constructor(dt,Ot){super(dt,Ot),this.scheduler=dt,this.work=Ot,this.pending=!1}schedule(dt,Ot=0){var pt;if(this.closed)return this;this.state=dt;const Yt=this.id,Ut=this.scheduler;return null!=Yt&&(this.id=this.recycleAsyncId(Ut,Yt,Ot)),this.pending=!0,this.delay=Ot,this.id=null!==(pt=this.id)&&void 0!==pt?pt:this.requestAsyncId(Ut,this.id,Ot),this}requestAsyncId(dt,Ot,pt=0){return ye.setInterval(dt.flush.bind(dt,this),pt)}recycleAsyncId(dt,Ot,pt=0){if(null!=pt&&this.delay===pt&&!1===this.pending)return Ot;null!=Ot&&ye.clearInterval(Ot)}execute(dt,Ot){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const pt=this._execute(dt,Ot);if(pt)return pt;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(dt,Ot){let Yt,pt=!1;try{this.work(dt)}catch(Ut){pt=!0,Yt=Ut||new Error("Scheduled action threw falsy error")}if(pt)return this.unsubscribe(),Yt}unsubscribe(){if(!this.closed){const{id:dt,scheduler:Ot}=this,{actions:pt}=Ot;this.work=this.state=this.scheduler=null,this.pending=!1,(0,gt.P)(pt,this),null!=dt&&(this.id=this.recycleAsyncId(Ot,dt,null)),this.delay=null,super.unsubscribe()}}});var qt=k(9360),Ht=k(8251);const Re=(0,k(2726).fo)("Geolocation",{web:()=>k.e(579).then(k.bind(k,579)).then(kt=>new kt.GeolocationWeb)});var Fe=k(2029),St=k(5957);function Ce(kt,dt){1&kt&&Fe._UZ(0,"ion-icon",13)}function Rt(kt,dt){1&kt&&Fe._UZ(0,"ion-spinner")}function Qt(kt,dt){if(1&kt){const Ot=Fe.EpF();Fe.TgZ(0,"ion-button",3),Fe.NdJ("click",function(){Fe.CHM(Ot);const Yt=Fe.oxw();return Fe.KtG(Yt.openSideView())}),Fe._UZ(1,"ion-icon",14),Fe.qZA()}}function Gt(kt,dt){1&kt&&(Fe.ynx(0),Fe.TgZ(1,"div",15)(2,"p"),Fe._uU(3,"There was a problem communicating with Open Charge Map. Please check your data connection."),Fe.qZA()(),Fe.BQk())}let Zt=(()=>{var kt;class dt{constructor(pt,Yt,Ut,ii,gn,Ft,Jn,Wt,wt,vt,ln,ni){(0,x.Z)(this,"appManager",void 0),(0,x.Z)(this,"nav",void 0),(0,x.Z)(this,"events",void 0),(0,x.Z)(this,"translate",void 0),(0,x.Z)(this,"platform",void 0),(0,x.Z)(this,"poiManager",void 0),(0,x.Z)(this,"mapping",void 0),(0,x.Z)(this,"journeyManager",void 0),(0,x.Z)(this,"zone",void 0),(0,x.Z)(this,"modalController",void 0),(0,x.Z)(this,"alertController",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"mapDisplayed",!1),(0,x.Z)(this,"debouncedRefreshMapResults",void 0),(0,x.Z)(this,"mapCanvasID",void 0),(0,x.Z)(this,"initialResultsShown",!1),(0,x.Z)(this,"searchOnDemand",!1),(0,x.Z)(this,"poiViewMode","modal"),(0,x.Z)(this,"sideViewAvailable",!1),(0,x.Z)(this,"searchPolyline",void 0),(0,x.Z)(this,"routePlanningMode",!0),(0,x.Z)(this,"searchKeyword",""),(0,x.Z)(this,"selectedPOI",void 0),(0,x.Z)(this,"appConfig",new me.X),(0,x.Z)(this,"defaultMapZoom",15),(0,x.Z)(this,"defaultStartPos",new ae.wC(37.415328,-122.076575)),(0,x.Z)(this,"placeSearchMapPOI",void 0),(0,x.Z)(this,"_watchId",null),this.appManager=pt,this.nav=Yt,this.events=Ut,this.translate=ii,this.platform=gn,this.poiManager=Ft,this.mapping=Jn,this.journeyManager=Wt,this.zone=wt,this.modalController=vt,this.alertController=ln,this.logging=ni,this.mapCanvasID="map-canvas",this.mapping.setMapType(pt.searchSettings.MapType),this.mapping.setMapAPI(Ne.N.defaultMapProvider),(0,ct.R)(window,"resize").pipe(function Te(kt,dt=_t){return(0,qt.e)((Ot,pt)=>{let Yt=null,Ut=null,ii=null;const gn=()=>{if(Yt){Yt.unsubscribe(),Yt=null;const Jn=Ut;Ut=null,pt.next(Jn)}};function Ft(){const Jn=ii+kt,Wt=dt.now();if(Wt{Ut=Jn,ii=dt.now(),Yt||(Yt=dt.schedule(Ft,kt),pt.add(Yt))},()=>{gn(),pt.complete()},void 0,()=>{Ut=Yt=null}))})}(500)).subscribe(lr=>{let mi={width:Be.c.getClientHeight(),height:Be.c.getClientWidth()};this.events.publish("ocm:window:resized",[mi])})}ionViewDidEnter(){this.logging.log("Entered search page.",Ie.i.VERBOSE),this.mapping.focusMap(),this.mapping.updateMapSize()}ionViewWillLeave(){this.logging.log("Leaving search page.",Ie.i.VERBOSE),this.mapping.unfocusMap()}getPreferredMapHeight(pt){return null==pt&&(pt=Be.c.getClientHeight()),pt-56}enforceMapHeight(pt){this.logging.log("Would resize map:"+pt.width+" "+pt.height,Ie.i.VERBOSE);const Yt=this.getPreferredMapHeight(pt[0]);document.getElementById(this.mapCanvasID).offsetHeight!==Yt&&(document.getElementById(this.mapCanvasID).style.height=Yt+"px"),this.mapping&&(this.logging.log("Map height:"+Yt,Ie.i.VERBOSE),this.mapping.updateMapSize())}initialiseMapping(){var pt=this;return(0,C.Z)(function*(){yield pt.platform.ready(),pt.debouncedRefreshMapResults=Be.c.debounce(pt.refreshMapResults,1e3,!1),pt.events.subscribe("ocm:mapping:ready",(0,C.Z)(function*(){if(pt.logging.log("init map: mapping ready"),pt.mapping&&pt.mapping.updateMapSize(),!pt.initialResultsShown)if(pt.appManager.searchSettings.StartSearchPosition&&!pt.appManager.searchSettings.StartViewPoiId)pt.searchOnDemand=!0,pt.mapping.updateMapCentrePos(pt.appManager.searchSettings.StartSearchPosition.latitude,pt.appManager.searchSettings.StartSearchPosition.longitude,!0,pt.defaultMapZoom);else{let Yt=localStorage.getItem("_locationEnabled");1==pt.appManager.isEmbeddedMode&&"true"!=Yt?yield(yield pt.alertController.create({header:"Search using your location?",message:"Select OK to continue.",buttons:[{text:"Cancel",role:"cancel",cssClass:"secondary",handler:(ii=(0,C.Z)(function*(gn){yield pt.useFallbackPosition()}),function(Ft){return ii.apply(this,arguments)})},{text:"OK",handler:function(){var ii=(0,C.Z)(function*(){yield pt.locateUser()});return function(){return ii.apply(this,arguments)}}()}]})).present():(yield pt.locateUser(),pt.mapping&&pt.mapping.updateMapSize())}var ii})),pt.events.subscribe("ocm:mapping:zoom",()=>{pt.debouncedRefreshMapResults()}),pt.events.subscribe("ocm:mapping:dragend",()=>{pt.debouncedRefreshMapResults()}),pt.events.subscribe("ocm:poiList:updated",Yt=>{pt.showPOIListOnMap(Yt)}),pt.events.subscribe("ocm:poiList:cleared",()=>{pt.mapping.clearMarkers(),setTimeout(()=>{pt.debouncedRefreshMapResults()},500)}),pt.events.subscribe("ocm:window:resized",Yt=>{null!=Yt&&Yt.length>0&&pt.enforceMapHeight(Yt[0])}),pt.events.subscribe("ocm:poi:selected",Yt=>{if(Yt.poi)pt.viewPOIDetails(Yt,Yt.poi);else{let Ut=pt.getPOIByID(Yt.poiId);pt.viewPOIDetails(Yt,Ut)}}),pt.mapping.initMap(pt.mapCanvasID)})()}ngAfterViewInit(){var pt=this;return(0,C.Z)(function*(){yield pt.initialiseMapping()})()}ngOnInit(){var pt=this;return(0,C.Z)(function*(){pt.logging.log("Refreshing reference data ..",Ie.i.VERBOSE),(yield pt.appManager.referenceDataManager.refreshReferenceData(pt.appManager.api))||(pt.appManager.isOffline=!0)})()}showPOIListOnMap(pt){const Yt=this.getPreferredMapHeight(null);this.mapping.refreshMapView(Yt,this.poiManager.poiList,null),this.mapDisplayed||(this.mapDisplayed=!0)}getIconForPOI(pt){return Be.c.getIconForPOI(pt)}getPOIByID(pt){const Yt=this.poiManager.poiList;for(let Ut=0;Ut0&&(Yt.minPowerKW=pt.appManager.searchSettings.MinPowerKW),null!=pt.appManager.searchSettings.MaxPowerKW&&pt.appManager.searchSettings.MaxPowerKW>0&&(Yt.maxPowerKW=pt.appManager.searchSettings.MaxPowerKW),null!=pt.appManager.searchSettings.MaxResults&&pt.appManager.searchSettings.MaxResults>0&&pt.appManager.searchSettings.MaxResults<=1e4&&(Yt.maxResults=pt.appManager.searchSettings.MaxResults),null!=pt.journeyManager.getRoutePolyline()&&(Yt.polyline=pt.journeyManager.getRoutePolyline(),Yt.boundingbox=null,Yt.levelOfDetail=null,Yt.latitude=null,Yt.longitude=null)),pt.appManager.searchSettings.EnablePOIPendingApproval&&(Yt.submissionStatusTypeIdList=[1,100,200]),pt.appManager.isRequestInProgress=!0;let ii=yield pt.poiManager.refreshPOIList(Yt);pt.appManager.isRequestInProgress=!1,pt.initialResultsShown=!0,ii>=Yt.maxResults&&pt.appManager.showToastNotification("A maximum of "+ii+" results are returned per search. Zoom in for details.")})()}viewPOIDetails(pt,Yt){this.logging.log("Viewing/fetching ["+this.poiViewMode+"] POI Details "+pt.poiId),null!=Yt?(this.mapping.unfocusMap(),this.modalController.create({component:ee.H,componentProps:{item:Yt}}).then(Ut=>{Ut.onDidDismiss().then(()=>{this.logging.log("Dismissing POI Details."),this.mapping.focusMap(),this.searchOnDemand=!0}),Ut.present()})):this.poiManager.getPOIById(pt.poiId,!0).then(Ut=>{this.logging.log("Got POI Details "+Ut.ID),"modal"===this.poiViewMode&&(this.searchOnDemand=!1,this.modalController.create({component:ee.H,componentProps:{item:Ut}}).then(ii=>{ii.onDidDismiss().then(()=>{this.logging.log("Dismissing POI Details."),this.mapping.focusMap(),this.searchOnDemand=!0}),ii.present()}),this.mapping.unfocusMap()),"side"===this.poiViewMode&&(this.selectedPOI=Ut)},Ut=>{this.appManager.showToastNotification("POI Details not available")})}closePOIDetails(){this.selectedPOI=null}openRoutePlannerModal(){this.searchOnDemand=!1,this.mapping.unfocusMap(),this.modalController.create({component:_e.u}).then(pt=>{pt.onDidDismiss().then(Yt=>{this.logging.log("Dismissing Route Planner Details."),this.mapping.focusMap(),this.searchOnDemand=!0}),pt.present()})}openSearchOptions(){this.searchOnDemand=!1,this.mapping.unfocusMap(),this.modalController.create({component:he.N}).then(pt=>{pt.onDidDismiss().then(Yt=>{this.mapping.focusMap(),this.searchOnDemand=!0}),pt.present()})}openSideView(){this.poiViewMode="side",this.mapping.updateMapSize()}closeSideView(){this.poiViewMode="modal",this.mapping.updateMapSize()}planRoute(){this.routePlanningMode=!0}search(pt){this.placeSearchMapPOI.getPlacesAutoComplete(pt,"poiSearch")}useFallbackPosition(){let pt=this.defaultStartPos;null!=this.appManager.searchSettings.LastSearchPosition&&(pt=this.appManager.searchSettings.LastSearchPosition),this.appManager.searchSettings.StartSearchPosition=pt,this.appManager.searchSettings.LastSearchPosition=null,this.searchOnDemand=!0,this.mapping.updateMapCentrePos(pt.latitude,pt.longitude,!0,this.defaultMapZoom)}getPosition(pt={}){var Yt=this;return(0,C.Z)(function*(){return new Promise((Ut,ii)=>{Yt._watchId=Re.watchPosition(pt,(gn,Ft)=>{Yt._watchId&&Re.clearWatch({id:Yt._watchId}),Ft?ii(Ft):Ut(gn)})})})()}locateUser(){var pt=this;return(0,C.Z)(function*(){pt.useFallbackPosition();try{pt.logging.log("Attempting to locate user..");const Yt=yield pt.getPosition({timeout:1e4});if(!Yt)throw"Failed to get user location.";return pt.logging.log("Got user location."),pt.appManager.searchSettings.StartSearchPosition=new ae.wC(Yt.coords.latitude,Yt.coords.longitude),pt.searchOnDemand=!0,pt.mapping.updateMapCentrePos(Yt.coords.latitude,Yt.coords.longitude,!0,pt.defaultMapZoom),localStorage.setItem("_locationEnabled","true"),!0}catch(Yt){return pt.logging.log("Failed to get user location. Searching using default or last position."+Yt),pt.appManager.showToastNotification("Your location could not be determined."),pt.useFallbackPosition(),!1}})()}placeSelected(pt){this.searchKeyword=pt.Address,this.logging.log("Got place details:"+pt.Address),this.mapping.focusMap(),this.mapping.updateMapCentrePos(pt.Location.latitude,pt.Location.longitude,!0),this.debouncedRefreshMapResults()}}return kt=dt,(0,x.Z)(dt,"\u0275fac",function(pt){return new(pt||kt)(Fe.Y36(le.c),Fe.Y36(ie.SH),Fe.Y36(St.z),Fe.Y36(y.sK),Fe.Y36(ie.t4),Fe.Y36(et.R),Fe.Y36(Ue.v),Fe.Y36(Ee.i),Fe.Y36(Fe.R0b),Fe.Y36(ie.IN),Fe.Y36(ie.Br),Fe.Y36(Ie.z))}),(0,x.Z)(dt,"\u0275cmp",Fe.Xpm({type:kt,selectors:[["ng-component"]],viewQuery:function(pt,Yt){if(1&pt&&Fe.Gf(ue.v,7),2&pt){let Ut;Fe.iGM(Ut=Fe.CRH())&&(Yt.placeSearchMapPOI=Ut.first)}},decls:18,vars:10,consts:[["slot","start"],["autocapitalize","on","autocomplete","on",3,"ngModel","placeholder","debounce","ngModelChange","ionInput"],["slot","end"],[3,"click"],["name","locate","slot","start",4,"ngIf"],[4,"ngIf"],[3,"color","click"],["name","options","slot","end"],[3,"click",4,"ngIf"],[1,"search-page"],[3,"placeChanged"],["placeSearchMapPOI",""],["id","map-canvas",2,"height","100%","width","100%","min-height","300px"],["name","locate","slot","start"],["name","car","title","Route","slot","end"],[2,"position","absolute"]],template:function(pt,Yt){1&pt&&(Fe.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-buttons",0),Fe._UZ(3,"ion-menu-button"),Fe.qZA(),Fe.TgZ(4,"ion-searchbar",1),Fe.NdJ("ngModelChange",function(ii){return Yt.searchKeyword=ii})("ionInput",function(ii){return Yt.search(ii)}),Fe.ALo(5,"translate"),Fe.qZA(),Fe.TgZ(6,"ion-buttons",2)(7,"ion-button",3),Fe.NdJ("click",function(){return Yt.locateUser()}),Fe.YNc(8,Ce,1,0,"ion-icon",4),Fe.YNc(9,Rt,1,0,"ion-spinner",5),Fe.qZA(),Fe.TgZ(10,"ion-button",6),Fe.NdJ("click",function(){return Yt.openSearchOptions()}),Fe._UZ(11,"ion-icon",7),Fe.qZA(),Fe.YNc(12,Qt,2,0,"ion-button",8),Fe.qZA()()(),Fe.TgZ(13,"ion-content",9)(14,"place-search",10,11),Fe.NdJ("placeChanged",function(ii){return Yt.placeSelected(ii)}),Fe.qZA(),Fe.YNc(16,Gt,4,0,"ng-container",5),Fe._UZ(17,"div",12),Fe.qZA()),2&pt&&(Fe.xp6(4),Fe.Q6J("ngModel",Yt.searchKeyword)("placeholder",Fe.lcZ(5,8,"ocm.search.performSearch"))("debounce",500),Fe.xp6(4),Fe.Q6J("ngIf",!Yt.appManager.isRequestInProgress),Fe.xp6(1),Fe.Q6J("ngIf",Yt.appManager.isRequestInProgress),Fe.xp6(1),Fe.Q6J("color",Yt.appManager.searchSettings.HasActiveFilters?"danger":"default"),Fe.xp6(2),Fe.Q6J("ngIf",1==Yt.sideViewAvailable&&"modal"==Yt.poiViewMode),Fe.xp6(4),Fe.Q6J("ngIf",Yt.appManager.isOffline))},dependencies:[s.O5,J.JJ,J.On,ie.YG,ie.Sm,ie.W2,ie.Gu,ie.gu,ie.fG,ie.VI,ie.PQ,ie.sr,ie.j9,ue.v,y.X$],styles:[".search-page[_ngcontent-%COMP%] #map-canvas[_ngcontent-%COMP%]{width:100%;height:98%}.search-page[_ngcontent-%COMP%] #place-search[_ngcontent-%COMP%]{min-height:300px;background-color:#f0f0f0;position:absolute;z-index:100;width:100%}.search-page[_ngcontent-%COMP%] ion-buttons[_ngcontent-%COMP%]{flex:.4}.search-page[_ngcontent-%COMP%] ion-grid[_ngcontent-%COMP%], .search-page[_ngcontent-%COMP%] ion-row[_ngcontent-%COMP%], .search-page[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%]{padding:0}.search-page[_ngcontent-%COMP%] scroll-content[_ngcontent-%COMP%]{overflow-y:hidden}.search-page[_ngcontent-%COMP%] .banner[_ngcontent-%COMP%]{padding-left:2em}.search-page[_ngcontent-%COMP%] .sideview[_ngcontent-%COMP%]{background:rgb(238,238,238);background:linear-gradient(to bottom,rgb(238,238,238) 0%,rgb(255,255,255) 100%)}"]})),dt})(),Jt=(()=>{var kt;class dt{}return kt=dt,(0,x.Z)(dt,"\u0275fac",function(pt){return new(pt||kt)}),(0,x.Z)(dt,"\u0275mod",Fe.oAB({type:kt})),(0,x.Z)(dt,"\u0275inj",Fe.cJS({imports:[s.ez,J.u5,ie.Pc,y.aw,h.e,Y.Bz.forChild([{path:"",component:Zt}])]})),dt})()},4119:(Nn,yt,k)=>{"use strict";k.d(yt,{N:()=>ct});var x=k(5861),h=k(1180),y=k(4669),s=k(6470),J=k(4783),ie=k(866),Y=k(1847),C=k(2029),Ne=k(9843),me=k(5957),he=k(6814),_e=k(6223),ee=k(6086),ae=k(3999);let oe=(()=>{var ht;class Le extends ae.X${constructor(gt,De){super(gt,De)}transform(gt,...De){let Pe=super.transform(gt,...De);return Pe==gt?null!=De&&De[0].default?De[0].default:De[0].Title?De[0].Title:Pe:Pe}}return ht=Le,(0,h.Z)(Le,"\u0275fac",function(gt){return new(gt||ht)(C.Y36(ae.sK,16),C.Y36(C.sBO,16))}),(0,h.Z)(Le,"\u0275pipe",C.Yjl({name:"nullableTranslate",type:ht,pure:!0})),(0,h.Z)(Le,"\u0275prov",C.Yz7({token:ht,factory:ht.\u0275fac})),Le})();function Be(ht,Le){if(1&ht){const ye=C.EpF();C.TgZ(0,"p",23),C._UZ(1,"ion-icon",24),C._uU(2," One or more filters are currently being applied. "),C.TgZ(3,"ion-button",25),C.NdJ("click",function(){C.CHM(ye);const De=C.oxw();return C.KtG(De.clearFilters())}),C._UZ(4,"ion-icon",26),C.TgZ(5,"ion-label"),C._uU(6,"Clear"),C.qZA()()()}}function Ie(ht,Le){if(1&ht&&(C.TgZ(0,"ion-select-option",28),C._uU(1),C.qZA()),2&ht){const ye=Le.$implicit;C.Q6J("value",ye.ID),C.xp6(1),C.Oqu(ye.Title)}}function Ee(ht,Le){if(1&ht){const ye=C.EpF();C.TgZ(0,"ion-item")(1,"ion-select",15),C.NdJ("ngModelChange",function(De){C.CHM(ye);const Pe=C.oxw();return C.KtG(Pe.searchSettings.FilterOptionsByCountryId=De)})("ionChange",function(){C.CHM(ye);const De=C.oxw();return C.KtG(De.onCountryChange())}),C.ALo(2,"translate"),C.TgZ(3,"ion-select",27),C._uU(4,"(All Countries)"),C.qZA(),C.YNc(5,Ie,2,2,"ion-select-option",6),C.qZA()()}if(2&ht){const ye=C.oxw();C.xp6(1),C.Q6J("label",C.lcZ(2,3,"ocm.search.countries"))("ngModel",ye.searchSettings.FilterOptionsByCountryId),C.xp6(4),C.Q6J("ngForOf",ye.countries)}}function Ue(ht,Le){if(1&ht&&(C.TgZ(0,"ion-select-option",28),C._uU(1),C.ALo(2,"nullableTranslate"),C.qZA()),2&ht){const ye=Le.$implicit;C.Q6J("value",ye.ID),C.xp6(1),C.Oqu(C.xi3(2,2,"ocm.reference.usageType.value_"+ye.ID,ye))}}function et(ht,Le){if(1&ht&&(C.TgZ(0,"ion-select-option",28),C._uU(1),C.ALo(2,"nullableTranslate"),C.qZA()),2&ht){const ye=Le.$implicit;C.Q6J("value",ye.ID),C.xp6(1),C.Oqu(C.xi3(2,2,"ocm.reference.statusType.value_"+ye.ID,ye))}}function le(ht,Le){if(1&ht&&(C.TgZ(0,"ion-select-option",28),C._uU(1),C.ALo(2,"nullableTranslate"),C.qZA()),2&ht){const ye=Le.$implicit;C.Q6J("value",ye.ID),C.xp6(1),C.Oqu(C.xi3(2,2,"ocm.reference.connectionType.value_"+ye.ID,ye))}}function ue(ht,Le){if(1&ht&&(C.TgZ(0,"ion-select-option",28),C._uU(1),C.qZA()),2&ht){const ye=Le.$implicit;C.Q6J("value",ye.code),C.xp6(1),C.Oqu(ye.title)}}let ct=(()=>{var ht;class Le{constructor(gt,De,Pe,Ae,Ye){(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"poiManager",void 0),(0,h.Z)(this,"mapping",void 0),(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"searchSettings",void 0),(0,h.Z)(this,"maxPower",J.U),(0,h.Z)(this,"powerRange",{lower:0,upper:this.maxPower}),(0,h.Z)(this,"_languages",[]),this.appManager=gt,this.poiManager=De,this.mapping=Pe,this.modalController=Ae,this.events=Ye,this.searchSettings=gt.searchSettings}ngOnInit(){var gt=this;return(0,x.Z)(function*(){null!=gt.searchSettings.MinPowerKW&&(gt.powerRange.lower=gt.searchSettings.MinPowerKW),null!=gt.searchSettings.MaxPowerKW&&(gt.powerRange.upper=gt.searchSettings.MaxPowerKW),0==gt.powerRange.upper&&(gt.powerRange.upper=gt.maxPower),gt.appManager.analytics.viewEvent("Settings"),gt.useFilteredOptions&&(yield gt.onCountryChange())})()}get useFilteredOptions(){return this.searchSettings.FilterOptionsByCountryId>0}clearFilters(){this.searchSettings.ClearActiveFilters(),this.powerRange={lower:0,upper:this.maxPower},this.searchSettings.CheckForActiveFilters()}get operators(){return this.appManager.referenceDataManager.getNetworkOperators(this.useFilteredOptions)}get connectionTypes(){return this.appManager.referenceDataManager.getConnectionTypes(this.useFilteredOptions)}get usageTypes(){return this.appManager.referenceDataManager.getUsageTypes(this.useFilteredOptions)}get statusTypes(){return this.appManager.referenceDataManager.getStatusTypes(this.useFilteredOptions)}get countries(){return this.appManager.referenceDataManager.getCountries(this.useFilteredOptions)}get isCountryFilterFeatureEnabled(){return ie.c.isFeatureEnabled("FILTER_OPTIONS_BY_COUNTRY")}get languages(){return this._languages.length>0||(this._languages=this.appManager.getLanguages()),this._languages}ionViewWillLeave(){null!=this.searchSettings.Language&&this.appManager.setLanguage(this.searchSettings.Language),this.searchSettings.MinPowerKW=this.powerRange.lower,this.searchSettings.MaxPowerKW=this.powerRange.upper,1==this.searchSettings.MinPowerKW&&(this.searchSettings.MinPowerKW=null),this.searchSettings.MaxPowerKW==this.maxPower&&(this.searchSettings.MaxPowerKW=null),this.appManager.searchSettings=this.searchSettings,this.appManager.saveSearchSettings(),this.events.publish("ocm:poiList:cleared")}onLanguageChange(){null!=this.searchSettings.Language&&""!=this.searchSettings.Language&&this.appManager.setLanguage(this.searchSettings.Language)}onCountryChange(){var gt=this;return(0,x.Z)(function*(){gt.appManager.referenceDataManager.refreshFilteredReferenceData(gt.appManager.api,{CountryIds:[gt.searchSettings.FilterOptionsByCountryId]})})()}onMapTypeChange(){var gt=this;return(0,x.Z)(function*(){gt.mapping.setMapType(gt.searchSettings.MapType)})()}onOperatorSelected(gt=null){var De=this;return(0,x.Z)(function*(){null!=gt&&(De.searchSettings.OperatorList.find(Pe=>Pe==gt.ID)||De.searchSettings.OperatorList.push(gt.ID))})()}onOperatorRemoved(gt){var De=this;return(0,x.Z)(function*(){De.searchSettings.OperatorList=De.searchSettings.OperatorList.filter(Pe=>Pe!=gt)})()}close(){this.modalController.dismiss()}}return ht=Le,(0,h.Z)(Le,"\u0275fac",function(gt){return new(gt||ht)(C.Y36(s.c),C.Y36(y.R),C.Y36(Y.v),C.Y36(Ne.IN),C.Y36(me.z))}),(0,h.Z)(Le,"\u0275cmp",C.Xpm({type:ht,selectors:[["ng-component"]],decls:71,vars:40,consts:[[1,"settings-page","ion-padding"],["danger","",4,"ngIf"],[4,"ngIf"],["lines","none"],["mode","multi",3,"operatorList","useFilteredOperators","operatorRemoved","operatorChanged"],["multiple","true","cancelText","Cancel","okText","OK",3,"label","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["dualKnobs","true","min","0","max","650","pin","true",3,"ngModel","ngModelChange"],["slot","start","size","small","name","flash"],["slot","end","name","flash"],["slot","start",2,"padding-top","0"],["type","number","min","0",2,"width","3em","border","none",3,"ngModel","max","ngModelChange"],["slot","end",2,"padding-top","0"],["type","number",2,"width","3em","border","none",3,"ngModel","max","min","ngModelChange"],["label","Language","multiple","false",3,"ngModel","ngModelChange","ionChange"],["multiple","false","cancelText","Cancel","okText","OK",3,"label","ngModel","ngModelChange","ionChange"],["value","ROADMAP"],["value","SATELLITE"],[3,"ngModel","ngModelChange"],["label","Max Results","type","number","placeholder","500","min","100","max","10000",3,"ngModel","ngModelChange"],["slot","end"],[3,"click"],["name","close","slot","start"],["danger",""],["name","alert"],["size","small","color","light",3,"click"],["slot","start","name","close"],["value",""],[3,"value"]],template:function(gt,De){1>&&(C.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),C._uU(3),C.ALo(4,"translate"),C.qZA()()(),C.TgZ(5,"ion-content",0)(6,"h2"),C._uU(7,"Search Filters"),C.qZA(),C.TgZ(8,"p"),C._uU(9,"Note: Filters will remove usable charging locations from your search results if we do not have complete data (i.e Operator or Power Levels)."),C.qZA(),C.YNc(10,Be,7,0,"p",1),C.TgZ(11,"ion-list"),C.YNc(12,Ee,6,5,"ion-item",2),C.TgZ(13,"ion-item",3)(14,"ion-label"),C._uU(15),C.ALo(16,"translate"),C.qZA()(),C.TgZ(17,"ion-item")(18,"app-operator-lookup",4),C.NdJ("operatorRemoved",function(Ae){return De.onOperatorRemoved(Ae)})("operatorChanged",function(Ae){return De.onOperatorSelected(Ae)}),C.qZA()(),C.TgZ(19,"ion-item")(20,"ion-select",5),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.UsageTypeList=Ae}),C.ALo(21,"translate"),C.YNc(22,Ue,3,5,"ion-select-option",6),C.qZA()(),C.TgZ(23,"ion-item")(24,"ion-select",5),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.StatusTypeList=Ae}),C.ALo(25,"translate"),C.YNc(26,et,3,5,"ion-select-option",6),C.qZA()(),C.TgZ(27,"ion-item")(28,"ion-select",5),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.ConnectionTypeList=Ae}),C.ALo(29,"translate"),C.YNc(30,le,3,5,"ion-select-option",6),C.qZA()(),C.TgZ(31,"ion-item",3)(32,"ion-range",7),C.NdJ("ngModelChange",function(Ae){return De.powerRange=Ae}),C.TgZ(33,"ion-icon",8),C._uU(34,"0"),C.qZA(),C._UZ(35,"ion-icon",9),C.qZA()(),C.TgZ(36,"ion-item",3)(37,"ion-note",10),C._uU(38,"Min. Power (kW)"),C._UZ(39,"br"),C.TgZ(40,"input",11),C.NdJ("ngModelChange",function(Ae){return De.powerRange.lower=Ae}),C.qZA()(),C.TgZ(41,"ion-note",12),C._uU(42,"Max. Power (kW)"),C._UZ(43,"br"),C.TgZ(44,"input",13),C.NdJ("ngModelChange",function(Ae){return De.powerRange.upper=Ae}),C.qZA()()()(),C.TgZ(45,"h2"),C._uU(46," General Settings "),C.qZA(),C.TgZ(47,"ion-item")(48,"ion-select",14),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.Language=Ae})("ionChange",function(){return De.onLanguageChange()}),C.YNc(49,ue,2,2,"ion-select-option",6),C.qZA()(),C.TgZ(50,"ion-item")(51,"ion-select",15),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.MapType=Ae})("ionChange",function(){return De.onMapTypeChange()}),C.ALo(52,"translate"),C.TgZ(53,"ion-select-option",16),C._uU(54,"Road Map"),C.qZA(),C.TgZ(55,"ion-select-option",17),C._uU(56,"Satellite"),C.qZA()()(),C.TgZ(57,"ion-item")(58,"ion-toggle",18),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.EnableAdvancedEditorFeatures=Ae}),C._uU(59,"Enable Advanced Editor Options"),C.qZA()(),C.TgZ(60,"ion-item")(61,"ion-toggle",18),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.EnablePOIPendingApproval=Ae}),C._uU(62,"Show New POIs Pending Approval"),C.qZA()(),C.TgZ(63,"ion-item")(64,"ion-input",19),C.NdJ("ngModelChange",function(Ae){return De.searchSettings.MaxResults=Ae}),C.qZA()()(),C.TgZ(65,"ion-footer")(66,"ion-toolbar")(67,"ion-buttons",20)(68,"ion-button",21),C.NdJ("click",function(){return De.close()}),C._UZ(69,"ion-icon",22),C._uU(70," Close "),C.qZA()()()()),2>&&(C.xp6(3),C.hij(" ",C.lcZ(4,28,"ocm.general.settings")," "),C.xp6(7),C.Q6J("ngIf",1==De.searchSettings.HasActiveFilters),C.xp6(2),C.Q6J("ngIf",De.isCountryFilterFeatureEnabled),C.xp6(3),C.Oqu(C.lcZ(16,30,"ocm.search.networkOperators")),C.xp6(3),C.Q6J("operatorList",De.searchSettings.OperatorList)("useFilteredOperators",!1),C.xp6(2),C.Q6J("label",C.lcZ(21,32,"ocm.search.usageTypes"))("ngModel",De.searchSettings.UsageTypeList),C.xp6(2),C.Q6J("ngForOf",De.usageTypes),C.xp6(2),C.Q6J("label",C.lcZ(25,34,"ocm.search.operationalStatusTypes"))("ngModel",De.searchSettings.StatusTypeList),C.xp6(2),C.Q6J("ngForOf",De.statusTypes),C.xp6(2),C.Q6J("label",C.lcZ(29,36,"ocm.search.connectionTypes"))("ngModel",De.searchSettings.ConnectionTypeList),C.xp6(2),C.Q6J("ngForOf",De.connectionTypes),C.xp6(2),C.Q6J("ngModel",De.powerRange),C.xp6(8),C.Q6J("ngModel",De.powerRange.lower)("max",De.powerRange.upper),C.xp6(4),C.Q6J("ngModel",De.powerRange.upper)("max",De.maxPower)("min",De.powerRange.lower),C.xp6(4),C.Q6J("ngModel",De.searchSettings.Language),C.xp6(1),C.Q6J("ngForOf",De.languages),C.xp6(2),C.Q6J("label",C.lcZ(52,38,"ocm.details.location.map"))("ngModel",De.searchSettings.MapType),C.xp6(7),C.Q6J("ngModel",De.searchSettings.EnableAdvancedEditorFeatures),C.xp6(3),C.Q6J("ngModel",De.searchSettings.EnablePOIPendingApproval),C.xp6(3),C.Q6J("ngModel",De.searchSettings.MaxResults))},dependencies:[he.sg,he.O5,_e.Fj,_e.wV,_e.JJ,_e.qQ,_e.Fd,_e.On,Ne.YG,Ne.Sm,Ne.W2,Ne.fr,Ne.Gu,Ne.gu,Ne.pK,Ne.Ie,Ne.Q$,Ne.q_,Ne.uN,Ne.I_,Ne.t9,Ne.n0,Ne.wd,Ne.ho,Ne.sr,Ne.w,Ne.as,Ne.QI,Ne.yf,Ne.Uj,ee.z,ae.X$,oe],encapsulation:2})),Le})()},9472:(Nn,yt,k)=>{"use strict";k.r(yt),k.d(yt,{SignInModule:()=>me});var x=k(1180),h=k(8767),y=k(5086),s=k(3999),J=k(6814),ie=k(6223),Y=k(9843),C=k(6800),Ne=k(2029);let me=(()=>{var he;class _e{}return he=_e,(0,x.Z)(_e,"\u0275fac",function(ae){return new(ae||he)}),(0,x.Z)(_e,"\u0275mod",Ne.oAB({type:he})),(0,x.Z)(_e,"\u0275inj",Ne.cJS({imports:[J.ez,ie.u5,Y.Pc,s.aw,y.e,C.Bz.forChild([{path:"",component:h.F}])]})),_e})()},8767:(Nn,yt,k)=>{"use strict";k.d(yt,{F:()=>he});var x=k(5861),h=k(1180),y=k(9127),s=k(6470),J=k(2029),ie=k(9843),Y=k(3999),C=k(6800),Ne=k(6814),me=k(6223);let he=(()=>{var _e;class ee{constructor(oe,Be,Ie,Ee,Ue,et,le,ue){(0,h.Z)(this,"appManager",void 0),(0,h.Z)(this,"modalController",void 0),(0,h.Z)(this,"translate",void 0),(0,h.Z)(this,"alertController",void 0),(0,h.Z)(this,"loadingController",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"router",void 0),(0,h.Z)(this,"location",void 0),(0,h.Z)(this,"email",void 0),(0,h.Z)(this,"password",void 0),this.appManager=oe,this.modalController=Be,this.translate=Ie,this.alertController=Ee,this.loadingController=Ue,this.logging=et,this.router=le,this.location=ue,this.email=""}cancelSignIn(){this.modalController.dismiss()}performSignIn(){var oe=this;return(0,x.Z)(function*(){const Be=yield oe.loadingController.create({message:"Signing In.."});yield Be.present();let Ie=!1;try{yield oe.appManager.api.performSignIn(oe.email,oe.password),Be.dismiss(),localStorage.setItem("authResponse",JSON.stringify(oe.appManager.api.authResponse)),oe.appManager.isUserAuthenticated(!0),oe.modalController.dismiss(),oe.appManager.analytics.appEvent("Profile","SignedIn")}catch(Ee){Ie=!0,Be.dismiss(),yield(yield oe.alertController.create({header:"Open Charge Map",subHeader:"Email or Password not recognised",buttons:["Ok"]})).present(),oe.logging.log("Error logging in:"+Ee)}})()}}return _e=ee,(0,h.Z)(ee,"\u0275fac",function(oe){return new(oe||_e)(J.Y36(s.c),J.Y36(ie.IN),J.Y36(Y.sK),J.Y36(ie.Br),J.Y36(ie.HT),J.Y36(y.z),J.Y36(C.F0),J.Y36(Ne.Ye))}),(0,h.Z)(ee,"\u0275cmp",J.Xpm({type:_e,selectors:[["ng-component"]],decls:37,vars:8,consts:[[1,"signin-page","ion-padding"],["item-left",""],["src","assets/images/icons/branding/AppIcon_128x128.png"],[1,"ion-padding"],["position","floating"],["type","text",3,"ngModel","ngModelChange"],["type","password",3,"ngModel","ngModelChange"],[3,"click"],["slot","secondary"],["name","close","slot","start"],["slot","primary"],["type","submit","color","primary",3,"click"],["name","log-in","slot","start"]],template:function(oe,Be){1&oe&&(J.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),J._uU(3),J.ALo(4,"translate"),J.qZA()()(),J.TgZ(5,"ion-content",0)(6,"ion-avatar",1),J._UZ(7,"img",2),J.qZA(),J.TgZ(8,"p",3),J._uU(9," Sign in using your Open Charge Map account. "),J.qZA(),J.TgZ(10,"ion-list")(11,"ion-item")(12,"ion-label",4),J._uU(13,"Email"),J.qZA(),J.TgZ(14,"ion-input",5),J.NdJ("ngModelChange",function(Ee){return Be.email=Ee}),J.qZA()(),J.TgZ(15,"ion-item")(16,"ion-label",4),J._uU(17,"Password"),J.qZA(),J.TgZ(18,"ion-input",6),J.NdJ("ngModelChange",function(Ee){return Be.password=Ee}),J.qZA()()(),J.TgZ(19,"p"),J._uU(20,"or "),J.TgZ(21,"a",7),J.NdJ("click",function(){return Be.appManager.launchWebPage("https://openchargemap.org/site/loginprovider/register")}),J._uU(22,"Register as New User"),J.qZA(),J._uU(23," or "),J.TgZ(24,"a",7),J.NdJ("click",function(){return Be.appManager.launchWebPage("https://openchargemap.org/site/loginprovider/passwordreset")}),J._uU(25,"Reset your password"),J.qZA()()(),J.TgZ(26,"ion-footer")(27,"ion-toolbar")(28,"ion-buttons",8)(29,"ion-button",7),J.NdJ("click",function(){return Be.cancelSignIn()}),J._UZ(30,"ion-icon",9),J._uU(31," Cancel"),J.qZA()(),J.TgZ(32,"ion-buttons",10)(33,"ion-button",11),J.NdJ("click",function(){return Be.performSignIn()}),J._UZ(34,"ion-icon",12),J._uU(35),J.ALo(36,"translate"),J.qZA()()()()),2&oe&&(J.xp6(3),J.hij(" ",J.lcZ(4,4,"ocm.general.signIn")," "),J.xp6(11),J.Q6J("ngModel",Be.email),J.xp6(4),J.Q6J("ngModel",Be.password),J.xp6(17),J.hij(" ",J.lcZ(36,6,"ocm.general.signIn"),""))},dependencies:[me.JJ,me.On,ie.BJ,ie.YG,ie.Sm,ie.W2,ie.fr,ie.Gu,ie.gu,ie.pK,ie.Ie,ie.Q$,ie.q_,ie.wd,ie.sr,ie.j9,Y.X$],encapsulation:2})),ee})()},439:(Nn,yt,k)=>{"use strict";k.d(yt,{l:()=>Ne});var x=k(5861),h=k(1180),y=k(9127),s=k(9159),J=k(7518),ie=k(9862),Y=k(553),C=k(2029);let Ne=(()=>{var me;class he{constructor(ee,ae,oe){(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"refData",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"serviceBase","https://api.openchargemap.io"),(0,h.Z)(this,"serviceBaseURL",this.serviceBase+"/v3"),(0,h.Z)(this,"hasAuthorizationError",!1),(0,h.Z)(this,"ATTRIBUTION_METADATAFIELDID",4),(0,h.Z)(this,"authResponse",void 0),(0,h.Z)(this,"clientName","ocm.api.default"),(0,h.Z)(this,"authorizationErrorCallback",void 0),(0,h.Z)(this,"generalErrorCallback",void 0),(0,h.Z)(this,"allowMirror",!1),(0,h.Z)(this,"lastPOIApiCallURL",""),this.http=ee,this.refData=ae,this.logging=oe,this.serviceBaseURL=Y.N.apiBase+"/v3"}getNumberListString(ee){let ae="";for(let oe=0;oe0&&(Be+="&connectiontypeid="+ae.getNumberListString(ee.connectionTypeIdList)),null!=ee.operatorIdList&&ee.operatorIdList.length>0&&(Be+="&operatorid="+ae.getNumberListString(ee.operatorIdList)),null!=ee.usageTypeIdList&&ee.usageTypeIdList.length>0&&(Be+="&usagetypeid="+ae.getNumberListString(ee.usageTypeIdList)),null!=ee.statusTypeIdList&&ee.statusTypeIdList.length>0&&(Be+="&statustypeid="+ae.getNumberListString(ee.statusTypeIdList)),null!=ee.locationTitle&&(Be+="&locationtitle="+ee.locationTitle),null!=ee.minPowerKW&&ee.minPowerKW>0&&(Be+="&minpowerkw="+ee.minPowerKW),null!=ee.maxPowerKW&&ee.maxPowerKW>0&&(Be+="&maxpowerkw="+ee.maxPowerKW),null!=ee.submissionStatusTypeIdList&&(Be+="&submissionstatustypeid="+ae.getNumberListString(ee.submissionStatusTypeIdList)),null!=ee.poiIdList&&ee.poiIdList.length>0&&(Be+="&chargepointid="+ae.getNumberListString(ee.poiIdList)),0==ee.enableCaching&&(Be+="&enablecaching=false"),null!=ee.compact&&(Be+="&compact="+ee.compact),ee.levelOfDetail>1&&(Be+="&levelofdetail="+ee.levelOfDetail),null!=ee.polyline&&(Be+="&polyline="+ee.polyline),null!=ee.boundingbox&&(Be+="&boundingbox="+ee.boundingbox),null!=ee.additionalParams&&(Be+="&"+ee.additionalParams);const Ie=oe+Be;if(ae.lastPOIApiCallURL===Ie&&0!=ee.enableCaching)return ae.logging.log("Skipped API call due to same query being repeated."),[];ae.lastPOIApiCallURL=Ie,ae.logging.log("API Call:"+Ie,y.i.VERBOSE);try{let Ee=yield ae.http.get(Ie,ae.getHttpRequestOptions()).toPromise();return ae.refData.hydrateCompactPOIList(Ee)}catch(Ee){const Ue=Ee.message||"Could not fetch POI list from server.";throw ae.logging.log("API Client: "+JSON.stringify(Ee),y.i.ERROR),Ue}})()}getHttpRequestOptions(ee=!0){let ae=new ie.WM;return ee&&(ae=ae.append("Content-Type","application/json")),this.authResponse&&this.authResponse.Data&&this.authResponse.Data.access_token&&(ae=ae.append("Authorization","Bearer "+this.authResponse.Data.access_token)),ae=ae.append("X-API-Key",Y.N.apiKey),{headers:ae}}fetchCoreReferenceData(ee){let ae=this.serviceBaseURL+"/referencedata/?client="+this.clientName+"&output=json"+(this.allowMirror?"&allowmirror=true":"")+"&verbose=false&compact=true";return null!=ee&&null!=ee.CountryIds&&(ae+="&countryid="+this.getNumberListString(ee.CountryIds)),this.logging.log("API Call:"+ae,y.i.VERBOSE),this.http.get(ae,this.getHttpRequestOptions())}performSignIn(ee,ae){return this.http.post(this.serviceBaseURL+"/profile/authenticate/",JSON.stringify({emailaddress:ee,password:ae}),this.getHttpRequestOptions()).toPromise().then(Ie=>(this.authResponse=Ie,this.authResponse))}performSubmission(ee,ae){return ee===J.qO.POI?this.submitPOI(ae):ee===J.qO.Comment?this.submitUserComment(ae):ee===J.qO.Media?this.submitMediaItem(ae):void 0}submitUserComment(ee){const ae=JSON.stringify(ee);return this.logging.log("[api] Submitting user comment"),this.http.post(this.serviceBaseURL+"/comment/",ae,this.getHttpRequestOptions()).toPromise()}submitMediaItem(ee){const ae=JSON.stringify(ee);return this.http.post(this.serviceBaseURL+"/mediaitem/",ae,this.getHttpRequestOptions()).toPromise()}submitPOI(ee){const ae=JSON.stringify(ee);return this.http.post(this.serviceBaseURL+"/poi/",ae,this.getHttpRequestOptions()).toPromise()}getPanoramioLocationPhotos(ee){return new Promise(ae=>{const Be="https://www.panoramio.com/map/get_panoramas.php?set=public&from=0&to=2&minx="+(ee.longitude-.001)+"&miny="+(ee.latitude-.001)+"&maxx="+(ee.longitude+.001)+"maxy="+(ee.latitude+.001)+"&size=medium&mapfilter=true&callback=?";return console.log(Be),this.http.get(Be).toPromise()})}fetchReverseGeocodeResult(ee,ae){return this.http.get(this.serviceBaseURL+"/geocode/?client="+this.clientName+"&output=json&camelcase=false&latitude="+ee+"&longitude="+ae,this.getHttpRequestOptions()).toPromise()}isLocalStorageAvailable(){return typeof window.localStorage<"u"}setCachedDataObject(ee,ae){this.isLocalStorageAvailable()&&(typeof ae>"u"&&(ae=null),null===ae?localStorage.removeItem(ee):localStorage.setItem(ee,JSON.stringify(ae)))}getCachedDataObject(ee){if(this.isLocalStorageAvailable()){const ae=localStorage.getItem(ee);if(null!=ae&&ae.length>0)return JSON.parse(ae)}return null}}return me=he,(0,h.Z)(he,"\u0275fac",function(ee){return new(ee||me)(C.LFG(ie.eN),C.LFG(s.W),C.LFG(y.z))}),(0,h.Z)(he,"\u0275prov",C.Yz7({token:me,factory:me.\u0275fac,providedIn:"root"})),he})()},3294:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>ie});var x=k(5861),h=k(1180),y=k(9127),s=k(2029),J=k(9843);let ie=(()=>{var Y;class C{constructor(me,he){(0,h.Z)(this,"logger",void 0),(0,h.Z)(this,"platform",void 0),(0,h.Z)(this,"isCordova",!1),(0,h.Z)(this,"ga",null),this.logger=me,this.platform=he,this.isCordova=!(!he.is("cordova")&&!he.is("capacitor"))}init(me){var he=this;return(0,x.Z)(function*(){he.isCordova&&he.ga?yield he.ga.startTrackerWithId(me):he.logger.log("Could not initialise analytics")})()}setAppVersion(me){var he=this;return(0,x.Z)(function*(){if(he.isCordova&&he.ga)return he.ga.setAppVersion(me);he.logger.log(me)})()}appEvent(me,he){var _e=this;return(0,x.Z)(function*(){if(_e.isCordova&&_e.ga)return _e.ga.trackEvent(me,he);_e.logger.log(he)})()}viewEvent(me){var he=this;return(0,x.Z)(function*(){if(he.isCordova&&he.ga)return he.ga.trackView(me);he.logger.log(me)})()}}return Y=C,(0,h.Z)(C,"\u0275fac",function(me){return new(me||Y)(s.LFG(y.z),s.LFG(J.t4))}),(0,h.Z)(C,"\u0275prov",s.Yz7({token:Y,factory:Y.\u0275fac,providedIn:"root"})),C})()},6470:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>Ie});var x=k(5861),h=k(1180),y=k(9127),s=k(439),J=k(7518),ie=k(2029),Y=k(5957);let C=(()=>{var Ee;class Ue{constructor(le){(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"isQueueProcessing",void 0),(0,h.Z)(this,"appManager",void 0),this.events=le,this.isQueueProcessing=!1}setAppManager(le){this.appManager=le}add(le,ue){let ct=this.getQueueItems();ct.push(new J.aX(le,ue)),this.saveQueueItems(ct)}update(le){let ue=this.getQueueItems(),ct=new Array;return ue.forEach(ht=>{ct.push(ht.ID==le.ID?le:ht)}),ct}processNextQueueItem(){let le=this.getNextQueueItem();null!=le&&null!=this.appManager&&this.appManager.api.performSubmission(le.SubmissionType,le.Data).then(()=>{le.IsSubmitted=!0,le.Attempts++,this.update(le),this.clear()})}getNextQueueItem(){let le=this.getQueueItems(),ue=null;return le.forEach(ct=>{null==ue&&!ct.IsCancelled&&!ct.IsInProgress&&!ct.IsSubmitted&&(ue=ct)}),ue}hasPendingItems(){let le=!1;return this.getQueueItems().forEach(ct=>{!ct.IsFailure&&!ct.IsCancelled&&!ct.IsSubmitted&&(le=!0)}),le}isCompleted(){let le=this.getQueueItems(),ue=!0;return le.forEach(ct=>{(ct.IsInProgress||ct.IsFailure)&&(ue=!1)}),ue}clear(le=!1){let ue=this.getQueueItems(),ct=new Array;le||ue.forEach(ht=>{(ht.IsInProgress||ht.IsFailure)&&ct.push(ht)}),this.saveQueueItems(ct)}saveQueueItems(le){localStorage.setItem("submissionQueue",JSON.stringify(le))}getQueueItems(){let le=localStorage.getItem("submissionQueue");return null!=le?JSON.parse(le):new Array}}return Ee=Ue,(0,h.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ie.LFG(Y.z))}),(0,h.Z)(Ue,"\u0275prov",ie.Yz7({token:Ee,factory:Ee.\u0275fac,providedIn:"root"})),Ue})();var Ne=k(9159),me=k(989),he=k(3294),_e=k(553),ee=k(9862),ae=k(9843),oe=k(3999),Be=k(6091);let Ie=(()=>{var Ee;class Ue{constructor(le,ue,ct,ht,Le,ye,gt,De,Pe,Ae,Ye,_t,hn){(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"api",void 0),(0,h.Z)(this,"submissionQueue",void 0),(0,h.Z)(this,"platform",void 0),(0,h.Z)(this,"referenceDataManager",void 0),(0,h.Z)(this,"journeyManager",void 0),(0,h.Z)(this,"translateService",void 0),(0,h.Z)(this,"toastController",void 0),(0,h.Z)(this,"loadingController",void 0),(0,h.Z)(this,"jwtHelper",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"analytics",void 0),(0,h.Z)(this,"enableSubmissionQueue",void 0),(0,h.Z)(this,"searchSettings",void 0),(0,h.Z)(this,"platformMode",void 0),(0,h.Z)(this,"journeys",void 0),(0,h.Z)(this,"isDebugMode",void 0),(0,h.Z)(this,"clientWidth",void 0),(0,h.Z)(this,"clientHeight",void 0),(0,h.Z)(this,"isRequestInProgress",!1),(0,h.Z)(this,"title","Open Charge Map"),(0,h.Z)(this,"_isUserAuthenticated",null),(0,h.Z)(this,"isEmbeddedMode",!1),(0,h.Z)(this,"isOffline",!1),this.http=le,this.events=ue,this.api=ct,this.submissionQueue=ht,this.platform=Le,this.referenceDataManager=ye,this.journeyManager=gt,this.translateService=De,this.toastController=Pe,this.loadingController=Ae,this.jwtHelper=Ye,this.logging=_t,this.analytics=hn,this.api.clientName="ocm.app.ionic."+_e.N.version,this.isDebugMode=!1,this.enableSubmissionQueue=!1,this.submissionQueue.setAppManager(this),this.platformMode=Le.is("cordova")?"cordova":"web",this.initAppManager(),this.searchSettings=new J.Nm,this.loadSearchSettings(),this.applyURLQueryStringOptions(),this.searchSettings.CheckForActiveFilters(),this.journeyManager.loadJourneys()}loadSearchSettings(){if(null!=localStorage.getItem("searchSettings")){this.searchSettings=new J.Nm;try{let le=JSON.parse(localStorage.getItem("searchSettings"));Object.assign(this.searchSettings,le)}catch{}}}savePushRegistration(le){localStorage.setItem("_pushToken",le.toString())}getPushRegistration(){localStorage.getItem("_pushToken")}getQueryVariable(le){let ct=window.location.search.substring(1).split("&");for(let ht=0;htdecodeURIComponent(De))}return null}applyURLQueryStringOptions(){if(this.getQueryVariable("mode")&&"embedded"==this.getQueryVariable("mode")[0]&&(this.isEmbeddedMode=!0),this.getQueryVariable("operatorid")){let le=this.getQueryVariable("operatorid");for(let ue of le)this.searchSettings.OperatorList.unshift(parseInt(ue,10))}if(this.getQueryVariable("latitude")&&this.getQueryVariable("longitude")){let le=this.getQueryVariable("latitude")[0],ue=this.getQueryVariable("longitude")[0];this.searchSettings.StartSearchPosition=new J.wC(parseFloat(le),parseFloat(ue))}this.getQueryVariable("title")&&(this.title=this.getQueryVariable("title")[0]),this.getQueryVariable("languagecode")&&this.setLanguage(this.getQueryVariable("languagecode")[0]),this.getQueryVariable("id")&&(this.searchSettings.StartViewPoiId=this.getQueryVariable("id")[0])}saveSearchSettings(){this.searchSettings.CheckForActiveFilters(),localStorage.setItem("searchSettings",JSON.stringify(this.searchSettings))}getLanguages(){return[{code:"ar",title:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 / Arabic"},{code:"bg",title:"Bulgarian / \u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"},{code:"cs",title:"Czech / \u010ce\u0161tina"},{code:"de",title:"German / Deutsch"},{code:"el",title:"Greek / \u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae"},{code:"en",title:"English"},{code:"es",title:"Spanish / Espa\xf1ol"},{code:"et",title:"Estonian / Eesti"},{code:"fi",title:"Finnish / Suomi"},{code:"fr",title:"French / Fran\xe7ais"},{code:"fy",title:"West Frisian / Frysk"},{code:"hu",title:"Hungarian / Magyar"},{code:"it",title:"Italian / Italiano"},{code:"ja",title:"Japanese / \u65e5\u672c\u8a9e"},{code:"lt",title:"Lithuanian / Lietuvi\u0173"},{code:"nl",title:"Dutch / Nederlands"},{code:"pt",title:"Portuguese / portugu\xeas"},{code:"ro",title:"Romanian / Rom\xe2n\u0103"},{code:"ru",title:"Russian / P\u0443\u0441\u0441\u043a\u0438\u0439"},{code:"sk",title:"Slovak / Sloven\u010dina"},{code:"tr",title:"Turkish / T\xfcrk\xe7e"},{code:"zh",title:"Chinese / \u4e2d\u56fd\u7684"}]}setLanguage(le){(null==le||""==le)&&(le="en"),this.logging.log("Changing language: "+le),this.translateService.use(le)}initAppManager(){this.initAuthFromStorage(),this.isUserAuthenticated(!0)&&this.enableSubmissionQueue&&null!=this.submissionQueue&&this.submissionQueue.hasPendingItems()&&this.submissionQueue.processNextQueueItem()}initAuthFromStorage(){let le=localStorage.getItem("authResponse");if(null!=le){let ue=JSON.parse(le);null!=ue.Data&&null!=ue.Data.access_token&&(this.jwtHelper.decodeToken(ue.Data.access_token),this.jwtHelper.isTokenExpired(ue.Data.access_token)?localStorage.removeItem("authResponse"):(this.api.authResponse=ue,this.logging.log("User has valid auth token in local storage",y.i.VERBOSE)))}}isUserAuthenticated(le=!1){return!1===le&&null!=this._isUserAuthenticated||(this._isUserAuthenticated=!1,null!=this.api.authResponse&&(this.jwtHelper.isTokenExpired(this.api.authResponse.Data.access_token)||(this._isUserAuthenticated=!0))),this._isUserAuthenticated}getCurrentAuthToken(){return null!=this.api.authResponse?this.api.authResponse.Data.access_token:null}getUserProfile(){return null!=this.api.authResponse?this.api.authResponse.Data.UserProfile:null}signOutCurrentUser(){localStorage.removeItem("authResponse"),this.api.authResponse=null,this._isUserAuthenticated=!1}submitComment(le){if(!this.enableSubmissionQueue)return this.api.performSubmission(J.qO.Comment,le);this.submissionQueue.add(J.qO.Comment,le),this.submissionQueue.processNextQueueItem()}submitMediaItem(le){if(!this.enableSubmissionQueue)return this.api.performSubmission(J.qO.Media,le);this.submissionQueue.add(J.qO.Media,le),this.submissionQueue.processNextQueueItem()}submitPOI(le){if(!this.enableSubmissionQueue)return this.api.performSubmission(J.qO.POI,le);this.submissionQueue.add(J.qO.POI,le),this.submissionQueue.processNextQueueItem()}showToastNotification(le){var ue=this;return(0,x.Z)(function*(){yield(yield ue.toastController.create({message:le,duration:3e3})).present()})()}showLoadingProgress(le){var ue=this;return(0,x.Z)(function*(){yield(yield ue.loadingController.create({message:le})).present()})()}dismissLoadingProgress(){var le=this;return(0,x.Z)(function*(){return le.loadingController.dismiss()})()}launchOCMWebPage(le){this.isUserAuthenticated(!0)&&(-1===le.indexOf("?")&&(le+="?"),le+="&auth="+this.getCurrentAuthToken()),le="https://openchargemap.org/site"+le,window.open(le,"_system")}launchWebPage(le){window.open(le,"_system")}isPlatform(le){return this.platform.is(le)}}return Ee=Ue,(0,h.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ie.LFG(ee.eN),ie.LFG(Y.z),ie.LFG(s.l),ie.LFG(C),ie.LFG(ae.t4),ie.LFG(Ne.W),ie.LFG(me.i),ie.LFG(oe.sK),ie.LFG(ae.yF),ie.LFG(ae.HT),ie.LFG(Be.N0),ie.LFG(y.z),ie.LFG(he.c))}),(0,h.Z)(Ue,"\u0275prov",ie.Yz7({token:Ee,factory:Ee.\u0275fac,providedIn:"root"})),Ue})()},5957:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>y});var x=k(1180),h=k(2029);let y=(()=>{var s;class J{constructor(){(0,x.Z)(this,"c",new Map)}subscribe(Y,...C){let Ne=this.c.get(Y);Ne||this.c.set(Y,Ne=[]),Ne.push(...C)}unsubscribe(Y,C){if(!C)return this.c.delete(Y);const Ne=this.c.get(Y);if(!Ne)return!1;const me=Ne.indexOf(C);return!(me<0||(Ne.splice(me,1),0===Ne.length&&this.c.delete(Y),0))}publish(Y,...C){const Ne=this.c.get(Y);return Ne?Ne.map(me=>{try{return me(...C)}catch(he){return console.error(he),null}}):null}}return s=J,(0,x.Z)(J,"\u0275fac",function(Y){return new(Y||s)}),(0,x.Z)(J,"\u0275prov",h.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})),J})()},989:(Nn,yt,k)=>{"use strict";k.d(yt,{i:()=>Y});var x=k(1180),h=k(9127),y=k(439),s=k(4669),J=k(7518),ie=k(2029);let Y=(()=>{var C;class Ne{constructor(he,_e,ee){(0,x.Z)(this,"api",void 0),(0,x.Z)(this,"poiManager",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"journeys",void 0),(0,x.Z)(this,"favourites",void 0),(0,x.Z)(this,"routePolyline",void 0),this.api=he,this.poiManager=_e,this.logging=ee,this.journeys=[],this.favourites=[]}loadJourneys(){let he=localStorage.getItem("journeys");if(null!=he&&(this.journeys=JSON.parse(he)),null!=this.journeys)for(let _e of this.journeys)this.fetchAllJourneyPOIDetails(_e)}fetchAllJourneyPOIDetails(he){this.logging.log("Journeys - fetching poi details for Journey "+he.Title);let _e=new J.be;_e.poiIdList=[];for(let ee of he.Stages)for(let ae of ee.WayPoints)for(let oe of ae.PoiIDs)_e.poiIdList.push(oe);this.api.fetchPOIListByParam(_e).then(ee=>{for(let ae of ee)this.updateStoredPOI(ae)})}updateStoredPOI(he){if(this.journeys.forEach(_e=>{_e.Stages.forEach(ee=>{ee.WayPoints.forEach(ae=>{ae.PoiIDs.forEach(oe=>{if(oe==he.ID)if(null==ae.PoiList){ae.PoiList=[];let Be=new J.Qp("charging",1);Be.Poi=he,Be.PoiID=he.ID,ae.PoiList.push(Be)}else for(let Be of ae.PoiList)Be.PoiID==he.ID&&(Be.Poi=he)})})})}),null!=this.favourites)for(let _e of this.favourites)"charging"==_e.Type&&_e.PoiID==he.ID&&(_e.Poi=he)}saveJourneys(){let he=JSON.parse(JSON.stringify(this.journeys));for(let ee of he)for(const ae of ee.Stages)for(let oe of ae.WayPoints)for(let Be of oe.PoiList)Be.Poi=null,Be.Photos=null;const _e=JSON.stringify(he);localStorage.setItem("journeys",_e)}addJourney(he,_e){let ee=new J.vw;ee.Title="Stage 1",null!=_e&&ee.WayPoints.push(_e),he.Stages.push(ee),this.journeys.push(he)}deleteJourney(he){this.journeys=this.journeys.filter(_e=>_e.ID!=he),this.saveJourneys()}getJourney(he){let _e=this.journeys.filter(ee=>ee.ID==he);return _e.length>0?_e[0]:null}getJourneyStages(he){return this.getJourney(he).Stages}addJourneyWaypoint(he,_e,ee){let ae=this.getJourney(he);if(null==_e){let oe=new J.vw;oe.Title="Stage "+(ae.Stages.length+1),oe.WayPoints.push(ee),ae.Stages.push(oe)}else{let oe=ae.Stages[_e];null==oe.WayPoints&&(oe.WayPoints=[]),oe.WayPoints.push(ee)}}addJourneyStage(he,_e){return this.getJourney(he).Stages.push(_e)-1}setupTestJourneys(){this.journeys=[];let he=new J.fw;he.Title="New York to Brooklyn",he.Notes="A little jaunt to Brooklyn",he.Stages=[];let _e=new J.vw,ee=new J.kA;ee.Notes="Starting point",ee.Position=new J.wC(40,1.2),ee.Title="Start",_e.WayPoints.push(ee);let ae=new J.kA;ae.Notes="Middle point",ae.Position=new J.wC(40,1.33),ae.Title="Middle",_e.WayPoints.push(ae);let oe=new J.kA;oe.Notes="End point",oe.Position=new J.wC(40,1.33),oe.Title="End",_e.WayPoints.push(oe),he.Stages.push(_e),this.journeys.push(he);let Be=new J.fw;Be.Title="Aberdeen to London",Be.Notes="Roadtrip",Be.Stages=[],this.journeys.push(Be)}calculateEnergyConsumptionkWh(he,_e,ee=0,ae){return he*ae}setRoutePolyline(he){this.routePolyline=he}getRoutePolyline(){return this.routePolyline}}return C=Ne,(0,x.Z)(Ne,"\u0275fac",function(he){return new(he||C)(ie.LFG(y.l),ie.LFG(s.R),ie.LFG(h.z))}),(0,x.Z)(Ne,"\u0275prov",ie.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"})),Ne})()},9127:(Nn,yt,k)=>{"use strict";k.d(yt,{i:()=>s,z:()=>J});var x=k(1180),h=k(553),y=k(2029),s=function(ie){return ie[ie.VERBOSE=0]="VERBOSE",ie[ie.INFO=1]="INFO",ie[ie.WARNING=2]="WARNING",ie[ie.ERROR=3]="ERROR",ie}(s||{});let J=(()=>{var ie;class Y{constructor(){(0,x.Z)(this,"logLevel",void 0),this.logLevel=s.VERBOSE,h.N.production&&(this.logLevel=s.INFO)}log(Ne,me=s.VERBOSE){console&&console.log&&me>=this.logLevel&&console.log("["+s[me]+"] {"+(new Date).toLocaleTimeString()+"} "+Ne)}}return ie=Y,(0,x.Z)(Y,"\u0275fac",function(Ne){return new(Ne||ie)}),(0,x.Z)(Y,"\u0275prov",y.Yz7({token:ie,factory:ie.\u0275fac,providedIn:"root"})),Y})()},4669:(Nn,yt,k)=>{"use strict";k.d(yt,{R:()=>C});var x=k(5861),h=k(1180),y=k(9127),s=k(439),J=k(3294),ie=k(2029),Y=k(5957);let C=(()=>{var Ne;class me{constructor(_e,ee,ae,oe){(0,h.Z)(this,"api",void 0),(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"analytics",void 0),(0,h.Z)(this,"poiList",void 0),(0,h.Z)(this,"isRequestInProgress",!1),this.api=_e,this.events=ee,this.logging=ae,this.analytics=oe}refreshPOIList(_e){var ee=this;return(0,x.Z)(function*(){try{return ee.poiList=yield ee.fetchPOIList(_e),ee.events.publish("ocm:poiList:updated"),ee.analytics.appEvent("Search","Fetched Results"),ee.poiList.length}catch{return 0}})()}fetchPOIList(_e){var ee=this;return(0,x.Z)(function*(){ee.isRequestInProgress=!0;try{let ae=yield ee.api.fetchPOIListByParam(_e);return ee.isRequestInProgress=!1,ae&&ae.length&&ee.logging.log("fetched POI list ["+ae.length+"]"),ae}catch{return ee.isRequestInProgress=!1,[]}})()}clearResults(){this.poiList=[],this.events.publish("ocm:poiList:cleared"),this.logging.log("clearing results after settings change",y.i.VERBOSE)}getPOIById(_e,ee=!1,ae=!1){var oe=this;return(0,x.Z)(function*(){if(!ae&&null!=oe.poiList){const Ee=oe.poiList.find(Ue=>Ue.ID==_e);if(Ee)return Ee}const Be={poiIdList:[_e],enableCaching:!ae,includeComments:!0},Ie=yield oe.api.fetchPOIListByParam(Be);return Ie&&Ie.length>0?(oe.poiList&&Ie[0].ID==_e&&(oe.poiList=oe.poiList.filter(Ee=>Ee.ID!=_e),oe.poiList.push(Ie[0]),oe.logging.log("POI refreshed in cache "+_e)),Ie[0]):null})()}}return Ne=me,(0,h.Z)(me,"\u0275fac",function(_e){return new(_e||Ne)(ie.LFG(s.l),ie.LFG(Y.z),ie.LFG(y.z),ie.LFG(J.c))}),(0,h.Z)(me,"\u0275prov",ie.Yz7({token:Ne,factory:Ne.\u0275fac,providedIn:"root"})),me})()},9159:(Nn,yt,k)=>{"use strict";k.d(yt,{W:()=>ie});var x=k(5861),h=k(1180),y=k(9127),s=k(2029),J=k(9862);let ie=(()=>{var Y;class C{constructor(me,he){(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"referenceData",void 0),(0,h.Z)(this,"filteredReferenceData",void 0),this.http=me,this.logging=he,this.loadCachedRefData()}refreshReferenceData(me){var he=this;return(0,x.Z)(function*(){try{const _e=yield me.fetchCoreReferenceData(null).toPromise();return he.setCoreReferenceData(_e),he.setFilteredReferenceData(_e),he.logging.log("Got refreshed core ref data.",y.i.VERBOSE),he.sortCoreReferenceData(),he.cacheCurrentRefData(),!0}catch(_e){return he.logging.log("Error fetching core ref data:"+_e),!1}})()}refreshFilteredReferenceData(me,he){me.fetchCoreReferenceData(he).subscribe(_e=>{this.setFilteredReferenceData(_e),this.sortCoreReferenceData(),this.logging.log("Got refreshed filtered reference data.",y.i.VERBOSE)},_e=>{this.logging.log("Error fetching filtered reference data:"+_e)})}setCoreReferenceData(me){this.referenceData=me}setFilteredReferenceData(me){this.filteredReferenceData=me}referenceDataLoaded(){return null!=this.referenceData}getCountries(me=!1){return 1==me?this.filteredReferenceData.Countries:this.referenceData.Countries}getCountryByID(me){return this.getRefDataByID(this.referenceData.Countries,me)}getConnectionTypes(me=!1){return 1==me?this.filteredReferenceData.ConnectionTypes:this.referenceData.ConnectionTypes}getConnectionTypeByID(me){return this.getRefDataByID(this.referenceData.ConnectionTypes,me)}getUsageTypes(me=!1){return 1==me?this.filteredReferenceData.UsageTypes:this.referenceData.UsageTypes.filter(he=>he.ID>0)}getUsageTypeByID(me){return this.getRefDataByID(this.referenceData.UsageTypes,me)}getStatusTypes(me=!1){return 1==me?this.filteredReferenceData.StatusTypes:this.referenceData.StatusTypes.filter(he=>he.ID>0)}getStatusTypeByID(me){return this.getRefDataByID(this.referenceData.StatusTypes,me)}getNetworkOperators(me=!1){return 1==me?this.filteredReferenceData.Operators:this.referenceData.Operators}getNetworkOperatorByID(me){return this.getRefDataByID(this.referenceData.Operators,me)}getDataProviders(me=!1){return 1==me?this.filteredReferenceData.DataProviders:this.referenceData.DataProviders}getDataProviderByID(me){return this.getRefDataByID(this.referenceData.DataProviders,me)}getCheckinStatusTypes(me=!1,he=!0){let _e=null;return _e=1==me?this.filteredReferenceData.CheckinStatusTypes:this.referenceData.CheckinStatusTypes,he&&(_e=_e.filter(ee=>!1===ee.IsAutomatedCheckin)),_e}getCheckinStatusTypeByID(me){return this.getRefDataByID(this.referenceData.CheckinStatusTypes,me)}getCommentTypes(me=!1,he=!0){let _e;return _e=1==me?this.filteredReferenceData.UserCommentTypes:this.referenceData.UserCommentTypes,he&&(_e=_e.filter(ee=>100!==ee.ID&&110!==ee.ID)),_e}getCommentTypeByID(me){return this.getRefDataByID(this.referenceData.UserCommentTypes,me)}getSubmissionStatusTypes(me=!1){return 1==me?this.filteredReferenceData.SubmissionStatusTypes:this.referenceData.SubmissionStatusTypes}getSubmissionStatusTypesByID(me){return this.getRefDataByID(this.referenceData.SubmissionStatusTypes,me)}getChargingLevelTypes(me=!1){return 1==me?this.filteredReferenceData.ChargerTypes:this.referenceData.ChargerTypes}getChargingLevelTypeByID(me){return this.getRefDataByID(this.referenceData.ChargerTypes,me)}getOutputCurrentTypes(me=!1){return me?this.referenceData.CurrentTypes:this.filteredReferenceData.CurrentTypes}getOutputCurrentTypeByID(me){return this.getRefDataByID(this.referenceData.CurrentTypes,me)}loadCachedRefData(){const me=localStorage.getItem("referenceData");if(null==me)this.http.get("./assets/data/CoreReferenceData.json").subscribe(he=>{this.logging.log("Using bundled reference data as cached ref data."),this.setCoreReferenceData(he),this.setFilteredReferenceData(he)});else{let he=JSON.parse(me);this.setCoreReferenceData(he)}this.setFilteredReferenceData(this.referenceData)}cacheCurrentRefData(){null!=this.referenceData&&(this.referenceData.CacheDate=new Date,localStorage.setItem("referenceData",JSON.stringify(this.referenceData)))}getRefDataByID(me,he){if(""!==he&&(he=parseInt(he,10)),null!=me)for(let _e=0;_ehe.Title?1:0}getMetadataValueByMetadataFieldID(me,he){if(""!==he&&(he=parseInt(he,10)),null!=me)for(let _e=0;_e{"use strict";k.d(yt,{v:()=>Ie});var x=k(1180),h=k(9903),y=k(3955),s=k(866),J=k(9127),ie=k(5861),Y=k(5592),C=k(3052),Ne=k(553),me=k(7518);class he{constructor(Ue,et){(0,x.Z)(this,"events",void 0),(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"mapAPIType",void 0),(0,x.Z)(this,"mapReady",void 0),(0,x.Z)(this,"providerError",void 0),(0,x.Z)(this,"mapCanvasID",void 0),(0,x.Z)(this,"map",void 0),(0,x.Z)(this,"markerList",void 0),(0,x.Z)(this,"polylinePath",void 0),(0,x.Z)(this,"mapkitUtils",void 0),this.events=Ue,this.logging=et,this.events=Ue,this.mapAPIType=y.b.MAPKIT_JS,this.mapReady=!1,this.markerList=new Map,this.mapkitUtils=new _e}initAPI(){mapkit&&mapkit.init({authorizationCallback:function(Ue){Ue(Ne.N.mapKitToken)}})}disposeMap(){}initMap(Ue,et,le){this.mapCanvasID=Ue;let ue=!0;if(ue=!(typeof mapkit>"u"),!ue)return this.logging.log("Call to initMap before API is ready:"+y.b[this.mapAPIType],J.i.ERROR),this.mapReady=!1,!1;this.initAPI(),null==this.map&&(document.getElementById(Ue),this.map=new mapkit.Map(Ue),this.map.annotationForCluster=function(ht){"poi"===ht.clusteringIdentifier&&(ht.title="Charging Location",ht.subtitle=ht.memberAnnotations.reduce((Le,ye)=>Le+ye.population,0))},this.mapReady=!0,mapkit.addEventListener("configuration-change",ht=>{this.events.publish("ocm:mapping:ready")}),this.map.addEventListener("scroll-end",ht=>{this.events.publish("ocm:mapping:dragend")}),this.map.addEventListener("zoom-end",ht=>{this.events.publish("ocm:mapping:zoom")}))}clearMarkers(){null!=this.markerList&&this.markerList.forEach((Ue,et)=>{try{this.map.removeAnnotation(et)}catch{}}),this.markerList=new Map}showPOIListOnMap(Ue,et){let ht=0,ye=0==this.markerList.size;if(null!=Ue){let De=[];for(let Pe=0;Pe{const St=Fe.target.poi;this.events.publish("ocm:poi:selected",{poi:St,poiId:St.ID})}),this.markerList.set(Ae.ID,Re),De.push(Re),ht++}}De.length>0&&(this.map.addAnnotations(De),ye&&this.map.showItems(De,{animate:!0,padding:new mapkit.Padding(60,25,60,25)})),this.logging.log(ht+" new map markers added out of a total "+this.markerList.size)}}refreshMapLayout(){null!=this.map&&setTimeout(()=>{this.logging.log("MapKit: refreshMapLayout",J.i.VERBOSE)},200)}setMapCenter(Ue,et){this.map&&(this.map.setCenterAnimated(new mapkit.Coordinate(Ue.coords.latitude,Ue.coords.longitude),!1),et&&this.setMapZoom(et))}getMapCenter(){return new Y.y(et=>{if(null!=this.map){let le=this.map.center;null!=le&&(et.next(new C.jR(le.latitude,le.longitude)),et.complete())}})}setMapZoom(Ue){const et=Math.min(Ue,28),le=this.mapkitUtils.deltaFromZoomLevel(this.map,this.map.center,Math.round(et)),ue=new mapkit.CoordinateSpan(111*le.latitudeDelta,111*le.longitudeDelta),ct=new mapkit.CoordinateRegion(this.map.center,ue);this.map.setRegionAnimated(ct)}getMapZoom(){return new Y.y(et=>{this.logging.log("MapKit: getMapZoom not supported",J.i.VERBOSE),et.next(this.map._impl.zoomLevel),et.complete()})}setMapType(Ue){this.logging.log("MapKit: skipped setting Map Type :"+Ue)}getMapBounds(){return new Y.y(et=>{let le=new Array,ue=this.map.region.toBoundingRegion();le.push(new C.wC(ue.southLatitude,ue.westLongitude)),le.push(new C.wC(ue.northLatitude,ue.eastLongitude)),et.next(le),et.complete()})}moveToMapBounds(Ue){this.logging.log("MapKit: map bounds not implemented")}renderMap(Ue,et,le){return document.getElementById(this.mapCanvasID).style.height=et+"px",this.mapReady&&this.showPOIListOnMap(Ue,le),!0}renderPolyline(Ue){this.clearPolyline()}clearPolyline(){null!=this.polylinePath&&this.polylinePath.setMap(null)}focusMap(){}unfocusMap(){}placeSearch(Ue){return(0,ie.Z)(function*(){let et=new mapkit.Search({getsUserLocation:!0});return new Promise(function(){var le=(0,ie.Z)(function*(ue,ct){let ht=[];et.search(Ue,function(){var Le=(0,ie.Z)(function*(ye,gt){ye&&ct(ye),ht=[],gt.places.map(De=>{let Pe=new me.nS;Pe.Title=De.name,Pe.Address=De.formattedAddress,Pe.Type="place",Pe.Location=new C.wC(De.coordinate.latitude,De.coordinate.longitude),ht.push(Pe)}),ue(ht)});return function(ye,gt){return Le.apply(this,arguments)}}())});return function(ue,ct){return le.apply(this,arguments)}}())})()}addPOILayer(Ue){this.logging.log("Add POI Layer not implemented in this provider.")}}class _e{constructor(){(0,x.Z)(this,"mercatorRadius",85445659.44705395),(0,x.Z)(this,"mercatorOffset",268435456)}longitudeToPixelSpaceX(Ue){return Math.round(this.mercatorOffset+this.mercatorRadius*Ue*Math.PI/180)}latitudeToPixelSpaceY(Ue){return Math.round(this.mercatorOffset-this.mercatorRadius*Math.log((1+Math.sin(Ue*Math.PI/180))/(1-Math.sin(Ue*Math.PI/180)))/2)}pixelSpaceXToLongitude(Ue){return(Math.round(Ue)-this.mercatorOffset)/this.mercatorRadius*180/Math.PI}pixelSpaceYToLatitude(Ue){return 180*(Math.PI/2-2*Math.atan(Math.exp((Math.round(Ue)-this.mercatorOffset)/this.mercatorRadius)))/Math.PI}deltaFromZoomLevel(Ue,et,le){let ue=this.longitudeToPixelSpaceX(et.longitude),ct=this.latitudeToPixelSpaceY(et.latitude),Le=Math.pow(2,20-le),ye=Ue.visibleMapRect.size,gt=ye.width*Le,De=ye.height*Le,Pe=ue-gt/2,Ae=ct-De/2,Ye=this.pixelSpaceXToLongitude(Pe),hn=this.pixelSpaceXToLongitude(Pe+gt)-Ye,qt=this.pixelSpaceYToLatitude(Ae);return{latitudeDelta:-1*(this.pixelSpaceYToLatitude(Ae+De)-qt),longitudeDelta:hn}}}var ee=k(2029),ae=k(5957),oe=k(9862);let Be=(()=>{var Ee;class Ue extends h.k{constructor(le,ue,ct){super(le,ue,ct),this.mapAPIType=y.b.MAPTILER,this.mapTileSet="https://maps.tilehosting.com/styles/streets/style.json?key=Gs9z7krALe3CGI60d5cL"}initAPI(){}}return Ee=Ue,(0,x.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ee.LFG(ae.z),ee.LFG(J.z),ee.LFG(oe.eN))}),(0,x.Z)(Ue,"\u0275prov",ee.Yz7({token:Ee,factory:Ee.\u0275fac})),Ue})(),Ie=(()=>{var Ee;class Ue{constructor(le,ue,ct){(0,x.Z)(this,"logging",void 0),(0,x.Z)(this,"http",void 0),(0,x.Z)(this,"map",void 0),(0,x.Z)(this,"mapCentreMarker",void 0),(0,x.Z)(this,"mapsInitialised",void 0),(0,x.Z)(this,"mapAPIReady",void 0),(0,x.Z)(this,"mapOptions",void 0),(0,x.Z)(this,"searchMarker",void 0),(0,x.Z)(this,"errorMessage",void 0),(0,x.Z)(this,"parentAppContext",void 0),(0,x.Z)(this,"mapProvider",void 0),(0,x.Z)(this,"debouncedMapPositionUpdate",void 0),(0,x.Z)(this,"events",void 0),(0,x.Z)(this,"isFocused",!1),this.logging=ue,this.http=ct,this.events=le,this.mapOptions=new y._,this.mapAPIReady=!1,this.mapsInitialised=!1,this.setMapAPI(this.mapOptions.mapAPI);let ht=this;this.debouncedMapPositionUpdate=s.c.debounce(()=>{this.logging.log("signaling map position change:"),ht.mapProvider.mapReady&&ht.getMapCenter().subscribe(Le=>{null!=Le?(this.logging.log("Map centre/zoom changed, updating search position:"+Le),this.updateMapCentrePos(Le.coords.latitude,Le.coords.longitude,!1)):this.logging.log("Map centre/zoom changed - map not ready to change centre pos:")})},300,!1)}setParentAppContext(le){this.parentAppContext=le}setMapAPI(le){this.mapOptions.mapAPI=le,this.mapOptions.mapAPI==y.b.MAPBOX&&(this.mapProvider=new h.k(this.events,this.logging,this.http)),this.mapOptions.mapAPI==y.b.MAPKIT_JS&&(this.mapProvider=new he(this.events,this.logging)),this.mapOptions.mapAPI==y.b.MAPTILER&&(this.mapProvider=new Be(this.events,this.logging,this.http))}isMapReady(){return null!=this.mapProvider&&this.mapProvider.mapReady}externalAPILoaded(le){this.mapAPIReady=!0,this.logging.log("Mapping API Loaded: "+y.b[le])}initMap(le){if(!this.isMapReady())if(null!=this.mapProvider)this.mapsInitialised&&this.logging.log("initMap: Map provider already initialised"),this.logging.log("Mapping Manager: Init "+y.b[this.mapProvider.mapAPIType]),this.mapProvider.initMap(le,this.mapOptions,this);else{if(this.mapsInitialised)return void this.logging.log("initMap: map already initialised");this.logging.log("initMap: "+this.mapOptions.mapAPI)}}mapManipulationPerformed(le){this.logging.log("map manipulated:"+le),("drag"==le||"zoom"==le)&&this.debouncedMapPositionUpdate()}updateMapSize(){this.mapProvider&&this.mapProvider.refreshMapLayout()}updateMapCentrePos(le,ue,ct,ht){ct&&null!=this.mapProvider&&this.mapProvider.setMapCenter(new C.jR(le,ue),ht),this.mapOptions.mapCentre=new C.jR(le,ue)}moveToMapBounds(le){this.mapProvider.moveToMapBounds(le)}refreshMapView(le,ue,ct){return null!=this.mapProvider?(this.logging.log("Mapping Manager: renderMap "+y.b[this.mapProvider.mapAPIType]),this.isMapReady()?this.mapProvider.renderMap(ue,le,this.parentAppContext):this.logging.log("refreshMapView: map provider not initialised..")):this.logging.log("Unsupported Map API: refreshMapView",J.i.ERROR),!0}setMapType(le){this.mapOptions.mapType!=le&&(this.mapOptions.mapType=le,this.isMapReady()&&null!=this.mapProvider?(this.logging.log("Changing map type:"+le),this.mapProvider.setMapType(le)):this.logging.log("Map type set, maps not initialised yet."))}unfocusMap(){this.logging.log("[mapping] Unfocus Map."),this.isFocused=!1,this.mapProvider.unfocusMap()}focusMap(){this.logging.log("[mapping] Focus Map."),this.isFocused=!0,this.mapProvider.focusMap()}getMapBounds(){return this.mapProvider.getMapBounds()}getMapZoom(){return this.mapProvider.getMapZoom()}setMapZoom(le){this.mapProvider.setMapZoom(le)}getMapCenter(){return this.mapProvider.getMapCenter()}showPOIOnStaticMap(le,ue,ct=!1,ht=!1,Le=200,ye=200){let gt=document.getElementById(le);if(null!=gt){let Pe=ue.AddressInfo.Latitude,Ae=ue.AddressInfo.Longitude;Le>640&&(Le=640),ye>640&&(ye=640);let Ye=Le,_t=ye,hn="https://maps.googleapis.com/maps/api/staticmap?center="+Pe+","+Ae+"&zoom=14&size="+Ye+"x"+_t+"&maptype=roadmap&markers=color:blue%7Clabel:A%7C"+Pe+","+Ae+"&sensor=false",qt="";qt+=1==ct?"
"+s.c.formatMapLink(ue,'
',ht)+"
":'
',gt.innerHTML=qt}}renderPolyline(le){this.mapProvider.renderPolyline(le)}clearPolyline(){this.mapProvider.clearPolyline()}clearMarkers(){this.logging.log("mapping: clearing markers"),this.mapProvider.clearMarkers()}addPOILayer(le){this.mapProvider.addPOILayer(le)}}return Ee=Ue,(0,x.Z)(Ue,"\u0275fac",function(le){return new(le||Ee)(ee.LFG(ae.z),ee.LFG(J.z),ee.LFG(oe.eN))}),(0,x.Z)(Ue,"\u0275prov",ee.Yz7({token:Ee,factory:Ee.\u0275fac,providedIn:"root"})),Ue})()},3955:(Nn,yt,k)=>{"use strict";k.d(yt,{_:()=>s,b:()=>y});var x=k(1180),h=k(553),y=function(J){return J[J.GOOGLE_WEB=1]="GOOGLE_WEB",J[J.GOOGLE_NATIVE=2]="GOOGLE_NATIVE",J[J.LEAFLET=3]="LEAFLET",J[J.MAPBOX=4]="MAPBOX",J[J.MAPKIT_JS=5]="MAPKIT_JS",J[J.MAPTILER=6]="MAPTILER",J}(y||{});class s{constructor(){(0,x.Z)(this,"enableClustering",void 0),(0,x.Z)(this,"resultBatchID",void 0),(0,x.Z)(this,"useMarkerIcons",void 0),(0,x.Z)(this,"useMarkerAnimation",void 0),(0,x.Z)(this,"enableTrackingMapCentre",void 0),(0,x.Z)(this,"enableSearchByWatchingLocation",void 0),(0,x.Z)(this,"mapCentre",void 0),(0,x.Z)(this,"searchDistanceKM",void 0),(0,x.Z)(this,"iconSet",void 0),(0,x.Z)(this,"mapAPI",void 0),(0,x.Z)(this,"mapMoveQueryRefreshMS",void 0),(0,x.Z)(this,"requestSearchUpdate",void 0),(0,x.Z)(this,"enableSearchRadiusIndicator",void 0),(0,x.Z)(this,"mapType",void 0),(0,x.Z)(this,"minZoomLevel",void 0),(0,x.Z)(this,"onMapMoveCompleted",void 0),this.enableClustering=!1,this.resultBatchID=-1,this.useMarkerIcons=!0,this.useMarkerAnimation=!0,this.enableTrackingMapCentre=!1,this.enableSearchByWatchingLocation=!1,this.mapCentre=null,this.mapAPI=h.N.defaultMapProvider,this.mapType="ROADMAP",this.searchDistanceKM=1e5,this.mapMoveQueryRefreshMS=300,this.enableSearchRadiusIndicator=!1,this.minZoomLevel=2}}},9903:(Nn,yt,k)=>{"use strict";k.d(yt,{k:()=>Be});var x=k(5861),h=k(1180),y=k(866),s=k(3955),J=k(5592),ie=k(3052),Y=k(9127),C=k(2574),me=k(553),he=k(7518),_e=k(2029),ee=k(5957),ae=k(9862);let Be=(()=>{var Ie;class Ee{constructor(et,le,ue){(0,h.Z)(this,"events",void 0),(0,h.Z)(this,"logging",void 0),(0,h.Z)(this,"http",void 0),(0,h.Z)(this,"mapAPIType",void 0),(0,h.Z)(this,"mapReady",void 0),(0,h.Z)(this,"providerError",void 0),(0,h.Z)(this,"mapCanvasID",void 0),(0,h.Z)(this,"map",void 0),(0,h.Z)(this,"markerList",void 0),(0,h.Z)(this,"polylinePath",void 0),(0,h.Z)(this,"_isMapAnimating",!1),(0,h.Z)(this,"searchMarker",void 0),(0,h.Z)(this,"mapTileSet",void 0),this.events=et,this.logging=le,this.http=ue,this.events=et,this.mapAPIType=s.b.MAPBOX,this.mapReady=!1,this.markerList=new Map}initAPI(){C&&(C.accessToken=me.N.mapBoxToken)}disposeMap(){this.map&&(this.logging.log("Disposing map",Y.i.INFO),this.map.remove())}getCurrentMapTileSet(et){return"SATELLITE"==et?"mapbox://styles/mapbox/satellite-streets-v12?optimize=true":"mapbox://styles/mapbox/streets-v12?optimize=true"}flyAroundPoint(et){if(this._isMapAnimating){this.map.rotateTo(et/100%360,{duration:0});const le=this;requestAnimationFrame(function(ue){le.flyAroundPoint(ue)})}}initMap(et,le,ue){this.mapCanvasID=et;let ct=!0;if(ct=!(typeof C>"u"),!ct)return this.logging.log("Call to initMap before API is ready:"+s.b[this.mapAPIType],Y.i.ERROR),this.mapReady=!1,!1;if(null==this.map){let gt=function(Pe){return Pe*(2-Pe)};document.getElementById(et),this.initAPI(),this.map=new C.Map({container:et,style:this.getCurrentMapTileSet(le.mapType),zoom:15,attributionControl:!1}),this.map.addControl(new C.AttributionControl({compact:!0,customAttribution:["Open Charge Map Contributors"]})),this.map.addControl(new C.NavigationControl),this.mapReady=!0,this.map.getCanvas().focus();let Le=100,ye=25;this.map.getCanvas().addEventListener("keydown",Pe=>{Pe.preventDefault(),38===Pe.which?this.map.panBy([0,-Le],{easing:gt}):40===Pe.which?this.map.panBy([0,Le],{easing:gt}):37===Pe.which?this.map.easeTo({bearing:this.map.getBearing()-ye,easing:gt}):39===Pe.which?this.map.easeTo({bearing:this.map.getBearing()+ye,easing:gt}):32===Pe.which&&(this._isMapAnimating?this._isMapAnimating=!1:(this._isMapAnimating=!0,this.flyAroundPoint(0)))},!0),this.map.on("load",()=>{this.events.publish("ocm:mapping:ready")});let De=y.c.debounce(()=>{this.getMapCenter().subscribe(Pe=>{this.searchMarker.setLngLat(new C.LngLat(Pe.coords.longitude,Pe.coords.latitude))})},500,!1);this.map.on("move",()=>{this.searchMarker&&De()}),this.map.on("moveend",()=>{this.events.publish("ocm:mapping:dragend"),le.onMapMoveCompleted&&le.onMapMoveCompleted()}),this.map.on("zoomend",()=>{this.events.publish("ocm:mapping:zoom")})}}clearMarkers(){null!=this.markerList&&this.markerList.forEach((et,le)=>{et.remove()}),this.markerList=new Map}showPOIListOnMap(et,le,ue=!0){let ht=this.map,Le=new C.LngLatBounds,ye=0;if(ht.getZoom(),null!=et){for(let Ye=0;Ye{const Ce=St.currentTarget.poi;this.events.publish("ocm:poi:selected",{poiId:Ce.ID,poi:Ce})}),Le.extend(Re.getLngLat()),this.markerList.set(_t.ID,Re),ye++}}this.logging.log(ye+" new map markers added out of a total "+this.markerList.size)}if(null!=et&&et.length>0)if(null==le||le.appConfig.enableLiveMapQuerying)null==ht.getCenter()&&ht.setCenter(Le.getCenter());else{this.logging.log("Fitting to marker bounds:"+Le),ht.setCenter(Le.getCenter()),this.logging.log("zoom before fit bounds:"+ht.getZoom()),ht.fitBounds(Le);let Ae=ht.getZoom();ht.setZoom(Ae<6?6:Ae)}}refreshMapLayout(){null!=this.map&&setTimeout(()=>{this.logging.log("MapBoxGL: refreshMapLayout",Y.i.VERBOSE),this.map.resize()},200)}setMapCenter(et){this.mapReady&&(this.map.setCenter(new C.LngLat(et.coords.longitude,et.coords.latitude)),this.searchMarker||(this.searchMarker=new C.Marker({color:"#99ccff",anchor:"bottom"}).setLngLat(new C.LngLat(et.coords.longitude,et.coords.latitude)).addTo(this.map),this.searchMarker.getElement().addEventListener("click",()=>{let le=this.searchMarker.getLngLat();this.events.publish("ocm:mapping:addpoi",new ie.wC(le.lat,le.lng))})))}getMapCenter(){return new J.y(le=>{if(null!=this.map){let ue=this.map.getCenter();null!=ue&&(le.next(new ie.jR(ue.lat,ue.lng)),le.complete())}})}setMapZoom(et){this.map.setZoom(et)}getMapZoom(){return new J.y(le=>{let ue=this.map.getZoom();le.next(ue),le.complete()})}setMapType(et){this.map.setStyle(this.getCurrentMapTileSet(et))}getMapBounds(){return new J.y(le=>{let ue=new Array,ct=this.map.getBounds();ue.push(new ie.wC(ct.getSouthWest().lat,ct.getSouthWest().lng)),ue.push(new ie.wC(ct.getNorthEast().lat,ct.getNorthEast().lng)),le.next(ue),le.complete()})}moveToMapBounds(et){this.map.fitBounds(new C.LngLatBounds(new C.LngLat(et.southWest.longitude,et.southWest.latitude),new C.LngLat(et.northEast.longitude,et.northEast.latitude)))}renderMap(et,le,ue){return document.getElementById(this.mapCanvasID).style.height=le+"px",this.mapReady&&this.showPOIListOnMap(et,ue),!0}renderPolyline(et){this.clearPolyline()}clearPolyline(){null!=this.polylinePath&&this.polylinePath.setMap(null)}focusMap(){}unfocusMap(){}placeSearch(et,le,ue){var ct=this;return(0,x.Z)(function*(){let ht=`https://api.mapbox.com/geocoding/v5/mapbox.places/${et||ue+","+le}.json?access_token=${me.N.mapBoxToken}`;return new Promise(function(){var Le=(0,x.Z)(function*(ye,gt){ct.http.get(ht).toPromise().then(De=>{let Pe=[];Pe=[],De.features&&De.features.map(Ae=>{let Ye=new he.nS;Ye.Title=Ae.place_name,Ye.Address=Ae.place_name,Ye.Type="place",Ye.Location=new ie.wC(Ae.center[1],Ae.center[0]),Ye.Attribution=De.attribution,Pe.push(Ye)}),ye(Pe)})});return function(ye,gt){return Le.apply(this,arguments)}}())})()}addPOILayer(et){this.logging.log("Add POI Layer not implemented in this provider."),this.showPOIListOnMap(et,null,!1)}}return Ie=Ee,(0,h.Z)(Ee,"\u0275fac",function(et){return new(et||Ie)(_e.LFG(ee.z),_e.LFG(Y.z),_e.LFG(ae.eN))}),(0,h.Z)(Ee,"\u0275prov",_e.Yz7({token:Ie,factory:Ie.\u0275fac})),Ee})()},553:(Nn,yt,k)=>{"use strict";k.d(yt,{N:()=>x});const x={name:"prod",version:"8.5.7",production:!0,analyticsId:"",googleMapsKey:"",mapBoxToken:"pk.eyJ1Ijoid2VicHJvZnVzaW9uIiwiYSI6ImNrdHZlc2N5dTI5Zjcydm8zYWFwc2JnbTMifQ.M7b5SOzbPcg_8XAHCOeP0w",mapKitToken:"",enableStaticMaps:!1,defaultMapProvider:4,apiBase:"https://api.openchargemap.io",apiKey:"9bb03e5b-0fb2-4916-9b2b-26c6bd27a56a",enabledFeatures:["MAP","ADD_COMMENT","ADD_PHOTO","FAVOURITES","FILTER_OPTIONS_BY_COUNTRY","ADD_POI","EDIT_POI","LAYERS"]}},3108:(Nn,yt,k)=>{"use strict";var x=k(6593),h=k(2029),y=k(1180),s=k(5086),J=k(3999),ie=k(6814),Y=k(6223),C=k(9843);let Ne=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,C.Pc,J.aw,s.e]})),Mn})(),me=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,C.Pc,J.aw,s.e]})),Mn})(),he=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,C.Pc,J.aw,s.e]})),Mn})();var _e=k(4606),ee=k(9862),ae=k(6800),oe=k(6091);class Be{constructor(Mn,qn="/assets/i18n/",yn=".json"){(0,y.Z)(this,"http",void 0),(0,y.Z)(this,"prefix",void 0),(0,y.Z)(this,"suffix",void 0),this.http=Mn,this.prefix=qn,this.suffix=yn}getTranslation(Mn){return this.http.get(`${this.prefix}${Mn}${this.suffix}`)}}var Ie=k(5861),Ee=k(1847),Ue=k(3247),et=k(8767),le=k(4292),ue=k(6470);function ct(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"div"),h._uU(1," You are not signed in. "),h.TgZ(2,"button",5),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.showSignInModal())}),h._uU(3),h.ALo(4,"translate"),h.qZA()()}2&Cn&&(h.xp6(3),h.Oqu(h.lcZ(4,1,"ocm.general.signIn")))}function ht(Cn,Mn){if(1&Cn&&(h.TgZ(0,"div")(1,"ion-card")(2,"ion-item")(3,"ion-avatar",6),h._UZ(4,"img",7),h.qZA(),h.TgZ(5,"h2"),h._uU(6),h.qZA()(),h.TgZ(7,"ion-card-content")(8,"p"),h._uU(9),h.qZA(),h.TgZ(10,"p"),h._uU(11),h.qZA()(),h.TgZ(12,"ion-item")(13,"ion-note",8),h._UZ(14,"ion-icon",9),h._uU(15),h.qZA()()()()),2&Cn){const qn=h.oxw();h.xp6(4),h.s9C("src",qn.userProfile.ProfileImageURL,h.LSH),h.xp6(2),h.Oqu(qn.userProfile.Username),h.xp6(3),h.hij(" ",qn.userProfile.Profile,""),h.xp6(2),h.hij(" Date Joined: ",qn.userProfile.DateCreated," "),h.xp6(4),h.hij(" ",qn.userProfile.ReputationPoints," Contributor Points ")}}let Le=(()=>{var Cn;class Mn{constructor(yn,_n,Hi,nt){(0,y.Z)(this,"appManager",void 0),(0,y.Z)(this,"nav",void 0),(0,y.Z)(this,"translate",void 0),(0,y.Z)(this,"modalController",void 0),(0,y.Z)(this,"userProfile",void 0),this.appManager=yn,this.nav=_n,this.translate=Hi,this.modalController=nt}ionViewDidEnter(){this.userProfile=this.appManager.getUserProfile(),null!=this.userProfile&&this.appManager.isUserAuthenticated(!0)?this.refreshProfileView():this.showSignInModal(),this.appManager.analytics.viewEvent("Profile")}refreshProfileView(){this.userProfile=this.appManager.getUserProfile()}showSignInModal(){this.modalController.create({component:et.F,componentProps:{Profile:this.userProfile}}).then(yn=>{yn.onDidDismiss().then(()=>{this.refreshProfileView()}),yn.present()})}close(){this.modalController.dismiss()}}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)(h.Y36(ue.c),h.Y36(C.SH),h.Y36(J.sK),h.Y36(C.IN))}),(0,y.Z)(Mn,"\u0275cmp",h.Xpm({type:Cn,selectors:[["ng-component"]],decls:14,vars:5,consts:[[1,"profile-page","ion-padding"],[4,"ngIf"],["slot","end"],[3,"click"],["name","close","slot","start"],["ion-button","",3,"click"],["slot","start"],[3,"src"],["item-left",""],["name","star"]],template:function(yn,_n){1&yn&&(h.TgZ(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),h._uU(3),h.ALo(4,"translate"),h.qZA()()(),h.TgZ(5,"ion-content",0),h.YNc(6,ct,5,3,"div",1),h.YNc(7,ht,16,5,"div",1),h.qZA(),h.TgZ(8,"ion-footer")(9,"ion-toolbar")(10,"ion-buttons",2)(11,"ion-button",3),h.NdJ("click",function(){return _n.close()}),h._UZ(12,"ion-icon",4),h._uU(13," Close "),h.qZA()()()()),2&yn&&(h.xp6(3),h.hij(" ",h.lcZ(4,3,"ocm.navigation.profile.sectionTitle")," "),h.xp6(3),h.Q6J("ngIf",null==_n.userProfile),h.xp6(1),h.Q6J("ngIf",null!=_n.userProfile))},dependencies:[ie.O5,C.BJ,C.YG,C.Sm,C.PM,C.FN,C.W2,C.fr,C.Gu,C.gu,C.Ie,C.uN,C.wd,C.sr,J.X$],encapsulation:2})),Mn})();var ye=k(9127),gt=k(553),De=k(6662),Pe=k(3294),Ae=k(866),Ye=k(9236),_t=k(8062),hn=k(2726);const qt=(0,hn.fo)("PushNotifications",{}),Fe=(0,hn.fo)("StatusBar"),St=(0,hn.fo)("SplashScreen",{web:()=>k.e(4485).then(k.bind(k,4485)).then(Cn=>new Cn.SplashScreenWeb)}),Ce=(0,hn.fo)("App",{web:()=>k.e(2912).then(k.bind(k,2912)).then(Cn=>new Cn.AppWeb)});var Rt=k(5957);function Qt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.openRoutePlannerModal())}),h._UZ(1,"ion-icon",12),h.TgZ(2,"ion-label"),h._uU(3," Route Planner "),h.qZA()()}}function Gt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.add())}),h._UZ(1,"ion-icon",13),h.TgZ(2,"ion-label"),h._uU(3),h.ALo(4,"translate"),h.qZA()()}2&Cn&&(h.xp6(3),h.hij(" ",h.lcZ(4,1,"ocm.general.addLocation")," "))}function Zt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.journeys())}),h._UZ(1,"ion-icon",12),h.TgZ(2,"ion-label"),h._uU(3," Journeys "),h.qZA()()}}function Jt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.TgZ(0,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.addLayer())}),h._UZ(1,"ion-icon",14),h.TgZ(2,"ion-label"),h._uU(3," Add Layer "),h.qZA()()}}function kt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.ynx(0),h.TgZ(1,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.signIn())}),h._UZ(2,"ion-icon",15),h.TgZ(3,"ion-label"),h._uU(4),h.ALo(5,"translate"),h.qZA()(),h.BQk()}2&Cn&&(h.xp6(4),h.hij(" ",h.lcZ(5,1,"ocm.general.signIn")," "))}function dt(Cn,Mn){if(1&Cn){const qn=h.EpF();h.ynx(0),h.TgZ(1,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.profile())}),h._UZ(2,"ion-icon",15),h.TgZ(3,"ion-label"),h._uU(4),h.ALo(5,"translate"),h.qZA()(),h.TgZ(6,"ion-item",9),h.NdJ("click",function(){h.CHM(qn);const _n=h.oxw();return h.KtG(_n.signOut())}),h._UZ(7,"ion-icon",16),h.TgZ(8,"ion-label"),h._uU(9),h.ALo(10,"translate"),h._UZ(11,"br"),h.TgZ(12,"small",17),h._uU(13),h.qZA()()(),h.BQk()}if(2&Cn){const qn=h.oxw();h.xp6(4),h.hij(" ",h.lcZ(5,3,"ocm.navigation.profile.sectionTitle")," "),h.xp6(5),h.hij(" ",h.lcZ(10,5,"ocm.general.signOut")," "),h.xp6(4),h.hij(" ",qn.getUserName(),"")}}const Ot=function(){return["/search"]};let pt=(()=>{var Cn;class Mn{constructor(yn,_n,Hi,nt,ge,ve,Xe,ft){(0,y.Z)(this,"platform",void 0),(0,y.Z)(this,"translate",void 0),(0,y.Z)(this,"mapping",void 0),(0,y.Z)(this,"modalController",void 0),(0,y.Z)(this,"appManager",void 0),(0,y.Z)(this,"logger",void 0),(0,y.Z)(this,"analytics",void 0),(0,y.Z)(this,"events",void 0),(0,y.Z)(this,"enabledFeatures",void 0),this.platform=yn,this.translate=_n,this.mapping=Hi,this.modalController=nt,this.appManager=ge,this.logger=ve,this.analytics=Xe,this.events=ft,this.logger.log("Environment: "+gt.N.name),this.initializeApp(),this.enabledFeatures=gt.N.enabledFeatures,1!=ge.searchSettings.EnableAdvancedEditorFeatures&&(this.enabledFeatures=this.enabledFeatures.filter(Ct=>"LAYERS"!=Ct))}configurePushNotifications(){qt.register(),qt.addListener("registration",yn=>{this.logger.log("Push registration success, token: "+yn.value),this.appManager.savePushRegistration(yn.value)}),qt.addListener("registrationError",yn=>{this.logger.log("Error on registration: "+JSON.stringify(yn))}),qt.addListener("pushNotificationReceived",yn=>{this.logger.log("Push received: "+JSON.stringify(yn),ye.i.INFO)}),qt.addListener("pushNotificationActionPerformed",yn=>{this.logger.log("Push action performed: "+JSON.stringify(yn))})}isUserAuthenticated(){return this.appManager.isUserAuthenticated()}getUserName(){let yn=this.appManager.getUserProfile();return yn?yn.EmailAddress?yn.EmailAddress:yn.Username:"Not Signed In"}initializeApp(){var yn=this;this.platform.ready().then(()=>{this.platform.is("capacitor")&&(Fe.show(),St.hide()),this.translate.addLangs(this.appManager.getLanguages().map(_n=>_n.code)),this.translate.setDefaultLang("en"),null!=this.appManager.searchSettings.Language?this.translate.use(this.appManager.searchSettings.Language):this.translate.currentLang||this.translate.use("en"),this.translate.get("ocm.search.performSearch").toPromise().then(_n=>{}),this.analytics.init(gt.N.analyticsId).then(()=>{this.analytics.setAppVersion(gt.N.version),this.analytics.appEvent("Startup","App Loaded")}).catch(_n=>this.logger.log("Error starting analytics")),this.events.subscribe("ocm:mapping:addpoi",function(){var _n=(0,Ie.Z)(function*(Hi){Ae.c.isFeatureEnabled("ADD_POI")&&yn.add(Hi)});return function(Hi){return _n.apply(this,arguments)}}()),(this.platform.is("ios")||this.platform.is("android"))&&(this.configurePushNotifications(),this.checkForAppOpenUrl())})}checkForAppOpenUrl(){return(0,Ie.Z)(function*(){Ce.addListener("appUrlOpen",_n=>{alert("App (re)opened with URL: "+_n.url)});let yn=yield Ce.getLaunchUrl();yn&&yn.url&&alert("App opened with URL: "+yn.url)})()}openRoutePlannerModal(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:Ue.u});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}continueAdd(yn){var _n=this;return(0,Ie.Z)(function*(){const Hi=yield _n.modalController.create({component:De.Y,componentProps:{startPos:yn}});Hi.onDidDismiss().then(nt=>{_n.mapping.focusMap()}),yield Hi.present()})()}add(yn){var _n=this;return(0,Ie.Z)(function*(){if(_n.mapping.unfocusMap(),!_n.appManager.isUserAuthenticated(!0)){const Hi=yield _n.modalController.create({component:et.F});return Hi.onDidDismiss().then(function(){var nt=(0,Ie.Z)(function*(ge){_n.mapping.focusMap(),_n.appManager.isUserAuthenticated(!0)&&(yield _n.continueAdd(yn))});return function(ge){return nt.apply(this,arguments)}}()),yield Hi.present()}yield _n.continueAdd(yn)})()}signIn(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:et.F});return _n.onDidDismiss().then(Hi=>{yn.mapping.focusMap(),yn.appManager.isUserAuthenticated(!0)}),yield _n.present()})()}signOut(){var yn=this;return(0,Ie.Z)(function*(){yn.appManager.signOutCurrentUser()})()}profile(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:Le});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}journeys(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:le.g});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}addLayer(){var yn=this;return(0,Ie.Z)(function*(){const _n=yield yn.modalController.create({component:_t.A});yield _n.present();const{data:Hi}=yield _n.onWillDismiss();Hi&&yn.mapping.addPOILayer(Hi)})()}about(){var yn=this;return(0,Ie.Z)(function*(){yn.mapping.unfocusMap();const _n=yield yn.modalController.create({component:Ye.t});_n.onDidDismiss().then(Hi=>{yn.mapping.focusMap()}),yield _n.present()})()}}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)(h.Y36(C.t4),h.Y36(J.sK),h.Y36(Ee.v),h.Y36(C.IN),h.Y36(ue.c),h.Y36(ye.z),h.Y36(Pe.c),h.Y36(Rt.z))}),(0,y.Z)(Mn,"\u0275cmp",h.Xpm({type:Cn,selectors:[["app-root"]],decls:29,vars:17,consts:[["contentId","main-content",3,"disabled"],["contentId","main-content","swipeGesture","false"],["slot","start"],["src","assets/images/icons/branding/AppIcon_128x128.png"],["auto-hide","false"],[3,"routerDirection","routerLink"],["slot","start","name","home"],[3,"click",4,"ngIf"],[4,"ngIf"],[3,"click"],["slot","start","name","information-circle-outline"],["id","main-content"],["slot","start","name","map"],["slot","start","name","add-circle-outline"],["slot","start","name","albums"],["slot","start","name","person"],["slot","start","name","log-out"],[2,"color","#c0c0c0"]],template:function(yn,_n){1&yn&&(h.TgZ(0,"ion-app")(1,"ion-split-pane",0)(2,"ion-menu",1)(3,"ion-header")(4,"ion-toolbar")(5,"ion-thumbnail",2),h._UZ(6,"img",3),h.qZA(),h.TgZ(7,"ion-title"),h._uU(8),h.qZA()()(),h.TgZ(9,"ion-content")(10,"ion-list")(11,"ion-menu-toggle",4)(12,"ion-item",5),h._UZ(13,"ion-icon",6),h.TgZ(14,"ion-label"),h._uU(15),h.ALo(16,"translate"),h.qZA()(),h.YNc(17,Qt,4,0,"ion-item",7),h.YNc(18,Gt,5,3,"ion-item",7),h.YNc(19,Zt,4,0,"ion-item",7),h.YNc(20,Jt,4,0,"ion-item",7),h.YNc(21,kt,6,3,"ng-container",8),h.YNc(22,dt,14,7,"ng-container",8),h.TgZ(23,"ion-item",9),h.NdJ("click",function(){return _n.about()}),h._UZ(24,"ion-icon",10),h.TgZ(25,"ion-label"),h._uU(26),h.ALo(27,"translate"),h.qZA()()()()()(),h._UZ(28,"ion-router-outlet",11),h.qZA()()),2&yn&&(h.xp6(1),h.Q6J("disabled",!0),h.xp6(7),h.Oqu(_n.appManager.title),h.xp6(4),h.Q6J("routerDirection","root")("routerLink",h.DdM(16,Ot)),h.xp6(3),h.hij(" ",h.lcZ(16,12,"ocm.search.sectionTitle")," "),h.xp6(2),h.Q6J("ngIf",_n.enabledFeatures.includes("ROUTE_PLANNER")),h.xp6(1),h.Q6J("ngIf",_n.enabledFeatures.includes("ADD_POI")),h.xp6(1),h.Q6J("ngIf",_n.enabledFeatures.includes("FAVOURITES")),h.xp6(1),h.Q6J("ngIf",_n.enabledFeatures.includes("LAYERS")),h.xp6(1),h.Q6J("ngIf",!_n.isUserAuthenticated()),h.xp6(1),h.Q6J("ngIf",_n.isUserAuthenticated()),h.xp6(4),h.hij(" ",h.lcZ(27,14,"ocm.general.about")," "))},dependencies:[ie.O5,C.dr,C.W2,C.Gu,C.gu,C.Ie,C.Q$,C.q_,C.z0,C.zc,C.jI,C.Bs,C.wd,C.sr,C.jP,C.YI,ae.rH,J.X$],encapsulation:2})),Mn})();const Yt=[{path:"",redirectTo:"search",pathMatch:"full"},{path:"search",loadChildren:()=>Promise.resolve().then(k.bind(k,4606)).then(Cn=>Cn.SearchPageModule)},{path:"journeys",loadChildren:()=>Promise.resolve().then(k.bind(k,9192)).then(Cn=>Cn.JourneysModule)},{path:"signin",loadChildren:()=>Promise.resolve().then(k.bind(k,9472)).then(Cn=>Cn.SignInModule)},{path:"poi-editor/:id",loadChildren:()=>Promise.resolve().then(k.bind(k,5722)).then(Cn=>Cn.PoiEditorPageModule)},{path:"about",loadChildren:()=>Promise.resolve().then(k.bind(k,7425)).then(Cn=>Cn.AboutPageModule)},{path:"layer-editor",loadChildren:()=>Promise.resolve().then(k.bind(k,2309)).then(Cn=>Cn.LayerEditorPageModule)}];let Ut=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ae.Bz.forRoot(Yt,{useHash:!0}),ae.Bz]})),Mn})(),ii=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,C.Pc,J.aw,s.e]})),Mn})();var gn=k(9472);let Ft=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,C.Pc,J.aw,s.e,ae.Bz.forChild([{path:"",component:Le}])]})),Mn})();var Jn=k(4119);let Wt=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn})),(0,y.Z)(Mn,"\u0275inj",h.cJS({imports:[ie.ez,Y.u5,C.Pc,J.aw,s.e,ae.Bz.forChild([{path:"",component:Jn.N}])]})),Mn})();var wt=k(9192),vt=k(5722),ln=k(7425),ni=k(2309);function er(){return localStorage.getItem("access_token")}function lr(Cn){return new Be(Cn,"/assets/i18n/",".json")}let Fi=(()=>{var Cn;class Mn{}return Cn=Mn,(0,y.Z)(Mn,"\u0275fac",function(yn){return new(yn||Cn)}),(0,y.Z)(Mn,"\u0275mod",h.oAB({type:Cn,bootstrap:[pt]})),(0,y.Z)(Mn,"\u0275inj",h.cJS({providers:[{provide:ae.wN,useClass:C.r4}],imports:[x.b2,ee.JF,J.aw.forRoot({loader:{provide:J.Zw,useFactory:lr,deps:[ee.eN]}}),C.Pc.forRoot(),Ut,oe.Ar.forRoot({config:{tokenGetter:er}}),_e.SearchPageModule,ii,wt.JourneysModule,gn.SignInModule,he,Ne,me,vt.PoiEditorPageModule,Ft,Wt,ln.AboutPageModule,ni.LayerEditorPageModule]})),Mn})();gt.N.production&&(0,h.G48)(),x.q6().bootstrapModule(Fi).catch(Cn=>console.log(Cn))},2574:function(Nn){Nn.exports=function(){"use strict";var yt,k,x;function h(s,J){if(yt)if(k){var ie="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+yt+")(sharedChunk); ("+k+")(sharedChunk); self.onerror = null;",Y={};yt(Y),x=J(Y),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(x.workerUrl=window.URL.createObjectURL(new Blob([ie],{type:"text/javascript"})))}else k=J;else yt=J}return h(0,function(s){var J=typeof self<"u"?self:{},ie="2.15.0";let Y;const C={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==Y){const n=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Y=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):n}catch{Y=n}}return Y},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!C.API_URL)return null;try{const n=new URL(C.API_URL);return"api.mapbox.cn"===n.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===n.hostname?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ne={supported:!1,testSupport:function(n){!_e&&he&&(ee?ae(n):me=n)}};let me,he,_e=!1,ee=!1;function ae(n){const e=n.createTexture();n.bindTexture(n.TEXTURE_2D,e);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,he),n.isContextLost())return;Ne.supported=!0}catch{}n.deleteTexture(e),_e=!0}J.document&&(he=J.document.createElement("img"),he.onload=function(){me&&ae(me),me=null,ee=!0},he.onerror=function(){_e=!0,me=null},he.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const oe="01";function Be(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ie=Ee;function Ee(n,e,i,a){this.cx=3*n,this.bx=3*(i-n)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=n,this.p1y=e,this.p2x=i,this.p2y=a}Ee.prototype={sampleCurveX:function(n){return((this.ax*n+this.bx)*n+this.cx)*n},sampleCurveY:function(n){return((this.ay*n+this.by)*n+this.cy)*n},sampleCurveDerivativeX:function(n){return(3*this.ax*n+2*this.bx)*n+this.cx},solveCurveX:function(n,e){if(void 0===e&&(e=1e-6),n<0)return 0;if(n>1)return 1;for(var i=n,a=0;a<8;a++){var u=this.sampleCurveX(i)-n;if(Math.abs(u)u?_=i:w=i,i=.5*(w-_)+_;return i},solve:function(n,e){return this.sampleCurveY(this.solveCurveX(n,e))}};var Ue=Be(Ie),et=le;function le(n,e){this.x=n,this.y=e}le.prototype={clone:function(){return new le(this.x,this.y)},add:function(n){return this.clone()._add(n)},sub:function(n){return this.clone()._sub(n)},multByPoint:function(n){return this.clone()._multByPoint(n)},divByPoint:function(n){return this.clone()._divByPoint(n)},mult:function(n){return this.clone()._mult(n)},div:function(n){return this.clone()._div(n)},rotate:function(n){return this.clone()._rotate(n)},rotateAround:function(n,e){return this.clone()._rotateAround(n,e)},matMult:function(n){return this.clone()._matMult(n)},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(n){return this.x===n.x&&this.y===n.y},dist:function(n){return Math.sqrt(this.distSqr(n))},distSqr:function(n){var e=n.x-this.x,i=n.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(n){return Math.atan2(this.y-n.y,this.x-n.x)},angleWith:function(n){return this.angleWithSep(n.x,n.y)},angleWithSep:function(n,e){return Math.atan2(this.x*e-this.y*n,this.x*n+this.y*e)},_matMult:function(n){var e=n[2]*this.x+n[3]*this.y;return this.x=n[0]*this.x+n[1]*this.y,this.y=e,this},_add:function(n){return this.x+=n.x,this.y+=n.y,this},_sub:function(n){return this.x-=n.x,this.y-=n.y,this},_mult:function(n){return this.x*=n,this.y*=n,this},_div:function(n){return this.x/=n,this.y/=n,this},_multByPoint:function(n){return this.x*=n.x,this.y*=n.y,this},_divByPoint:function(n){return this.x/=n.x,this.y/=n.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var n=this.y;return this.y=this.x,this.x=-n,this},_rotate:function(n){var e=Math.cos(n),i=Math.sin(n),a=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=a,this},_rotateAround:function(n,e){var i=Math.cos(n),a=Math.sin(n),u=e.y+a*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-a*(this.y-e.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},le.convert=function(n){return n instanceof le?n:Array.isArray(n)?new le(n[0],n[1]):n};var ue=Be(et);const ct=Math.PI/180,ht=180/Math.PI;function Le(n){return n*ct}function ye(n){return n*ht}const gt=[[0,0],[1,0],[1,1],[0,1]];function De(n){if(n<=0)return 0;if(n>=1)return 1;const e=n*n,i=e*n;return 4*(n<.5?i:3*(n-e)+i-.75)}function Pe(n,e,i,a){const u=new Ue(n,e,i,a);return function(p){return u.solve(p)}}const Ae=Pe(.25,.1,.25,1);function Ye(n,e,i){return Math.min(i,Math.max(e,n))}function _t(n,e,i){return(i=Ye((i-n)/(e-n),0,1))*i*(3-2*i)}function hn(n,e,i){const a=i-e,u=((n-e)%a+a)%a+e;return u===e?i:u}function qt(n,e,i){if(!n.length)return i(null,[]);let a=n.length;const u=new Array(n.length);let p=null;n.forEach((_,w)=>{e(_,(I,S)=>{I&&(p=I),u[w]=S,0==--a&&i(p,u)})})}function Ht(n){const e=[];for(const i in n)e.push(n[i]);return e}function Te(n,...e){for(const i of e)for(const a in i)n[a]=i[a];return n}let Je=1;function Re(){return Je++}function Fe(){return function n(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,n)}()}function St(n){return n<=1?1:Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Ce(n){return!!n&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n)}function Rt(n,e){n.forEach(i=>{e[i]&&(e[i]=e[i].bind(e))})}function Qt(n,e){return-1!==n.indexOf(e,n.length-e.length)}function Gt(n,e,i){const a={};for(const u in n)a[u]=e.call(i||this,n[u],u,n);return a}function Zt(n,e,i){const a={};for(const u in n)e.call(i||this,n[u],u,n)&&(a[u]=n[u]);return a}function Jt(n){return Array.isArray(n)?n.map(Jt):"object"==typeof n&&n?Gt(n,Jt):n}const kt={};function dt(n){kt[n]||(typeof console<"u"&&console.warn(n),kt[n]=!0)}function Ot(n,e,i){return(i.y-n.y)*(e.x-n.x)>(e.y-n.y)*(i.x-n.x)}function pt(n){let e=0;for(let i,a,u=0,p=n.length,_=p-1;u@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,u,p)=>{const _=u||p;return e[a]=!_||_.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let ii=null;function gn(n){if(null==ii){const e=n.navigator?n.navigator.userAgent:null;ii=!!n.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return ii}function Ft(n){try{const e=J[n];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function Jn(n,e){return[n[4*e],n[4*e+1],n[4*e+2],n[4*e+3]]}const Wt="mapbox-tiles";let ln,ni,wt=500,vt=50;function er(){try{return J.caches}catch{}}function lr(){er()&&!ln&&(ln=J.caches.open(Wt))}function mi(n){const e=n.indexOf("?");if(e<0)return n;const a=function(u){const p=u.indexOf("?");return p>0?u.slice(p+1).split("&"):[]}(n).filter(u=>{const p=u.split("=");return"language"===p[0]||"worldview"===p[0]});return a.length?`${n.slice(0,e)}?${a.join("&")}`:n.slice(0,e)}let Fi=1/0;const Cn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Cn);class Mn extends Error{constructor(e,i,a){401===i&&Bt(a)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=a}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const qn=Yt()?()=>self.worker&&self.worker.referrer:()=>("blob:"===J.location.protocol?J.parent:J).location.href,yn=function(n,e){if(!(/^file:/.test(i=n.url)||/^file:/.test(qn())&&!/^\w+:/.test(i))){if(J.fetch&&J.Request&&J.AbortController&&J.Request.prototype.hasOwnProperty("signal"))return function(a,u){const p=new J.AbortController,_=new J.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:qn(),referrerPolicy:a.referrerPolicy,signal:p.signal});let w=!1,I=!1;const S=(B=_.url).indexOf("sku=")>0&&Bt(B);var B;"json"===a.type&&_.headers.set("Accept","application/json");const j=(X,te,de)=>{if(I)return;if(X&&"SecurityError"!==X.message&&dt(X.toString()),te&&de)return H(te);const ke=Date.now();J.fetch(_).then(tt=>{if(tt.ok){const mt=S?tt.clone():null;return H(tt,mt,ke)}return u(new Mn(tt.statusText,tt.status,a.url))}).catch(tt=>{"AbortError"!==tt.name&&u(new Error(`${tt.message} ${a.url}`))})},H=(X,te,de)=>{("arrayBuffer"===a.type?X.arrayBuffer():"json"===a.type?X.json():X.text()).then(ke=>{I||(te&&de&&function(tt,mt,Qe){if(lr(),!ln)return;const ut={status:mt.status,statusText:mt.statusText,headers:new J.Headers};mt.headers.forEach((tn,nn)=>ut.headers.set(nn,tn));const xt=Ut(mt.headers.get("Cache-Control")||"");if(xt["no-store"])return;xt["max-age"]&&ut.headers.set("Expires",new Date(Qe+1e3*xt["max-age"]).toUTCString());const bt=ut.headers.get("Expires");bt&&(new Date(bt).getTime()-Qe<42e4||function(tn,nn){if(void 0===ni)try{new Response(new ReadableStream),ni=!0}catch{ni=!1}ni?nn(tn.body):tn.blob().then(nn)}(mt,tn=>{const nn=new J.Response(tn,ut);lr(),ln&&ln.then(Tn=>Tn.put(mi(tt.url),nn)).catch(Tn=>dt(Tn.message))}))}(_,te,de),w=!0,u(null,ke,X.headers.get("Cache-Control"),X.headers.get("Expires")))}).catch(ke=>{I||u(new Error(ke.message))})};return S?function(X,te){if(lr(),!ln)return te(null);const de=mi(X.url);ln.then(ke=>{ke.match(de).then(tt=>{const mt=function(Qe){if(!Qe)return!1;const ut=new Date(Qe.headers.get("Expires")||0),xt=Ut(Qe.headers.get("Cache-Control")||"");return ut>Date.now()&&!xt["no-cache"]}(tt);ke.delete(de),mt&&ke.put(de,tt.clone()),te(null,tt,mt)}).catch(te)}).catch(te)}(_,j):j(null,null),{cancel:()=>{I=!0,w||p.abort()}}}(n,e);if(Yt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",n,e,void 0,!0)}var i;return function(a,u){const p=new J.XMLHttpRequest;p.open(a.method||"GET",a.url,!0),"arrayBuffer"===a.type&&(p.responseType="arraybuffer");for(const _ in a.headers)p.setRequestHeader(_,a.headers[_]);return"json"===a.type&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials="include"===a.credentials,p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||0===p.status)&&null!==p.response){let _=p.response;if("json"===a.type)try{_=JSON.parse(p.response)}catch(w){return u(w)}u(null,_,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else u(new Mn(p.statusText,p.status,a.url))},p.send(a.body),{cancel:()=>p.abort()}}(n,e)},_n=function(n,e){return yn(Te(n,{type:"arrayBuffer"}),e)};function Hi(n){const e=J.document.createElement("a");return e.href=n,e.protocol===J.document.location.protocol&&e.host===J.document.location.host}const nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ge,ve;ge=[],ve=0;const Xe=function(n,e){if(Ne.supported&&(n.headers||(n.headers={}),n.headers.accept="image/webp,*/*"),ve>=C.MAX_PARALLEL_IMAGE_REQUESTS){const p={requestParameters:n,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return ge.push(p),p}ve++;let i=!1;const a=()=>{if(!i)for(i=!0,ve--;ge.length&&ve{a(),p?e(p):_&&(J.createImageBitmap?function(S,B){const j=new J.Blob([new Uint8Array(S)],{type:"image/png"});J.createImageBitmap(j).then(H=>{B(null,H)}).catch(H=>{B(new Error(`Could not load image because of ${H.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(_,(S,B)=>e(S,B,w,I)):function(S,B){const j=new J.Image,H=J.URL;j.onload=()=>{B(null,j),H.revokeObjectURL(j.src),j.onload=null,J.requestAnimationFrame(()=>{j.src=nt})},j.onerror=()=>B(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const X=new J.Blob([new Uint8Array(S)],{type:"image/png"});j.src=S.byteLength?H.createObjectURL(X):nt}(_,(S,B)=>e(S,B,w,I)))});return{cancel:()=>{u.cancel(),a()}}},ft="NO_ACCESS_TOKEN";function Ct(n){return 0===n.indexOf("mapbox:")}function Bt(n){return C.API_URL_REGEX.test(n)}function jt(n){return C.API_CDN_URL_REGEX.test(n)}function Et(n){return C.API_STYLE_REGEX.test(n)&&!Xt(n)}function Xt(n){return C.API_SPRITE_REGEX.test(n)}const Sn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function zn(n){const e=n.match(Sn);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function pe(n){const e=n.params.length?`?${n.params.join("&")}`:"";return`${n.protocol}://${n.authority}${n.path}${e}`}const ze="mapbox.eventData";function xe(n){if(!n)return null;const e=n.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(J.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class be{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=xe(C.ACCESS_TOKEN);let a="";return a=i&&i.u?J.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(u,p)=>String.fromCharCode(+("0x"+p)))):C.ACCESS_TOKEN||"",e?`${ze}.${e}:${a}`:`${ze}:${a}`}fetchEventData(){const e=Ft("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(e)try{const u=J.localStorage.getItem(i);u&&(this.eventData=JSON.parse(u));const p=J.localStorage.getItem(a);p&&(this.anonId=p)}catch{dt("Unable to read from LocalStorage")}}saveEventData(){const e=Ft("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(e)try{J.localStorage.setItem(a,this.anonId),Object.keys(this.eventData).length>=1&&J.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{dt("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,a,u){if(!C.EVENTS_URL)return;const p=zn(C.EVENTS_URL);p.params.push(`access_token=${u||C.ACCESS_TOKEN||""}`);const _={event:this.type,created:new Date(e).toISOString()},w=i?Te(_,i):_,I={url:pe(p),headers:{"Content-Type":"text/plain"},body:JSON.stringify([w])};var B;this.pendingRequest=(B=S=>{this.pendingRequest=null,a(S),this.saveEventData(),this.processRequests(u)},yn(Te(I,{method:"POST"}),B))}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const Ze=new class extends be{constructor(n){super("appUserTurnstile"),this._customAccessToken=n}postTurnstileEvent(n,e){C.EVENTS_URL&&C.ACCESS_TOKEN&&Array.isArray(n)&&n.some(i=>Ct(i)||Bt(i))&&this.queueRequest(Date.now(),e)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=xe(C.ACCESS_TOKEN),i=e?e.u:C.ACCESS_TOKEN;let a=i!==this.eventData.tokenU;Ce(this.anonId)||(this.anonId=Fe(),a=!0);const u=this.queue.shift();if(this.eventData.lastSuccess){const p=new Date(this.eventData.lastSuccess),_=new Date(u),w=(u-this.eventData.lastSuccess)/864e5;a=a||w>=1||w<-1||p.getDate()!==_.getDate()}else a=!0;a?this.postEvent(u,{sdkIdentifier:"mapbox-gl-js",sdkVersion:ie,skuId:oe,"enabled.telemetry":!1,userId:this.anonId},p=>{p||(this.eventData.lastSuccess=u,this.eventData.tokenU=i)},n):this.processRequests()}},Pt=Ze.postTurnstileEvent.bind(Ze),bn=new class extends be{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(n,e,i,a){this.skuToken=e,this.errorCb=a,C.EVENTS_URL&&(i||C.ACCESS_TOKEN?this.queueRequest({id:n,timestamp:Date.now()},i):this.errorCb(new Error(ft)))}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),Ce(this.anonId)||(this.anonId=Fe()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:ie,skuId:oe,skuToken:this.skuToken,userId:this.anonId},a=>{a?this.errorCb(a):e&&(this.success[e]=!0)},n))}},Kn=bn.postMapLoadEvent.bind(bn),Ci=new class extends be{constructor(){super("gljs.performance")}postPerformanceEvent(n,e){C.EVENTS_URL&&(n||C.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},n)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:e,performanceData:i}=this.queue.shift(),a=function(u){const p=J.performance.getEntriesByType("resource"),_=J.performance.getEntriesByType("mark"),w=function(H){const X={};if(H)for(const te in H)if("other"!==te)for(const de of H[te]){const ke=`${te}ResolveRangeMin`,tt=`${te}ResolveRangeMax`,mt=`${te}RequestCount`,Qe=`${te}RequestCachedCount`;X[ke]=Math.min(X[ke]||1/0,de.startTime),X[tt]=Math.max(X[tt]||-1/0,de.responseEnd);const ut=xt=>{void 0===X[xt]&&(X[xt]=0),++X[xt]};void 0!==de.transferSize&&0===de.transferSize&&ut(Qe),ut(mt)}return X}(function(H,X){const te={};if(H)for(const de of H){const ke=X(de);void 0===te[ke]&&(te[ke]=[]),te[ke].push(de)}return te}(p,mn)),I=J.devicePixelRatio,S=J.navigator.connection||J.navigator.mozConnection||J.navigator.webkitConnection,B={counters:[],metadata:[],attributes:[]},j=(H,X,te)=>{null!=te&&H.push({name:X,value:te.toString()})};for(const H in w)j(B.counters,H,w[H]);if(u.interactionRange[0]!==1/0&&u.interactionRange[1]!==-1/0&&(j(B.counters,"interactionRangeMin",u.interactionRange[0]),j(B.counters,"interactionRangeMax",u.interactionRange[1])),_)for(const H of Object.keys(st)){const X=st[H],te=_.find(de=>de.name===X);te&&j(B.counters,X,te.startTime)}return j(B.counters,"visibilityHidden",u.visibilityHidden),j(B.attributes,"style",function(H){if(H)for(const X of H){const te=X.name.split("?")[0];if(Et(te)){const de=te.split("/").slice(-2);if(2===de.length)return`mapbox://styles/${de[0]}/${de[1]}`}}}(p)),j(B.attributes,"terrainEnabled",u.terrainEnabled?"true":"false"),j(B.attributes,"fogEnabled",u.fogEnabled?"true":"false"),j(B.attributes,"projection",u.projection),j(B.attributes,"zoom",u.zoom),j(B.metadata,"devicePixelRatio",I),j(B.metadata,"connectionEffectiveType",S?S.effectiveType:void 0),j(B.metadata,"navigatorUserAgent",J.navigator.userAgent),j(B.metadata,"screenWidth",J.screen.width),j(B.metadata,"screenHeight",J.screen.height),j(B.metadata,"windowWidth",J.innerWidth),j(B.metadata,"windowHeight",J.innerHeight),j(B.metadata,"mapWidth",u.width/I),j(B.metadata,"mapHeight",u.height/I),j(B.metadata,"webglRenderer",u.renderer),j(B.metadata,"webglVendor",u.vendor),j(B.metadata,"sdkVersion",ie),j(B.metadata,"sdkIdentifier","mapbox-gl-js"),B}(i);for(const u of a.metadata);for(const u of a.counters);for(const u of a.attributes);this.postEvent(e,a,()=>{},n)}},wi=Ci.postPerformanceEvent.bind(Ci),cr=new class extends be{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(n,e,i,a){if(!C.API_URL||!C.SESSION_PATH)return;const u=zn(C.API_URL+C.SESSION_PATH);u.params.push(`sku=${e||""}`),u.params.push(`access_token=${a||C.ACCESS_TOKEN||""}`);const p={url:pe(u),headers:{"Content-Type":"text/plain"}};var w;this.pendingRequest=(w=_=>{this.pendingRequest=null,i(_),this.saveEventData(),this.processRequests(a)},yn(Te(p,{method:"GET"}),w))}getSessionAPI(n,e,i,a){this.skuToken=e,this.errorCb=a,C.SESSION_PATH&&C.API_URL&&(i||C.ACCESS_TOKEN?this.queueRequest({id:n,timestamp:Date.now()},i):this.errorCb(new Error(ft)))}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,a=>{a?this.errorCb(a):e&&(this.success[e]=!0)},n)}},Ui=cr.getSessionAPI.bind(cr),Lt=new Set,st={create:"create",load:"load",fullLoad:"fullLoad"},pn={mark(n){J.performance.mark(n)},measure(n,e,i){J.performance.measure(n,e,i)}};function mn(n){const e=n.name.split("?")[0];return jt(e)&&e.includes("mapbox-gl.js")?"javascript":jt(e)&&e.includes("mapbox-gl.css")?"css":C.API_FONTS_REGEX.test(e)?"fontRange":Xt(e)?"sprite":Et(e)?"style":C.API_TILEJSON_REGEX.test(e)?"tilejson":"other"}const En=J.performance;function ti(n){const e=n?n.url.toString():void 0;return En.getEntriesByName(e)}let gi,_i,Li,bi;const ir={now:()=>void 0!==Li?Li:J.performance.now(),setNow(n){Li=n},restoreNow(){Li=void 0},frame(n){const e=J.requestAnimationFrame(n);return{cancel:()=>J.cancelAnimationFrame(e)}},getImageData(n,e=0){const{width:i,height:a}=n;bi||(bi=J.document.createElement("canvas"));const u=bi.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return(i>bi.width||a>bi.height)&&(bi.width=i,bi.height=a),u.clearRect(-e,-e,i+2*e,a+2*e),u.drawImage(n,0,0,i,a),u.getImageData(-e,-e,i+2*e,a+2*e)},resolveURL:n=>(gi||(gi=J.document.createElement("a")),gi.href=n,gi.href),get devicePixelRatio(){return J.devicePixelRatio},get prefersReducedMotion(){return!!J.matchMedia&&(null==_i&&(_i=J.matchMedia("(prefers-reduced-motion: reduce)")),_i.matches)}};function Dr(n,e,i){i[n]&&-1!==i[n].indexOf(e)||(i[n]=i[n]||[],i[n].push(e))}function vi(n,e,i){if(i&&i[n]){const a=i[n].indexOf(e);-1!==a&&i[n].splice(a,1)}}class Ar{constructor(e,i={}){Te(this,i),this.type=e}}class qi extends Ar{constructor(e,i={}){super("error",Te({error:e},i))}}class Bi{on(e,i){return this._listeners=this._listeners||{},Dr(e,i,this._listeners),this}off(e,i){return vi(e,i,this._listeners),vi(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Dr(e,i,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,i){"string"==typeof e&&(e=new Ar(e,i||{}));const a=e.type;if(this.listens(a)){e.target=this;const u=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const w of u)w.call(this,e);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const w of p)vi(a,w,this._oneTimeListeners),w.call(this,e);const _=this._eventedParent;_&&(Te(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof qi&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var Kt=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Wi(n,...e){for(const i of e)for(const a in i)n[a]=i[a];return n}function rr(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function yr(n){if(Array.isArray(n))return n.map(yr);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const e={};for(const i in n)e[i]=yr(n[i]);return e}return rr(n)}class xr extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var Sr=xr;class Go{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[a,u]of i)this.bindings[a]=u}concat(e){return new Go(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var Eo=Go;const to={kind:"null"},Xn={kind:"number"},Ei={kind:"string"},Si={kind:"boolean"},we={kind:"color"},fe={kind:"object"},je={kind:"value"},lt={kind:"collator"},an={kind:"formatted"},Vt={kind:"resolvedImage"};function vn(n,e){return{kind:"array",itemType:n,N:e}}function Dn(n){if("array"===n.kind){const e=Dn(n.itemType);return"number"==typeof n.N?`array<${e}, ${n.N}>`:"value"===n.itemType.kind?"array":`array<${e}>`}return n.kind}const In=[to,Xn,Ei,Si,we,an,fe,vn(je),Vt];function Fn(n,e){if("error"===e.kind)return null;if("array"===n.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Fn(n.itemType,e.itemType))&&("number"!=typeof n.N||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if("value"===n.kind)for(const i of In)if(!Fn(i,e))return null}return`Expected ${Dn(n)} but found ${Dn(e)} instead.`}function di(n,e){return e.some(i=>i.kind===n.kind)}function Ai(n,e){return e.some(i=>"null"===i?null===n:"array"===i?Array.isArray(n):"object"===i?n&&!Array.isArray(n)&&"object"==typeof n:i===typeof n)}var Ni,vr={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function go(n){return(n=Math.round(n))<0?0:n>255?255:n}function Nr(n){return go("%"===n[n.length-1]?parseFloat(n)/100*255:parseInt(n))}function co(n){return(e="%"===n[n.length-1]?parseFloat(n)/100:parseFloat(n))<0?0:e>1?1:e;var e}function uo(n,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?n+(e-n)*i*6:2*i<1?e:3*i<2?n+(e-n)*(2/3-i)*6:n}try{Ni={}.parseCSSColor=function(n){var e,i=n.replace(/ /g,"").toLowerCase();if(i in vr)return vr[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var a=i.indexOf("("),u=i.indexOf(")");if(-1!==a&&u+1===i.length){var p=i.substr(0,a),_=i.substr(a+1,u-(a+1)).split(","),w=1;switch(p){case"rgba":if(4!==_.length)return null;w=co(_.pop());case"rgb":return 3!==_.length?null:[Nr(_[0]),Nr(_[1]),Nr(_[2]),w];case"hsla":if(4!==_.length)return null;w=co(_.pop());case"hsl":if(3!==_.length)return null;var I=(parseFloat(_[0])%360+360)%360/360,S=co(_[1]),B=co(_[2]),j=B<=.5?B*(S+1):B+S-B*S,H=2*B-j;return[go(255*uo(H,j,I+1/3)),go(255*uo(H,j,I)),go(255*uo(H,j,I-1/3)),w];default:return null}}return null}}catch{}class Jr{constructor(e,i,a,u=1){this.r=e,this.g=i,this.b=a,this.a=u}static parse(e){if(!e)return;if(e instanceof Jr)return e;if("string"!=typeof e)return;const i=Ni(e);return i?new Jr(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,a,u]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(a)},${u})`}toArray(){const{r:e,g:i,b:a,a:u}=this;return 0===u?[0,0,0,0]:[255*e/u,255*i/u,255*a/u,u]}toArray01(){const{r:e,g:i,b:a,a:u}=this;return 0===u?[0,0,0,0]:[e/u,i/u,a/u,u]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:a,a:u}=this;return[e,i,a,u]}}Jr.black=new Jr(0,0,0,1),Jr.white=new Jr(1,1,1,1),Jr.transparent=new Jr(0,0,0,0),Jr.red=new Jr(1,0,0,1),Jr.blue=new Jr(0,0,1,1);var kr=Jr;class To{constructor(e,i,a){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ds{constructor(e,i,a,u,p){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=a,this.fontStack=u,this.textColor=p}}class xo{constructor(e){this.sections=e}static fromString(e){return new xo([new ds(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof xo?e:xo.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const a={};i.fontStack&&(a["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(a["font-scale"]=i.scale),i.textColor&&(a["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(a)}return e}}class zi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new zi({name:e,available:!1}):null}serialize(){return["image",this.name]}}function Fr(n,e,i,a){return"number"==typeof n&&n>=0&&n<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===a||"number"==typeof a&&a>=0&&a<=1?null:`Invalid rgba value [${[n,e,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof a?[n,e,i,a]:[n,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Or(n){if(null===n||"string"==typeof n||"boolean"==typeof n||"number"==typeof n||n instanceof kr||n instanceof To||n instanceof xo||n instanceof zi)return!0;if(Array.isArray(n)){for(const e of n)if(!Or(e))return!1;return!0}if("object"==typeof n){for(const e in n)if(!Or(n[e]))return!1;return!0}return!1}function Er(n){if(null===n)return to;if("string"==typeof n)return Ei;if("boolean"==typeof n)return Si;if("number"==typeof n)return Xn;if(n instanceof kr)return we;if(n instanceof To)return lt;if(n instanceof xo)return an;if(n instanceof zi)return Vt;if(Array.isArray(n)){const e=n.length;let i;for(const a of n){const u=Er(a);if(i){if(i===u)continue;i=je;break}i=u}return vn(i||je,e)}return fe}function so(n){const e=typeof n;return null===n?"":"string"===e||"number"===e||"boolean"===e?String(n):n instanceof kr||n instanceof xo||n instanceof zi?n.toString():JSON.stringify(n)}class Gs{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(2!==e.length)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Or(e[1]))return i.error("invalid value");const a=e[1];let u=Er(a);const p=i.expectedType;return"array"!==u.kind||0!==u.N||!p||"array"!==p.kind||"number"==typeof p.N&&0!==p.N||(u=p),new Gs(u,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof kr?["rgba"].concat(this.value.toArray()):this.value instanceof xo?this.value.serialize():this.value}}var Po=Gs,Hr=class{constructor(n){this.name="ExpressionEvaluationError",this.message=n}toJSON(){return this.message}};const wa={string:Ei,number:Xn,boolean:Si,object:fe};class bs{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let a,u=1;const p=e[0];if("array"===p){let w,I;if(e.length>2){const S=e[1];if("string"!=typeof S||!(S in wa)||"object"===S)return i.error('The item type argument of "array" must be one of string, number, boolean',1);w=wa[S],u++}else w=je;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);I=e[2],u++}a=vn(w,I)}else a=wa[p];const _=[];for(;ue.outputDefined())}serialize(){const e=this.type,i=[e.kind];if("array"===e.kind){const a=e.itemType;if("string"===a.kind||"number"===a.kind||"boolean"===a.kind){i.push(a.kind);const u=e.N;("number"==typeof u||this.args.length>1)&&i.push(u)}}return i.concat(this.args.map(a=>a.serialize()))}}var gr=bs;class li{constructor(e){this.type=an,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&"object"==typeof a)return i.error("First argument must be an image or text section.");const u=[];let p=!1;for(let _=1;_<=e.length-1;++_){const w=e[_];if(p&&"object"==typeof w&&!Array.isArray(w)){p=!1;let I=null;if(w["font-scale"]&&(I=i.parse(w["font-scale"],1,Xn),!I))return null;let S=null;if(w["text-font"]&&(S=i.parse(w["text-font"],1,vn(Ei)),!S))return null;let B=null;if(w["text-color"]&&(B=i.parse(w["text-color"],1,we),!B))return null;const j=u[u.length-1];j.scale=I,j.font=S,j.textColor=B}else{const I=i.parse(e[_],1,je);if(!I)return null;const S=I.type.kind;if("string"!==S&&"value"!==S&&"null"!==S&&"resolvedImage"!==S)return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,u.push({content:I,scale:null,font:null,textColor:null})}}return new li(u)}evaluate(e){return new xo(this.sections.map(i=>{const a=i.content.evaluate(e);return Er(a)===Vt?new ds("",a,null,null,null):new ds(so(a),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const a={};i.scale&&(a["font-scale"]=i.scale.serialize()),i.font&&(a["text-font"]=i.font.serialize()),i.textColor&&(a["text-color"]=i.textColor.serialize()),e.push(a)}return e}}class Zi{constructor(e){this.type=Vt,this.input=e}static parse(e,i){if(2!==e.length)return i.error("Expected two arguments.");const a=i.parse(e[1],1,Ei);return a?new Zi(a):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),a=zi.fromString(i);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(i)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Rr={"to-boolean":Si,"to-color":we,"to-number":Xn,"to-string":Ei};class _o{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const a=e[0];if(("to-boolean"===a||"to-string"===a)&&2!==e.length)return i.error("Expected one argument.");const u=Rr[a],p=[];for(let _=1;_4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Fr(i[0],i[1],i[2],i[3]),!a))return new kr(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Hr(a||`Could not parse color from value '${"string"==typeof i?i:String(JSON.stringify(i))}'`)}if("number"===this.type.kind){let i=null;for(const a of this.args){if(i=a.evaluate(e),null===i)return 0;const u=Number(i);if(!isNaN(u))return u}throw new Hr(`Could not convert ${JSON.stringify(i)} to number.`)}return"formatted"===this.type.kind?xo.fromString(so(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?zi.fromString(so(this.args[0].evaluate(e))):so(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if("formatted"===this.type.kind)return new li([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Zi(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var rs=_o;const zr=["Unknown","Point","LineString","Polygon"];var ko=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?zr[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const n=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-n[0])+this.featureDistanceData.bearing[1]*(a*e-n[1])}return 0}parseColor(n){let e=this._parseColorCache[n];return e||(e=this._parseColorCache[n]=kr.parse(n)),e}};class br{constructor(e,i,a,u){this.name=e,this.type=i,this._evaluate=a,this.args=u}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const a=e[0],u=br.definitions[a];if(!u)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(u)?u[0]:u.type,_=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,w=_.filter(([S])=>!Array.isArray(S)||S.length===e.length-1);let I=null;for(const[S,B]of w){I=new Bo(i.registry,i.path,null,i.scope);const j=[];let H=!1;for(let X=1;X{return H=j,Array.isArray(H)?`(${H.map(Dn).join(", ")})`:`(${Dn(H.type)}...)`;var H}).join(" | "),B=[];for(let j=1;j=e[2]||n[1]<=e[1]||n[3]>=e[3])}function os(n,e){const i=(180+n[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n[1]*Math.PI/360)))/360,u=Math.pow(2,e.z);return[Math.round(i*u*Ti),Math.round(a*u*Ti)]}function Br(n,e,i){const a=n[0]-e[0],u=n[1]-e[1],p=n[0]-i[0],_=n[1]-i[1];return a*_-p*u==0&&a*p<=0&&u*_<=0}function zs(n,e){let i=!1;for(let _=0,w=e.length;_(a=n)[1]!=(p=I[S+1])[1]>a[1]&&a[0]<(p[0]-u[0])*(a[1]-u[1])/(p[1]-u[1])+u[0]&&(i=!i)}}var a,u,p;return i}function ws(n,e){for(let i=0;i0&&w<0||_<0&&w>0}function Ho(n,e,i){for(const S of i)for(let B=0;Bi[2]){const u=.5*a;let p=n[0]-i[0]>u?-a:i[0]-n[0]>u?a:0;0===p&&(p=n[0]-i[2]>u?-a:i[2]-n[0]>u?a:0),n[0]+=p}Ns(e,n)}function or(n,e,i,a){const u=Math.pow(2,a.z)*Ti,p=[a.x*Ti,a.y*Ti],_=[];if(!n)return _;for(const w of n)for(const I of w){const S=[I.x+p[0],I.y+p[1]];Cs(S,e,i,u),_.push(S)}return _}function Qa(n,e,i,a){const u=Math.pow(2,a.z)*Ti,p=[a.x*Ti,a.y*Ti],_=[];if(!n)return _;for(const I of n){const S=[];for(const B of I){const j=[B.x+p[0],B.y+p[1]];Ns(e,j),S.push(j)}_.push(S)}if(e[2]-e[0]<=u/2){(w=e)[0]=w[1]=1/0,w[2]=w[3]=-1/0;for(const I of _)for(const S of I)Cs(S,e,i,u)}var w;return _}class Os{constructor(e,i){this.type=Si,this.geojson=e,this.geometries=i}static parse(e,i){if(2!==e.length)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Or(e[1])){const a=e[1];if("FeatureCollection"===a.type)for(let u=0;u{e&&!Ur(i)&&(e=!1)}),e}function fs(n){if(n instanceof bo&&"feature-state"===n.name)return!1;let e=!0;return n.eachChild(i=>{e&&!fs(i)&&(e=!1)}),e}function Do(n,e){if(n instanceof bo&&e.indexOf(n.name)>=0)return!1;let i=!0;return n.eachChild(a=>{i&&!Do(a,e)&&(i=!1)}),i}class Hs{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(2!==e.length||"string"!=typeof e[1])return i.error("'var' expression requires exactly one string literal argument.");const a=e[1];return i.scope.has(a)?new Hs(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Io=Hs;class el{constructor(e,i=[],a,u=new Eo,p=[]){this.registry=e,this.path=i,this.key=i.map(_=>`[${_}]`).join(""),this.scope=u,this.errors=p,this.expectedType=a}parse(e,i,a,u,p={}){return i?this.concat(i,a,u)._parse(e,p):this._parse(e,p)}_parse(e,i){function a(u,p,_){return"assert"===_?new gr(p,[u]):"coerce"===_?new rs(p,[u]):u}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=e[0];if("string"!=typeof u)return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[u];if(p){let _=p.parse(e,this);if(!_)return null;if(this.expectedType){const w=this.expectedType,I=_.type;if("string"!==w.kind&&"number"!==w.kind&&"boolean"!==w.kind&&"object"!==w.kind&&"array"!==w.kind||"value"!==I.kind)if("color"!==w.kind&&"formatted"!==w.kind&&"resolvedImage"!==w.kind||"value"!==I.kind&&"string"!==I.kind){if(this.checkSubtype(w,I))return null}else _=a(_,w,i.typeAnnotation||"coerce");else _=a(_,w,i.typeAnnotation||"assert")}if(!(_ instanceof Po)&&"resolvedImage"!==_.type.kind&&yo(_)){const w=new ko;try{_=new Po(_.type,_.evaluate(w))}catch(I){return this.error(I.message),null}}return _}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,a){const u="number"==typeof e?this.path.concat(e):this.path,p=a?this.scope.concat(a):this.scope;return new el(this.registry,u,i||null,p,this.errors)}error(e,...i){const a=`${this.key}${i.map(u=>`[${u}]`).join("")}`;this.errors.push(new Sr(a,e))}checkSubtype(e,i){const a=Fn(e,i);return a&&this.error(a),a}}var Bo=el;function yo(n){if(n instanceof Io)return yo(n.boundExpression);if(n instanceof bo&&"error"===n.name||n instanceof Oo||n instanceof ia)return!1;const e=n instanceof rs||n instanceof gr;let i=!0;return n.eachChild(a=>{i=e?i&&yo(a):i&&a instanceof Po}),!!i&&Ur(n)&&Do(n,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function ra(n,e){const i=n.length-1;let a,u,p=0,_=i,w=0;for(;p<=_;)if(w=Math.floor((p+_)/2),a=n[w],u=n[w+1],a<=e){if(w===i||ee))throw new Hr("Input is not a number.");_=w-1}return 0}class Rs{constructor(e,i,a){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[u,p]of a)this.labels.push(u),this.outputs.push(p)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(e[1],1,Xn);if(!a)return null;const u=[];let p=null;i.expectedType&&"value"!==i.expectedType.kind&&(p=i.expectedType);for(let _=1;_=w)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',S);const j=i.parse(I,B,p);if(!j)return null;p=p||j.type,u.push([w,j])}return new Rs(p,a,u)}evaluate(e){const i=this.labels,a=this.outputs;if(1===i.length)return a[0].evaluate(e);const u=this.input.evaluate(e);if(u<=i[0])return a[0].evaluate(e);const p=i.length;return u>=i[p-1]?a[p-1].evaluate(e):a[ra(i,u)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var Ls=Rs;function ki(n,e,i){return n*(1-i)+e*i}var Ws=Object.freeze({__proto__:null,array:function(n,e,i){return n.map((a,u)=>ki(a,e[u],i))},color:function(n,e,i){return new kr(ki(n.r,e.r,i),ki(n.g,e.g,i),ki(n.b,e.b,i),ki(n.a,e.a,i))},number:ki});const v=.95047,M=1.08883,D=4/29,A=6/29,G=3*A*A,It=A*A*A,Yn=Math.PI/180,pi=180/Math.PI;function tr(n){return n>It?Math.pow(n,1/3):n/G+D}function Zr(n){return n>A?n*n*n:G*(n-D)}function Mo(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function oa(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Es(n){const e=oa(n.r),i=oa(n.g),a=oa(n.b),u=tr((.4124564*e+.3575761*i+.1804375*a)/v),p=tr((.2126729*e+.7151522*i+.072175*a)/1);return{l:116*p-16,a:500*(u-p),b:200*(p-tr((.0193339*e+.119192*i+.9503041*a)/M)),alpha:n.a}}function ks(n){let e=(n.l+16)/116,i=isNaN(n.a)?e:e+n.a/500,a=isNaN(n.b)?e:e-n.b/200;return e=1*Zr(e),i=v*Zr(i),a=M*Zr(a),new kr(Mo(3.2404542*i-1.5371385*e-.4985314*a),Mo(-.969266*i+1.8760108*e+.041556*a),Mo(.0556434*i-.2040259*e+1.0572252*a),n.alpha)}function Fa(n,e,i){const a=e-n;return n+i*(a>180||a<-180?a-360*Math.round(a/360):a)}const tl={forward:Es,reverse:ks,interpolate:function(n,e,i){return{l:ki(n.l,e.l,i),a:ki(n.a,e.a,i),b:ki(n.b,e.b,i),alpha:ki(n.alpha,e.alpha,i)}}},da={forward:function(n){const{l:e,a:i,b:a}=Es(n),u=Math.atan2(a,i)*pi;return{h:u<0?u+360:u,c:Math.sqrt(i*i+a*a),l:e,alpha:n.a}},reverse:function(n){const e=n.h*Yn,i=n.c;return ks({l:n.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:n.alpha})},interpolate:function(n,e,i){return{h:Fa(n.h,e.h,i),c:ki(n.c,e.c,i),l:ki(n.l,e.l,i),alpha:ki(n.alpha,e.alpha,i)}}};var yl=Object.freeze({__proto__:null,hcl:da,lab:tl});class Ba{constructor(e,i,a,u,p){this.type=e,this.operator=i,this.interpolation=a,this.input=u,this.labels=[],this.outputs=[];for(const[_,w]of p)this.labels.push(_),this.outputs.push(w)}static interpolationFactor(e,i,a,u){let p=0;if("exponential"===e.name)p=vl(i,e.base,a,u);else if("linear"===e.name)p=vl(i,1,a,u);else if("cubic-bezier"===e.name){const _=e.controlPoints;p=new Ue(_[0],_[1],_[2],_[3]).solve(vl(i,1,a,u))}return p}static parse(e,i){let[a,u,p,..._]=e;if(!Array.isArray(u)||0===u.length)return i.error("Expected an interpolation type expression.",1);if("linear"===u[0])u={name:"linear"};else if("exponential"===u[0]){const S=u[1];if("number"!=typeof S)return i.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:S}}else{if("cubic-bezier"!==u[0])return i.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const S=u.slice(1);if(4!==S.length||S.some(B=>"number"!=typeof B||B<0||B>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:S}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,Xn),!p)return null;const w=[];let I=null;"interpolate-hcl"===a||"interpolate-lab"===a?I=we:i.expectedType&&"value"!==i.expectedType.kind&&(I=i.expectedType);for(let S=0;S<_.length;S+=2){const B=_[S],j=_[S+1],H=S+3,X=S+4;if("number"!=typeof B)return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',H);if(w.length&&w[w.length-1][0]>=B)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const te=i.parse(j,X,I);if(!te)return null;I=I||te.type,w.push([B,te])}return"number"===I.kind||"color"===I.kind||"array"===I.kind&&"number"===I.itemType.kind&&"number"==typeof I.N?new Ba(I,a,u,p,w):i.error(`Type ${Dn(I)} is not interpolatable.`)}evaluate(e){const i=this.labels,a=this.outputs;if(1===i.length)return a[0].evaluate(e);const u=this.input.evaluate(e);if(u<=i[0])return a[0].evaluate(e);const p=i.length;if(u>=i[p-1])return a[p-1].evaluate(e);const _=ra(i,u),w=Ba.interpolationFactor(this.interpolation,u,i[_],i[_+1]),I=a[_].evaluate(e),S=a[_+1].evaluate(e);return"interpolate"===this.operator?Ws[this.type.kind.toLowerCase()](I,S,w):"interpolate-hcl"===this.operator?da.reverse(da.interpolate(da.forward(I),da.forward(S),w)):tl.reverse(tl.interpolate(tl.forward(I),tl.forward(S),w))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let a=0;aFn(u,w.type));return new cc(_?je:a,p)}evaluate(e){let i,a=null,u=0;for(const p of this.args){if(u++,a=p.evaluate(e),a&&a instanceof zi&&!a.available&&(i||(i=a),a=null,u===this.args.length))return i;if(null!==a)break}return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var ha=cc;class Ca{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Hr(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Hr(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var dc=Ea;class fa{constructor(e,i){this.type=Si,this.needle=e,this.haystack=i}static parse(e,i){if(3!==e.length)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=i.parse(e[1],1,je),u=i.parse(e[2],2,je);return a&&u?di(a.type,[Si,Ei,Xn,to,je])?new fa(a,u):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(a.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(null==a)return!1;if(!Ai(i,["boolean","string","number","null"]))throw new Hr(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Er(i))} instead.`);if(!Ai(a,["string","array"]))throw new Hr(`Expected second argument to be of type array or string, but found ${Dn(Er(a))} instead.`);return a.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Na=fa;class xl{constructor(e,i,a){this.type=Xn,this.needle=e,this.haystack=i,this.fromIndex=a}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=i.parse(e[1],1,je),u=i.parse(e[2],2,je);if(!a||!u)return null;if(!di(a.type,[Si,Ei,Xn,to,je]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(a.type)} instead`);if(4===e.length){const p=i.parse(e[3],3,Xn);return p?new xl(a,u,p):null}return new xl(a,u)}evaluate(e){const i=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!Ai(i,["boolean","string","number","null"]))throw new Hr(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Er(i))} instead.`);if(!Ai(a,["string","array"]))throw new Hr(`Expected second argument to be of type array or string, but found ${Dn(Er(a))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(e);return a.indexOf(i,u)}return a.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Iu=xl;class hc{constructor(e,i,a,u,p,_){this.inputType=e,this.type=i,this.input=a,this.cases=u,this.outputs=p,this.otherwise=_}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let a,u;i.expectedType&&"value"!==i.expectedType.kind&&(u=i.expectedType);const p={},_=[];for(let S=2;SNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof te&&Math.floor(te)!==te)return H.error("Numeric branch labels must be integer values.");if(a){if(H.checkSubtype(a,Er(te)))return null}else a=Er(te);if(void 0!==p[String(te)])return H.error("Branch labels must be unique.");p[String(te)]=_.length}const X=i.parse(j,S,u);if(!X)return null;u=u||X.type,_.push(X)}const w=i.parse(e[1],1,je);if(!w)return null;const I=i.parse(e[e.length-1],e.length-1,u);return I?"value"!==w.type.kind&&i.concat(1).checkSubtype(a,w.type)?null:new hc(a,u,w,p,_,I):null}evaluate(e){const i=this.input.evaluate(e);return(Er(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),a=[],u={};for(const _ of i){const w=u[this.cases[_]];void 0===w?(u[this.cases[_]]=a.length,a.push([this.cases[_],[_]])):a[w][1].push(_)}const p=_=>"number"===this.inputType.kind?Number(_):_;for(const[_,w]of a)e.push(1===w.length?p(w[0]):w.map(p)),e.push(this.outputs[_].serialize());return e.push(this.otherwise.serialize()),e}}var Us=hc;class nl{constructor(e,i,a){this.type=e,this.branches=i,this.otherwise=a}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&"value"!==i.expectedType.kind&&(a=i.expectedType);const u=[];for(let _=1;_i.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Ao=nl;class za{constructor(e,i,a,u){this.type=e,this.input=i,this.beginIndex=a,this.endIndex=u}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=i.parse(e[1],1,je),u=i.parse(e[2],2,Xn);if(!a||!u)return null;if(!di(a.type,[vn(je),Ei,je]))return i.error(`Expected first argument to be of type array or string, but found ${Dn(a.type)} instead`);if(4===e.length){const p=i.parse(e[3],3,Xn);return p?new za(a.type,a,u,p):null}return new za(a.type,a,u)}evaluate(e){const i=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!Ai(i,["string","array"]))throw new Hr(`Expected first argument to be of type array or string, but found ${Dn(Er(i))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(e);return i.slice(a,u)}return i.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Mu=za;function Ua(n,e){return"=="===n||"!="===n?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Vl(n,e,i,a){return 0===a.compare(e,i)}function sa(n,e,i){const a="=="!==n&&"!="!==n;return class X1{constructor(p,_,w){this.type=Si,this.lhs=p,this.rhs=_,this.collator=w,this.hasUntypedArgument="value"===p.type.kind||"value"===_.type.kind}static parse(p,_){if(3!==p.length&&4!==p.length)return _.error("Expected two or three arguments.");const w=p[0];let I=_.parse(p[1],1,je);if(!I)return null;if(!Ua(w,I.type))return _.concat(1).error(`"${w}" comparisons are not supported for type '${Dn(I.type)}'.`);let S=_.parse(p[2],2,je);if(!S)return null;if(!Ua(w,S.type))return _.concat(2).error(`"${w}" comparisons are not supported for type '${Dn(S.type)}'.`);if(I.type.kind!==S.type.kind&&"value"!==I.type.kind&&"value"!==S.type.kind)return _.error(`Cannot compare types '${Dn(I.type)}' and '${Dn(S.type)}'.`);a&&("value"===I.type.kind&&"value"!==S.type.kind?I=new gr(S.type,[I]):"value"!==I.type.kind&&"value"===S.type.kind&&(S=new gr(I.type,[S])));let B=null;if(4===p.length){if("string"!==I.type.kind&&"string"!==S.type.kind&&"value"!==I.type.kind&&"value"!==S.type.kind)return _.error("Cannot use collator to compare non-string types.");if(B=_.parse(p[3],3,lt),!B)return null}return new X1(I,S,B)}evaluate(p){const _=this.lhs.evaluate(p),w=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const I=Er(_),S=Er(w);if(I.kind!==S.kind||"string"!==I.kind&&"number"!==I.kind)throw new Hr(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${I.kind}, ${S.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const I=Er(_),S=Er(w);if("string"!==I.kind||"string"!==S.kind)return e(p,_,w)}return this.collator?i(p,_,w,this.collator.evaluate(p)):e(p,_,w)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}serialize(){const p=[n];return this.eachChild(_=>{p.push(_.serialize())}),p}}}const bl=sa("==",function(n,e,i){return e===i},Vl),vd=sa("!=",function(n,e,i){return e!==i},function(n,e,i,a){return!Vl(0,e,i,a)}),Gc=sa("<",function(n,e,i){return e",function(n,e,i){return e>i},function(n,e,i,a){return a.compare(e,i)>0}),Au=sa("<=",function(n,e,i){return e<=i},function(n,e,i,a){return a.compare(e,i)<=0}),wl=sa(">=",function(n,e,i){return e>=i},function(n,e,i,a){return a.compare(e,i)>=0});class $l{constructor(e,i,a,u,p,_){this.type=Ei,this.number=e,this.locale=i,this.currency=a,this.unit=u,this.minFractionDigits=p,this.maxFractionDigits=_}static parse(e,i){if(3!==e.length)return i.error("Expected two arguments.");const a=i.parse(e[1],1,Xn);if(!a)return null;const u=e[2];if("object"!=typeof u||Array.isArray(u))return i.error("NumberFormat options argument must be an object.");let p=null;if(u.locale&&(p=i.parse(u.locale,1,Ei),!p))return null;let _=null;if(u.currency&&(_=i.parse(u.currency,1,Ei),!_))return null;let w=null;if(u.unit&&(w=i.parse(u.unit,1,Ei),!w))return null;let I=null;if(u["min-fraction-digits"]&&(I=i.parse(u["min-fraction-digits"],1,Xn),!I))return null;let S=null;return u["max-fraction-digits"]&&(S=i.parse(u["max-fraction-digits"],1,Xn),!S)?null:new $l(a,p,_,w,I,S)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class il{constructor(e){this.type=Xn,this.input=e}static parse(e,i){if(2!==e.length)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=i.parse(e[1],1);return a?"array"!==a.type.kind&&"string"!==a.type.kind&&"value"!==a.type.kind?i.error(`Expected argument of type string or array, but found ${Dn(a.type)} instead.`):new il(a):null}evaluate(e){const i=this.input.evaluate(e);if("string"==typeof i||Array.isArray(i))return i.length;throw new Hr(`Expected value to be of type string or array, but found ${Dn(Er(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const xd={"==":bl,"!=":vd,">":fc,"<":Gc,">=":wl,"<=":Au,array:gr,at:dc,boolean:gr,case:Ao,coalesce:ha,collator:Oo,format:li,image:Zi,in:Na,"index-of":Iu,interpolate:Ts,"interpolate-hcl":Ts,"interpolate-lab":Ts,length:il,let:uc,literal:Po,match:Us,number:gr,"number-format":$l,object:gr,slice:Mu,step:Ls,string:gr,"to-boolean":rs,"to-color":rs,"to-number":rs,"to-string":rs,var:Io,within:ia};function pc(n,[e,i,a,u]){e=e.evaluate(n),i=i.evaluate(n),a=a.evaluate(n);const p=u?u.evaluate(n):1,_=Fr(e,i,a,p);if(_)throw new Hr(_);return new kr(e/255*p,i/255*p,a/255*p,p)}function qs(n,e){return n in e}function Ta(n,e){const i=e[n];return void 0===i?null:i}function Zs(n){return{type:n}}bo.register(xd,{error:[{kind:"error"},[Ei],(n,[e])=>{throw new Hr(e.evaluate(n))}],typeof:[Ei,[je],(n,[e])=>Dn(Er(e.evaluate(n)))],"to-rgba":[vn(Xn,4),[we],(n,[e])=>e.evaluate(n).toArray()],rgb:[we,[Xn,Xn,Xn],pc],rgba:[we,[Xn,Xn,Xn,Xn],pc],has:{type:Si,overloads:[[[Ei],(n,[e])=>qs(e.evaluate(n),n.properties())],[[Ei,fe],(n,[e,i])=>qs(e.evaluate(n),i.evaluate(n))]]},get:{type:je,overloads:[[[Ei],(n,[e])=>Ta(e.evaluate(n),n.properties())],[[Ei,fe],(n,[e,i])=>Ta(e.evaluate(n),i.evaluate(n))]]},"feature-state":[je,[Ei],(n,[e])=>Ta(e.evaluate(n),n.featureState||{})],properties:[fe,[],n=>n.properties()],"geometry-type":[Ei,[],n=>n.geometryType()],id:[je,[],n=>n.id()],zoom:[Xn,[],n=>n.globals.zoom],pitch:[Xn,[],n=>n.globals.pitch||0],"distance-from-center":[Xn,[],n=>n.distanceFromCenter()],"heatmap-density":[Xn,[],n=>n.globals.heatmapDensity||0],"line-progress":[Xn,[],n=>n.globals.lineProgress||0],"sky-radial-progress":[Xn,[],n=>n.globals.skyRadialProgress||0],accumulated:[je,[],n=>void 0===n.globals.accumulated?null:n.globals.accumulated],"+":[Xn,Zs(Xn),(n,e)=>{let i=0;for(const a of e)i+=a.evaluate(n);return i}],"*":[Xn,Zs(Xn),(n,e)=>{let i=1;for(const a of e)i*=a.evaluate(n);return i}],"-":{type:Xn,overloads:[[[Xn,Xn],(n,[e,i])=>e.evaluate(n)-i.evaluate(n)],[[Xn],(n,[e])=>-e.evaluate(n)]]},"/":[Xn,[Xn,Xn],(n,[e,i])=>e.evaluate(n)/i.evaluate(n)],"%":[Xn,[Xn,Xn],(n,[e,i])=>e.evaluate(n)%i.evaluate(n)],ln2:[Xn,[],()=>Math.LN2],pi:[Xn,[],()=>Math.PI],e:[Xn,[],()=>Math.E],"^":[Xn,[Xn,Xn],(n,[e,i])=>Math.pow(e.evaluate(n),i.evaluate(n))],sqrt:[Xn,[Xn],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[Xn,[Xn],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[Xn,[Xn],(n,[e])=>Math.log(e.evaluate(n))],log2:[Xn,[Xn],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[Xn,[Xn],(n,[e])=>Math.sin(e.evaluate(n))],cos:[Xn,[Xn],(n,[e])=>Math.cos(e.evaluate(n))],tan:[Xn,[Xn],(n,[e])=>Math.tan(e.evaluate(n))],asin:[Xn,[Xn],(n,[e])=>Math.asin(e.evaluate(n))],acos:[Xn,[Xn],(n,[e])=>Math.acos(e.evaluate(n))],atan:[Xn,[Xn],(n,[e])=>Math.atan(e.evaluate(n))],min:[Xn,Zs(Xn),(n,e)=>Math.min(...e.map(i=>i.evaluate(n)))],max:[Xn,Zs(Xn),(n,e)=>Math.max(...e.map(i=>i.evaluate(n)))],abs:[Xn,[Xn],(n,[e])=>Math.abs(e.evaluate(n))],round:[Xn,[Xn],(n,[e])=>{const i=e.evaluate(n);return i<0?-Math.round(-i):Math.round(i)}],floor:[Xn,[Xn],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[Xn,[Xn],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[Si,[Ei,je],(n,[e,i])=>n.properties()[e.value]===i.value],"filter-id-==":[Si,[je],(n,[e])=>n.id()===e.value],"filter-type-==":[Si,[Ei],(n,[e])=>n.geometryType()===e.value],"filter-<":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a{const i=n.id(),a=e.value;return typeof i==typeof a&&i":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a>u}],"filter-id->":[Si,[je],(n,[e])=>{const i=n.id(),a=e.value;return typeof i==typeof a&&i>a}],"filter-<=":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a<=u}],"filter-id-<=":[Si,[je],(n,[e])=>{const i=n.id(),a=e.value;return typeof i==typeof a&&i<=a}],"filter->=":[Si,[Ei,je],(n,[e,i])=>{const a=n.properties()[e.value],u=i.value;return typeof a==typeof u&&a>=u}],"filter-id->=":[Si,[je],(n,[e])=>{const i=n.id(),a=e.value;return typeof i==typeof a&&i>=a}],"filter-has":[Si,[je],(n,[e])=>e.value in n.properties()],"filter-has-id":[Si,[],n=>null!==n.id()&&void 0!==n.id()],"filter-type-in":[Si,[vn(Ei)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[Si,[vn(je)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[Si,[Ei,vn(je)],(n,[e,i])=>i.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[Si,[Ei,vn(je)],(n,[e,i])=>function(a,u,p,_){for(;p<=_;){const w=p+_>>1;if(u[w]===a)return!0;u[w]>a?_=w-1:p=w+1}return!1}(n.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Si,overloads:[[[Si,Si],(n,[e,i])=>e.evaluate(n)&&i.evaluate(n)],[Zs(Si),(n,e)=>{for(const i of e)if(!i.evaluate(n))return!1;return!0}]]},any:{type:Si,overloads:[[[Si,Si],(n,[e,i])=>e.evaluate(n)||i.evaluate(n)],[Zs(Si),(n,e)=>{for(const i of e)if(i.evaluate(n))return!0;return!1}]]},"!":[Si,[Si],(n,[e])=>!e.evaluate(n)],"is-supported-script":[Si,[Ei],(n,[e])=>{const i=n.globals&&n.globals.isSupportedScript;return!i||i(e.evaluate(n))}],upcase:[Ei,[Ei],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[Ei,[Ei],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[Ei,Zs(je),(n,e)=>e.map(i=>so(i.evaluate(n))).join("")],"resolved-locale":[Ei,[lt],(n,[e])=>e.evaluate(n).resolvedLocale()]});var N=xd;function ne(n){return{result:"success",value:n}}function it(n){return{result:"error",value:n}}function Q(n){return"data-driven"===n["property-type"]}function He(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function At(n){return!!n.expression&&n.expression.interpolated}function cn(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":null===n?"null":typeof n}function ri(n){return"object"==typeof n&&null!==n&&!Array.isArray(n)}function fr(n){return n}function Xi(n,e){const i="color"===e.type,a=n.stops&&"object"==typeof n.stops[0][0],u=a||!(a||void 0!==n.property),p=n.type||(At(e)?"exponential":"interval");if(i&&((n=Wi({},n)).stops&&(n.stops=n.stops.map(S=>[S[0],kr.parse(S[1])])),n.default=kr.parse(n.default?n.default:e.default)),n.colorSpace&&"rgb"!==n.colorSpace&&!yl[n.colorSpace])throw new Error(`Unknown color space: ${n.colorSpace}`);let _,w,I;if("exponential"===p)_=Tr;else if("interval"===p)_=Vi;else if("categorical"===p){_=sr,w=Object.create(null);for(const S of n.stops)w[S[0]]=S[1];I=typeof n.stops[0][0]}else{if("identity"!==p)throw new Error(`Unknown function type "${p}"`);_=ho}if(a){const S={},B=[];for(let X=0;XX[0]),evaluate:({zoom:X},te)=>Tr({stops:j,base:n.base},e,X).evaluate(X,te)}}if(u){const S="exponential"===p?{name:"exponential",base:void 0!==n.base?n.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:Ts.interpolationFactor.bind(void 0,S),zoomStops:n.stops.map(B=>B[0]),evaluate:({zoom:B})=>_(n,e,B,w,I)}}return{kind:"source",evaluate(S,B){const j=B&&B.properties?B.properties[n.property]:void 0;return void 0===j?pr(n.default,e.default):_(n,e,j,w,I)}}}function pr(n,e,i){return void 0!==n?n:void 0!==e?e:void 0!==i?i:void 0}function sr(n,e,i,a,u){return pr(typeof i===u?a[i]:void 0,n.default,e.default)}function Vi(n,e,i){if("number"!==cn(i))return pr(n.default,e.default);const a=n.stops.length;if(1===a||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[a-1][0])return n.stops[a-1][1];const u=ra(n.stops.map(p=>p[0]),i);return n.stops[u][1]}function Tr(n,e,i){const a=void 0!==n.base?n.base:1;if("number"!==cn(i))return pr(n.default,e.default);const u=n.stops.length;if(1===u||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[u-1][0])return n.stops[u-1][1];const p=ra(n.stops.map(B=>B[0]),i),_=function(B,j,H,X){const te=X-H,de=B-H;return 0===te?0:1===j?de/te:(Math.pow(j,de)-1)/(Math.pow(j,te)-1)}(i,a,n.stops[p][0],n.stops[p+1][0]),w=n.stops[p][1],I=n.stops[p+1][1];let S=Ws[e.type]||fr;if(n.colorSpace&&"rgb"!==n.colorSpace){const B=yl[n.colorSpace];S=(j,H)=>B.reverse(B.interpolate(B.forward(j),B.forward(H),_))}return"function"==typeof w.evaluate?{evaluate(...B){const j=w.evaluate.apply(void 0,B),H=I.evaluate.apply(void 0,B);if(void 0!==j&&void 0!==H)return S(j,H,_)}}:S(w,I,_)}function ho(n,e,i){return"color"===e.type?i=kr.parse(i):"formatted"===e.type?i=xo.fromString(i.toString()):"resolvedImage"===e.type?i=zi.fromString(i.toString()):cn(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),pr(i,n.default,e.default)}class ao{constructor(e,i){var a;this.expression=e,this._warningHistory={},this._evaluator=new ko,this._defaultValue=i?"color"===(a=i).type&&(ri(a.default)||Array.isArray(a.default))?new kr(0,0,0,0):"color"===a.type?kr.parse(a.default)||null:void 0===a.default?null:a.default:null,this._enumValues=i&&"enum"===i.type?i.values:null}evaluateWithoutErrorHandling(e,i,a,u,p,_,w,I){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=_,this._evaluator.featureTileCoord=w||null,this._evaluator.featureDistanceData=I||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,a,u,p,_,w,I){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=_||null,this._evaluator.featureTileCoord=w||null,this._evaluator.featureDistanceData=I||null;try{const S=this.expression.evaluate(this._evaluator);if(null==S||"number"==typeof S&&S!=S)return this._defaultValue;if(this._enumValues&&!(S in this._enumValues))throw new Hr(`Expected value to be one of ${Object.keys(this._enumValues).map(B=>JSON.stringify(B)).join(", ")}, but found ${JSON.stringify(S)} instead.`);return S}catch(S){return this._warningHistory[S.message]||(this._warningHistory[S.message]=!0,typeof console<"u"&&console.warn(S.message)),this._defaultValue}}}function ps(n){return Array.isArray(n)&&n.length>0&&"string"==typeof n[0]&&n[0]in N}function ss(n,e){const i=new Bo(N,[],e?function(u){const p={color:we,string:Ei,number:Xn,enum:Ei,boolean:Si,formatted:an,resolvedImage:Vt};return"array"===u.type?vn(p[u.value]||je,u.length):p[u.type]}(e):void 0),a=i.parse(n,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return a?ne(new ao(a,e)):it(i.errors)}class No{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent="constant"!==e&&!fs(i.expression)}evaluateWithoutErrorHandling(e,i,a,u,p,_){return this._styleExpression.evaluateWithoutErrorHandling(e,i,a,u,p,_)}evaluate(e,i,a,u,p,_){return this._styleExpression.evaluate(e,i,a,u,p,_)}}class fo{constructor(e,i,a,u){this.kind=e,this.zoomStops=a,this._styleExpression=i,this.isStateDependent="camera"!==e&&!fs(i.expression),this.interpolationType=u}evaluateWithoutErrorHandling(e,i,a,u,p,_){return this._styleExpression.evaluateWithoutErrorHandling(e,i,a,u,p,_)}evaluate(e,i,a,u,p,_){return this._styleExpression.evaluate(e,i,a,u,p,_)}interpolationFactor(e,i,a){return this.interpolationType?Ts.interpolationFactor(this.interpolationType,e,i,a):0}}function as(n,e){if("error"===(n=ss(n,e)).result)return n;const i=n.value.expression,a=Ur(i);if(!a&&!Q(e))return it([new Sr("","data expressions not supported")]);const u=Do(i,["zoom","pitch","distance-from-center"]);if(!u&&!He(e))return it([new Sr("","zoom expressions not supported")]);const p=mc(i);return p||u?p instanceof Sr?it([p]):p instanceof Ts&&!At(e)?it([new Sr("",'"interpolate" expressions cannot be used with this property')]):ne(p?new fo(a?"camera":"composite",n.value,p.labels,p instanceof Ts?p.interpolation:void 0):new No(a?"constant":"source",n.value)):it([new Sr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ys{constructor(e,i){this._parameters=e,this._specification=i,Wi(this,Xi(this._parameters,this._specification))}static deserialize(e){return new Ys(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function mc(n){let e=null;if(n instanceof uc)e=mc(n.result);else if(n instanceof ha){for(const i of n.args)if(e=mc(i),e)break}else(n instanceof Ls||n instanceof Ts)&&n.input instanceof bo&&"zoom"===n.input.name&&(e=n);return e instanceof Sr||n.eachChild(i=>{const a=mc(i);a instanceof Sr?e=a:!e&&a?e=new Sr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new Sr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class ai{constructor(e,i,a,u){this.message=(e?`${e}: `:"")+a,u&&(this.identifier=u),null!=i&&i.__line__&&(this.line=i.__line__)}}function Js(n){const e=n.key,i=n.value,a=n.valueSpec||{},u=n.objectElementValidators||{},p=n.style,_=n.styleSpec;let w=[];const I=cn(i);if("object"!==I)return[new ai(e,i,`object expected, ${I} found`)];for(const S in i){const B=S.split(".")[0];let j;u[B]?j=u[B]:a[B]?j=ts:u["*"]?j=u["*"]:a["*"]&&(j=ts),j?w=w.concat(j({key:(e&&`${e}.`)+S,value:i[S],valueSpec:a[B]||a["*"],style:p,styleSpec:_,object:i,objectKey:S},i)):w.push(new ai(e,i[S],`unknown property "${S}"`))}for(const S in a)u[S]||a[S].required&&void 0===a[S].default&&void 0===i[S]&&w.push(new ai(e,i,`missing required property "${S}"`));return w}function Su(n){const e=n.value,i=n.valueSpec,a=n.style,u=n.styleSpec,p=n.key,_=n.arrayElementValidator||ts;if("array"!==cn(e))return[new ai(p,e,`array expected, ${cn(e)} found`)];if(i.length&&e.length!==i.length)return[new ai(p,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.lengthp)return[new ai(e,i,`${i} is greater than the maximum value ${p}`)]}return[]}function Cl(n){const e=n.valueSpec,i=rr(n.value.type);let a,u,p,_={};const w="categorical"!==i&&void 0===n.value.property,I=!w,S="array"===cn(n.value.stops)&&"array"===cn(n.value.stops[0])&&"object"===cn(n.value.stops[0][0]),B=Js({key:n.key,value:n.value,valueSpec:n.styleSpec.function,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:function(X){if("identity"===i)return[new ai(X.key,X.value,'identity function may not have a "stops" property')];let te=[];const de=X.value;return te=te.concat(Su({key:X.key,value:de,valueSpec:X.valueSpec,style:X.style,styleSpec:X.styleSpec,arrayElementValidator:j})),"array"===cn(de)&&0===de.length&&te.push(new ai(X.key,de,"array must have at least one stop")),te},default:function(X){return ts({key:X.key,value:X.value,valueSpec:e,style:X.style,styleSpec:X.styleSpec})}}});return"identity"===i&&w&&B.push(new ai(n.key,n.value,'missing required property "property"')),"identity"===i||n.value.stops||B.push(new ai(n.key,n.value,'missing required property "stops"')),"exponential"===i&&n.valueSpec.expression&&!At(n.valueSpec)&&B.push(new ai(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(I&&!Q(n.valueSpec)?B.push(new ai(n.key,n.value,"property functions not supported")):w&&!He(n.valueSpec)&&B.push(new ai(n.key,n.value,"zoom functions not supported"))),"categorical"!==i&&!S||void 0!==n.value.property||B.push(new ai(n.key,n.value,'"property" property is required')),B;function j(X){let te=[];const de=X.value,ke=X.key;if("array"!==cn(de))return[new ai(ke,de,`array expected, ${cn(de)} found`)];if(2!==de.length)return[new ai(ke,de,`array length 2 expected, length ${de.length} found`)];if(S){if("object"!==cn(de[0]))return[new ai(ke,de,`object expected, ${cn(de[0])} found`)];if(void 0===de[0].zoom)return[new ai(ke,de,"object stop key must have zoom")];if(void 0===de[0].value)return[new ai(ke,de,"object stop key must have value")];const tt=rr(de[0].zoom);if("number"!=typeof tt)return[new ai(ke,de[0].zoom,"stop zoom values must be numbers")];if(p&&p>tt)return[new ai(ke,de[0].zoom,"stop zoom values must appear in ascending order")];tt!==p&&(p=tt,u=void 0,_={}),te=te.concat(Js({key:`${ke}[0]`,value:de[0],valueSpec:{zoom:{}},style:X.style,styleSpec:X.styleSpec,objectElementValidators:{zoom:es,value:H}}))}else te=te.concat(H({key:`${ke}[0]`,value:de[0],valueSpec:{},style:X.style,styleSpec:X.styleSpec},de));return ps(yr(de[1]))?te.concat([new ai(`${ke}[1]`,de[1],"expressions are not allowed in function stops.")]):te.concat(ts({key:`${ke}[1]`,value:de[1],valueSpec:e,style:X.style,styleSpec:X.styleSpec}))}function H(X,te){const de=cn(X.value),ke=rr(X.value),tt=null!==X.value?X.value:te;if(a){if(de!==a)return[new ai(X.key,tt,`${de} stop domain type must match previous stop domain type ${a}`)]}else a=de;if("number"!==de&&"string"!==de&&"boolean"!==de&&"number"!=typeof ke&&"string"!=typeof ke&&"boolean"!=typeof ke)return[new ai(X.key,tt,"stop domain value must be a number, string, or boolean")];if("number"!==de&&"categorical"!==i){let mt=`number expected, ${de} found`;return Q(e)&&void 0===i&&(mt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ai(X.key,tt,mt)]}return"categorical"!==i||"number"!==de||"number"==typeof ke&&isFinite(ke)&&Math.floor(ke)===ke?"categorical"!==i&&"number"===de&&"number"==typeof ke&&"number"==typeof u&&void 0!==u&&kenew ai(`${n.key}${a.key}`,n.value,a.message));const i=e.value.expression||e.value._styleExpression.expression;if("property"===n.expressionContext&&"text-font"===n.propertyKey&&!i.outputDefined())return[new ai(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===n.expressionContext&&"layout"===n.propertyType&&!fs(i))return[new ai(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===n.expressionContext)return Za(i,n);if(n.expressionContext&&0===n.expressionContext.indexOf("cluster")){if(!Do(i,["zoom","feature-state"]))return[new ai(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===n.expressionContext&&!Ur(i))return[new ai(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Za(n,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const u of e.valueSpec.expression.parameters)i.delete(u);if(0===i.size)return[];const a=[];return n instanceof bo&&i.has(n.name)?[new ai(e.key,e.value,`["${n.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(n.eachChild(u=>{a.push(...Za(u,e))}),a)}function $i(n){const e=n.key,i=n.value,a=n.valueSpec,u=[];return Array.isArray(a.values)?-1===a.values.indexOf(rr(i))&&u.push(new ai(e,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(a.values).indexOf(rr(i))&&u.push(new ai(e,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),u}function gc(n){if(!0===n||!1===n)return!0;if(!Array.isArray(n)||0===n.length)return!1;switch(n[0]){case"has":return n.length>=2&&"$id"!==n[1]&&"$type"!==n[1];case"in":return n.length>=3&&("string"!=typeof n[1]||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==n.length||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!gc(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function _c(n,e="fill"){if(null==n)return{filter:()=>!0,needGeometry:!1,needFeature:!1};gc(n)||(n=ol(n));const i=n;let a=!0;try{a=function(S){if(!El(S))return S;let B=yr(S);return Hc(B),B=bd(B),B}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const u=Kt[`filter_${e}`],p=ss(a,u);let _=null;if("error"===p.result)throw new Error(p.value.map(S=>`${S.key}: ${S.message}`).join(", "));_=(S,B,j)=>p.value.evaluate(S,B,{},j);let w=null,I=null;if(a!==i){const S=ss(i,u);if("error"===S.result)throw new Error(S.value.map(B=>`${B.key}: ${B.message}`).join(", "));w=(B,j,H,X,te)=>S.value.evaluate(B,j,{},H,void 0,void 0,X,te),I=!Ur(S.value.expression)}return{filter:_,dynamicFilter:w||void 0,needGeometry:wd(a),needFeature:!!I}}function bd(n){if(!Array.isArray(n))return n;const e=function(i){if(Tl.has(i[0]))for(let a=1;abd(i))}function Hc(n){let e=!1;const i=[];if("case"===n[0]){for(let a=1;a",">=","<","<=","to-boolean"]);function rl(n,e){return ne?1:0}function wd(n){if(!Array.isArray(n))return!1;if("within"===n[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?aa(n[1],n[2],e):"any"===e?(i=n.slice(1),["any"].concat(i.map(ol))):"all"===e?["all"].concat(n.slice(1).map(ol)):"none"===e?["all"].concat(n.slice(1).map(ol).map(jn)):"in"===e?Wc(n[1],n.slice(2)):"!in"===e?jn(Wc(n[1],n.slice(2))):"has"===e?Pu(n[1]):"!has"===e?jn(Pu(n[1])):"within"!==e||n;var i}function aa(n,e,i){switch(n){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,n,e]}}function Wc(n,e){if(0===e.length)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(i=>typeof i!=typeof e[0])?["filter-in-large",n,["literal",e.sort(rl)]]:["filter-in-small",n,["literal",e]]}}function Pu(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function jn(n){return["!",n]}function wr(n){return gc(yr(n.value))?zo(Wi({},n,{expressionContext:"filter",valueSpec:n.styleSpec[`filter_${n.layerType||"fill"}`]})):sl(n)}function sl(n){const e=n.value,i=n.key;if("array"!==cn(e))return[new ai(i,e,`array expected, ${cn(e)} found`)];const a=n.styleSpec;let u,p=[];if(e.length<1)return[new ai(i,e,"filter array must have at least 1 element")];switch(p=p.concat($i({key:`${i}[0]`,value:e[0],valueSpec:a.filter_operator,style:n.style,styleSpec:n.styleSpec})),rr(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===rr(e[1])&&p.push(new ai(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&p.push(new ai(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(u=cn(e[1]),"string"!==u&&p.push(new ai(`${i}[1]`,e[1],`string expected, ${u} found`)));for(let _=2;_{S in i&&e.push(new ai(a,i[S],`"${S}" is prohibited for ref layers`))}),u.layers.forEach(S=>{rr(S.id)===w&&(I=S)}),I?I.ref?e.push(new ai(a,i.ref,"ref cannot reference another ref layer")):_=rr(I.type):"string"==typeof w&&e.push(new ai(a,i.ref,`ref layer "${w}" not found`))}else if("background"!==_&&"sky"!==_)if(i.source){const I=u.sources&&u.sources[i.source],S=I&&rr(I.type);I?"vector"===S&&"raster"===_?e.push(new ai(a,i.source,`layer "${i.id}" requires a raster source`)):"raster"===S&&"raster"!==_?e.push(new ai(a,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==S||i["source-layer"]?"raster-dem"===S&&"hillshade"!==_?e.push(new ai(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==_||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||"geojson"===S&&I.lineMetrics||e.push(new ai(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ai(a,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new ai(a,i.source,`source "${i.source}" not found`))}else e.push(new ai(a,i,'missing required property "source"'));return e=e.concat(Js({key:a,value:i,valueSpec:p.layer,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{"*":()=>[],type:()=>ts({key:`${a}.type`,value:i.type,valueSpec:p.layer.type,style:n.style,styleSpec:n.styleSpec,object:i,objectKey:"type"}),filter:I=>wr(Wi({layerType:_},I)),layout:I=>Js({layer:i,key:I.key,value:I.value,valueSpec:{},style:I.style,styleSpec:I.styleSpec,objectElementValidators:{"*":S=>yc(Wi({layerType:_},S))}}),paint:I=>Js({layer:i,key:I.key,value:I.value,valueSpec:{},style:I.style,styleSpec:I.styleSpec,objectElementValidators:{"*":S=>Uo(Wi({layerType:_},S))}})}})),e}function ms(n){const e=n.value,i=n.key,a=cn(e);return"string"!==a?[new ai(i,e,`string expected, ${a} found`)]:[]}const Hl={promoteId:function({key:n,value:e}){if("string"===cn(e))return ms({key:n,value:e});{const i=[];for(const a in e)i.push(...ms({key:`${n}.${a}`,value:e[a]}));return i}}};function vc(n){const e=n.value,i=n.key,a=n.styleSpec,u=n.style;if(!e.type)return[new ai(i,e,'"type" is required')];const p=rr(e.type);let _;switch(p){case"vector":case"raster":case"raster-dem":return _=Js({key:i,value:e,valueSpec:a[`source_${p.replace("-","_")}`],style:n.style,styleSpec:a,objectElementValidators:Hl}),_;case"geojson":if(_=Js({key:i,value:e,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Hl}),e.cluster)for(const w in e.clusterProperties){const[I,S]=e.clusterProperties[w],B="string"==typeof I?[I,["accumulated"],["get",w]]:I;_.push(...zo({key:`${i}.${w}.map`,value:S,expressionContext:"cluster-map"})),_.push(...zo({key:`${i}.${w}.reduce`,value:B,expressionContext:"cluster-reduce"}))}return _;case"video":return Js({key:i,value:e,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Js({key:i,value:e,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new ai(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return $i({key:`${i}.type`,value:e.type,valueSpec:{values:_h(a)},style:u,styleSpec:a})}}function _h(n){return n.source.reduce((e,i)=>{const a=n[i];return"enum"===a.type.type&&(e=e.concat(Object.keys(a.type.values))),e},[])}function yh(n){const e=n.value,i=n.styleSpec,a=i.light,u=n.style;let p=[];const _=cn(e);if(void 0===e)return p;if("object"!==_)return p=p.concat([new ai("light",e,`object expected, ${_} found`)]),p;for(const w in e){const I=w.match(/^(.*)-transition$/);p=p.concat(I&&a[I[1]]&&a[I[1]].transition?ts({key:w,value:e[w],valueSpec:i.transition,style:u,styleSpec:i}):a[w]?ts({key:w,value:e[w],valueSpec:a[w],style:u,styleSpec:i}):[new ai(w,e[w],`unknown property "${w}"`)])}return p}function qc(n){const e=n.value,i=n.key,a=n.style,u=n.styleSpec,p=u.terrain;let _=[];const w=cn(e);if(void 0===e)return _;if("object"!==w)return _=_.concat([new ai("terrain",e,`object expected, ${w} found`)]),_;for(const I in e){const S=I.match(/^(.*)-transition$/);_=_.concat(S&&p[S[1]]&&p[S[1]].transition?ts({key:I,value:e[I],valueSpec:u.transition,style:a,styleSpec:u}):p[I]?ts({key:I,value:e[I],valueSpec:p[I],style:a,styleSpec:u}):[new ai(I,e[I],`unknown property "${I}"`)])}if(e.source){const I=a.sources&&a.sources[e.source],S=I&&rr(I.type);I?"raster-dem"!==S&&_.push(new ai(i,e.source,`terrain cannot be used with a source of type ${String(S)}, it only be used with a "raster-dem" source type`)):_.push(new ai(i,e.source,`source "${e.source}" not found`))}else _.push(new ai(i,e,'terrain is missing required property "source"'));return _}function gs(n){const e=n.value,i=n.style,a=n.styleSpec,u=a.fog;let p=[];const _=cn(e);if(void 0===e)return p;if("object"!==_)return p=p.concat([new ai("fog",e,`object expected, ${_} found`)]),p;for(const w in e){const I=w.match(/^(.*)-transition$/);p=p.concat(I&&u[I[1]]&&u[I[1]].transition?ts({key:w,value:e[w],valueSpec:a.transition,style:i,styleSpec:a}):u[w]?ts({key:w,value:e[w],valueSpec:u[w],style:i,styleSpec:a}):[new ai(w,e[w],`unknown property "${w}"`)])}return p}const Da={"*":()=>[],array:Su,boolean:function(n){const e=n.value,i=n.key,a=cn(e);return"boolean"!==a?[new ai(i,e,`boolean expected, ${a} found`)]:[]},number:es,color:function(n){const e=n.key,i=n.value,a=cn(i);return"string"!==a?[new ai(e,i,`color expected, ${a} found`)]:null===Ni(i)?[new ai(e,i,`color expected, "${i}" found`)]:[]},enum:$i,filter:wr,function:Cl,layer:Dl,object:Js,source:vc,light:yh,terrain:qc,fog:gs,string:ms,formatted:function(n){return 0===ms(n).length?[]:zo(n)},resolvedImage:function(n){return 0===ms(n).length?[]:zo(n)},projection:function(n){const e=n.value,i=n.styleSpec,a=i.projection,u=n.style;let p=[];const _=cn(e);if("object"===_)for(const w in e)p=p.concat(ts({key:w,value:e[w],valueSpec:a[w],style:u,styleSpec:i}));else"string"!==_&&(p=p.concat([new ai("projection",e,`object or string expected, ${_} found`)]));return p}};function ts(n){const e=n.value,i=n.valueSpec,a=n.styleSpec;return i.expression&&ri(rr(e))?Cl(n):i.expression&&ps(yr(e))?zo(n):i.type&&Da[i.type]?Da[i.type](n):Js(Wi({},n,{valueSpec:i.type?a[i.type]:i}))}function Il(n){const e=n.value,i=n.key,a=ms(n);return a.length||(-1===e.indexOf("{fontstack}")&&a.push(new ai(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new ai(i,e,'"glyphs" url must include a "{range}" token'))),a}function pa(n,e=Kt){return Ks(ts({key:"",value:n,valueSpec:e.$root,styleSpec:e,style:n,objectElementValidators:{glyphs:Il,"*":()=>[]}}))}const Cd=n=>Ks(Uo(n)),Ou=n=>Ks(yc(n));function Ks(n){return n.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function Ru(n,e){let i=!1;if(e&&e.length)for(const a of e)n.fire(new qi(new Error(a.message))),i=!0;return i}var Yc=Xs,js=3;function Xs(n,e,i){var a=this.cells=[];if(n instanceof ArrayBuffer){this.arrayBuffer=n;var u=new Int32Array(this.arrayBuffer);n=u[0],this.d=(e=u[1])+2*(i=u[2]);for(var p=0;p=B[X+0]&&a>=B[X+1])?(_[H]=!0,p.push(S[H])):_[H]=!1}}},Xs.prototype._forEachCell=function(n,e,i,a,u,p,_,w){for(var I=this._convertToCellCoord(n),S=this._convertToCellCoord(e),B=this._convertToCellCoord(i),j=this._convertToCellCoord(a),H=I;H<=B;H++)for(var X=S;X<=j;X++){var te=this.d*X+H;if((!w||w(this._convertFromCellCoord(H),this._convertFromCellCoord(X),this._convertFromCellCoord(H+1),this._convertFromCellCoord(X+1)))&&u.call(this,n,e,i,a,te,p,_,w))return}},Xs.prototype._convertFromCellCoord=function(n){return(n-this.padding)/this.scale},Xs.prototype._convertToCellCoord=function(n){return Math.max(0,Math.min(this.d-1,Math.floor(n*this.scale)+this.padding))},Xs.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var n=this.cells,e=js+this.cells.length+1+1,i=0,a=0;a=0||(u[p]=Ml(n[p],e)));n instanceof Error&&(u.message=n.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==a&&(u.$name=a),u}throw new Error("can't serialize object of type "+typeof n)}function al(n){if(null==n||"boolean"==typeof n||"number"==typeof n||"string"==typeof n||n instanceof Boolean||n instanceof Number||n instanceof String||n instanceof Date||n instanceof RegExp||xc(n)||Kc(n)||ArrayBuffer.isView(n)||n instanceof J.ImageData)return n;if(Array.isArray(n))return n.map(al);if("object"==typeof n){const e=n.$name||"Object",{klass:i}=Jc[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(n);const a=Object.create(i.prototype);for(const u of Object.keys(n))"$name"!==u&&(a[u]=al(n[u]));return a}throw new Error("can't deserialize object of type "+typeof n)}const R={"Latin-1 Supplement":n=>n>=128&&n<=255,Arabic:n=>n>=1536&&n<=1791,"Arabic Supplement":n=>n>=1872&&n<=1919,"Arabic Extended-A":n=>n>=2208&&n<=2303,"Hangul Jamo":n=>n>=4352&&n<=4607,"Unified Canadian Aboriginal Syllabics":n=>n>=5120&&n<=5759,Khmer:n=>n>=6016&&n<=6143,"Unified Canadian Aboriginal Syllabics Extended":n=>n>=6320&&n<=6399,"General Punctuation":n=>n>=8192&&n<=8303,"Letterlike Symbols":n=>n>=8448&&n<=8527,"Number Forms":n=>n>=8528&&n<=8591,"Miscellaneous Technical":n=>n>=8960&&n<=9215,"Control Pictures":n=>n>=9216&&n<=9279,"Optical Character Recognition":n=>n>=9280&&n<=9311,"Enclosed Alphanumerics":n=>n>=9312&&n<=9471,"Geometric Shapes":n=>n>=9632&&n<=9727,"Miscellaneous Symbols":n=>n>=9728&&n<=9983,"Miscellaneous Symbols and Arrows":n=>n>=11008&&n<=11263,"CJK Radicals Supplement":n=>n>=11904&&n<=12031,"Kangxi Radicals":n=>n>=12032&&n<=12255,"Ideographic Description Characters":n=>n>=12272&&n<=12287,"CJK Symbols and Punctuation":n=>n>=12288&&n<=12351,Hiragana:n=>n>=12352&&n<=12447,Katakana:n=>n>=12448&&n<=12543,Bopomofo:n=>n>=12544&&n<=12591,"Hangul Compatibility Jamo":n=>n>=12592&&n<=12687,Kanbun:n=>n>=12688&&n<=12703,"Bopomofo Extended":n=>n>=12704&&n<=12735,"CJK Strokes":n=>n>=12736&&n<=12783,"Katakana Phonetic Extensions":n=>n>=12784&&n<=12799,"Enclosed CJK Letters and Months":n=>n>=12800&&n<=13055,"CJK Compatibility":n=>n>=13056&&n<=13311,"CJK Unified Ideographs Extension A":n=>n>=13312&&n<=19903,"Yijing Hexagram Symbols":n=>n>=19904&&n<=19967,"CJK Unified Ideographs":n=>n>=19968&&n<=40959,"Yi Syllables":n=>n>=40960&&n<=42127,"Yi Radicals":n=>n>=42128&&n<=42191,"Hangul Jamo Extended-A":n=>n>=43360&&n<=43391,"Hangul Syllables":n=>n>=44032&&n<=55215,"Hangul Jamo Extended-B":n=>n>=55216&&n<=55295,"Private Use Area":n=>n>=57344&&n<=63743,"CJK Compatibility Ideographs":n=>n>=63744&&n<=64255,"Arabic Presentation Forms-A":n=>n>=64336&&n<=65023,"Vertical Forms":n=>n>=65040&&n<=65055,"CJK Compatibility Forms":n=>n>=65072&&n<=65103,"Small Form Variants":n=>n>=65104&&n<=65135,"Arabic Presentation Forms-B":n=>n>=65136&&n<=65279,"Halfwidth and Fullwidth Forms":n=>n>=65280&&n<=65519};function U(n){for(const e of n)if(K(e.charCodeAt(0)))return!0;return!1}function $(n){for(const e of n)if(!z(e.charCodeAt(0)))return!1;return!0}function z(n){return!(R.Arabic(n)||R["Arabic Supplement"](n)||R["Arabic Extended-A"](n)||R["Arabic Presentation Forms-A"](n)||R["Arabic Presentation Forms-B"](n))}function K(n){return!(746!==n&&747!==n&&(n<4352||!(R["Bopomofo Extended"](n)||R.Bopomofo(n)||R["CJK Compatibility Forms"](n)&&!(n>=65097&&n<=65103)||R["CJK Compatibility Ideographs"](n)||R["CJK Compatibility"](n)||R["CJK Radicals Supplement"](n)||R["CJK Strokes"](n)||!(!R["CJK Symbols and Punctuation"](n)||n>=12296&&n<=12305||n>=12308&&n<=12319||12336===n)||R["CJK Unified Ideographs Extension A"](n)||R["CJK Unified Ideographs"](n)||R["Enclosed CJK Letters and Months"](n)||R["Hangul Compatibility Jamo"](n)||R["Hangul Jamo Extended-A"](n)||R["Hangul Jamo Extended-B"](n)||R["Hangul Jamo"](n)||R["Hangul Syllables"](n)||R.Hiragana(n)||R["Ideographic Description Characters"](n)||R.Kanbun(n)||R["Kangxi Radicals"](n)||R["Katakana Phonetic Extensions"](n)||R.Katakana(n)&&12540!==n||!(!R["Halfwidth and Fullwidth Forms"](n)||65288===n||65289===n||65293===n||n>=65306&&n<=65310||65339===n||65341===n||65343===n||n>=65371&&n<=65503||65507===n||n>=65512&&n<=65519)||!(!R["Small Form Variants"](n)||n>=65112&&n<=65118||n>=65123&&n<=65126)||R["Unified Canadian Aboriginal Syllabics"](n)||R["Unified Canadian Aboriginal Syllabics Extended"](n)||R["Vertical Forms"](n)||R["Yijing Hexagram Symbols"](n)||R["Yi Syllables"](n)||R["Yi Radicals"](n))))}function Me(n){return!(K(n)||(e=n,R["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||R["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||R["Letterlike Symbols"](e)||R["Number Forms"](e)||R["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||R["Control Pictures"](e)&&9251!==e||R["Optical Character Recognition"](e)||R["Enclosed Alphanumerics"](e)||R["Geometric Shapes"](e)||R["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||R["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||R["CJK Symbols and Punctuation"](e)||R.Katakana(e)||R["Private Use Area"](e)||R["CJK Compatibility Forms"](e)||R["Small Form Variants"](e)||R["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}function Ge(n){return n>=1424&&n<=2303||R["Arabic Presentation Forms-A"](n)||R["Arabic Presentation Forms-B"](n)}function en(n,e){return!(!e&&Ge(n)||n>=2304&&n<=3583||n>=3840&&n<=4255||R.Khmer(n))}function $n(n){for(const e of n)if(Ge(e.charCodeAt(0)))return!0;return!1}const xn="deferred",Oi="loading",ar="loaded";let po=null,f="unavailable",r=null;const c=function(n){n&&"string"==typeof n&&n.indexOf("NetworkError")>-1&&(f="error"),po&&po(n)};function m(){b.fire(new Ar("pluginStateChange",{pluginStatus:f,pluginURL:r}))}const b=new Bi,T=function(){return f},O=function(){if(f!==xn||!r)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");f=Oi,m(),r&&_n({url:r},n=>{n?c(n):(f=ar,m())})},L={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>f===ar||null!=L.applyArabicShaping,isLoading:()=>f===Oi,setState(n){f=n.pluginStatus,r=n.pluginURL},isParsed:()=>null!=L.applyArabicShaping&&null!=L.processBidirectionalText&&null!=L.processStyledBidirectionalText,getPluginURL:()=>r};class Z{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,a){for(const u of i)if(!en(u.charCodeAt(0),a))return!1;return!0}(e,L.isLoaded())}}class q{constructor(e,i){this.property=e,this.value=i,this.expression=function(a,u){if(ri(a))return new Ys(a,u);if(ps(a)){const p=as(a,u);if("error"===p.result)throw new Error(p.value.map(_=>`${_.key}: ${_.message}`).join(", "));return p.value}{let p=a;return"string"==typeof a&&"color"===u.type&&(p=kr.parse(a)),{kind:"constant",evaluate:()=>p}}}(void 0===i?e.specification.default:i,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,i,a){return this.property.possiblyEvaluate(this,e,i,a)}}class W{constructor(e){this.property=e,this.value=new q(e,void 0)}transitioned(e,i){return new Oe(this.property,this.value,i,Te({},e.transition,this.transition),e.now)}untransitioned(){return new Oe(this.property,this.value,null,{},0)}}class se{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Jt(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new W(this._values[e].property)),this._values[e].value=new q(this._values[e].property,null===i?void 0:Jt(i))}getTransition(e){return Jt(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new W(this._values[e].property)),this._values[e].transition=Jt(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const a=this.getValue(i);void 0!==a&&(e[i]=a);const u=this.getTransition(i);void 0!==u&&(e[`${i}-transition`]=u)}return e}transitioned(e,i){const a=new $e(this._properties);for(const u of Object.keys(this._values))a._values[u]=this._values[u].transitioned(e,i._values[u]);return a}untransitioned(){const e=new $e(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class Oe{constructor(e,i,a,u,p){const _=u.delay||0,w=u.duration||0;p=p||0,this.property=e,this.value=i,this.begin=p+_,this.end=this.begin+w,e.specification.transition&&(u.delay||u.duration)&&(this.prior=a)}possiblyEvaluate(e,i,a){const u=e.now||0,p=this.value.possiblyEvaluate(e,i,a),_=this.prior;if(_){if(u>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(uthis.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function zt(n,e=1){let i=0,a=0;return{members:n.map(u=>{const p=Mt[u.type].BYTES_PER_ELEMENT,_=i=dn(i,Math.max(e,p)),w=u.components||1;return a=Math.max(a,p),i+=p*w,{name:u.name,type:u.type,components:w,offset:_}}),size:dn(i,Math.max(a,e)),alignment:e}}function dn(n,e){return Math.ceil(n/e)*e}class Vn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){const u=2*e;return this.int16[u+0]=i,this.int16[u+1]=a,e}}Vn.prototype.bytesPerElement=4,ui(Vn,"StructArrayLayout2i4");class on extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,a)}emplace(e,i,a,u){const p=3*e;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=u,e}}on.prototype.bytesPerElement=6,ui(on,"StructArrayLayout3i6");class Rn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=4*e;return this.int16[_+0]=i,this.int16[_+1]=a,this.int16[_+2]=u,this.int16[_+3]=p,e}}Rn.prototype.bytesPerElement=8,ui(Rn,"StructArrayLayout4i8");class un extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w){const I=this.length;return this.resize(I+1),this.emplace(I,e,i,a,u,p,_,w)}emplace(e,i,a,u,p,_,w,I){const S=6*e,B=12*e,j=3*e;return this.int16[S+0]=i,this.int16[S+1]=a,this.uint8[B+4]=u,this.uint8[B+5]=p,this.uint8[B+6]=_,this.uint8[B+7]=w,this.float32[j+2]=I,e}}un.prototype.bytesPerElement=12,ui(un,"StructArrayLayout2i4ub1f12");class Zn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=4*e;return this.float32[_+0]=i,this.float32[_+1]=a,this.float32[_+2]=u,this.float32[_+3]=p,e}}Zn.prototype.bytesPerElement=16,ui(Zn,"StructArrayLayout4f16");class sn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p){const _=this.length;return this.resize(_+1),this.emplace(_,e,i,a,u,p)}emplace(e,i,a,u,p,_){const w=6*e,I=3*e;return this.uint16[w+0]=i,this.uint16[w+1]=a,this.uint16[w+2]=u,this.uint16[w+3]=p,this.float32[I+2]=_,e}}sn.prototype.bytesPerElement=12,ui(sn,"StructArrayLayout4ui1f12");class An extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=4*e;return this.uint16[_+0]=i,this.uint16[_+1]=a,this.uint16[_+2]=u,this.uint16[_+3]=p,e}}An.prototype.bytesPerElement=8,ui(An,"StructArrayLayout4ui8");class Gn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_){const w=this.length;return this.resize(w+1),this.emplace(w,e,i,a,u,p,_)}emplace(e,i,a,u,p,_,w){const I=6*e;return this.int16[I+0]=i,this.int16[I+1]=a,this.int16[I+2]=u,this.int16[I+3]=p,this.int16[I+4]=_,this.int16[I+5]=w,e}}Gn.prototype.bytesPerElement=12,ui(Gn,"StructArrayLayout6i12");class Ln extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H){const X=this.length;return this.resize(X+1),this.emplace(X,e,i,a,u,p,_,w,I,S,B,j,H)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X){const te=12*e;return this.int16[te+0]=i,this.int16[te+1]=a,this.int16[te+2]=u,this.int16[te+3]=p,this.uint16[te+4]=_,this.uint16[te+5]=w,this.uint16[te+6]=I,this.uint16[te+7]=S,this.int16[te+8]=B,this.int16[te+9]=j,this.int16[te+10]=H,this.int16[te+11]=X,e}}Ln.prototype.bytesPerElement=24,ui(Ln,"StructArrayLayout4i4ui4i24");class Wn extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_){const w=this.length;return this.resize(w+1),this.emplace(w,e,i,a,u,p,_)}emplace(e,i,a,u,p,_,w){const I=10*e,S=5*e;return this.int16[I+0]=i,this.int16[I+1]=a,this.int16[I+2]=u,this.float32[S+2]=p,this.float32[S+3]=_,this.float32[S+4]=w,e}}Wn.prototype.bytesPerElement=20,ui(Wn,"StructArrayLayout3i3f20");class Di extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Di.prototype.bytesPerElement=4,ui(Di,"StructArrayLayout1ul4");class Gi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H,X){const te=this.length;return this.resize(te+1),this.emplace(te,e,i,a,u,p,_,w,I,S,B,j,H,X)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X,te){const de=20*e,ke=10*e;return this.int16[de+0]=i,this.int16[de+1]=a,this.int16[de+2]=u,this.int16[de+3]=p,this.int16[de+4]=_,this.float32[ke+3]=w,this.float32[ke+4]=I,this.float32[ke+5]=S,this.float32[ke+6]=B,this.int16[de+14]=j,this.uint32[ke+8]=H,this.uint16[de+18]=X,this.uint16[de+19]=te,e}}Gi.prototype.bytesPerElement=40,ui(Gi,"StructArrayLayout5i4f1i1ul2ui40");class hi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w){const I=this.length;return this.resize(I+1),this.emplace(I,e,i,a,u,p,_,w)}emplace(e,i,a,u,p,_,w,I){const S=8*e;return this.int16[S+0]=i,this.int16[S+1]=a,this.int16[S+2]=u,this.int16[S+4]=p,this.int16[S+5]=_,this.int16[S+6]=w,this.int16[S+7]=I,e}}hi.prototype.bytesPerElement=16,ui(hi,"StructArrayLayout3i2i2i16");class Pi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p){const _=this.length;return this.resize(_+1),this.emplace(_,e,i,a,u,p)}emplace(e,i,a,u,p,_){const w=4*e,I=8*e;return this.float32[w+0]=i,this.float32[w+1]=a,this.float32[w+2]=u,this.int16[I+6]=p,this.int16[I+7]=_,e}}Pi.prototype.bytesPerElement=16,ui(Pi,"StructArrayLayout2f1f2i16");class ur extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=12*e,w=3*e;return this.uint8[_+0]=i,this.uint8[_+1]=a,this.float32[w+1]=u,this.float32[w+2]=p,e}}ur.prototype.bytesPerElement=12,ui(ur,"StructArrayLayout2ub2f12");class dr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,a)}emplace(e,i,a,u){const p=3*e;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=u,e}}dr.prototype.bytesPerElement=12,ui(dr,"StructArrayLayout3f12");class xi extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,a)}emplace(e,i,a,u){const p=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=a,this.uint16[p+2]=u,e}}xi.prototype.bytesPerElement=6,ui(xi,"StructArrayLayout3ui6");class Cr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt){const bt=this.length;return this.resize(bt+1),this.emplace(bt,e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt){const tn=30*e,nn=15*e,Tn=60*e;return this.int16[tn+0]=i,this.int16[tn+1]=a,this.int16[tn+2]=u,this.float32[nn+2]=p,this.float32[nn+3]=_,this.uint16[tn+8]=w,this.uint16[tn+9]=I,this.uint32[nn+5]=S,this.uint32[nn+6]=B,this.uint32[nn+7]=j,this.uint16[tn+16]=H,this.uint16[tn+17]=X,this.uint16[tn+18]=te,this.float32[nn+10]=de,this.float32[nn+11]=ke,this.uint8[Tn+48]=tt,this.uint8[Tn+49]=mt,this.uint8[Tn+50]=Qe,this.uint32[nn+13]=ut,this.int16[tn+28]=xt,this.uint8[Tn+58]=bt,e}}Cr.prototype.bytesPerElement=60,ui(Cr,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Kr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,Bn){const Hn=this.length;return this.resize(Hn+1),this.emplace(Hn,e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,Bn)}emplace(e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke,tt,mt,Qe,ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,Bn,Hn){const wn=38*e,si=19*e;return this.int16[wn+0]=i,this.int16[wn+1]=a,this.int16[wn+2]=u,this.float32[si+2]=p,this.float32[si+3]=_,this.int16[wn+8]=w,this.int16[wn+9]=I,this.int16[wn+10]=S,this.int16[wn+11]=B,this.int16[wn+12]=j,this.int16[wn+13]=H,this.uint16[wn+14]=X,this.uint16[wn+15]=te,this.uint16[wn+16]=de,this.uint16[wn+17]=ke,this.uint16[wn+18]=tt,this.uint16[wn+19]=mt,this.uint16[wn+20]=Qe,this.uint16[wn+21]=ut,this.uint16[wn+22]=xt,this.uint16[wn+23]=bt,this.uint16[wn+24]=tn,this.uint16[wn+25]=nn,this.uint16[wn+26]=Tn,this.uint16[wn+27]=Un,this.uint16[wn+28]=fn,this.uint32[si+15]=Pn,this.float32[si+16]=On,this.float32[si+17]=Bn,this.float32[si+18]=Hn,e}}Kr.prototype.bytesPerElement=76,ui(Kr,"StructArrayLayout3i2f6i15ui1ul3f76");class Wr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Wr.prototype.bytesPerElement=4,ui(Wr,"StructArrayLayout1f4");class qr extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,u,p){const _=this.length;return this.resize(_+1),this.emplace(_,e,i,a,u,p)}emplace(e,i,a,u,p,_){const w=5*e;return this.float32[w+0]=i,this.float32[w+1]=a,this.float32[w+2]=u,this.float32[w+3]=p,this.float32[w+4]=_,e}}qr.prototype.bytesPerElement=20,ui(qr,"StructArrayLayout5f20");class ns extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,a,u)}emplace(e,i,a,u,p){const _=6*e;return this.uint32[3*e+0]=i,this.uint16[_+2]=a,this.uint16[_+3]=u,this.uint16[_+4]=p,e}}ns.prototype.bytesPerElement=12,ui(ns,"StructArrayLayout1ul3ui12");class _s extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){const u=2*e;return this.uint16[u+0]=i,this.uint16[u+1]=a,e}}_s.prototype.bytesPerElement=4,ui(_s,"StructArrayLayout2ui4");class vo extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}vo.prototype.bytesPerElement=2,ui(vo,"StructArrayLayout1ui2");class ja extends $t{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){const u=2*e;return this.float32[u+0]=i,this.float32[u+1]=a,e}}ja.prototype.bytesPerElement=8,ui(ja,"StructArrayLayout2f8");class mo extends Dt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}mo.prototype.size=40;class jr extends Gi{get(e){return new mo(this,e)}}ui(jr,"CollisionBoxArray");class Lr extends Dt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Lr.prototype.size=60;class Zo extends Cr{get(e){return new Lr(this,e)}}ui(Zo,"PlacedSymbolArray");class Ds extends Dt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ds.prototype.size=76;class Vr extends Kr{get(e){return new Ds(this,e)}}ui(Vr,"SymbolInstanceArray");class ls extends Wr{getoffsetX(e){return this.float32[1*e+0]}}ui(ls,"GlyphOffsetArray");class ll extends Vn{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}ui(ll,"SymbolLineVertexArray");class Al extends Dt{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Al.prototype.size=12;class Wl extends ns{get(e){return new Al(this,e)}}ui(Wl,"FeatureIndexArray");class Qs extends _s{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}ui(Qs,"FillExtrusionCentroidArray");const ql=zt([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Yl=zt([{name:"a_dash",components:4,type:"Uint16"}]);var Ed={exports:{}},h_=function(n,e){var i,a,u,p,_,w,I,S;for(a=n.length-(i=3&n.length),u=e,_=3432918353,w=461845907,S=0;S>>16)*_&65535)<<16)&4294967295)<<15|I>>>17))*w+(((I>>>16)*w&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(I=0,i){case 3:I^=(255&n.charCodeAt(S+2))<<16;case 2:I^=(255&n.charCodeAt(S+1))<<8;case 1:u^=I=(65535&(I=(I=(65535&(I^=255&n.charCodeAt(S)))*_+(((I>>>16)*_&65535)<<16)&4294967295)<<15|I>>>17))*w+(((I>>>16)*w&65535)<<16)&4294967295}return u^=n.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0},wv=function(n,e){for(var i,a=n.length,u=e^a,p=0;a>=4;)i=1540483477*(65535&(i=255&n.charCodeAt(p)|(255&n.charCodeAt(++p))<<8|(255&n.charCodeAt(++p))<<16|(255&n.charCodeAt(++p))<<24))+((1540483477*(i>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:u^=(255&n.charCodeAt(p+2))<<16;case 2:u^=(255&n.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&n.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};Ed.exports=h_,Ed.exports.murmur3=h_,Ed.exports.murmur2=wv;var bc=Be(Ed.exports);class xh{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,a,u){this.ids.push(sm(e)),this.positions.push(i,a,u)}getPositions(e){const i=sm(e);let a=0,u=this.ids.length-1;for(;a>1;this.ids[_]>=i?u=_:a=_+1}const p=[];for(;this.ids[a]===i;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(e,i){const a=new Float64Array(e.ids),u=new Uint32Array(e.positions);return cs(a,u,0,a.length-1),i&&i.push(a.buffer,u.buffer),{ids:a,positions:u}}static deserialize(e){const i=new xh;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function sm(n){const e=+n;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:bc(String(n))}function cs(n,e,i,a){for(;i>1];let p=i-1,_=a+1;for(;;){do{p++}while(n[p]u);if(p>=_)break;bh(n,p,_),bh(e,3*p,3*_),bh(e,3*p+1,3*_+1),bh(e,3*p+2,3*_+2)}_-i`u_${u}`),this.type=a}setUniform(e,i,a,u,p){i.set(e,p,u.constantOr(this.value))}getBinding(e,i){return"color"===this.type?new Xc(e):new wh(e)}}class ku{constructor(e,i){this.uniformNames=i.map(a=>`u_${a}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,a,u,p){const _="u_pattern"===p||"u_dash"===p?this.pattern:"u_pixel_ratio"===p?this.pixelRatio:null;_&&i.set(e,p,_)}getBinding(e,i){return"u_pattern"===i||"u_dash"===i?new Aa(e):new wh(e)}}class wc{constructor(e,i,a,u){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:"color"===a?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,a,u,p,_){const w=this.paintVertexArray.length,I=this.expression.evaluate(new Z(0),i,{},p,u,_);this.paintVertexArray.resize(e),this._setPaintValue(w,e,I)}updatePaintArray(e,i,a,u,p){const _=this.expression.evaluate({zoom:0},a,u,void 0,p);this._setPaintValue(e,i,_)}_setPaintValue(e,i,a){if("color"===this.type){const u=Mf(a);for(let p=e;p`u_${w}_t`),this.type=a,this.useIntegerZoom=u,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map(w=>({name:`a_${w}`,type:"Float32",components:"color"===a?4:2,offset:0})),this.paintVertexArray=new _}populatePaintArray(e,i,a,u,p,_){const w=this.expression.evaluate(new Z(this.zoom),i,{},p,u,_),I=this.expression.evaluate(new Z(this.zoom+1),i,{},p,u,_),S=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(S,e,w,I)}updatePaintArray(e,i,a,u,p){const _=this.expression.evaluate({zoom:this.zoom},a,u,void 0,p),w=this.expression.evaluate({zoom:this.zoom+1},a,u,void 0,p);this._setPaintValue(e,i,_,w)}_setPaintValue(e,i,a,u){if("color"===this.type){const p=Mf(a),_=Mf(u);for(let w=e;w!0)){this.binders={},this._buffers=[];const u=[];for(const p in e.paint._values){if(!a(p))continue;const _=e.paint.get(p);if(!(_ instanceof qe&&Q(_.property.specification)))continue;const w=f_(p,e.type),I=_.value,S=_.property.specification.type,B=!!_.property.useIntegerZoom,j="line-dasharray"===p||p.endsWith("pattern"),H="line-dasharray"===p&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==I.kind||H)if("source"===I.kind||H||j){const X=cm(p,S,"source");this.binders[p]=j?new Sl(I,w,S,X,e.id):new wc(I,w,S,X),u.push(`/a_${p}`)}else{const X=cm(p,S,"composite");this.binders[p]=new Wo(I,w,S,B,i,X),u.push(`/z_${p}`)}else this.binders[p]=j?new ku(I.value,w):new Eh(I.value,w,S),u.push(`/u_${p}`)}this.cacheKey=u.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof wc||i instanceof Wo?i.maxValue:0}populatePaintArrays(e,i,a,u,p,_){for(const w in this.binders){const I=this.binders[w];(I instanceof wc||I instanceof Wo||I instanceof Sl)&&I.populatePaintArray(e,i,a,u,p,_)}}setConstantPatternPositions(e){for(const i in this.binders){const a=this.binders[i];a instanceof ku&&a.setConstantPatternPositions(e)}}updatePaintArrays(e,i,a,u,p,_){let w=!1;for(const I in e){const S=i.getPositions(I);for(const B of S){const j=a.feature(B.index);for(const H in this.binders){const X=this.binders[H];if((X instanceof wc||X instanceof Wo||X instanceof Sl)&&!0===X.expression.isStateDependent){const te=u.paint.get(H);X.expression=te.value,X.updatePaintArray(B.start,B.end,j,e[I],p,_),w=!0}}}}return w}defines(){const e=[];for(const i in this.binders){const a=this.binders[i];(a instanceof Eh||a instanceof ku)&&e.push(...a.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof wc||a instanceof Wo||a instanceof Sl)for(let u=0;u!0)){this.programConfigurations={};for(const u of e)this.programConfigurations[u.id]=new Sa(u,i,a);this.needsUpload=!1,this._featureMap=new xh,this._bufferOffset=0}populatePaintArrays(e,i,a,u,p,_,w){for(const I in this.programConfigurations)this.programConfigurations[I].populatePaintArrays(e,i,u,p,_,w);void 0!==i.id&&this._featureMap.add(i.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,a,u,p){for(const _ of a)this.needsUpload=this.programConfigurations[_.id].updatePaintArrays(e,this._featureMap,i,_,u,p)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const lm={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function f_(n,e){return lm[n]||[n.replace(`${e}-`,"").replace(/-/g,"_")]}const p_={"line-pattern":{source:sn,composite:sn},"fill-pattern":{source:sn,composite:sn},"fill-extrusion-pattern":{source:sn,composite:sn},"line-dasharray":{source:An,composite:An}},m_={color:{source:ja,composite:Zn},number:{source:Wr,composite:ja}};function cm(n,e,i){const a=p_[n];return a&&a[i]||m_[e][i]}ui(Eh,"ConstantBinder"),ui(ku,"PatternConstantBinder"),ui(wc,"SourceExpressionBinder"),ui(Sl,"PatternCompositeBinder"),ui(Wo,"CompositeExpressionBinder"),ui(Sa,"ProgramConfiguration",{omit:["_buffers"]}),ui(Fu,"ProgramConfigurationSet");const um="-transition";class cl extends Bi{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new We(i.layout)),i.paint)){this._transitionablePaint=new se(i.paint);for(const a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(const a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ke(i.paint)}}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,a={}){null!=i&&this._validate(Ou,`layers.${this.id}.layout.${e}`,e,i,a)||("visibility"!==e?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return Qt(e,um)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,a={}){if(null!=i&&this._validate(Cd,`layers.${this.id}.paint.${e}`,e,i,a))return!1;if(Qt(e,um))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const u=this._transitionablePaint._values[e],p=u.value.isDataDriven(),_=u.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const w=this._transitionablePaint._values[e].value,I=w.isDataDriven(),S=Qt(e,"pattern")||"line-dasharray"===e;return I||p||S||this._handleOverridablePaintPropertyUpdate(e,_,w)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,a){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Zt(e,(i,a)=>!(void 0===i||"layout"===a&&!Object.keys(i).length||"paint"===a&&!Object.keys(i).length))}_validate(e,i,a,u,p={}){return(!p||!1!==p.validate)&&Ru(this,e.call(pa,{key:i,layerType:this.type,objectKey:a,value:u,styleSpec:Kt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof qe&&Q(i.property.specification)&&("source"===i.value.kind||"composite"===i.value.kind)&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=_c(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const Af=zt([{name:"a_pos",components:2,type:"Int16"}],4),Th=zt([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qo{constructor(e=[]){this.segments=e}prepareSegment(e,i,a,u){let p=this.segments[this.segments.length-1];return e>qo.MAX_VERTEX_ARRAY_LENGTH&&dt(`Max vertices per segment is ${qo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!p||p.vertexLength+e>qo.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==u)&&(p={vertexOffset:i.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},void 0!==u&&(p.sortKey=u),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,a,u){return new qo([{vertexOffset:e,primitiveOffset:i,vertexLength:a,primitiveLength:u,vaos:{},sortKey:0}])}}qo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ui(qo,"SegmentVector");var Ii=8192;class Cc{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof $r?new $r(e.lng,e.lat):$r.convert(e),this}setSouthWest(e){return this._sw=e instanceof $r?new $r(e.lng,e.lat):$r.convert(e),this}extend(e){const i=this._sw,a=this._ne;let u,p;if(e instanceof $r)u=e,p=e;else{if(!(e instanceof Cc))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Cc.convert(e)):this.extend($r.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend($r.convert(e)):this;if(u=e._sw,p=e._ne,!u||!p)return this}return i||a?(i.lng=Math.min(u.lng,i.lng),i.lat=Math.min(u.lat,i.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new $r(u.lng,u.lat),this._ne=new $r(p.lng,p.lat)),this}getCenter(){return new $r((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new $r(this.getWest(),this.getNorth())}getSouthEast(){return new $r(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:i,lat:a}=$r.convert(e);let u=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u}static convert(e){return!e||e instanceof Cc?e:new Cc(e)}}var Qc=1e-6,ma=typeof Float32Array<"u"?Float32Array:Array;function Sf(){var n=new ma(9);return ma!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function Dh(n,e,i){var a=e[0],u=e[1],p=e[2],_=e[3],w=e[4],I=e[5],S=e[6],B=e[7],j=e[8],H=i[0],X=i[1],te=i[2],de=i[3],ke=i[4],tt=i[5],mt=i[6],Qe=i[7],ut=i[8];return n[0]=H*a+X*_+te*S,n[1]=H*u+X*w+te*B,n[2]=H*p+X*I+te*j,n[3]=de*a+ke*_+tt*S,n[4]=de*u+ke*w+tt*B,n[5]=de*p+ke*I+tt*j,n[6]=mt*a+Qe*_+ut*S,n[7]=mt*u+Qe*w+ut*B,n[8]=mt*p+Qe*I+ut*j,n}function ga(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Ih(n,e){var i=e[0],a=e[1],u=e[2],p=e[3],_=e[4],w=e[5],I=e[6],S=e[7],B=e[8],j=e[9],H=e[10],X=e[11],te=e[12],de=e[13],ke=e[14],tt=e[15],mt=i*w-a*_,Qe=i*I-u*_,ut=i*S-p*_,xt=a*I-u*w,bt=a*S-p*w,tn=u*S-p*I,nn=B*de-j*te,Tn=B*ke-H*te,Un=B*tt-X*te,fn=j*ke-H*de,Pn=j*tt-X*de,On=H*tt-X*ke,Bn=mt*On-Qe*Pn+ut*fn+xt*Un-bt*Tn+tn*nn;return Bn?(n[0]=(w*On-I*Pn+S*fn)*(Bn=1/Bn),n[1]=(u*Pn-a*On-p*fn)*Bn,n[2]=(de*tn-ke*bt+tt*xt)*Bn,n[3]=(H*bt-j*tn-X*xt)*Bn,n[4]=(I*Un-_*On-S*Tn)*Bn,n[5]=(i*On-u*Un+p*Tn)*Bn,n[6]=(ke*ut-te*tn-tt*Qe)*Bn,n[7]=(B*tn-H*ut+X*Qe)*Bn,n[8]=(_*Pn-w*Un+S*nn)*Bn,n[9]=(a*Un-i*Pn-p*nn)*Bn,n[10]=(te*bt-de*ut+tt*mt)*Bn,n[11]=(j*ut-B*bt-X*mt)*Bn,n[12]=(w*Tn-_*fn-I*nn)*Bn,n[13]=(i*fn-a*Tn+u*nn)*Bn,n[14]=(de*Qe-te*xt-ke*mt)*Bn,n[15]=(B*xt-j*Qe+H*mt)*Bn,n):null}function eu(n,e,i){var a=e[0],u=e[1],p=e[2],_=e[3],w=e[4],I=e[5],S=e[6],B=e[7],j=e[8],H=e[9],X=e[10],te=e[11],de=e[12],ke=e[13],tt=e[14],mt=e[15],Qe=i[0],ut=i[1],xt=i[2],bt=i[3];return n[0]=Qe*a+ut*w+xt*j+bt*de,n[1]=Qe*u+ut*I+xt*H+bt*ke,n[2]=Qe*p+ut*S+xt*X+bt*tt,n[3]=Qe*_+ut*B+xt*te+bt*mt,n[4]=(Qe=i[4])*a+(ut=i[5])*w+(xt=i[6])*j+(bt=i[7])*de,n[5]=Qe*u+ut*I+xt*H+bt*ke,n[6]=Qe*p+ut*S+xt*X+bt*tt,n[7]=Qe*_+ut*B+xt*te+bt*mt,n[8]=(Qe=i[8])*a+(ut=i[9])*w+(xt=i[10])*j+(bt=i[11])*de,n[9]=Qe*u+ut*I+xt*H+bt*ke,n[10]=Qe*p+ut*S+xt*X+bt*tt,n[11]=Qe*_+ut*B+xt*te+bt*mt,n[12]=(Qe=i[12])*a+(ut=i[13])*w+(xt=i[14])*j+(bt=i[15])*de,n[13]=Qe*u+ut*I+xt*H+bt*ke,n[14]=Qe*p+ut*S+xt*X+bt*tt,n[15]=Qe*_+ut*B+xt*te+bt*mt,n}function Dd(n,e,i){var a,u,p,_,w,I,S,B,j,H,X,te,de=i[0],ke=i[1],tt=i[2];return e===n?(n[12]=e[0]*de+e[4]*ke+e[8]*tt+e[12],n[13]=e[1]*de+e[5]*ke+e[9]*tt+e[13],n[14]=e[2]*de+e[6]*ke+e[10]*tt+e[14],n[15]=e[3]*de+e[7]*ke+e[11]*tt+e[15]):(u=e[1],p=e[2],_=e[3],w=e[4],I=e[5],S=e[6],B=e[7],j=e[8],H=e[9],X=e[10],te=e[11],n[0]=a=e[0],n[1]=u,n[2]=p,n[3]=_,n[4]=w,n[5]=I,n[6]=S,n[7]=B,n[8]=j,n[9]=H,n[10]=X,n[11]=te,n[12]=a*de+w*ke+j*tt+e[12],n[13]=u*de+I*ke+H*tt+e[13],n[14]=p*de+S*ke+X*tt+e[14],n[15]=_*de+B*ke+te*tt+e[15]),n}function Va(n,e,i){var a=i[0],u=i[1],p=i[2];return n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n[3]=e[3]*a,n[4]=e[4]*u,n[5]=e[5]*u,n[6]=e[6]*u,n[7]=e[7]*u,n[8]=e[8]*p,n[9]=e[9]*p,n[10]=e[10]*p,n[11]=e[11]*p,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function tu(n,e,i){var a=Math.sin(i),u=Math.cos(i),p=e[4],_=e[5],w=e[6],I=e[7],S=e[8],B=e[9],j=e[10],H=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=p*u+S*a,n[5]=_*u+B*a,n[6]=w*u+j*a,n[7]=I*u+H*a,n[8]=S*u-p*a,n[9]=B*u-_*a,n[10]=j*u-w*a,n[11]=H*u-I*a,n}function Mh(n,e,i){var a=Math.sin(i),u=Math.cos(i),p=e[0],_=e[1],w=e[2],I=e[3],S=e[8],B=e[9],j=e[10],H=e[11];return e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=p*u-S*a,n[1]=_*u-B*a,n[2]=w*u-j*a,n[3]=I*u-H*a,n[8]=p*a+S*u,n[9]=_*a+B*u,n[10]=w*a+j*u,n[11]=I*a+H*u,n}function g_(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Pf(n,e,i){var a,u,p,_=i[0],w=i[1],I=i[2],S=Math.hypot(_,w,I);return S0&&(p=1/Math.sqrt(p)),n[0]=e[0]*p,n[1]=e[1]*p,n[2]=e[2]*p,n}function Ga(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Md(n,e,i){var a=e[0],u=e[1],p=e[2],_=i[0],w=i[1],I=i[2];return n[0]=u*I-p*w,n[1]=p*_-a*I,n[2]=a*w-u*_,n}function Yo(n,e,i){var a=e[0],u=e[1],p=e[2],_=i[3]*a+i[7]*u+i[11]*p+i[15];return n[0]=(i[0]*a+i[4]*u+i[8]*p+i[12])/(_=_||1),n[1]=(i[1]*a+i[5]*u+i[9]*p+i[13])/_,n[2]=(i[2]*a+i[6]*u+i[10]*p+i[14])/_,n}function y_(n,e,i){var a=i[0],u=i[1],p=i[2],_=e[0],w=e[1],I=e[2],S=u*I-p*w,B=p*_-a*I,j=a*w-u*_,H=u*j-p*B,X=p*S-a*j,te=a*B-u*S,de=2*i[3];return B*=de,j*=de,X*=2,te*=2,n[0]=_+(S*=de)+(H*=2),n[1]=w+B+X,n[2]=I+j+te,n}var nu,Pl=Ah,Cv=fm,Ev=Id;function v_(n,e,i){return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n}function x_(n,e){var i=e[0],a=e[1],u=e[2],p=e[3],_=i*i+a*a+u*u+p*p;return _>0&&(_=1/Math.sqrt(_)),n[0]=i*_,n[1]=a*_,n[2]=u*_,n[3]=p*_,n}function iu(n,e,i){var a=e[0],u=e[1],p=e[2],_=e[3];return n[0]=i[0]*a+i[4]*u+i[8]*p+i[12]*_,n[1]=i[1]*a+i[5]*u+i[9]*p+i[13]*_,n[2]=i[2]*a+i[6]*u+i[10]*p+i[14]*_,n[3]=i[3]*a+i[7]*u+i[11]*p+i[15]*_,n}function Ad(){var n=new ma(4);return ma!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function Sd(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function Of(n,e,i){i*=.5;var a=e[0],u=e[1],p=e[2],_=e[3],w=Math.sin(i),I=Math.cos(i);return n[0]=a*I+_*w,n[1]=u*I+p*w,n[2]=p*I-u*w,n[3]=_*I-a*w,n}function Rf(n,e,i){i*=.5;var a=e[0],u=e[1],p=e[2],_=e[3],w=Math.sin(i),I=Math.cos(i);return n[0]=a*I-p*w,n[1]=u*I+_*w,n[2]=p*I+a*w,n[3]=_*I-u*w,n}dm(),nu=new ma(4),ma!=Float32Array&&(nu[0]=0,nu[1]=0,nu[2]=0,nu[3]=0);var pm=x_;dm(),Bu(1,0,0),Bu(0,1,0),Ad(),Ad(),Sf();const zu=zt([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Lf}=zu,kf=zt([{name:"a_pos_3",components:3,type:"Int16"}]);var Ec=zt([{name:"a_pos",type:"Int16",components:2}]);class Uu{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,a){const u=Ga(i,this.dir);if(Math.abs(u)<1e-6)return!1;const p=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/u;return a[0]=this.pos[0]+this.dir[0]*p,a[1]=this.pos[1]+this.dir[1]*p,a[2]=this.pos[2]+this.dir[2]*p,!0}closestPointOnSphere(e,i,a){if(de=(X=this.pos)[0],ke=X[1],tt=X[2],mt=(te=e)[0],Qe=te[1],ut=te[2],Math.abs(de-mt)<=Qc*Math.max(1,Math.abs(de),Math.abs(mt))&&Math.abs(ke-Qe)<=Qc*Math.max(1,Math.abs(ke),Math.abs(Qe))&&Math.abs(tt-ut)<=Qc*Math.max(1,Math.abs(tt),Math.abs(ut))||0===i)return a[0]=a[1]=a[2]=0,!1;var X,te,de,ke,tt,mt,Qe,ut;const[u,p,_]=this.dir,w=this.pos[0]-e[0],I=this.pos[1]-e[1],S=this.pos[2]-e[2],B=u*u+p*p+_*_,j=2*(w*u+I*p+S*_),H=j*j-4*B*(w*w+I*I+S*S-i*i);if(H<0){const X=Math.max(-j/2,0),te=w+u*X,de=I+p*X,ke=S+_*X,tt=Math.hypot(te,de,ke);return a[0]=te*i/tt,a[1]=de*i/tt,a[2]=ke*i/tt,!1}{const X=(-j-Math.sqrt(H))/(2*B);if(X<0){const te=Math.hypot(w,I,S);return a[0]=w*i/te,a[1]=I*i/te,a[2]=S*i/te,!1}return a[0]=w+u*X,a[1]=I+p*X,a[2]=S+_*X,!0}}}class Zu{constructor(e,i,a,u,p){this.TL=e,this.TR=i,this.BR=a,this.BL=u,this.horizon=p}static fromInvProjectionMatrix(e,i,a){const u=[-1,1,1],p=[1,1,1],_=[1,-1,1],w=[-1,-1,1],I=Yo(u,u,e),S=Yo(p,p,e),B=Yo(_,_,e),j=Yo(w,w,e);return new Zu(I,S,B,j,i/a)}}class Ff{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,a,u){const p=Math.pow(2,a),_=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(I=>{const S=iu([],I,e),B=1/S[3]/i*p;return(j=S)[0]=(H=S)[0]*(X=[B,B,u?1/S[3]:B,B])[0],j[1]=H[1]*X[1],j[2]=H[2]*X[2],j[3]=H[3]*X[3],j;var j,H,X}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const S=ea([],Md([],Pl([],_[I[0]],_[I[1]]),Pl([],_[I[2]],_[I[1]]))),B=-Ga(S,_[I[1]]);return S.concat(B)});return new Ff(_,w)}}class ta{static fromPoints(e){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const u of e)Nu(i,i,u),Sh(a,a,u);return new ta(i,a)}static applyTransform(e,i){const a=e.getCorners();for(let u=0;u=0;if(0===_)return 0;_!==i.length&&(a=!1)}if(a)return 2;for(let u=0;u<3;u++){let p=Number.MAX_VALUE,_=-Number.MAX_VALUE;for(let w=0;wthis.max[u]-this.min[u])return 0}return 1}}const Bf=5,Nf=6,Ha=Ii/Math.PI/2,b_=16383,Pd=[64,32,16],Pa=-Ha,Wa=Ha,w_=[new ta([Pa,Pa,Pa],[Wa,Wa,Wa]),new ta([Pa,Pa,Pa],[0,0,Wa]),new ta([0,Pa,Pa],[Wa,0,Wa]),new ta([Pa,0,Pa],[0,Wa,Wa]),new ta([0,0,Pa],[Wa,Wa,Wa])];function Vs(n){return n*Ha/Rl}function Oh(n,e,i,a=!0){const u=_a([],n._camera.position,n.worldSize),p=[e,i,1,1];iu(p,p,n.pixelMatrixInverse),v_(p,p,1/p[3]);const _=ea([],Pl([],p,u)),w=n.globeMatrix,I=[w[12],w[13],w[14]],S=Pl([],I,u),B=Id(S),j=ea([],S),H=n.worldSize/(2*Math.PI),X=Ga(j,_),te=Math.asin(H/B);if(te1?null:function(a,u,p,_){const w=Math.sin(p);return a*(Math.sin((1-_)*p)/w)+u*(Math.sin(_*p)/w)}(n.a[e],n.b[e],n.angle,Ye(i,0,1))+n.center[e]}function Ro(n){if(n.z<=1)return w_[n.z+2*n.y+n.x];const e=Zf(Rd(n));return ta.fromPoints(e)}function ul(n,e,i){return _a(n,n,1-i),Ph(n,n,e,i)}function zf(n,e){const i=Ol(e.zoom);if(0===i)return Ro(n);const a=Rd(n),u=Zf(a),p=Ll(a.getWest())*e.worldSize,_=Ll(a.getEast())*e.worldSize,w=kl(a.getNorth())*e.worldSize,I=kl(a.getSouth())*e.worldSize,S=[p,w,0],B=[_,w,0],j=[p,I,0],H=[_,I,0],X=Ih([],e.globeMatrix);return Yo(S,S,X),Yo(B,B,X),Yo(j,j,X),Yo(H,H,X),u[0]=ul(u[0],j,i),u[1]=ul(u[1],H,i),u[2]=ul(u[2],B,i),u[3]=ul(u[3],S,i),ta.fromPoints(u)}function Uf(n,e,i){for(const a of n)Yo(a,a,e),_a(a,a,i)}function Rd({x:n,y:e,z:i}){const a=1/(1<Math.PI/2*1.01}const Vf=Le(85),vm=Math.cos(Vf),xm=Math.sin(Vf),Rl=6371008.8,kd=2*Math.PI*Rl;class Jl{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Jl(hn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,a=this.lat*i,u=e.lat*i,p=Math.sin(a)*Math.sin(u)+Math.cos(a)*Math.cos(u)*Math.cos((e.lng-this.lng)*i);return Rl*Math.acos(Math.min(p,1))}toBounds(e=0){const i=360*e/40075017,a=i/Math.cos(Math.PI/180*this.lat);return new Cc(new Jl(this.lng-a,this.lat-i),new Jl(this.lng+a,this.lat+i))}toEcef(e){const i=Vs(e);return ju(this.lat,this.lng,Ha+i)}static convert(e){if(e instanceof Jl)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Jl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Jl(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var $r=Jl;function $u(n){return kd*Math.cos(n*Math.PI/180)}function Ll(n){return(180+n)/360}function kl(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function dl(n,e){return n/$u(e)}function Oa(n){return 360*n-180}function Fs(n){return 360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90}function bm(n,e){return n*$u(Fs(e))}const Is=85.051129;function Fd(n){return 1/Math.cos(n*Math.PI/180)}class Tc{constructor(e,i,a=0){this.x=+e,this.y=+i,this.z=+a}static fromLngLat(e,i=0){const a=$r.convert(e);return new Tc(Ll(a.lng),kl(a.lat),dl(i,a.lat))}toLngLat(){return new $r(Oa(this.x),Fs(this.y))}toAltitude(){return bm(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/kd*Fd(Fs(this.y))}}function Bd(n,e,i,a,u,p,_,w,I){const S=(e+a)/2,B=(i+u)/2,j=new ue(S,B);w(j),function(H,X,te,de,ke,tt){const mt=te-ke,Qe=de-tt;return Math.abs((de-X)*mt-(te-H)*Qe)/Math.hypot(mt,Qe)}(j.x,j.y,p.x,p.y,_.x,_.y)>=I?(Bd(n,e,i,S,B,p,j,w,I),Bd(n,S,B,a,u,j,_,w,I)):n.push(_)}function wm(n,e,i){let a=n[0],u=a.x,p=a.y;e(a);const _=[a];for(let w=1;wn.x+1||an.y+1)&&dt("Geometry exceeds allowed extent, reduce your vector tile buffer size"),n}function Fl(n,e,i){const a=n.loadGeometry(),u=n.extent,p=Ii/u;if(e&&i&&i.projection.isReprojectedInTileSpace){const _=1<{const X=Oa((e.x+H.x/u)/_),te=Fs((e.y+H.y/u)/_),de=B.project(X,te);H.x=(de.x*w-I)*u,H.y=(de.y*w-S)*u};for(let H=0;H=u||te.y<0||te.y>=u||(j(te),X.push(te));a[H]=X}}for(const _ of a)for(const w of _)Cm(w,p);return a}function au(n,e){return{type:n.type,id:n.id,properties:n.properties,geometry:e?Fl(n):[]}}function Hf(n,e,i,a,u){n.emplaceBack(2*e+(a+1)/2,2*i+(u+1)/2)}function lu(n,e,i){n.emplaceBack(e.x,e.y,e.z,16384*i[0],16384*i[1],16384*i[2])}class Wf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Vn,this.indexArray=new xi,this.segments=new qo,this.programConfigurations=new Fu(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,a,u){const p=this.layers[0],_=[];let w=null;"circle"===p.type&&(w=p.layout.get("circle-sort-key"));for(const{feature:S,id:B,index:j,sourceLayerIndex:H}of e){const X=this.layers[0]._featureFilter.needGeometry,te=au(S,X);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),te,a))continue;const de=w?w.evaluate(te,{},a):void 0,ke={id:B,properties:S.properties,type:S.type,sourceLayerIndex:H,index:j,geometry:X?te.geometry:Fl(S,a,u),patterns:{},sortKey:de};_.push(ke)}w&&_.sort((S,B)=>S.sortKey-B.sortKey);let I=null;"globe"===u.projection.name&&(this.globeExtVertexArray=new Gn,I=u.projection);for(const S of _){const{geometry:B,index:j,sourceLayerIndex:H}=S,X=e[j].feature;this.addFeature(S,B,j,i.availableImages,a,I),i.featureIndex.insert(X,B,j,H,this.index)}}update(e,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,a,u)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Af.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Th.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,a,u,p,_){for(const w of i)for(const I of w){const S=I.x,B=I.y;if(S<0||S>=Ii||B<0||B>=Ii)continue;if(_){const X=_.projectTilePoint(S,B,p),te=_.upVector(p,S,B),de=this.globeExtVertexArray;lu(de,X,te),lu(de,X,te),lu(de,X,te),lu(de,X,te)}const j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),H=j.vertexLength;Hf(this.layoutVertexArray,S,B,-1,-1),Hf(this.layoutVertexArray,S,B,1,-1),Hf(this.layoutVertexArray,S,B,1,1),Hf(this.layoutVertexArray,S,B,-1,1),this.indexArray.emplaceBack(H,H+1,H+2),this.indexArray.emplaceBack(H,H+2,H+3),j.vertexLength+=4,j.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},u,p)}}function qf(n,e){for(let i=0;i1){if(kh(n,e))return!0;for(let a=0;a1?i:i.sub(e)._mult(u)._add(e))}function Bh(n,e){let i,a,u,p=!1;for(let _=0;_e.y!=u.y>e.y&&e.x<(u.x-a.x)*(e.y-a.y)/(u.y-a.y)+a.x&&(p=!p)}return p}function Bl(n,e){let i=!1;for(let a=0,u=n.length-1;ae.y!=_.y>e.y&&e.x<(_.x-p.x)*(e.y-p.y)/(_.y-p.y)+p.x&&(i=!i)}return i}function Xf(n,e,i,a,u){for(const _ of n)if(e<=_.x&&i<=_.y&&a>=_.x&&u>=_.y)return!0;const p=[new ue(e,i),new ue(e,u),new ue(a,u),new ue(a,i)];if(n.length>2)for(const _ of p)if(Bl(n,_))return!0;for(let _=0;_u.x&&e.x>u.x||n.yu.y&&e.y>u.y)return!1;const p=Ot(n,e,i[0]);return p!==Ot(n,e,i[1])||p!==Ot(n,e,i[2])||p!==Ot(n,e,i[3])}function Nl(n,e,i){const a=e.paint.get(n).value;return"constant"===a.kind?a.value:i.programConfigurations.get(e.id).getMaxValue(n)}function Nh(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function ep(n,e,i,a,u){if(!e[0]&&!e[1])return n;const p=ue.convert(e)._mult(u);"viewport"===i&&p._rotate(-a);const _=[];for(let w=0;w0){const Qe=i.projection.upVector(S,X.x,X.y);de.x+=Qe[0]*B*te,de.y+=Qe[1]*B*te,de.z+=Qe[2]*B*te}const ke=p?X:Dm(de.x,de.y,de.z,a),tt=p?n.tilespaceRays.map(Qe=>Gu(Qe,te)):n.queryGeometry.screenGeometry,mt=iu([],[de.x,de.y,de.z,1],a);if(!_&&p?I*=mt[3]/i.cameraToCenterDistance:_&&!p&&(I*=i.cameraToCenterDistance/mt[3]),p){const Qe=Fs((H.y/Ii+S.y)/(1<n.width||u.height>n.height||i.x>n.width-u.width||i.y>n.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>e.width||u.height>e.height||a.x>e.width-u.width||a.y>e.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const _=n.data,w=e.data;for(let I=0;I{e[n.evaluationKey]=I;const S=n.expression.evaluate(e);u.data[_+w+0]=Math.floor(255*S.r/S.a),u.data[_+w+1]=Math.floor(255*S.g/S.a),u.data[_+w+2]=Math.floor(255*S.b/S.a),u.data[_+w+3]=Math.floor(255*S.a)};if(n.clips)for(let _=0,w=0;_80*i){a=p=n[0],u=_=n[1];for(var te=i;tep&&(p=w),I>_&&(_=I);S=0!==(S=Math.max(p-a,_-u))?32767/S:0}return Ud(H,X,i,a,u,S,0),X}function Pm(n,e,i,a,u){var p,_;if(u===km(n,e,i,a)>0)for(p=e;p=e;p-=a)_=op(p,n[p],n[p+1],_);return _&&Uh(_,_.next)&&(Ju(_),_=_.next),_}function uu(n,e){if(!n)return n;e||(e=n);var i,a=n;do{if(i=!1,a.steiner||!Uh(a,a.next)&&0!==Jo(a.prev,a,a.next))a=a.next;else{if(Ju(a),(a=e=a.prev)===a.next)break;i=!0}}while(i||a!==e);return e}function Ud(n,e,i,a,u,p,_){if(n){!_&&p&&function(B,j,H,X){var te=B;do{0===te.z&&(te.z=Om(te.x,te.y,j,H,X)),te.prevZ=te.prev,te.nextZ=te.next,te=te.next}while(te!==B);te.prevZ.nextZ=null,te.prevZ=null,function(de){var ke,tt,mt,Qe,ut,xt,bt,tn,nn=1;do{for(tt=de,de=null,ut=null,xt=0;tt;){for(xt++,mt=tt,bt=0,ke=0;ke0||tn>0&&mt;)0!==bt&&(0===tn||!mt||tt.z<=mt.z)?(Qe=tt,tt=tt.nextZ,bt--):(Qe=mt,mt=mt.nextZ,tn--),ut?ut.nextZ=Qe:de=Qe,Qe.prevZ=ut,ut=Qe;tt=mt}ut.nextZ=null,nn*=2}while(xt>1)}(te)}(n,a,u,p);for(var w,I,S=n;n.prev!==n.next;)if(w=n.prev,I=n.next,p?M_(n,a,u,p):I_(n))e.push(w.i/i|0),e.push(n.i/i|0),e.push(I.i/i|0),Ju(n),n=I.next,S=I.next;else if((n=I)===S){_?1===_?Ud(n=Ic(uu(n),e,i),e,i,a,u,p,2):2===_&&Zd(n,e,i,a,u,p):Ud(uu(n),e,i,a,u,p,1);break}}}function I_(n){var e=n.prev,i=n,a=n.next;if(Jo(e,i,a)>=0)return!1;for(var u=e.x,p=i.x,_=a.x,w=e.y,I=i.y,S=a.y,B=up?u>_?u:_:p>_?p:_,X=w>I?w>S?w:S:I>S?I:S,te=a.next;te!==e;){if(te.x>=B&&te.x<=H&&te.y>=j&&te.y<=X&&jd(u,w,p,I,_,S,te.x,te.y)&&Jo(te.prev,te,te.next)>=0)return!1;te=te.next}return!0}function M_(n,e,i,a){var u=n.prev,p=n,_=n.next;if(Jo(u,p,_)>=0)return!1;for(var w=u.x,I=p.x,S=_.x,B=u.y,j=p.y,H=_.y,X=wI?w>S?w:S:I>S?I:S,ke=B>j?B>H?B:H:j>H?j:H,tt=Om(X,te,e,i,a),mt=Om(de,ke,e,i,a),Qe=n.prevZ,ut=n.nextZ;Qe&&Qe.z>=tt&&ut&&ut.z<=mt;){if(Qe.x>=X&&Qe.x<=de&&Qe.y>=te&&Qe.y<=ke&&Qe!==u&&Qe!==_&&jd(w,B,I,j,S,H,Qe.x,Qe.y)&&Jo(Qe.prev,Qe,Qe.next)>=0||(Qe=Qe.prevZ,ut.x>=X&&ut.x<=de&&ut.y>=te&&ut.y<=ke&&ut!==u&&ut!==_&&jd(w,B,I,j,S,H,ut.x,ut.y)&&Jo(ut.prev,ut,ut.next)>=0))return!1;ut=ut.nextZ}for(;Qe&&Qe.z>=tt;){if(Qe.x>=X&&Qe.x<=de&&Qe.y>=te&&Qe.y<=ke&&Qe!==u&&Qe!==_&&jd(w,B,I,j,S,H,Qe.x,Qe.y)&&Jo(Qe.prev,Qe,Qe.next)>=0)return!1;Qe=Qe.prevZ}for(;ut&&ut.z<=mt;){if(ut.x>=X&&ut.x<=de&&ut.y>=te&&ut.y<=ke&&ut!==u&&ut!==_&&jd(w,B,I,j,S,H,ut.x,ut.y)&&Jo(ut.prev,ut,ut.next)>=0)return!1;ut=ut.nextZ}return!0}function Ic(n,e,i){var a=n;do{var u=a.prev,p=a.next.next;!Uh(u,p)&&Lm(u,a,a.next,p)&&Ra(u,p)&&Ra(p,u)&&(e.push(u.i/i|0),e.push(a.i/i|0),e.push(p.i/i|0),Ju(a),Ju(a.next),a=n=p),a=a.next}while(a!==n);return uu(a)}function Zd(n,e,i,a,u,p){var _=n;do{for(var w=_.next.next;w!==_.prev;){if(_.i!==w.i&&Rm(_,w)){var I=Yu(_,w);return _=uu(_,_.next),I=uu(I,I.next),Ud(_,e,i,a,u,p,0),void Ud(I,e,i,a,u,p,0)}w=w.next}_=_.next}while(_!==n)}function A_(n,e){return n.x-e.x}function Tv(n,e){var i=function(u,p){var _,w=p,I=u.x,S=u.y,B=-1/0;do{if(S<=w.y&&S>=w.next.y&&w.next.y!==w.y){var j=w.x+(S-w.y)*(w.next.x-w.x)/(w.next.y-w.y);if(j<=I&&j>B&&(B=j,_=w.x=w.x&&w.x>=te&&I!==w.x&&jd(S_.x||w.x===_.x&&Dv(_,w)))&&(_=w,ke=H)),w=w.next}while(w!==X);return _}(n,e);if(!i)return e;var a=Yu(i,n);return uu(a,a.next),uu(i,i.next)}function Dv(n,e){return Jo(n.prev,n,e.prev)<0&&Jo(e.next,n,n.next)<0}function Om(n,e,i,a,u){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-i)*u|0)|n<<8))|n<<4))|n<<2))|n<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*u|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Iv(n){var e=n,i=n;do{(e.x=(n-_)*(p-w)&&(n-_)*(a-w)>=(i-_)*(e-w)&&(i-_)*(p-w)>=(u-_)*(a-w)}function Rm(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!function(i,a){var u=i;do{if(u.i!==i.i&&u.next.i!==i.i&&u.i!==a.i&&u.next.i!==a.i&&Lm(u,u.next,i,a))return!0;u=u.next}while(u!==i);return!1}(n,e)&&(Ra(n,e)&&Ra(e,n)&&function(i,a){var u=i,p=!1,_=(i.x+a.x)/2,w=(i.y+a.y)/2;do{u.y>w!=u.next.y>w&&u.next.y!==u.y&&_<(u.next.x-u.x)*(w-u.y)/(u.next.y-u.y)+u.x&&(p=!p),u=u.next}while(u!==i);return p}(n,e)&&(Jo(n.prev,n,e.prev)||Jo(n,e.prev,e))||Uh(n,e)&&Jo(n.prev,n,n.next)>0&&Jo(e.prev,e,e.next)>0)}function Jo(n,e,i){return(e.y-n.y)*(i.x-e.x)-(e.x-n.x)*(i.y-e.y)}function Uh(n,e){return n.x===e.x&&n.y===e.y}function Lm(n,e,i,a){var u=qu(Jo(n,e,i)),p=qu(Jo(n,e,a)),_=qu(Jo(i,a,n)),w=qu(Jo(i,a,e));return u!==p&&_!==w||!(0!==u||!Zh(n,i,e))||!(0!==p||!Zh(n,a,e))||!(0!==_||!Zh(i,n,a))||!(0!==w||!Zh(i,e,a))}function Zh(n,e,i){return e.x<=Math.max(n.x,i.x)&&e.x>=Math.min(n.x,i.x)&&e.y<=Math.max(n.y,i.y)&&e.y>=Math.min(n.y,i.y)}function qu(n){return n>0?1:n<0?-1:0}function Ra(n,e){return Jo(n.prev,n,n.next)<0?Jo(n,e,n.next)>=0&&Jo(n,n.prev,e)>=0:Jo(n,e,n.prev)<0||Jo(n,n.next,e)<0}function Yu(n,e){var i=new jh(n.i,n.x,n.y),a=new jh(e.i,e.x,e.y),u=n.next,p=e.prev;return n.next=e,e.prev=n,i.next=u,u.prev=i,a.next=i,i.prev=a,p.next=a,a.prev=p,a}function op(n,e,i,a){var u=new jh(n,e,i);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Ju(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function jh(n,e,i){this.i=n,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function km(n,e,i,a){for(var u=0,p=e,_=i-a;p0&&i.holes.push(a+=n[u-1].length)}return i};var Fm=Be(zh.exports);function Mv(n,e,i,a,u){Vh(n,e,i||0,a||n.length-1,u||Av)}function Vh(n,e,i,a,u){for(;a>i;){if(a-i>600){var p=a-i+1,_=e-i+1,w=Math.log(p),I=.5*Math.exp(2*w/3),S=.5*Math.sqrt(w*I*(p-I)/p)*(_-p/2<0?-1:1);Vh(n,e,Math.max(i,Math.floor(e-_*I/p+S)),Math.min(a,Math.floor(e+(p-_)*I/p+S)),u)}var B=n[e],j=i,H=a;for(du(n,i,e),u(n[a],B)>0&&du(n,i,a);j0;)H--}0===u(n[i],B)?du(n,i,H):du(n,++H,a),H<=e&&(i=H+1),e<=H&&(a=H-1)}}function du(n,e,i){var a=n[e];n[e]=n[i],n[i]=a}function Av(n,e){return ne?1:0}function Bm(n,e){const i=n.length;if(i<=1)return[n];const a=[];let u,p;for(let _=0;_1)for(let _=0;_i.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Vn,this.indexArray=new xi,this.indexArray2=new _s,this.programConfigurations=new Fu(e.layers,e.zoom),this.segments=new qo,this.segments2=new qo,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,a,u){this.hasPattern=sp("fill",this.layers,i);const p=this.layers[0].layout.get("fill-sort-key"),_=[];for(const{feature:w,id:I,index:S,sourceLayerIndex:B}of e){const j=this.layers[0]._featureFilter.needGeometry,H=au(w,j);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),H,a))continue;const X=p?p.evaluate(H,{},a,i.availableImages):void 0,te={id:I,properties:w.properties,type:w.type,sourceLayerIndex:B,index:S,geometry:j?H.geometry:Fl(w,a,u),patterns:{},sortKey:X};_.push(te)}p&&_.sort((w,I)=>w.sortKey-I.sortKey);for(const w of _){const{geometry:I,index:S,sourceLayerIndex:B}=w;if(this.hasPattern){const j=ap("fill",this.layers,w,this.zoom,i);this.patternFeatures.push(j)}else this.addFeature(w,I,S,a,{},i.availableImages);i.featureIndex.insert(e[S].feature,I,S,B,this.index)}}update(e,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,a,u)}addFeatures(e,i,a,u,p){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,i,a,u)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sm),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,i,a,u,p,_=[]){for(const w of Bm(i,500)){let I=0;for(const te of w)I+=te.length;const S=this.segments.prepareSegment(I,this.layoutVertexArray,this.indexArray),B=S.vertexLength,j=[],H=[];for(const te of w){if(0===te.length)continue;te!==w[0]&&H.push(j.length/2);const de=this.segments2.prepareSegment(te.length,this.layoutVertexArray,this.indexArray2),ke=de.vertexLength;this.layoutVertexArray.emplaceBack(te[0].x,te[0].y),this.indexArray2.emplaceBack(ke+te.length-1,ke),j.push(te[0].x),j.push(te[0].y);for(let tt=1;tt>3}if(u--,1===a||2===a)p+=n.readSVarint(),_+=n.readSVarint(),1===a&&(e&&w.push(e),e=[]),e.push(new R_(p,_));else{if(7!==a)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&w.push(e),w},Mc.prototype.bbox=function(){var n=this._pbf;n.pos=this._geometry;for(var e=n.readVarint()+n.pos,i=1,a=0,u=0,p=0,_=1/0,w=-1/0,I=1/0,S=-1/0;n.pos>3}if(a--,1===i||2===i)(u+=n.readSVarint())<_&&(_=u),u>w&&(w=u),(p+=n.readSVarint())S&&(S=p);else if(7!==i)throw new Error("unknown command "+i)}return[_,I,w,S]},Mc.prototype.toGeoJSON=function(n,e,i){var a,u,p=this.extent*Math.pow(2,i),_=this.extent*n,w=this.extent*e,I=this.loadGeometry(),S=Mc.types[this.type];function B(X){for(var te=0;te>3;u=1===_?a.readString():2===_?a.readFloat():3===_?a.readDouble():4===_?a.readVarint64():5===_?a.readVarint():6===_?a.readSVarint():7===_?a.readBoolean():null}return u}(i))}Vm.prototype.feature=function(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];var e=this._pbf.readVarint()+this._pbf.pos;return new k_(this._pbf,e,this.extent,this._keys,this._values)};var Sv=jm;function Pv(n,e,i){if(3===n){var a=new Sv(i,i.readVarint()+i.pos);a.length&&(e[a.name]=a)}}var hu=Kl.VectorTile=function(n,e){this.layers=n.readFields(Pv,{},e)},Gr=Kl.VectorTileFeature=Um;function Ac(n,e,i,a){const u=[],p=0===a?(_,w,I,S,B,j)=>{_.push(new ue(j,I+(j-w)/(S-w)*(B-I)))}:(_,w,I,S,B,j)=>{_.push(new ue(w+(j-I)/(B-I)*(S-w),j))};for(const _ of n){const w=[];for(const I of _){if(I.length<=2)continue;const S=[];for(let H=0;He&&p(S,X,te,de,ke,e):tt>i?mt=e&&p(S,X,te,de,ke,e),mt>i&&tt<=i&&p(S,X,te,de,ke,i)}let B=I[I.length-1];const j=0===a?B.x:B.y;j>=e&&j<=i&&S.push(B),S.length&&(B=S[S.length-1],S[0].x===B.x&&S[0].y===B.y||S.push(S[0]),w.push(S))}w.length&&u.push(w)}return u}Kl.VectorTileLayer=jm;const Gm=Gr.types,Hm=Math.pow(2,13);function fu(n,e,i,a,u,p,_,w){n.emplaceBack((e<<1)+_,(i<<1)+p,(Math.floor(a*Hm)<<1)+u,Math.round(w))}function pu(n,e,i){n.emplaceBack(e.x,e.y,e.z,16384*i[0],16384*i[1],16384*i[2])}class Wm{constructor(){this.acc=new ue(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new ue(e.x,e.y),this.max=new ue(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const a=this.min,u=this.max;e.xu.x&&(u.x=e.x),e.yu.y&&(u.y=e.y),((0===e.x||e.x===Ii)&&e.x===i.x)!=((0===e.y||e.y===Ii)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,ki(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Ii!=e.x>Ii&&this.addBorderIntersection(1,ki(i.y,e.y,(Ii-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,ki(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Ii!=e.y>Ii&&this.addBorderIntersection(3,ki(i.x,e.x,(Ii-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const a=this.borders[e];ia[1]&&(a[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const a=0===e.x?0:1;this.addBorderIntersection(a,i.y),this.addBorderIntersection(a,e.y)}else{const a=0===e.y?2:3;this.addBorderIntersection(a,i.x),this.addBorderIntersection(a,e.x)}}centroid(){const e=this.polyCount.reduce((i,a)=>i+a.edges,0);return 0!==e?this.acc.div(e)._round():new ue(0,0)}span(){return new ue(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class Ku{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new Rn,this.centroidVertexArray=new Qs,this.indexArray=new xi,this.programConfigurations=new Fu(e.layers,e.zoom),this.segments=new qo,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,a,u){this.features=[],this.hasPattern=sp("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(p){const _=Math.exp(Math.PI*(1-p.y/(1<=0;tt--){const mt=X[tt];(0===mt.length||(te=mt[0]).every(Qe=>Qe.x<=0)||te.every(Qe=>Qe.x>=Ii)||te.every(Qe=>Qe.y<=0)||te.every(Qe=>Qe.y>=Ii))&&X.splice(tt,1)}var te;let de;if(B)de=dp(X,I,u);else{de=[];for(const tt of X)de.push({polygon:tt,bounds:I})}const ke=H?this.edgeRadius:0;for(const{polygon:tt,bounds:mt}of de){let Qe=0,ut=0;for(const bt of tt)H&&!bt[0].equals(bt[bt.length-1])&&bt.push(bt[0]),ut+=H?bt.length-1:bt.length;const xt=this.segments.prepareSegment((H?5:4)*ut,this.layoutVertexArray,this.indexArray);if(H){const bt=[],tn=[];Qe=xt.vertexLength;for(const Tn of tt){let Un,fn;Tn.length&&Tn!==tt[0]&&tn.push(bt.length/2),Un=Tn[1].sub(Tn[0])._perp()._unit();for(let Pn=1;Pn4&&qm(bt[bt.length-2],bt[0],bt[1]),fn=ke?Hh(bt[bt.length-2],bt[0],bt[1],ke):0;nn=bt[1].sub(bt[0])._perp()._unit();let Pn=!0;for(let On=1,Bn=0;On0?1:0,Qn=Hn.dist(wn);if(Bn+Qn>32768&&(Bn=0),ke){Tn=si.sub(wn)._perp()._unit();let Ki=F_(Hn,wn,si,cp(nn,Tn),ke);isNaN(Ki)&&(Ki=0);const Ri=wn.sub(Hn)._unit();Hn=Hn.add(Ri.mult(fn))._round(),wn=wn.add(Ri.mult(-Ki))._round(),fn=Ki,nn=Tn}const Mi=xt.vertexLength,Ji=bt.length>4&&qm(Hn,wn,si);let Ir=qh(Bn,Un,Pn);if(fu(this.layoutVertexArray,Hn.x,Hn.y,ci,Yi,0,0,Ir),fu(this.layoutVertexArray,Hn.x,Hn.y,ci,Yi,0,1,Ir),Bn+=Qn,Ir=qh(Bn,Ji,!Pn),Un=Ji,fu(this.layoutVertexArray,wn.x,wn.y,ci,Yi,0,0,Ir),fu(this.layoutVertexArray,wn.x,wn.y,ci,Yi,0,1,Ir),xt.vertexLength+=4,this.indexArray.emplaceBack(Mi+0,Mi+1,Mi+2),this.indexArray.emplaceBack(Mi+1,Mi+3,Mi+2),xt.primitiveLength+=2,ke){const Ki=Qe+(1===On?bt.length-2:On-2),Ri=1===On?Qe:Ki+1;if(this.indexArray.emplaceBack(Mi+1,Ki,Mi+3),this.indexArray.emplaceBack(Ki,Ri,Mi+3),xt.primitiveLength+=2,void 0===tn&&(tn=Mi),!Wh(si,bt[On],mt)){const Xr=On===bt.length-1?tn:xt.vertexLength;this.indexArray.emplaceBack(Mi+2,Mi+3,Xr),this.indexArray.emplaceBack(Mi+3,Xr+1,Xr),this.indexArray.emplaceBack(Mi+3,Ri,Xr+1),xt.primitiveLength+=3}Pn=!Pn}if(B){const Ki=this.layoutVertexExtArray,Ri=S.projectTilePoint(Hn.x,Hn.y,u),Xr=S.projectTilePoint(wn.x,wn.y,u),Qi=S.upVector(u,Hn.x,Hn.y),nr=S.upVector(u,wn.x,wn.y);pu(Ki,Ri,Qi),pu(Ki,Ri,Qi),pu(Ki,Xr,nr),pu(Ki,Xr,nr)}}H&&(Qe+=bt.length-1)}}if(j&&j.polyCount.length>0){if(j.borders){j.vertexArrayOffset=this.centroidVertexArray.length;const tt=j.borders,mt=this.featuresOnBorder.push(j)-1;for(let Qe=0;Qe<4;Qe++)tt[Qe][0]!==Number.MAX_VALUE&&this.borders[Qe].push(mt)}this.encodeCentroid(j.borders?void 0:j.centroid(),j)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,p,_,u)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,a)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[a].borders[e][0])}encodeCentroid(e,i,a=!0){let u,p;if(e)if(0!==e.y){const w=i.span()._mult(this.tileToMeter);u=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(w.x/10)),p=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(w.y/10))}else u=Math.ceil(7*(e.x+450)),p=0;else u=0,p=+a;let _=a?this.centroidVertexArray.length:i.vertexArrayOffset;for(const w of i.polyCount){a&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*w.edges+w.top);for(let I=0;Ii[1].x&&e.x>i[1].x||n.yi[1].y&&e.y>i[1].y}function qm(n,e,i){if(n.x<0||n.x>=Ii||e.x<0||e.x>=Ii||i.x<0||i.x>=Ii)return!1;const a=i.sub(e),u=a.perp(),p=n.sub(e);return(a.x*p.x+a.y*p.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(p.x*p.x+p.y*p.y))>-.866&&u.x*p.x+u.y*p.y<0}function qh(n,e,i){const a=e?2|n:-3&n;return i?1|a:-2&a}function up(){const n=Math.PI/32,e=Math.tan(n),i=Rl;return i*Math.sqrt(1+2*e*e)-i}function dp(n,e,i){const a=1<{for(const nn of bt)te.push({polygon:nn,bounds:tn})},ke=Math.ceil(Math.log2(B)),tt=Math.ceil(Math.log2(j)),mt=ke-tt,Qe=[];for(let bt=0;bt0?0:1);for(let bt=0;bttn+1?xt.push({polygons:Bn,bounds:wn,depth:tn+1}):de(Bn,wn)}if(Hn.length){const wn=[new ue(0===nn?On:Tn.x,1===nn?On:Tn.y),Un];Qe.length>tn+1?xt.push({polygons:Hn,bounds:wn,depth:tn+1}):de(Hn,wn)}}return te}(n,e,Math.ceil((p-u)/11.25),Math.ceil((_-w)/11.25),1,(I,S,B)=>{if(0===I)return.5*(S+B);{const j=Fs((i.y+S/Ii)/a);return(kl(.5*(Fs((i.y+B/Ii)/a)+j))*a-i.y)*Ii}})}ui(Ku,"FillExtrusionBucket",{omit:["layers","features"]}),ui(Wm,"PartMetadata");const mu=new ot({"fill-extrusion-edge-radius":new ce(Kt["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var B_={paint:new ot({"fill-extrusion-opacity":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ve(Kt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new ce(Kt["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:mu};function Yh(n,e,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[n*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class gu{constructor(e,i,a){this.z=e,this.x=i,this.y=a,this.key=Sc(0,e,e,i,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const a=(_=this.y,w=this.z,I=Yh(256*(p=this.x),256*(_=Math.pow(2,w)-_-1),w),S=Yh(256*(p+1),256*(_+1),w),I[0]+","+I[1]+","+S[0]+","+S[1]),u=function(p,_,w){let I,S="";for(let B=p;B>0;B--)I=1<this.canonical.z?new Bs(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Bs(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return Sc(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const a=this.canonical.z-e;return Sc(this.wrap*+i,e,e,this.canonical.x>>a,this.canonical.y>>a)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Bs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,u=2*this.canonical.y;return[new Bs(i,this.wrap,i,a,u),new Bs(i,this.wrap,i,a+1,u),new Bs(i,this.wrap,i,a,u+1),new Bs(i,this.wrap,i,a+1,u+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.yi.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new un,this.layoutVertexArray2=new Zn,this.indexArray=new xi,this.programConfigurations=new Fu(e.layers,e.zoom),this.segments=new qo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,a,u){this.hasPattern=sp("line",this.layers,i);const p=this.layers[0].layout.get("line-sort-key"),_=[];for(const{feature:B,id:j,index:H,sourceLayerIndex:X}of e){const te=this.layers[0]._featureFilter.needGeometry,de=au(B,te);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),de,a))continue;const ke=p?p.evaluate(de,{},a):void 0,tt={id:j,properties:B.properties,type:B.type,sourceLayerIndex:X,index:H,geometry:te?de.geometry:Fl(B,a,u),patterns:{},sortKey:ke};_.push(tt)}p&&_.sort((B,j)=>B.sortKey-j.sortKey);const{lineAtlas:w,featureIndex:I}=i,S=this.addConstantDashes(w);for(const B of _){const{geometry:j,index:H,sourceLayerIndex:X}=B;if(S&&this.addFeatureDashes(B,w),this.hasPattern){const te=ap("line",this.layers,B,this.zoom,i);this.patternFeatures.push(te)}else this.addFeature(B,j,H,a,w.positions,i.availableImages);I.insert(e[H].feature,j,H,X,this.index)}}addConstantDashes(e){let i=!1;for(const a of this.layers){const u=a.paint.get("line-dasharray").value,p=a.layout.get("line-cap").value;if("constant"!==u.kind||"constant"!==p.kind)i=!0;else{const _=p.value,w=u.value;if(!w)continue;e.addDash(w,_)}}return i}addFeatureDashes(e,i){const a=this.zoom;for(const u of this.layers){const p=u.paint.get("line-dasharray").value,_=u.layout.get("line-cap").value;if("constant"===p.kind&&"constant"===_.kind)continue;let w,I;if("constant"===p.kind){if(w=p.value,!w)continue}else w=p.evaluate({zoom:a},e);I="constant"===_.kind?_.value:_.evaluate({zoom:a},e),i.addDash(w,I),e.patterns[u.id]=i.getKey(w,I)}}update(e,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,a,u)}addFeatures(e,i,a,u,p){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,i,a,u)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,z_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Km),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,a,u,p,_){const w=this.layers[0].layout,I=w.get("line-join").evaluate(e,{}),S=w.get("line-cap").evaluate(e,{}),B=w.get("line-miter-limit"),j=w.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const H of i)this.addLine(H,e,I,S,B,j);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,p,_,u)}addLine(e,i,a,u,p,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let tt=0;tt=2&&e[I-1].equals(e[I-2]);)I--;let S=0;for(;S0;if(tn&&tt>S){const fn=H.dist(X);if(fn>2*B){const Pn=H.sub(H.sub(X)._mult(B/fn)._round());this.updateDistance(X,Pn),this.addCurrentVertex(Pn,de,0,0,j),X=Pn}}const Tn=X&&te;let Un=Tn?a:w?"butt":u;if(Tn&&"round"===Un&&(xt<_?Un="miter":xt<=2&&(Un="fakeround")),"miter"===Un&&xt>p&&(Un="bevel"),"bevel"===Un&&(xt>2&&(Un="flipbevel"),xt100)mt=ke.mult(-1);else{const fn=xt*de.add(ke).mag()/de.sub(ke).mag();mt._perp()._mult(fn*(nn?-1:1))}this.addCurrentVertex(H,mt,0,0,j),this.addCurrentVertex(H,mt.mult(-1),0,0,j)}else if("bevel"===Un||"fakeround"===Un){const fn=-Math.sqrt(xt*xt-1),Pn=nn?fn:0,On=nn?0:fn;if(X&&this.addCurrentVertex(H,de,Pn,On,j),"fakeround"===Un){const Bn=Math.round(180*bt/Math.PI/20);for(let Hn=1;Hn2*B){const Pn=H.add(te.sub(H)._mult(B/fn)._round());this.updateDistance(H,Pn),this.addCurrentVertex(Pn,ke,0,0,j),H=Pn}}}}addCurrentVertex(e,i,a,u,p,_=!1){const w=i.y*u-i.x,I=-i.y-i.x*u;this.addHalfVertex(e,i.x+i.y*a,i.y-i.x*a,_,!1,a,p),this.addHalfVertex(e,w,I,_,!0,-u,p)}addHalfVertex({x:e,y:i},a,u,p,_,w,I){this.layoutVertexArray.emplaceBack((e<<1)+(p?1:0),(i<<1)+(_?1:0),Math.round(63*a)+128,Math.round(63*u)+128,1+(0===w?0:w<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const S=I.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,S),I.primitiveLength++),_?this.e2=S:this.e1=S}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}ui(Qu,"LineBucket",{omit:["layers","patternFeatures"]});const Xm=new ot({"line-cap":new Ve(Kt.layout_line["line-cap"]),"line-join":new Ve(Kt.layout_line["line-join"]),"line-miter-limit":new ce(Kt.layout_line["line-miter-limit"]),"line-round-limit":new ce(Kt.layout_line["line-round-limit"]),"line-sort-key":new Ve(Kt.layout_line["line-sort-key"])});var Qm={paint:new ot({"line-opacity":new Ve(Kt.paint_line["line-opacity"]),"line-color":new Ve(Kt.paint_line["line-color"]),"line-translate":new ce(Kt.paint_line["line-translate"]),"line-translate-anchor":new ce(Kt.paint_line["line-translate-anchor"]),"line-width":new Ve(Kt.paint_line["line-width"]),"line-gap-width":new Ve(Kt.paint_line["line-gap-width"]),"line-offset":new Ve(Kt.paint_line["line-offset"]),"line-blur":new Ve(Kt.paint_line["line-blur"]),"line-dasharray":new Ve(Kt.paint_line["line-dasharray"]),"line-pattern":new Ve(Kt.paint_line["line-pattern"]),"line-gradient":new rt(Kt.paint_line["line-gradient"]),"line-trim-offset":new ce(Kt.paint_line["line-trim-offset"])}),layout:Xm};const hp=new class extends Ve{possiblyEvaluate(n,e){return e=new Z(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(n,e)}evaluate(n,e,i,a){return e=Te({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(n,e,i,a)}}(Qm.paint.properties["line-width"].specification);function Kh(n,e){return e>0?e+2*n:n}hp.useIntegerZoom=!0;const Ov=zt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Rv=zt([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),j_=zt([{name:"a_projected_pos",components:4,type:"Float32"}],4);zt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const V_=zt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Lv=zt([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);zt([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const $_=zt([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Xh=zt([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);zt([{name:"triangle",components:3,type:"Uint16"}]),zt([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),zt([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),zt([{type:"Float32",name:"offsetX"}]),zt([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Ms=24;const La=128;function Vd(n,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Z(n+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:a,interpolationType:u}=i;let p=0;for(;p{a.text=function(u,p,_){const w=p.layout.get("text-transform").evaluate(_,{});return"uppercase"===w?u=u.toLocaleUpperCase():"lowercase"===w&&(u=u.toLocaleLowerCase()),L.applyArabicShaping&&(u=L.applyArabicShaping(u)),u}(a.text,e,i)}),n}const Rc={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42","\u2190":"\u2191","\u2192":"\u2193"};function Gd(n){return"\ufe36"===n||"\ufe48"===n||"\ufe38"===n||"\ufe44"===n||"\ufe42"===n||"\ufe3e"===n||"\ufe3c"===n||"\ufe3a"===n||"\ufe18"===n||"\ufe40"===n||"\ufe10"===n||"\ufe13"===n||"\ufe14"===n||"\uff40"===n||"\uffe3"===n||"\ufe11"===n||"\ufe12"===n}function eg(n){return"\ufe35"===n||"\ufe47"===n||"\ufe37"===n||"\ufe43"===n||"\ufe41"===n||"\ufe3d"===n||"\ufe3b"===n||"\ufe39"===n||"\ufe17"===n||"\ufe3f"===n}var Qh=Yr,Hd=function(n,e,i,a,u){var p,_,w=8*u-a-1,I=(1<>1,B=-7,j=i?u-1:0,H=i?-1:1,X=n[e+j];for(j+=H,p=X&(1<<-B)-1,X>>=-B,B+=w;B>0;p=256*p+n[e+j],j+=H,B-=8);for(_=p&(1<<-B)-1,p>>=-B,B+=a;B>0;_=256*_+n[e+j],j+=H,B-=8);if(0===p)p=1-S;else{if(p===I)return _?NaN:1/0*(X?-1:1);_+=Math.pow(2,a),p-=S}return(X?-1:1)*_*Math.pow(2,p-a)},G_=function(n,e,i,a,u,p){var _,w,I,S=8*p-u-1,B=(1<>1,H=23===u?Math.pow(2,-24)-Math.pow(2,-77):0,X=a?0:p-1,te=a?1:-1,de=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(w=isNaN(e)?1:0,_=B):(_=Math.floor(Math.log(e)/Math.LN2),e*(I=Math.pow(2,-_))<1&&(_--,I*=2),(e+=_+j>=1?H/I:H*Math.pow(2,1-j))*I>=2&&(_++,I/=2),_+j>=B?(w=0,_=B):_+j>=1?(w=(e*I-1)*Math.pow(2,u),_+=j):(w=e*Math.pow(2,j-1)*Math.pow(2,u),_=0));u>=8;n[i+X]=255&w,X+=te,w/=256,u-=8);for(_=_<0;n[i+X]=255&_,X+=te,_/=256,S-=8);n[i+X-te]|=128*de};function Yr(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0),this.pos=0,this.type=0,this.length=this.buf.length}Yr.Varint=0,Yr.Fixed64=1,Yr.Bytes=2,Yr.Fixed32=5;var _u=4294967296,tg=1/_u,pp=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ql(n){return n.type===Yr.Bytes?n.readVarint()+n.pos:n.pos+1}function ef(n,e,i){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(a);for(var u=i.pos-1;u>=n;u--)i.buf[u+a]=i.buf[u]}function ng(n,e){for(var i=0;i>>8,n[i+2]=e>>>16,n[i+3]=e>>>24}function rg(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+(n[e+3]<<24)}Yr.prototype={destroy:function(){this.buf=null},readFields:function(n,e,i){for(i=i||this.length;this.pos>3,p=this.pos;this.type=7&a,n(u,e,this),this.pos===p&&this.skip(a)}return e},readMessage:function(n,e){return this.readFields(n,e,this.readVarint()+this.pos)},readFixed32:function(){var n=td(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=rg(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=td(this.buf,this.pos)+td(this.buf,this.pos+4)*_u;return this.pos+=8,n},readSFixed64:function(){var n=td(this.buf,this.pos)+rg(this.buf,this.pos+4)*_u;return this.pos+=8,n},readFloat:function(){var n=Hd(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=Hd(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var e,i,a=this.buf;return e=127&(i=a[this.pos++]),i<128?e:(e|=(127&(i=a[this.pos++]))<<7,i<128?e:(e|=(127&(i=a[this.pos++]))<<14,i<128?e:(e|=(127&(i=a[this.pos++]))<<21,i<128?e:function(u,p,_){var w,I,S=_.buf;if(w=(112&(I=S[_.pos++]))>>4,I<128||(w|=(127&(I=S[_.pos++]))<<3,I<128)||(w|=(127&(I=S[_.pos++]))<<10,I<128)||(w|=(127&(I=S[_.pos++]))<<17,I<128)||(w|=(127&(I=S[_.pos++]))<<24,I<128)||(w|=(1&(I=S[_.pos++]))<<31,I<128))return function ed(n,e,i){return i?4294967296*e+(n>>>0):4294967296*(e>>>0)+(n>>>0)}(u,w,p);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=a[this.pos]))<<28,n,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2==1?(n+1)/-2:n/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=12&&pp?pp.decode(this.buf.subarray(e,n)):function(i,a,u){for(var p="",_=a;_239?4:B>223?3:B>191?2:1;if(_+H>u)break;1===H?B<128&&(j=B):2===H?128==(192&(w=i[_+1]))&&(j=(31&B)<<6|63&w)<=127&&(j=null):3===H?(I=i[_+2],128==(192&(w=i[_+1]))&&128==(192&I)&&((j=(15&B)<<12|(63&w)<<6|63&I)<=2047||j>=55296&&j<=57343)&&(j=null)):4===H&&(I=i[_+2],S=i[_+3],128==(192&(w=i[_+1]))&&128==(192&I)&&128==(192&S)&&((j=(15&B)<<18|(63&w)<<12|(63&I)<<6|63&S)<=65535||j>=1114112)&&(j=null)),null===j?(j=65533,H=1):j>65535&&(j-=65536,p+=String.fromCharCode(j>>>10&1023|55296),j=56320|1023&j),p+=String.fromCharCode(j),_+=H}return p}(this.buf,e,n)},readBytes:function(){var n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e},readPackedVarint:function(n,e){if(this.type!==Yr.Bytes)return n.push(this.readVarint(e));var i=Ql(this);for(n=n||[];this.pos127;);else if(e===Yr.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Yr.Fixed32)this.pos+=4;else{if(e!==Yr.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(n,e){this.writeVarint(n<<3|e)},realloc:function(n){for(var e=this.length||16;e268435455||n<0?function(e,i){var a,u,p,w;if(e>=0?(a=e%4294967296|0,u=e/4294967296|0):(u=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,u=u+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),p=a,(w=i).buf[w.pos++]=127&p|128,p>>>=7,w.buf[w.pos++]=127&p|128,p>>>=7,w.buf[w.pos++]=127&p|128,p>>>=7,w.buf[w.pos++]=127&p|128,w.buf[w.pos]=127&(p>>>=7),function(p,_){var w=(7&p)<<4;_.buf[_.pos++]|=w|((p>>>=3)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p|((p>>>=7)?128:0),p&&(_.buf[_.pos++]=127&p)))))}(u,i)}(n,this):(this.realloc(4),this.buf[this.pos++]=127&n|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=n>>>7&127))))},writeSVarint:function(n){this.writeVarint(n<0?2*-n-1:2*n)},writeBoolean:function(n){this.writeVarint(!!n)},writeString:function(n){n=String(n),this.realloc(4*n.length),this.pos++;var e=this.pos;this.pos=function(a,u,p){for(var _,w,I=0;I55295&&_<57344){if(!w){_>56319||I+1===u.length?(a[p++]=239,a[p++]=191,a[p++]=189):w=_;continue}if(_<56320){a[p++]=239,a[p++]=191,a[p++]=189,w=_;continue}_=w-55296<<10|_-56320|65536,w=null}else w&&(a[p++]=239,a[p++]=191,a[p++]=189,w=null);_<128?a[p++]=_:(_<2048?a[p++]=_>>6|192:(_<65536?a[p++]=_>>12|224:(a[p++]=_>>18|240,a[p++]=_>>12&63|128),a[p++]=_>>6&63|128),a[p++]=63&_|128)}return p}(this.buf,n,this.pos);var i=this.pos-e;i>=128&&ef(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(n){this.realloc(4),G_(this.buf,n,this.pos,!0,23,4),this.pos+=4},writeDouble:function(n){this.realloc(8),G_(this.buf,n,this.pos,!0,52,8),this.pos+=8},writeBytes:function(n){var e=n.length;this.writeVarint(e),this.realloc(e);for(var i=0;i=128&&ef(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(n,e,i){this.writeTag(n,Yr.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(n,e){e.length&&this.writeMessage(n,ng,e)},writePackedSVarint:function(n,e){e.length&&this.writeMessage(n,H_,e)},writePackedBoolean:function(n,e){e.length&&this.writeMessage(n,q_,e)},writePackedFloat:function(n,e){e.length&&this.writeMessage(n,W_,e)},writePackedDouble:function(n,e){e.length&&this.writeMessage(n,kv,e)},writePackedFixed32:function(n,e){e.length&&this.writeMessage(n,tf,e)},writePackedSFixed32:function(n,e){e.length&&this.writeMessage(n,mp,e)},writePackedFixed64:function(n,e){e.length&&this.writeMessage(n,Y_,e)},writePackedSFixed64:function(n,e){e.length&&this.writeMessage(n,ig,e)},writeBytesField:function(n,e){this.writeTag(n,Yr.Bytes),this.writeBytes(e)},writeFixed32Field:function(n,e){this.writeTag(n,Yr.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(n,e){this.writeTag(n,Yr.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(n,e){this.writeTag(n,Yr.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(n,e){this.writeTag(n,Yr.Fixed64),this.writeSFixed64(e)},writeVarintField:function(n,e){this.writeTag(n,Yr.Varint),this.writeVarint(e)},writeSVarintField:function(n,e){this.writeTag(n,Yr.Varint),this.writeSVarint(e)},writeStringField:function(n,e){this.writeTag(n,Yr.Bytes),this.writeString(e)},writeFloatField:function(n,e){this.writeTag(n,Yr.Fixed32),this.writeFloat(e)},writeDoubleField:function(n,e){this.writeTag(n,Yr.Fixed64),this.writeDouble(e)},writeBooleanField:function(n,e){this.writeVarintField(n,!!e)}};var Wd=Be(Qh);const gp=3;function og(n,e,i){e.glyphs=[],1===n&&i.readMessage(Fv,e)}function Fv(n,e,i){if(3===n){const{id:a,bitmap:u,width:p,height:_,left:w,top:I,advance:S}=i.readMessage(J_,{});e.glyphs.push({id:a,bitmap:new hl({width:p+2*gp,height:_+2*gp},u),metrics:{width:p,height:_,left:w,top:I,advance:S}})}else 4===n?e.ascender=i.readSVarint():5===n&&(e.descender=i.readSVarint())}function J_(n,e,i){1===n?e.id=i.readVarint():2===n?e.bitmap=i.readBytes():3===n?e.width=i.readVarint():4===n?e.height=i.readVarint():5===n?e.left=i.readSVarint():6===n?e.top=i.readSVarint():7===n&&(e.advance=i.readVarint())}const qd=gp;function _p(n){let e=0,i=0;for(const _ of n)e+=_.w*_.h,i=Math.max(i,_.w);n.sort((_,w)=>w.h-_.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let u=0,p=0;for(const _ of n)for(let w=a.length-1;w>=0;w--){const I=a[w];if(!(_.w>I.w||_.h>I.h)){if(_.x=I.x,_.y=I.y,p=Math.max(p,_.y+_.h),u=Math.max(u,_.x+_.w),_.w===I.w&&_.h===I.h){const S=a.pop();we.hasImage(a)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in e.updatedImages)this.patchUpdatedImage(this.iconPositions[a],e.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],e.getImage(a),i)}patchUpdatedImage(e,i,a){if(!e||!i||e.version===i.version)return;e.version=i.version;const[u,p]=e.tl;a.update(i.data,void 0,{x:u,y:p})}}ui(yu,"ImagePosition"),ui(sg,"ImageAtlas");const va={horizontal:1,vertical:2,horizontalOnly:3},ag=-17;class Yd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const a=new Yd;return a.scale=e||1,a.fontStack=i,a}static forImage(e){const i=new Yd;return i.imageName=e,i}}class nd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const a=new nd;for(let u=0;u=0&&a>=e&&rf[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const a=new nd;return a.text=this.text.substring(e,i),a.sectionIndex=this.sectionIndex.slice(e,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(Yd.forText(e.scale,e.fontStack||i));const a=this.sections.length-1;for(let u=0;u=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function nf(n,e,i,a,u,p,_,w,I,S,B,j,H,X,te){const de=nd.fromFeature(n,u);j===va.vertical&&de.verticalizePunctuation(H);let ke=[];const tt=function(bt,tn,nn,Tn,Un,fn){if(!bt)return[];const Pn=[],On=function(si,fi,ci,Yi,Qn,Mi){let Ji=0;for(let Ir=0;Ir=0;let Hn=0;for(let si=0;si0&&gl>oo&&(oo=gl)}else{const na=nn[is.fontStack];if(!na)continue;na[lo]&&(eo=na[lo]);const xs=tn[is.fontStack];if(!xs)continue;const gl=xs.glyphs[lo];if(!gl)continue;if(So=gl.metrics,Vo=8203!==lo?Ms:0,Mi){const gd=void 0!==xs.ascender?Math.abs(xs.ascender):0,Cu=void 0!==xs.descender?Math.abs(xs.descender):0,Zc=(gd+Cu)*Mr;wo-i/2;){if(_--,_<0)return!1;w-=n[_].dist(p),p=n[_]}w+=n[_].dist(n[_+1]),_++;const I=[];let S=0;for(;wa;)S-=I.shift().angleDelta;if(S>u)return!1;_++,w+=B.dist(j)}return!0}function vp(n){let e=0;for(let i=0;iS){const te=(S-I)/X,de=ki(j.x,H.x,te),ke=ki(j.y,H.y,te),tt=new tc(de,ke,0,H.angleTo(j),B);return!_||X_(n,tt,w,_,e)?tt:void 0}I+=X}}function Q_(n,e,i,a,u,p,_,w,I){const S=xp(a,p,_),B=qa(a,u),j=B*_,H=0===n[0].x||n[0].x===I||0===n[0].y||n[0].y===I;return e-j=0&&ut=0&&xt=0&&H+S<=B){const bt=new tc(ut,xt,0,mt,te);bt._round(),a&&!X_(n,bt,p,a,u)||X.push(bt)}}j+=tt}return w||X.length||_||(X=ey(n,j/2,i,a,u,p,_,!0,I)),X}function pg(n,e,i,a,u){const p=[];for(let _=0;_=a&&j.x>=a||(B.x>=a?B=new ue(a,B.y+(a-B.x)/(j.x-B.x)*(j.y-B.y))._round():j.x>=a&&(j=new ue(a,B.y+(a-B.x)/(j.x-B.x)*(j.y-B.y))._round()),B.y>=u&&j.y>=u||(B.y>=u?B=new ue(B.x+(u-B.y)/(j.y-B.y)*(j.x-B.x),u)._round():j.y>=u&&(j=new ue(B.x+(u-B.y)/(j.y-B.y)*(j.x-B.x),u)._round()),I&&B.equals(I[I.length-1])||(I=[B],p.push(I)),I.push(j)))))}}return p}ui(tc,"Anchor");const Jd=1e20;function wp(n,e,i,a,u,p,_,w,I){for(let S=e;S-1);I++,p[I]=w,_[I]=S,_[I+1]=Jd}for(let w=0,I=0;w{let w=this.entries[u];w||(w=this.entries[u]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let I=w.glyphs[p];if(void 0!==I)return void _(null,{stack:u,id:p,glyph:I});if(I=this._tinySDF(w,u,p),I)return w.glyphs[p]=I,void _(null,{stack:u,id:p,glyph:I});const S=Math.floor(p/256);if(256*S>65535)return void _(new Error("glyphs > 65535 not supported"));if(w.ranges[S])return void _(null,{stack:u,id:p,glyph:I});let B=w.requests[S];B||(B=w.requests[S]=[],id.loadGlyphRange(u,S,this.url,this.requestManager,(j,H)=>{if(H){w.ascender=H.ascender,w.descender=H.descender;for(const X in H.glyphs)this._doesCharSupportLocalGlyph(+X)||(w.glyphs[+X]=H.glyphs[+X]);w.ranges[S]=!0}for(const X of B)X(j,H);delete w.requests[S]})),B.push((j,H)=>{j?_(j):H&&_(null,{stack:u,id:p,glyph:H.glyphs[p]||null})})},(u,p)=>{if(u)i(u);else if(p){const _={};for(const{stack:w,id:I,glyph:S}of p)void 0===_[w]&&(_[w]={}),void 0===_[w].glyphs&&(_[w].glyphs={}),_[w].glyphs[I]=S&&{id:S.id,bitmap:S.bitmap.clone(),metrics:S.metrics},_[w].ascender=this.entries[w].ascender,_[w].descender=this.entries[w].descender;i(null,_)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Lc.none&&(this.localGlyphMode===Lc.all?!!this.localFontFamily:!!this.localFontFamily&&(R["CJK Unified Ideographs"](e)||R["Hangul Syllables"](e)||R.Hiragana(e)||R.Katakana(e)||R["CJK Symbols and Punctuation"](e)))}_tinySDF(e,i,a){const u=this.localFontFamily;if(!u||!this._doesCharSupportLocalGlyph(a))return;let p=e.tinySDF;if(!p){let de="400";/bold/i.test(i)?de="900":/medium/i.test(i)?de="500":/light/i.test(i)&&(de="200"),p=e.tinySDF=new id.TinySDF({fontFamily:u,fontWeight:de,fontSize:24*As,buffer:3*As,radius:8*As}),p.fontWeight=de}if(this.localGlyphs[p.fontWeight][a])return this.localGlyphs[p.fontWeight][a];const _=String.fromCharCode(a),{data:w,width:I,height:S,glyphWidth:B,glyphHeight:j,glyphLeft:H,glyphTop:X,glyphAdvance:te}=p.draw(_);return this.localGlyphs[p.fontWeight][a]={id:a,bitmap:new hl({width:I,height:S},w),metrics:{width:B/As,height:j/As,left:H/As,top:X/As-27,advance:te/As,localGlyph:!0}}}}id.loadGlyphRange=function(n,e,i,a,u){const p=256*e,_=p+255,w=a.transformRequest(a.normalizeGlyphsURL(i).replace("{fontstack}",n).replace("{range}",`${p}-${_}`),Cn.Glyphs);_n(w,(I,S)=>{if(I)u(I);else if(S){const B={},j=new Wd(S).readFields(og,{});for(const H of j.glyphs)B[H.id]=H;u(null,{glyphs:B,ascender:j.ascender,descender:j.descender})}})},id.TinySDF=class{constructor({fontSize:n=24,buffer:e=3,radius:i=8,cutoff:a=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:_="normal"}={}){this.buffer=e,this.cutoff=a,this.radius=i;const w=this.size=n+4*e,I=this._createCanvas(w),S=this.ctx=I.getContext("2d",{willReadFrequently:!0});S.font=`${_} ${p} ${n}px ${u}`,S.textBaseline="alphabetic",S.textAlign="left",S.fillStyle="black",this.gridOuter=new Float64Array(w*w),this.gridInner=new Float64Array(w*w),this.f=new Float64Array(w),this.z=new Float64Array(w+1),this.v=new Uint16Array(w)}_createCanvas(n){const e=document.createElement("canvas");return e.width=e.height=n,e}draw(n){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:a,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(n),_=Math.ceil(i),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-u))),I=Math.min(this.size-this.buffer,_+Math.ceil(a)),S=w+2*this.buffer,B=I+2*this.buffer,j=Math.max(S*B,0),H=new Uint8ClampedArray(j),X={data:H,width:S,height:B,glyphWidth:w,glyphHeight:I,glyphTop:_,glyphLeft:0,glyphAdvance:e};if(0===w||0===I)return X;const{ctx:te,buffer:de,gridInner:ke,gridOuter:tt}=this;te.clearRect(de,de,w,I),te.fillText(n,de,de+_);const mt=te.getImageData(de,de,w,I);tt.fill(Jd,0,j),ke.fill(0,0,j);for(let Qe=0;Qe0?tn*tn:0,ke[bt]=tn<0?tn*tn:0}}wp(tt,0,0,S,B,S,this.f,this.v,this.z),wp(ke,de,de,w,I,S,this.f,this.v,this.z);for(let Qe=0;Qefn+Pn[1]-Pn[0],te=j.reduce(X,0),de=H.reduce(X,0),ke=w-te,tt=I-de;let mt=0,Qe=te,ut=0,xt=de,bt=0,tn=ke,nn=0,Tn=tt;if(p.content&&a){const fn=p.content;mt=od(j,0,fn[0]),ut=od(H,0,fn[1]),Qe=od(j,fn[0],fn[2]),xt=od(H,fn[1],fn[3]),bt=fn[0]-mt,nn=fn[1]-ut,tn=fn[2]-fn[0]-Qe,Tn=fn[3]-fn[1]-xt}const Un=(fn,Pn,On,Bn)=>{const Hn=Kd(fn.stretch-mt,Qe,S,n.left),wn=Ep(fn.fixed-bt,tn,fn.stretch,te),si=Kd(Pn.stretch-ut,xt,B,n.top),fi=Ep(Pn.fixed-nn,Tn,Pn.stretch,de),ci=Kd(On.stretch-mt,Qe,S,n.left),Yi=Ep(On.fixed-bt,tn,On.stretch,te),Qn=Kd(Bn.stretch-ut,xt,B,n.top),Mi=Ep(Bn.fixed-nn,Tn,Bn.stretch,de),Ji=new ue(Hn,si),Ir=new ue(ci,si),Ki=new ue(ci,Qn),Ri=new ue(Hn,Qn),Xr=new ue(wn/_,fi/_),Qi=new ue(Yi/_,Mi/_),nr=e*Math.PI/180;if(nr){const ro=Math.sin(nr),oo=Math.cos(nr),wo=[oo,-ro,ro,oo];Ji._matMult(wo),Ir._matMult(wo),Ri._matMult(wo),Ki._matMult(wo)}const no=fn.stretch+fn.fixed,io=Pn.stretch+Pn.fixed;return{tl:Ji,tr:Ir,bl:Ri,br:Ki,tex:{x:p.paddedRect.x+rd+no,y:p.paddedRect.y+rd+io,w:On.stretch+On.fixed-no,h:Bn.stretch+Bn.fixed-io},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Xr,pixelOffsetBR:Qi,minFontScaleX:tn/_/S,minFontScaleY:Tn/_/B,isSDF:i}};if(a&&(p.stretchX||p.stretchY)){const fn=sd(j,ke,te),Pn=sd(H,tt,de);for(let On=0;On0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:a}=this,u=i[e];for(;e>0;){const p=e-1>>1,_=i[p];if(a(u,_)>=0)break;i[e]=_,e=p}i[e]=u}_down(e){const{data:i,compare:a}=this,u=this.length>>1,p=i[e];for(;e=0)break;i[e]=w,e=_}i[e]=p}}function lf(n,e){return ne?1:0}function mg(n,e=1,i=!1){let a=1/0,u=1/0,p=-1/0,_=-1/0;const w=n[0];for(let X=0;Xp)&&(p=te.x),(!X||te.y>_)&&(_=te.y)}const I=Math.min(p-a,_-u);let S=I/2;const B=new ad([],gg);if(0===I)return new ue(a,u);for(let X=a;Xj.d||!j.d)&&(j=X,i&&console.log("found best %d after %d probes",Math.round(1e4*X.d)/1e4,H)),X.max-j.d<=e||(S=X.h/2,B.push(new ld(X.p.x-S,X.p.y-S,S,n)),B.push(new ld(X.p.x+S,X.p.y-S,S,n)),B.push(new ld(X.p.x-S,X.p.y+S,S,n)),B.push(new ld(X.p.x+S,X.p.y+S,S,n)),H+=4)}return i&&(console.log(`num probes: ${H}`),console.log(`best distance: ${j.d}`)),j.p}function gg(n,e){return e.max-n.max}class ld{constructor(e,i,a,u){this.p=new ue(e,i),this.h=a,this.d=function(p,_){let w=!1,I=1/0;for(let S=0;S<_.length;S++){const B=_[S];for(let j=0,H=B.length,X=H-1;jp.y!=de.y>p.y&&p.x<(de.x-te.x)*(p.y-te.y)/(de.y-te.y)+te.x&&(w=!w),I=Math.min(I,Kf(p,te,de))}}return(w?1:-1)*Math.sqrt(I)}(this.p,u),this.max=this.d+this.h*Math.SQRT2}}const cd=7,Dp=Number.POSITIVE_INFINITY,ty=Math.sqrt(2);function Ip(n,[e,i]){let a=0,u=0;if(i===Dp){e<0&&(e=0);const p=e/ty;switch(n){case"top-right":case"top-left":u=p-cd;break;case"bottom-right":case"bottom-left":u=-p+cd;break;case"bottom":u=-e+cd;break;case"top":u=e-cd}switch(n){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=e;break;case"right":a=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),n){case"top-right":case"top-left":case"top":u=i-cd;break;case"bottom-right":case"bottom-left":case"bottom":u=-i+cd}switch(n){case"top-right":case"bottom-right":case"right":a=-e;break;case"top-left":case"bottom-left":case"left":a=e}}return[a,u]}function Bv(n,e,i,a,u,p,_,w,I,S){n.createArrays(),n.tilePixelRatio=Ii/(512*n.overscaling),n.compareText={},n.iconsNeedLinear=!1;const B=n.layers[0].layout,j=n.layers[0]._unevaluatedLayout._values,H={};if("composite"===n.textSizeData.kind){const{minZoom:de,maxZoom:ke}=n.textSizeData;H.compositeTextSizes=[j["text-size"].possiblyEvaluate(new Z(de),w),j["text-size"].possiblyEvaluate(new Z(ke),w)]}if("composite"===n.iconSizeData.kind){const{minZoom:de,maxZoom:ke}=n.iconSizeData;H.compositeIconSizes=[j["icon-size"].possiblyEvaluate(new Z(de),w),j["icon-size"].possiblyEvaluate(new Z(ke),w)]}H.layoutTextSize=j["text-size"].possiblyEvaluate(new Z(I+1),w),H.layoutIconSize=j["icon-size"].possiblyEvaluate(new Z(I+1),w),H.textMaxSize=j["text-size"].possiblyEvaluate(new Z(18),w);const X="map"===B.get("text-rotation-alignment")&&"point"!==B.get("symbol-placement"),te=B.get("text-size");for(const de of n.features){const ke=B.get("text-font").evaluate(de,{},w).join(","),tt=te.evaluate(de,{},w),mt=H.layoutTextSize.evaluate(de,{},w),Qe=(H.layoutIconSize.evaluate(de,{},w),{horizontal:{},vertical:void 0}),ut=de.text;let xt,bt=[0,0];if(ut){const Tn=ut.toString(),Un=B.get("text-letter-spacing").evaluate(de,{},w)*Ms,fn=B.get("text-line-height").evaluate(de,{},w)*Ms,Pn=$(Tn)?Un:0,On=B.get("text-anchor").evaluate(de,{},w),Bn=B.get("text-variable-anchor");if(!Bn){const ci=B.get("text-radial-offset").evaluate(de,{},w);bt=ci?Ip(On,[ci*Ms,Dp]):B.get("text-offset").evaluate(de,{},w).map(Yi=>Yi*Ms)}let Hn=X?"center":B.get("text-justify").evaluate(de,{},w);const wn="point"===B.get("symbol-placement"),si=wn?B.get("text-max-width").evaluate(de,{},w)*Ms:1/0,fi=ci=>{n.allowVerticalPlacement&&U(Tn)&&(Qe.vertical=nf(ut,e,i,u,ke,si,fn,On,ci,Pn,bt,va.vertical,!0,mt,tt))};if(!X&&Bn){const ci="auto"===Hn?Bn.map(Qn=>Mp(Qn)):[Hn];let Yi=!1;for(let Qn=0;Qn=0||!U(Tn)){const ci=nf(ut,e,i,u,ke,si,fn,On,Hn,Pn,bt,va.horizontal,!1,mt,tt);ci&&(Qe.horizontal[Hn]=ci)}fi(wn?"left":Hn)}}let tn=!1;if(de.icon&&de.icon.name){const Tn=a[de.icon.name];Tn&&(xt=hg(u[de.icon.name],B.get("icon-offset").evaluate(de,{},w),B.get("icon-anchor").evaluate(de,{},w)),tn=Tn.sdf,void 0===n.sdfIcons?n.sdfIcons=Tn.sdf:n.sdfIcons!==Tn.sdf&&dt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Tn.pixelRatio!==n.pixelRatio||0!==B.get("icon-rotate").constantOr(1))&&(n.iconsNeedLinear=!0))}const nn=ny(Qe.horizontal)||Qe.vertical;n.iconsInText||(n.iconsInText=!!nn&&nn.iconsInText),(nn||xt)&&Nv(n,de,Qe,xt,a,H,mt,0,bt,tn,_,w,S)}p&&n.generateCollisionDebugBuffers(I,n.collisionBoxArray)}function Mp(n){switch(n){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nv(n,e,i,a,u,p,_,w,I,S,B,j,H){let X=p.textMaxSize.evaluate(e,{},j);void 0===X&&(X=_);const te=n.layers[0].layout,de=te.get("icon-offset").evaluate(e,{},j),ke=ny(i.horizontal)||i.vertical,tt="globe"===H.name,mt=Ms,Qe=_/mt,ut=n.tilePixelRatio*X/mt,xt=(On=n.overscaling,n.zoom>18&&On>2&&(On>>=1),Math.max(Ii/(512*On),1)*te.get("symbol-spacing")),bt=te.get("text-padding")*n.tilePixelRatio,tn=te.get("icon-padding")*n.tilePixelRatio,nn=Le(te.get("text-max-angle")),Tn="map"===te.get("text-rotation-alignment")&&"point"!==te.get("symbol-placement"),Un="map"===te.get("icon-rotation-alignment")&&"point"!==te.get("symbol-placement"),fn=te.get("symbol-placement"),Pn=xt/2;var On;const Bn=te.get("icon-text-fit");let Hn;a&&"none"!==Bn&&(n.allowVerticalPlacement&&i.vertical&&(Hn=fg(a,i.vertical,Bn,te.get("icon-text-fit-padding"),de,Qe)),ke&&(a=fg(a,ke,Bn,te.get("icon-text-fit-padding"),de,Qe)));const wn=(si,fi,ci)=>{if(fi.x<0||fi.x>=Ii||fi.y<0||fi.y>=Ii)return;let Yi=null;if(tt){const{x:Qn,y:Mi,z:Ji}=H.projectTilePoint(fi.x,fi.y,ci);Yi={anchor:new tc(Qn,Mi,Ji,0,void 0),up:H.upVector(ci,fi.x,fi.y)}}!function(Qn,Mi,Ji,Ir,Ki,Ri,Xr,Qi,nr,no,io,ro,oo,wo,jo,Ko,Qr,is,Lo,lo,Mr,So,eo,vs,Vo){const Ss=Qn.addToLineVertexArray(Mi,Ir);let $o,na,xs,gl,gd,Cu,Zc,uh=0,yy=0,Zg=0,jg=0,dh=-1,Wp=-1;const _l={};let Vg=bc("");const Eu=Ji?Ji.anchor:Mi;let yf=0,vf=0;if(void 0===nr._unevaluatedLayout.getValue("text-radial-offset")?[yf,vf]=nr.layout.get("text-offset").evaluate(Mr,{},Vo).map(xa=>xa*Ms):(yf=nr.layout.get("text-radial-offset").evaluate(Mr,{},Vo)*Ms,vf=Dp),Qn.allowVerticalPlacement&&Ki.vertical){const xa=Ki.vertical;if(jo)Cu=ud(xa),Qi&&(Zc=ud(Qi));else{const ua=nr.layout.get("text-rotate").evaluate(Mr,{},Vo)+90;xs=Xd(no,Eu,Mi,io,ro,oo,xa,wo,ua,Ko),Qi&&(gl=Xd(no,Eu,Mi,io,ro,oo,Qi,is,ua))}}if(Ri){const xa=nr.layout.get("icon-rotate").evaluate(Mr,{},Vo),ua="none"!==nr.layout.get("icon-text-fit"),Tu=Cp(Ri,xa,eo,ua),hh=Qi?Cp(Qi,xa,eo,ua):void 0;na=Xd(no,Eu,Mi,io,ro,oo,Ri,is,xa),uh=4*Tu.length;const $g=Qn.iconSizeData;let jl=null;"source"===$g.kind?(jl=[La*nr.layout.get("icon-size").evaluate(Mr,{},Vo)],jl[0]>nc&&dt(`${Qn.layerIds[0]}: Value for "icon-size" is >= ${cf}. Reduce your "icon-size".`)):"composite"===$g.kind&&(jl=[La*So.compositeIconSizes[0].evaluate(Mr,{},Vo),La*So.compositeIconSizes[1].evaluate(Mr,{},Vo)],(jl[0]>nc||jl[1]>nc)&&dt(`${Qn.layerIds[0]}: Value for "icon-size" is >= ${cf}. Reduce your "icon-size".`)),Qn.addSymbols(Qn.icon,Tu,jl,lo,Lo,Mr,!1,Ji,Mi,Ss.lineStartIndex,Ss.lineLength,-1,vs,Vo),dh=Qn.icon.placedSymbolArray.length-1,hh&&(yy=4*hh.length,Qn.addSymbols(Qn.icon,hh,jl,lo,Lo,Mr,va.vertical,Ji,Mi,Ss.lineStartIndex,Ss.lineLength,-1,vs,Vo),Wp=Qn.icon.placedSymbolArray.length-1)}for(const xa in Ki.horizontal){const ua=Ki.horizontal[xa];$o||(Vg=bc(ua.text),jo?gd=ud(ua):$o=Xd(no,Eu,Mi,io,ro,oo,ua,wo,nr.layout.get("text-rotate").evaluate(Mr,{},Vo),Ko));const Tu=1===ua.positionedLines.length;if(Zg+=Ap(Qn,Ji,Mi,ua,Xr,nr,jo,Mr,Ko,Ss,Ki.vertical?va.horizontal:va.horizontalOnly,Tu?Object.keys(Ki.horizontal):[xa],_l,dh,So,vs,Vo),Tu)break}Ki.vertical&&(jg+=Ap(Qn,Ji,Mi,Ki.vertical,Xr,nr,jo,Mr,Ko,Ss,va.vertical,["vertical"],_l,Wp,So,vs,Vo));let sc=-1;const qp=(xa,ua)=>xa?Math.max(xa,ua):ua;sc=qp(gd,sc),sc=qp(Cu,sc),sc=qp(Zc,sc);const vy=sc>-1?1:0;Qn.glyphOffsetArray.length>=Bc.MAX_GLYPHS&&dt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Mr.sortKey&&Qn.addToSortKeyRanges(Qn.symbolInstances.length,Mr.sortKey),Qn.symbolInstances.emplaceBack(Eu.x,Eu.y,Eu.z,Mi.x,Mi.y,_l.right>=0?_l.right:-1,_l.center>=0?_l.center:-1,_l.left>=0?_l.left:-1,_l.vertical>=0?_l.vertical:-1,dh,Wp,Vg,void 0!==$o?$o:Qn.collisionBoxArray.length,void 0!==$o?$o+1:Qn.collisionBoxArray.length,void 0!==xs?xs:Qn.collisionBoxArray.length,void 0!==xs?xs+1:Qn.collisionBoxArray.length,void 0!==na?na:Qn.collisionBoxArray.length,void 0!==na?na+1:Qn.collisionBoxArray.length,gl||Qn.collisionBoxArray.length,gl?gl+1:Qn.collisionBoxArray.length,io,Zg,jg,uh,yy,vy,0,yf,vf,sc)}(n,fi,Yi,si,i,a,u,Hn,n.layers[0],n.collisionBoxArray,e.index,e.sourceLayerIndex,n.index,bt,Tn,I,0,tn,Un,de,e,p,S,B,j)};if("line"===fn)for(const si of pg(e.geometry,0,0,Ii,Ii)){const fi=Q_(si,xt,nn,i.vertical||ke,a,mt,ut,n.overscaling,Ii);for(const ci of fi)ke&&_g(n,ke.text,Pn,ci)||wn(si,ci,j)}else if("line-center"===fn){for(const si of e.geometry)if(si.length>1){const fi=bp(si,nn,i.vertical||ke,a,mt,ut);fi&&wn(si,fi,j)}}else if("Polygon"===e.type)for(const si of Bm(e.geometry,0)){const fi=mg(si,16);wn(si[0],new tc(fi.x,fi.y,0,0,void 0),j)}else if("LineString"===e.type)for(const si of e.geometry)wn(si,new tc(si[0].x,si[0].y,0,0,void 0),j);else if("Point"===e.type)for(const si of e.geometry)for(const fi of si)wn([fi],new tc(fi.x,fi.y,0,0,void 0),j)}const cf=255,nc=cf*La;function Ap(n,e,i,a,u,p,_,w,I,S,B,j,H,X,te,de,ke){const tt=function(ut,xt,bt,tn,nn,Tn,Un,fn){const Pn=[];if(0===xt.positionedLines.length)return Pn;const On=tn.layout.get("text-rotate").evaluate(Tn,{})*Math.PI/180,Bn=function(ci){const Yi=ci[0],Qn=ci[1],Mi=Yi*Qn;return Mi>0?[Yi,-Qn]:Mi<0?[-Yi,Qn]:0===Yi?[Qn,Yi]:[Qn,-Yi]}(bt);let Hn=Math.abs(xt.top-xt.bottom);for(const ci of xt.positionedLines)Hn-=ci.lineOffset;const wn=xt.positionedLines.length,si=Hn/wn;let fi=xt.top-bt[1];for(let ci=0;cinc&&dt(`${n.layerIds[0]}: Value for "text-size" is >= ${cf}. Reduce your "text-size".`)):"composite"===mt.kind&&(Qe=[La*te.compositeTextSizes[0].evaluate(w,{},ke),La*te.compositeTextSizes[1].evaluate(w,{},ke)],(Qe[0]>nc||Qe[1]>nc)&&dt(`${n.layerIds[0]}: Value for "text-size" is >= ${cf}. Reduce your "text-size".`)),n.addSymbols(n.text,tt,Qe,I,_,w,B,e,i,S.lineStartIndex,S.lineLength,X,de,ke);for(const ut of j)H[ut]=n.text.placedSymbolArray.length-1;return 4*tt.length}function ny(n){for(const e in n)return n[e];return null}function Xd(n,e,i,a,u,p,_,w,I,S){let B=_.top,j=_.bottom,H=_.left,X=_.right;const te=_.collisionPadding;if(te&&(H-=te[0],B-=te[1],X+=te[2],j+=te[3]),I){const de=new ue(H,B),ke=new ue(X,B),tt=new ue(H,j),mt=new ue(X,j),Qe=Le(I);let ut=new ue(0,0);S&&(ut=new ue(S[0],S[1])),de._rotateAround(Qe,ut),ke._rotateAround(Qe,ut),tt._rotateAround(Qe,ut),mt._rotateAround(Qe,ut),H=Math.min(de.x,ke.x,tt.x,mt.x),X=Math.max(de.x,ke.x,tt.x,mt.x),B=Math.min(de.y,ke.y,tt.y,mt.y),j=Math.max(de.y,ke.y,tt.y,mt.y)}return n.emplaceBack(e.x,e.y,e.z,i.x,i.y,H,B,X,j,w,a,u,p),n.length-1}function ud(n){n.collisionPadding&&(n.top-=n.collisionPadding[1],n.bottom+=n.collisionPadding[3]);const e=n.bottom-n.top;return e>0?Math.max(10,e):null}function _g(n,e,i,a){const u=n.compareText;if(e in u){const p=u[e];for(let _=p.length-1;_>=0;_--)if(a.dist(p[_])Qe&&(ut(bt,Bn,nn,Tn,Pn,On),ut(Bn,tn,Pn,On,Un,fn))}ut(j,H,a,p,u,p),ut(H,X,u,p,u,_),ut(X,te,u,_,a,_),ut(te,j,a,_,a,p),de-=Qe,ke-=Qe,tt+=Qe,mt+=Qe;const xt=1/Math.max(tt-de,mt-ke);return{scale:xt,x:de*xt,y:ke*xt,x2:tt*xt,y2:mt*xt,projection:e}}const _r=ga(new Float32Array(16));class ic{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new $r(0,0)}projectTilePoint(e,i,a){return{x:e,y:i,z:0}}locationPoint(e,i,a=!0){return e._coordinatePoint(e.locationCoordinate(i),a)}pixelsPerMeter(e,i){return dl(1,e)*i}pixelSpaceConversion(e,i,a){return 1}farthestPixelDistance(e){return Sp(e,e.pixelsPerMeter)}pointCoordinate(e,i,a,u){const p=e.horizonLineFromTop(!1),_=new ue(i,Math.max(p,a));return e.rayIntersectionCoordinate(e.pointRayIntersection(_,u))}pointCoordinate3D(e,i,a){const u=new ue(i,a);if(e.elevation)return e.elevation.pointCoordinate(u);{const p=this.pointCoordinate(e,u.x,u.y,0);return[p.x,p.y,p.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const a=e.horizonLineFromTop();return i.y0?i<-xu+a&&(i=-xu+a):i>xu-a&&(i=xu-a);const _=p/Math.pow(hd(i),u);let w=_*Math.sin(u*e),I=p-_*Math.cos(u*e);return w=.5*(w/Math.PI+.5),I=.5*(I/Math.PI+.5),{x:w,y:this.southernCenter?I:1-I,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:a,f:u}=this,p=u-i,_=Math.sign(p),w=Math.sign(a)*Math.sqrt(e*e+p*p);let I=Math.atan2(e,Math.abs(p))*_;p*a<0&&(I-=Math.PI*Math.sign(e)*_);const S=Ye(ye(I/a)+this.center[0],-180,180),B=Ye(ye(2*Math.atan(Math.pow(u/w,1/a))-xu),-Is,Is);return new $r(S,this.southernCenter?-B:B)}}class uf extends ic{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:Ll(e),y:kl(i),z:0}}unproject(e,i){const a=Oa(e),u=Fs(i);return new $r(a,u)}}const Rp=Le(Is);class Lp extends ic{project(e,i){const a=(i=Le(i))*i,u=a*a;return{x:.5*((e=Le(e))*(.8707-.131979*a+u*(u*(.003971*a-.001529*u)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let a=i=(2*(1-i)-1)*Math.PI,u=25,p=0,_=a*a;do{_=a*a;const S=_*_;p=(a*(1.007226+_*(.015085+S*(.028874*_-.044475-.005916*S)))-i)/(1.007226+_*(.045255+S*(.259866*_-.311325-.005916*11*S))),a=Ye(a-p,-Rp,Rp)}while(Math.abs(p)>1e-6&&--u>0);_=a*a;const w=Ye(ye(e/(.8707+_*(_*(_*_*_*(.003971-.001529*_)-.013791)-.131979))),-180,180),I=ye(a);return new $r(w,I)}}const vg=Le(Is);class iy extends ic{project(e,i){i=Le(i),e=Le(e);const a=Math.cos(i),u=2/Math.PI,p=Math.acos(a*Math.cos(e/2)),_=Math.sin(p)/p,w=.5*(e*u+2*a*Math.sin(e/2)/_)||0,I=.5*(i+Math.sin(i)/_)||0;return{x:.5*(w/Math.PI+.5),y:1-.5*(I/Math.PI+1),z:0}}unproject(e,i){let a=e=(2*e-.5)*Math.PI,u=i=(2*(1-i)-1)*Math.PI,p=25;const _=1e-6;let w=0,I=0;do{const S=Math.cos(u),B=Math.sin(u),j=2*B*S,H=B*B,X=S*S,te=Math.cos(a/2),de=Math.sin(a/2),ke=2*te*de,tt=de*de,mt=1-X*te*te,Qe=mt?1/mt:0,ut=mt?Math.acos(S*te)*Math.sqrt(1/mt):0,xt=.5*(2*ut*S*de+2*a/Math.PI)-e,bt=.5*(ut*B+u)-i,tn=.5*Qe*(X*tt+ut*S*te*H)+1/Math.PI,nn=Qe*(ke*j/4-ut*B*de),Tn=.125*Qe*(j*de-ut*B*X*ke),Un=.5*Qe*(H*te+ut*tt*S)+.5,fn=nn*Tn-Un*tn;w=(bt*nn-xt*Un)/fn,I=(xt*Tn-bt*tn)/fn,a=Ye(a-w,-Math.PI,Math.PI),u=Ye(u-I,-vg,vg)}while((Math.abs(w)>_||Math.abs(I)>_)&&--p>0);return new $r(ye(a),ye(u))}}class xg extends ic{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Le(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:a,cosPhi:u}=this;return{x:Le(e)*u*a+.5,y:-Math.sin(Le(i))/u*a+.5,z:0}}unproject(e,i){const{scale:a,cosPhi:u}=this,p=-(i-.5)/a,_=Ye(ye((e-.5)/a)/u,-180,180),w=Math.asin(Ye(p*u,-1,1)),I=Ye(ye(w),-Is,Is);return new $r(_,I)}}class bg extends uf{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,a){const u=Vu(e,i,a);return Yo(u,u,su(Ro(a))),{x:u[0],y:u[1],z:u[2]}}locationPoint(e,i){const a=ju(i.lat,i.lng),u=ea([],a),p=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;Ph(a,a,u,dl(1,0)*Ii*p);const _=ga(new Float64Array(16));return eu(_,e.pixelMatrix,e.globeMatrix),Yo(a,a,_),new ue(a[0],a[1])}pixelsPerMeter(e,i){return dl(1,0)*i}pixelSpaceConversion(e,i,a){const u=dl(1,e)*i,p=ki(dl(1,45)*i,u,a);return this.pixelsPerMeter(e,i)/p}createTileMatrix(e,i,a){const u=Ld(Ro(a.canonical));return eu(new Float64Array(16),e.globeMatrix,u)}createInversionMatrix(e,i){const{center:a}=e,u=su(Ro(i));return Mh(u,u,Le(a.lng)),tu(u,u,Le(a.lat)),Va(u,u,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(u)}pointCoordinate(e,i,a,u){return Oh(e,i,a,!0)||new Tc(0,0)}pointCoordinate3D(e,i,a){const u=this.pointCoordinate(e,i,a,0);return[u.x,u.y,u.z]}isPointAboveHorizon(e,i){return!Oh(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(u,p){const _=u.cameraToCenterDistance,w=u._centerAltitude*p,I=u._camera,S=u._camera.forward(),B=$a([],_a([],S,-_),[0,0,w]),j=u.worldSize/(2*Math.PI),H=[0,0,-j],X=u.width/u.height,te=Math.tan(u.fovAboveCenter),de=_a([],I.up(),te),ke=_a([],I.right(),te*X),tt=ea([],$a([],$a([],S,de),ke)),mt=[];let Qe;if(new Uu(B,tt).closestPointOnSphere(H,j,mt)){const ut=$a([],mt,H),xt=Pl([],ut,B);Qe=Math.cos(u.fovAboveCenter)*Id(xt)}else{const ut=Pl([],B,H),xt=Pl([],H,B);ea(xt,xt);const bt=Id(ut)-j;Qe=Math.sqrt(bt*(bt+2*j));const tn=Math.acos(Qe/(j+bt))-Math.acos(Ga(S,xt));Qe*=Math.cos(tn)}return 1.01*Qe}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),a=Ol(e.zoom);if(a>0){const u=Sp(e,dl(1,e.center.lat)*e.worldSize),p=e.worldSize/(2*Math.PI),_=Math.max(e.width,e.height)/e.worldSize*Math.PI;return ki(i,u+p*(1-Math.cos(_)),Math.pow(a,10))}return i}upVector(e,i,a){return Vu(i,a,e,1)}upVectorScale(e){return{metersToTile:Vs(Rh(Ro(e)))}}}function wg(n){const e=n.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(n.name){case"mercator":return new uf(n);case"equirectangular":return new eh(n);case"naturalEarth":return new Lp(n);case"equalEarth":return new Pp(n);case"winkelTripel":return new iy(n);case"albers":return i?new xg(n):new yg(n);case"lambertConformalConic":return i?new xg(n):new Op(n);case"globe":return new bg(n)}throw new Error(`Invalid projection name: ${n.name}`)}const ry=Gr.types,oy=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function df(n,e,i,a,u,p,_,w,I,S,B,j,H){const X=w?Math.min(nc,Math.round(w[0])):0,te=w?Math.min(nc,Math.round(w[1])):0;n.emplaceBack(e,i,Math.round(32*a),Math.round(32*u),p,_,(X<<1)+(I?1:0),te,16*S,16*B,256*j,256*H)}function th(n,e,i,a,u,p,_){n.emplaceBack(e,i,a,u,p,_)}function nh(n,e,i,a,u){n.emplaceBack(e,i,a,u),n.emplaceBack(e,i,a,u),n.emplaceBack(e,i,a,u),n.emplaceBack(e,i,a,u)}function sy(n){for(const e of n.sections)if($n(e.text))return!0;return!1}class kp{constructor(e){this.layoutVertexArray=new Ln,this.indexArray=new xi,this.programConfigurations=e,this.segments=new qo,this.dynamicLayoutVertexArray=new Zn,this.opacityVertexArray=new Di,this.placedSymbolArray=new Zo,this.globeExtVertexArray=new Wn}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,i,a,u){this.isEmpty()||(a&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ov.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,j_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,oy,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Rv.members,!0)),this.opacityVertexBuffer.itemSize=1),(a||u)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}ui(kp,"SymbolBuffers");class ca{constructor(e,i,a){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new a,this.segments=new qo,this.collisionVertexArray=new ur,this.collisionVertexArrayExt=new dr}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,V_.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Lv.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}ui(ca,"CollisionBuffers");class Bc{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(_=>_.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ga([]),this.placementViewportMatrix=ga([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Vd(this.zoom,i["text-size"]),this.iconSizeData=Vd(this.zoom,i["icon-size"]);const a=this.layers[0].layout,u=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=a.get("text-allow-overlap")||a.get("icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==p&&void 0!==u.constantOr(1),this.sortFeaturesByY=("viewport-y"===p||"auto"===p&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=a.get("text-writing-mode").map(_=>va[_]),this.stateDependentLayerIds=this.layers.filter(_=>_.isStateDependent()).map(_=>_.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new kp(new Fu(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new kp(new Fu(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ls,this.lineVertexArray=new ll,this.symbolInstances=new Vr}calculateGlyphDependencies(e,i,a,u,p){for(let _=0;_0)&&("constant"!==I.value.kind||I.value.value.length>0),H="constant"!==B.value.kind||!!B.value.value||Object.keys(B.parameters).length>0,X=_.get("symbol-sort-key");if(this.features=[],!j&&!H)return;const te=i.iconDependencies,de=i.glyphDependencies,ke=i.availableImages,tt=new Z(this.zoom);for(const{feature:mt,id:Qe,index:ut,sourceLayerIndex:xt}of e){const bt=p._featureFilter.needGeometry,tn=au(mt,bt);if(!p._featureFilter.filter(tt,tn,a))continue;if(bt||(tn.geometry=Fl(mt,a,u)),w&&1!==mt.type&&a.z<=5){const fn=tn.geometry,Pn=.98078528056,On=(Bn,Hn)=>Ga(Vu(Bn.x,Bn.y,a,1),Vu(Hn.x,Hn.y,a,1))=0;for(const On of nn.sections)if(On.image)te[On.image.name]=!0;else{const Bn=U(nn.toString()),Hn=On.fontStack||fn,wn=de[Hn]=de[Hn]||{};this.calculateGlyphDependencies(On.text,wn,Pn,this.allowVerticalPlacement,Bn)}}}"line"===_.get("symbol-placement")&&(this.features=function(mt){const Qe={},ut={},xt=[];let bt=0;function tn(fn){xt.push(mt[fn]),bt++}function nn(fn,Pn,On){const Bn=ut[fn];return delete ut[fn],ut[Pn]=Bn,xt[Bn].geometry[0].pop(),xt[Bn].geometry[0]=xt[Bn].geometry[0].concat(On[0]),Bn}function Tn(fn,Pn,On){const Bn=Qe[Pn];return delete Qe[Pn],Qe[fn]=Bn,xt[Bn].geometry[0].shift(),xt[Bn].geometry[0]=On[0].concat(xt[Bn].geometry[0]),Bn}function Un(fn,Pn,On){const Bn=On?Pn[0][Pn[0].length-1]:Pn[0][0];return`${fn}:${Bn.x}:${Bn.y}`}for(let fn=0;fnfn.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((mt,Qe)=>mt.sortKey-Qe.sortKey)}update(e,i,a,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,a,u),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,a,u))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=wg(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const a=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:u,y:p}of i)this.lineVertexArray.emplaceBack(u,p);return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(e,i,a,u,p,_,w,I,S,B,j,H,X,te){const de=e.indexArray,ke=e.layoutVertexArray,tt=e.globeExtVertexArray,mt=e.segments.prepareSegment(4*i.length,ke,de,this.canOverlap?_.sortKey:void 0),Qe=this.glyphOffsetArray.length,ut=mt.vertexLength,xt=this.allowVerticalPlacement&&w===va.vertical?Math.PI/2:0,bt=_.text&&_.text.sections;for(let nn=0;nn=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:u),_=Xl(this.textSizeData,e,p)/Ms;return this.tilePixelRatio*_}getSymbolInstanceIconSize(e,i,a){const u=this.icon.placedSymbolArray.get(a),p=Xl(this.iconSizeData,e,u);return this.tilePixelRatio*p}_commitDebugCollisionVertexUpdate(e,i,a){e.emplaceBack(i,-a,-a),e.emplaceBack(i,a,-a),e.emplaceBack(i,a,a),e.emplaceBack(i,-a,a)}_updateTextDebugCollisionBoxes(e,i,a,u,p,_){for(let w=u;w0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){const a=e.placedSymbolArray.get(i),u=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;pu[w]-u[I]||p[I]-p[w]),_}addToSortKeyRanges(e,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex);const{rightJustifiedTextSymbolIndex:u,centerJustifiedTextSymbolIndex:p,leftJustifiedTextSymbolIndex:_,verticalPlacedTextSymbolIndex:w,placedIconSymbolIndex:I,verticalPlacedIconSymbolIndex:S}=a;u>=0&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&p!==u&&this.addIndicesForPlacedSymbol(this.text,p),_>=0&&_!==p&&_!==u&&this.addIndicesForPlacedSymbol(this.text,_),w>=0&&this.addIndicesForPlacedSymbol(this.text,w),I>=0&&this.addIndicesForPlacedSymbol(this.icon,I),S>=0&&this.addIndicesForPlacedSymbol(this.icon,S)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ui(Bc,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Bc.MAX_GLYPHS=65535,Bc.addDynamicAttributes=nh;const ay=new ot({"symbol-placement":new ce(Kt.layout_symbol["symbol-placement"]),"symbol-spacing":new ce(Kt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ce(Kt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ve(Kt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ce(Kt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ce(Kt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ce(Kt.layout_symbol["icon-ignore-placement"]),"icon-optional":new ce(Kt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ce(Kt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ve(Kt.layout_symbol["icon-size"]),"icon-text-fit":new ce(Kt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ce(Kt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ve(Kt.layout_symbol["icon-image"]),"icon-rotate":new Ve(Kt.layout_symbol["icon-rotate"]),"icon-padding":new ce(Kt.layout_symbol["icon-padding"]),"icon-keep-upright":new ce(Kt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ve(Kt.layout_symbol["icon-offset"]),"icon-anchor":new Ve(Kt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ce(Kt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ce(Kt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ce(Kt.layout_symbol["text-rotation-alignment"]),"text-field":new Ve(Kt.layout_symbol["text-field"]),"text-font":new Ve(Kt.layout_symbol["text-font"]),"text-size":new Ve(Kt.layout_symbol["text-size"]),"text-max-width":new Ve(Kt.layout_symbol["text-max-width"]),"text-line-height":new Ve(Kt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ve(Kt.layout_symbol["text-letter-spacing"]),"text-justify":new Ve(Kt.layout_symbol["text-justify"]),"text-radial-offset":new Ve(Kt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ce(Kt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ve(Kt.layout_symbol["text-anchor"]),"text-max-angle":new ce(Kt.layout_symbol["text-max-angle"]),"text-writing-mode":new ce(Kt.layout_symbol["text-writing-mode"]),"text-rotate":new Ve(Kt.layout_symbol["text-rotate"]),"text-padding":new ce(Kt.layout_symbol["text-padding"]),"text-keep-upright":new ce(Kt.layout_symbol["text-keep-upright"]),"text-transform":new Ve(Kt.layout_symbol["text-transform"]),"text-offset":new Ve(Kt.layout_symbol["text-offset"]),"text-allow-overlap":new ce(Kt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ce(Kt.layout_symbol["text-ignore-placement"]),"text-optional":new ce(Kt.layout_symbol["text-optional"])});var Cg={paint:new ot({"icon-opacity":new Ve(Kt.paint_symbol["icon-opacity"]),"icon-color":new Ve(Kt.paint_symbol["icon-color"]),"icon-halo-color":new Ve(Kt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ve(Kt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ve(Kt.paint_symbol["icon-halo-blur"]),"icon-translate":new ce(Kt.paint_symbol["icon-translate"]),"icon-translate-anchor":new ce(Kt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ve(Kt.paint_symbol["text-opacity"]),"text-color":new Ve(Kt.paint_symbol["text-color"],{runtimeType:we,getOverride:n=>n.textColor,hasOverride:n=>!!n.textColor}),"text-halo-color":new Ve(Kt.paint_symbol["text-halo-color"]),"text-halo-width":new Ve(Kt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ve(Kt.paint_symbol["text-halo-blur"]),"text-translate":new ce(Kt.paint_symbol["text-translate"]),"text-translate-anchor":new ce(Kt.paint_symbol["text-translate-anchor"])}),layout:ay};class hf{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:to,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ui(hf,"FormatSectionOverride",{omit:["defaultValue"]});class ih extends cl{constructor(e){super(e,Cg)}recalculate(e,i){super.recalculate(e,i),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const a=this.layout.get("text-writing-mode");if(a){const u=[];for(const p of a)u.indexOf(p)<0&&u.push(p);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,a,u){const p=this.layout.get(e).evaluate(i,{},a,u),_=this._unevaluatedLayout._values[e];return _.isDataDriven()||ps(_.value)||!p?p:(w=i.properties,p.replace(/{([^{}]+)}/g,(S,B)=>B in w?String(w[B]):""));var w}createBucket(e){return new Bc(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Cg.paint.overridableProperties){if(!ih.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),a=new hf(i),u=new ao(a,i.property.specification);let p=null;p="constant"===i.value.kind||"source"===i.value.kind?new No("source",u):new fo("composite",u,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new qe(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&ih.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const a=e.get("text-field"),u=Cg.paint.properties[i];let p=!1;const _=w=>{for(const I of w)if(u.overrides&&u.overrides.hasOverride(I))return void(p=!0)};if("constant"===a.value.kind&&a.value.value instanceof xo)_(a.value.value.sections);else if("source"===a.value.kind){const w=S=>{p||(S instanceof Po&&Er(S.value)===an?_(S.value.sections):S instanceof li?_(S.sections):S.eachChild(w))},I=a.value;I._styleExpression&&w(I._styleExpression.expression)}return p}getProgramConfiguration(e){return new Sa(this,e)}}var ly={paint:new ot({"background-color":new ce(Kt.paint_background["background-color"]),"background-pattern":new ce(Kt.paint_background["background-pattern"]),"background-opacity":new ce(Kt.paint_background["background-opacity"])})},cy={paint:new ot({"raster-opacity":new ce(Kt.paint_raster["raster-opacity"]),"raster-hue-rotate":new ce(Kt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ce(Kt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ce(Kt.paint_raster["raster-brightness-max"]),"raster-saturation":new ce(Kt.paint_raster["raster-saturation"]),"raster-contrast":new ce(Kt.paint_raster["raster-contrast"]),"raster-resampling":new ce(Kt.paint_raster["raster-resampling"]),"raster-fade-duration":new ce(Kt.paint_raster["raster-fade-duration"])})};class uy extends cl{constructor(e){super(e,{}),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isLayerDraped(){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var Eg={paint:new ot({"sky-type":new ce(Kt.paint_sky["sky-type"]),"sky-atmosphere-sun":new ce(Kt.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new ce(Kt.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new ce(Kt.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new ce(Kt.paint_sky["sky-gradient-radius"]),"sky-gradient":new rt(Kt.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new ce(Kt.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new ce(Kt.paint_sky["sky-atmosphere-color"]),"sky-opacity":new ce(Kt.paint_sky["sky-opacity"])})};function Fp(n,e,i){const a=[0,0,1],u=Sd([]);return Rf(u,u,i?-Le(n)+Math.PI:Le(n)),Of(u,u,-Le(e)),y_(a,a,u),ea(a,a)}const dy={circle:class extends cl{constructor(n){super(n,T_)}createBucket(n){return new Wf(n)}queryRadius(n){const e=n;return Nl("circle-radius",this,e)+Nl("circle-stroke-width",this,e)+Nh(this.paint.get("circle-translate"))}queryIntersectsFeature(n,e,i,a,u,p,_,w){const I=Tm(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,n.pixelToTileUnitsFactor),S=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return tp(n,a,p,_,w,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),I,S)}getProgramIds(){return["circle"]}getProgramConfiguration(n){return new Sa(this,n)}},heatmap:class extends cl{createBucket(n){return new Im(n)}constructor(n){super(n,Hu),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(n){"heatmap-color"===n&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Wu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(n){return Nl("heatmap-radius",this,n)}queryIntersectsFeature(n,e,i,a,u,p,_,w){const I=this.paint.get("heatmap-radius").evaluate(e,i);return tp(n,a,p,_,w,!0,!0,new ue(0,0),I)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(n){return new Sa(this,n)}},hillshade:class extends cl{constructor(n){super(n,rp)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends cl{constructor(n){super(n,zm)}getProgramIds(){const n=this.paint.get("fill-pattern"),e=n&&n.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(n){return new Sa(this,n)}recalculate(n,e){super.recalculate(n,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(n){return new $h(n)}queryRadius(){return Nh(this.paint.get("fill-translate"))}queryIntersectsFeature(n,e,i,a,u,p){return!n.queryGeometry.isAboveHorizon&&Yf(ep(n.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,n.pixelToTileUnitsFactor),a)}isTileClipped(){return!0}},"fill-extrusion":class extends cl{constructor(n){super(n,B_)}createBucket(n){return new Ku(n)}queryRadius(){return Nh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(n){return new Sa(this,n)}queryIntersectsFeature(n,e,i,a,u,p,_,w,I){const S=Tm(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,n.pixelToTileUnitsFactor),B=this.paint.get("fill-extrusion-height").evaluate(e,i),j=this.paint.get("fill-extrusion-base").evaluate(e,i),H=[0,0],X=w&&p.elevation,te=p.elevation?p.elevation.exaggeration():1,de=n.tile.getBucket(this);if(X&&de instanceof Ku){const ut=de.centroidVertexArray,xt=I+1;xtut.polygon).flat());const ke=X?w:null,[tt,mt]=(xt=a,bt=j,tn=B,nn=S,Tn=_,Un=ke,fn=H,Pn=te,On=p.center.lat,"globe"===(ut=p).projection.name?function(Hn,wn,si,fi,ci,Yi,Qn,Mi,Ji,Ir,Ki){const Ri=[],Xr=[],Qi=Hn.projection.upVectorScale(Ki,Hn.center.lat,Hn.worldSize).metersToTile,nr=[0,0,0,1],no=[0,0,0,1],io=(oo,wo,jo,Ko)=>{oo[0]=wo,oo[1]=jo,oo[2]=Ko,oo[3]=1},ro=up();si>0&&(si+=ro),fi+=ro;for(const oo of wn){const wo=[],jo=[];for(const Ko of oo){const Qr=Ko.x+ci.x,is=Ko.y+ci.y,Lo=Hn.projection.projectTilePoint(Qr,is,Ki),lo=Hn.projection.upVector(Ki,Ko.x,Ko.y);let Mr=si,So=fi;if(Qn){const eo=Jm(Qr,is,si,fi,Qn,Mi,Ji,Ir);Mr+=eo.base,So+=eo.top}0!==si?io(nr,Lo.x+lo[0]*Qi*Mr,Lo.y+lo[1]*Qi*Mr,Lo.z+lo[2]*Qi*Mr):io(nr,Lo.x,Lo.y,Lo.z),io(no,Lo.x+lo[0]*Qi*So,Lo.y+lo[1]*Qi*So,Lo.z+lo[2]*Qi*So),Yo(nr,nr,Yi),Yo(no,no,Yi),wo.push(new la(nr[0],nr[1],nr[2])),jo.push(new la(no[0],no[1],no[2]))}Ri.push(wo),Xr.push(jo)}return[Ri,Xr]}(ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On,n.tileID.canonical):Un?function(Hn,wn,si,fi,ci,Yi,Qn,Mi,Ji){const Ir=[],Ki=[],Ri=[0,0,0,1];for(const Xr of Hn){const Qi=[],nr=[];for(const no of Xr){const io=no.x+fi.x,ro=no.y+fi.y,oo=Jm(io,ro,wn,si,Yi,Qn,Mi,Ji);Ri[0]=io,Ri[1]=ro,Ri[2]=oo.base,Ri[3]=1,iu(Ri,Ri,ci),Ri[3]=Math.max(Ri[3],1e-5);const wo=new la(Ri[0]/Ri[3],Ri[1]/Ri[3],Ri[2]/Ri[3]);Ri[0]=io,Ri[1]=ro,Ri[2]=oo.top,Ri[3]=1,iu(Ri,Ri,ci),Ri[3]=Math.max(Ri[3],1e-5);const jo=new la(Ri[0]/Ri[3],Ri[1]/Ri[3],Ri[2]/Ri[3]);Qi.push(wo),nr.push(jo)}Ir.push(Qi),Ki.push(nr)}return[Ir,Ki]}(xt,bt,tn,nn,Tn,Un,fn,Pn,On):function(Hn,wn,si,fi,ci){const Yi=[],Qn=[],Mi=ci[8]*wn,Ji=ci[9]*wn,Ir=ci[10]*wn,Ki=ci[11]*wn,Ri=ci[8]*si,Xr=ci[9]*si,Qi=ci[10]*si,nr=ci[11]*si;for(const no of Hn){const io=[],ro=[];for(const oo of no){const wo=oo.x+fi.x,jo=oo.y+fi.y,Ko=ci[0]*wo+ci[4]*jo+ci[12],Qr=ci[1]*wo+ci[5]*jo+ci[13],is=ci[2]*wo+ci[6]*jo+ci[14],Lo=ci[3]*wo+ci[7]*jo+ci[15],lo=Ko+Mi,Mr=Qr+Ji,So=is+Ir,eo=Math.max(Lo+Ki,1e-5),vs=Ko+Ri,Vo=Qr+Xr,Ss=is+Qi,$o=Math.max(Lo+nr,1e-5);io.push(new la(lo/eo,Mr/eo,So/eo)),ro.push(new la(vs/$o,Vo/$o,Ss/$o))}Yi.push(io),Qn.push(ro)}return[Yi,Qn]}(xt,bt,tn,nn,Tn)),Qe=n.queryGeometry;var ut,xt,bt,tn,nn,Tn,Un,fn,Pn,On;return function(ut,xt,bt){let tn=1/0;Yf(bt,xt)&&(tn=Jh(bt,xt[0]));for(let nn=0;nn=3)for(let te=0;te{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class fy{constructor(){this.tasks={},this.taskQueue=[],Rt(["process"],this),this.invoker=new hy(this.process),this.nextId=0}add(e,i){const a=this.nextId++,u=function({type:p,isSymbolTile:_,zoom:w}){return w=w||0,"message"===p?0:"maybePrepare"!==p||_?"parseTile"!==p||_?"parseTile"===p&&_?300-w:"maybePrepare"===p&&_?400-w:500:200-w:100-w}(i);if(0===u){Yt();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[a]={fn:e,metadata:i,priority:u,id:a},this.taskQueue.push(a),this.invoker.trigger(),{cancel:()=>{delete this.tasks[a]}}}process(){Yt();try{if(this.taskQueue=this.taskQueue.filter(a=>!!this.tasks[a]),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let u=0;u>=1)>1;){const S=i+u>>1,B=a+p>>1;1&e?(u=i,p=a,i=_,a=w):(i=u,a=p,u=_,p=w),_=S,w=B}const I=4*n;Nc[I+0]=i,Nc[I+1]=a,Nc[I+2]=u,Nc[I+3]=p}const fl=new Uint16Array(2178),zc=new Uint8Array(1089),rh=new Uint16Array(1089);function Bp(n){return 0===n?-.03125:32===n?.03125:0}var oh=zt([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const ff={type:2,extent:Ii,loadGeometry:()=>[[new ue(0,0),new ue(Ii+1,0),new ue(Ii+1,Ii+1),new ue(0,Ii+1),new ue(0,0)]]};class Ig{constructor(e,i,a,u,p){this.tileID=e,this.uid=Re(),this.uses=0,this.tileSize=i,this.tileZoom=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=p,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;ip.getLayer(S)).filter(Boolean);if(0!==I.length){w.layers=I,w.stateDependentLayerIds&&(w.stateDependentLayers=w.stateDependentLayerIds.map(S=>I.filter(B=>B.id===S)[0]));for(const S of I)_[S.id]=w}}return _}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Bc){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Bc&&p.hasRTLText){this.hasRTLText=!0,L.isLoading()||L.isLoaded()||"deferred"!==T()||O();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(u).queryRadius(p))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new jr}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const a in this.buckets){const u=this.buckets[a];u.uploadPending()&&u.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new bu(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new bu(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new bu(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,a,u,p,_,w,I){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:u,pixelPosMatrix:w,transform:_,params:p,tileTransform:this.tileTransform},e,i,a):{}}querySourceFeatures(e,i){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const u=a.loadVTLayers(),p=i?i.sourceLayer:"",_=u._geojsonTileLayer||u[p];if(!_)return;const w=_c(i&&i.filter),{z:I,x:S,y:B}=this.tileID.canonical,j={z:I,x:S,y:B};for(let H=0;H<_.length;H++){const X=_.feature(H);if(w.needGeometry){const ke=au(X,!0);if(!w.filter(new Z(this.tileID.overscaledZ),ke,this.tileID.canonical))continue}else if(!w.filter(new Z(this.tileID.overscaledZ),X))continue;const te=a.getId(X,p),de=new Dg(X,I,S,B,te);de.tile=j,e.push(de)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const i=this.expirationTime;if(e.cacheControl){const a=Ut(e.cacheControl);a["max-age"]&&(this.expirationTime=Date.now()+1e3*a["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const a=Date.now();let u=!1;if(this.expirationTime>a)u=!1;else if(i)if(this.expirationTime=0;ke--){const tt=4*ke,mt=Nc[tt+0],Qe=Nc[tt+1],ut=Nc[tt+2],xt=Nc[tt+3],bt=mt+ut>>1,tn=Qe+xt>>1,nn=bt+tn-Qe,Tn=tn+mt-bt,Un=33*Qe+mt,fn=33*xt+ut,Pn=33*tn+bt,On=Math.hypot((fl[2*Un+0]+fl[2*fn+0])/2-fl[2*Pn+0],(fl[2*Un+1]+fl[2*fn+1])/2-fl[2*Pn+1])>=16;zc[Pn]=zc[Pn]||(On?1:0),ke<1022&&(zc[Pn]=zc[Pn]||zc[33*(Qe+Tn>>1)+(mt+nn>>1)]||zc[33*(xt+Tn>>1)+(ut+nn>>1)])}const j=new Rn,H=new xi;let X=0;function te(ke,tt){const mt=33*tt+ke;return 0===rh[mt]&&(j.emplaceBack(fl[2*mt+0],fl[2*mt+1],ke*Ii/32,tt*Ii/32),rh[mt]=++X),rh[mt]-1}function de(ke,tt,mt,Qe,ut,xt){const bt=ke+mt>>1,tn=tt+Qe>>1;if(Math.abs(ke-ut)+Math.abs(tt-xt)>1&&zc[33*tn+bt])de(ut,xt,ke,tt,bt,tn),de(mt,Qe,ut,xt,bt,tn);else{const nn=te(ke,tt),Tn=te(mt,Qe),Un=te(ut,xt);H.emplaceBack(nn,Tn,Un)}}return de(0,0,32,32,32,0),de(32,32,0,0,0,32),{vertices:j,indices:H}}(this.tileID.canonical,i);u=_.vertices,p=_.indices}else{u=new Rn,p=new xi;for(const{x:w,y:I}of a)u.emplaceBack(w,I,0,0);const _=Fm(u.int16,void 0,4);for(let w=0;w<_.length;w+=3)p.emplaceBack(_[w],_[w+1],_[w+2])}this._tileBoundsBuffer=e.createVertexBuffer(u,oh.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(p),this._tileBoundsSegments=qo.simpleSegment(0,0,u.length,p.length)}_makeGlobeTileDebugBuffers(e,i){const a=i.projection;if(!a||"globe"!==a.name||i.freezeTileCoverage)return;const u=this.tileID.canonical,p=su(zf(u,i)),_=Ol(i.zoom);let w;_>0&&(w=Ih(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,u,i,p,w,_),this._makeGlobeTileDebugTextBuffer(e,u,i,p,w,_)}_globePoint(e,i,a,u,p,_,w){let I=Vu(e,i,a);if(_){const S=1<.5?X=-1:H<-.5&&(X=1);let te=(e/Ii+a.x)/S+X,de=(i/Ii+a.y)/S;te=(te-B)*u._pixelsPerMercatorPixel+B,de=(de-j)*u._pixelsPerMercatorPixel+j;const ke=[te*u.worldSize,de*u.worldSize,0];Yo(ke,ke,_),I=ul(I,ke,w)}return Yo(I,I,p)}_makeGlobeTileDebugBorderBuffer(e,i,a,u,p,_){const w=new Vn,I=new vo,S=new on,B=(H,X,te,de,ke)=>{const tt=(te-H)/(ke-1),mt=(de-X)/(ke-1),Qe=w.length;for(let ut=0;utj*X+te;for(let X=0;Xe[_])return null}else{const w=1/a[_];let I=(n[_]-i[_])*w,S=(e[_]-i[_])*w;if(I>S){const B=I;I=S,S=B}if(I>u&&(u=I),Sp)return null}return u}function Up(n,e,i,a,u,p,_,w,I,S,B){const j=a-n,H=u-e,X=p-i,te=_-n,de=w-e,ke=I-i,tt=B[1]*ke-B[2]*de,mt=B[2]*te-B[0]*ke,Qe=B[0]*de-B[1]*te,ut=j*tt+H*mt+X*Qe;if(Math.abs(ut)<1e-15)return null;const xt=1/ut,bt=S[0]-n,tn=S[1]-e,nn=S[2]-i,Tn=(bt*tt+tn*mt+nn*Qe)*xt;if(Tn<0||Tn>1)return null;const Un=tn*X-nn*H,fn=nn*j-bt*X,Pn=bt*H-tn*j,On=(B[0]*Un+B[1]*fn+B[2]*Pn)*xt;return On<0||Tn+On>1?null:(te*Un+de*fn+ke*Pn)*xt}function pf(n,e,i){return(n-e)/(i-e)}function Ul(n,e,i,a,u,p,_,w,I){const S=1<{const mt=ke?1:0,Qe=(X+1)*de-mt,ut=te*de,xt=(te+1)*de-mt;tt[0]=X*de,tt[1]=ut,tt[2]=Qe,tt[3]=xt};let j=new Np(I);const H=[];for(let X=0;X=1;I/=2){const X=w[w.length-1];j=new Np(I);for(let te=0;te0;){const{idx:te,t:de,nodex:ke,nodey:tt,depth:mt}=X.pop();if(this.leaves[te]){Ul(ke,tt,mt,e,i,a,u,j,H);const ut=1<=wn[2])return de}continue}let Qe=0;for(let ut=0;ut=S[B[nn]]&&(B.splice(nn,0,ut),tn=!0);tn||(B[Qe]=ut),Qe++}}for(let ut=0;ut=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const a=[0,0,0,0],u=wu.getUnpackVector(i);let p=Math.floor((e+u[3])/u[2]);return a[2]=p%256,p=Math.floor(p/256),a[1]=p%256,p=Math.floor(p/256),a[0]=p,a}getPixels(){return new ya({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let u=i*this.dim,p=i*this.dim+this.dim,_=a*this.dim,w=a*this.dim+this.dim;switch(i){case-1:u=p-1;break;case 1:p=u+1}switch(a){case-1:_=w-1;break;case 1:w=_+1}const I=-i*this.dim,S=-a*this.dim;for(let B=_;B{this.remove(e,p)},a)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const _=this._getAndRemoveByKey(this.order[0]);_&&this.onRemove(_)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const a=e.wrapped().key,u=void 0===i?0:this.data[a].indexOf(i),p=this.data[a][u];return this.data[a].splice(u,1),p.timeout&&clearTimeout(p.timeout),0===this.data[a].length&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const a in this.data)for(const u of this.data[a])e(u.value)||i.push(u);for(const a of i)this.remove(a.value.tileID,a)}}class oc{constructor(e,i,a){this.func=e,this.mask=i,this.range=a}}oc.ReadOnly=!1,oc.ReadWrite=!0,oc.disabled=new oc(519,oc.ReadOnly,[0,1]);class Zp{constructor(e,i,a,u,p,_){this.test=e,this.ref=i,this.mask=a,this.fail=u,this.depthFail=p,this.pass=_}}Zp.disabled=new Zp({func:519,mask:0},0,0,7680,7680,7680);class pl{constructor(e,i,a){this.blendFunction=e,this.blendColor=i,this.mask=a}}pl.Replace=[1,0],pl.disabled=new pl(pl.Replace,kr.transparent,[!1,!1,!1,!1]),pl.unblended=new pl(pl.Replace,kr.transparent,[!0,!0,!0,!0]),pl.alphaBlended=new pl([1,771],kr.transparent,[!0,!0,!0,!0]);class ml{constructor(e,i,a){this.enable=e,this.mode=i,this.frontFace=a}}ml.disabled=new ml(!1,1029,2305),ml.backCCW=new ml(!0,1029,2305),ml.backCW=new ml(!0,1029,2304),ml.frontCW=new ml(!0,1028,2304),ml.frontCCW=new ml(!0,1028,2305);class Uc extends Bi{constructor(e,i,a){super(),this.id=e,this._onlySymbols=a,i.on("data",u=>{"source"===u.dataType&&"metadata"===u.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===u.dataType&&"content"===u.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new sh(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new Mg,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if("loaded"!==i.state&&"errored"!==i.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const i in this._tiles){const a=this._tiles[i];a.upload(e),a.prepare(this.map.style.imageManager)}}getIds(){return Ht(this._tiles).map(e=>e.tileID).sort(Vp).map(e=>e.key)}getRenderableIds(e){const i=[];for(const a in this._tiles)this._isIdRenderable(+a,e)&&i.push(this._tiles[a]);return e?i.sort((a,u)=>{const p=a.tileID,_=u.tileID,w=new ue(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),I=new ue(_.canonical.x,_.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-_.overscaledZ||I.y-w.y||I.x-w.x}).map(a=>a.tileID.key):i.map(a=>a.tileID).sort(Vp).map(a=>a.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const a=this._tiles[e];a&&("loading"!==a.state&&(a.state=i),this._loadTile(a,this._tileLoaded.bind(this,a,e,i)))}_tileLoaded(e,i,a,u){if(u)if(e.state="errored",404!==u.status)this._source.fire(new qi(u,{tile:e}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const p=this.map.painter.terrain;this.update(this.transform,p.getScaledDemTileSize(),!0),p.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=ir.now(),"expired"===a&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this._source.type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new Ar("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let u=0;u1||(Math.abs(_)>1&&(1===Math.abs(_+I)?_+=I:1===Math.abs(_-I)&&(_-=I)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,_,w),u.neighboringTiles&&u.neighboringTiles[S]&&(u.neighboringTiles[S].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,a,u){for(const p in this._tiles){let _=this._tiles[p];if(u[p]||!_.hasData()||_.tileID.overscaledZ<=i||_.tileID.overscaledZ>a)continue;let w=_.tileID;for(;_&&_.tileID.overscaledZ>i+1;){const S=_.tileID.scaledTo(_.tileID.overscaledZ-1);_=this._tiles[S.key],_&&_.hasData()&&(w=S)}let I=w;for(;I.overscaledZ>i;)if(I=I.scaledTo(I.overscaledZ-1),e[I.key]){u[w.key]=w;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const a=this._loadedParentTiles[e.key];return a&&a.tileID.overscaledZ>=i?a:null}for(let a=e.overscaledZ-1;a>=i;a--){const u=e.scaledTo(a),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const a=Math.ceil(e.width/i)+1,u=Math.ceil(e.height/i)+1,p=Math.floor(a*u*5),_="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,p):p,w="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,_):_;this._cache.setMaxSize(w)}handleWrapJump(e){const i=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,i){const a={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+i),a[p.tileID.key]=p}this._tiles=a;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(+u,this._tiles[u])}}update(e,i,a){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;let u;this.updateCacheSize(e,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(w=>new Bs(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y)):(u=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(u=u.filter(w=>this._source.hasTile(w)))):u=[];const p=this._updateRetainedTiles(u);if(fd(this._source.type)&&0!==u.length){const w={},I={},S=Object.keys(p);for(const j of S){const H=p[j],X=this._tiles[j];if(!X||X.fadeEndTime&&X.fadeEndTime<=ir.now())continue;const te=this.findLoadedParent(H,Math.max(H.overscaledZ-Uc.maxOverzooming,this._source.minzoom));te&&(this._addTile(te.tileID),w[te.tileID.key]=te.tileID),I[j]=H}const B=u[u.length-1].overscaledZ;for(const j in this._tiles){const H=this._tiles[j];if(p[j]||!H.hasData())continue;let X=H.tileID;for(;X.overscaledZ>B;){X=X.scaledTo(X.overscaledZ-1);const te=this._tiles[X.key];if(te&&te.hasData()&&I[X.key]){p[j]=H.tileID;break}}}for(const j in w)p[j]||(this._coveredTiles[j]=!0,p[j]=w[j])}for(const w in p)this._tiles[w].clearFadeHold();const _=function(w,I){const S=[];for(const B in w)B in I||S.push(B);return S}(this._tiles,p);for(const w of _){const I=this._tiles[w];I.hasSymbolBuckets&&!I.holdingForFade()?I.setHoldDuration(this.map._fadeDuration):I.hasSymbolBuckets&&!I.symbolFadeFinished()||this._removeTile(+w)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(0===e.length)return i;const a={},u=e.reduce((S,B)=>Math.min(S,B.overscaledZ),1/0),p=e[0].overscaledZ,_=Math.max(p-Uc.maxOverzooming,this._source.minzoom),w=Math.max(p+Uc.maxUnderzooming,this._source.minzoom),I={};for(const S of e){const B=this._addTile(S);i[S.key]=S,B.hasData()||u=this._source.maxzoom){const H=S.children(this._source.maxzoom)[0],X=this.getTile(H);if(X&&X.hasData()){i[H.key]=H;continue}}else{const H=S.children(this._source.maxzoom);if(i[H[0].key]&&i[H[1].key]&&i[H[2].key]&&i[H[3].key])continue}let j=B.wasRequested();for(let H=S.overscaledZ-1;H>=_;--H){const X=S.scaledTo(H);if(a[X.key]||(a[X.key]=!0,B=this.getTile(X),!B&&j&&(B=this._addTile(X)),B&&(i[X.key]=X,j=B.wasRequested(),B.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let a,u=this._tiles[e].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){a=this._loadedParentTiles[u.key];break}i.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;u=p}for(const p of i)this._loadedParentTiles[p]=a}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const a=!!i;if(!a){const u=this.map?this.map.painter:null;i=new Ig(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,u,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,a||this._source.fire(new Ar("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const a=i.getExpiryTimeout();a&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},a))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&"reloading"!==i.state?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,a){const u=[],p=this.transform;if(!p)return u;const _="globe"===p.projection.name,w=Ll(p.center.lng);for(const I in this._tiles){const S=this._tiles[I];if(a&&S.clearQueryDebugViz(),S.holdingForFade())continue;let B;if(_){const j=S.tileID.canonical;if(0===j.z){const H=[Math.abs(Ye(w,...ah(j,-1))-w),Math.abs(Ye(w,...ah(j,1))-w)];B=[0,2*H.indexOf(Math.min(...H))-1]}else{const H=[Math.abs(Ye(w,...ah(j,-1))-w),Math.abs(Ye(w,...ah(j,0))-w),Math.abs(Ye(w,...ah(j,1))-w)];B=[H.indexOf(Math.min(...H))-1]}}else B=[0];for(const j of B){const H=e.containsTile(S,p,i,j);H&&u.push(H)}}return u}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(a=>this._tiles[a].tileID);for(const a of i)a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(fd(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=ir.now())return!0}return!1}setFeatureState(e,i,a){this._state.updateState(e=e||"_geojsonTileLayer",i,a)}removeFeatureState(e,i,a){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,a)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,a){const u=this._tiles[e];u&&u.setDependencies(i,a)}reloadTilesForDependencies(e,i){for(const a in this._tiles)this._tiles[a].hasDependency(e,i)&&this._reloadTile(+a,"reloading");this._cache.filter(a=>!a.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const w=()=>{this._sourceLoaded&&(this._source.off("data",w),this._preloadTiles(e,i))};return void this._source.on("data",w)}const a=new Map,u=Array.isArray(e)?e:[e],p=this.map.painter.terrain,_=this.usedForTerrain&&p?p.getScaledDemTileSize():this._source.tileSize;for(const w of u){const I=w.coveringTiles({tileSize:_,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const S of I)a.set(S.key,S);this.usedForTerrain&&w.updateElevation(!1)}qt(Array.from(a.values()),(w,I)=>{const S=new Ig(w,this._source.tileSize*w.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(S,B=>{"raster-dem"===this._source.type&&S.dem&&this._backfillDEM(S),I(B,S)})},i)}}function Vp(n,e){const i=Math.abs(2*n.wrap)-+(n.wrap<0),a=Math.abs(2*e.wrap)-+(e.wrap<0);return n.overscaledZ-e.overscaledZ||a-i||e.canonical.y-n.canonical.y||e.canonical.x-n.canonical.x}function fd(n){return"raster"===n||"image"===n||"video"===n||"custom"===n}function ah(n,e){const i=1<=0&&j[3]>=0&&I.insert(w,j[0],j[1],j[2],j[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new hu(new Wd(this.rawTileData)).layers,this.sourceLayerCoder=new Tg(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,a,u){this.loadVTLayers();const p=e.params||{},_=_c(p.filter),w=e.tileResult,I=e.transform,S=w.bufferedTilespaceBounds,B=this.grid.query(S.min.x,S.min.y,S.max.x,S.max.y,(te,de,ke,tt)=>Xf(w.bufferedTilespaceGeometry,te,de,ke,tt));B.sort(gy);let j=null;I.elevation&&B.length>0&&(j=lh.create(I.elevation,this.tileID));const H={};let X;for(let te=0;te(tt||(tt=Fl(mt,this.tileID.canonical,e.tileTransform)),Qe.queryIntersectsFeature(w,mt,ut,tt,this.z,e.transform,e.pixelPosMatrix,j,xt)))}return H}loadMatchingFeature(e,i,a,u,p,_,w,I,S){const{featureIndex:B,bucketIndex:j,sourceLayerIndex:H,layoutVertexArrayOffset:X}=i,te=this.bucketLayerIDs[j];if(u&&!function(mt,Qe){for(let ut=0;ut=0)return!0;return!1}(u,te))return;const de=this.sourceLayerCoder.decode(H),ke=this.vtLayers[de].feature(B);if(a.needGeometry){const mt=au(ke,!0);if(!a.filter(new Z(this.tileID.overscaledZ),mt,this.tileID.canonical))return}else if(!a.filter(new Z(this.tileID.overscaledZ),ke))return;const tt=this.getId(ke,de);for(let mt=0;mt{const w=e instanceof Ke?e.get(_):null;return w&&w.evaluate?w.evaluate(i,a,u):w})}function gy(n,e){return e-n}ui($p,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class pd{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new hl({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const a=this.getKey(e,i);return this.positions[a]}trim(){const e=this.width,i=this.height=St(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,a){const u=[];let p=e.length%2==1?-e[e.length-1]*a:0,_=e[0]*a,w=!0;u.push({left:p,right:_,isDash:w,zeroLength:0===e[0]});let I=e[0];for(let S=1;S1&&(I=e[++w]);const B=Math.abs(S-I.left),j=Math.abs(S-I.right),H=Math.min(B,j);let X;const te=p/a*(u+1);if(I.isDash){const de=u-Math.abs(te);X=Math.sqrt(H*H+de*de)}else X=u-Math.sqrt(H*H+te*te);this.image.data[_+S]=Math.max(0,Math.min(255,X+128))}}}addRegularDash(e,i){for(let I=e.length-1;I>=0;--I){const S=e[I],B=e[I+1];S.zeroLength?e.splice(I,1):B&&B.isDash===S.isDash&&(B.left=S.left,e.splice(I,1))}const a=e[0],u=e[e.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const p=this.width*this.nextRow;let _=0,w=e[_];for(let I=0;I1&&(w=e[++_]);const S=Math.abs(I-w.left),B=Math.abs(I-w.right),j=Math.min(S,B);this.image.data[p+I]=Math.max(0,Math.min(255,(w.isDash?j:-j)+i+128))}}addDash(e,i){const a=this.getKey(e,i);if(this.positions[a])return this.positions[a];const u="round"===i,p=u?7:0,_=2*p+1;if(this.nextRow+_>this.height)return dt("LineAtlas out of space"),null;0===e.length&&e.push(1);let w=0;for(let B=0;B=Pn.maxzoom||"none"!==Pn.visibility&&(Gp(fn,this.zoom,a),(I[Pn.id]=Pn.createBucket({index:w.bucketLayerIDs.length,layers:fn,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Tn,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:a})).populate(Un,B,this.tileID.canonical,this.tileTransform),w.bucketLayerIDs.push(fn.map(On=>On.id)))}}let H,X,te,de;S.trim();const ke={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},tt=()=>{if(H)return p(H);if(X&&te&&de){const xt=new Fg(X),bt=new sg(te,de);for(const tn in I){const nn=I[tn];nn instanceof Bc?(Gp(nn.layers,this.zoom,a),Bv(nn,X,xt.positions,te,bt.iconPositions,this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection)):nn.hasPattern&&(nn instanceof Qu||nn instanceof $h||nn instanceof Ku)&&(Gp(nn.layers,this.zoom,a),nn.addFeatures(B,this.tileID.canonical,bt.patternPositions,a,this.tileTransform))}this.status="done",p(null,{buckets:Ht(I).filter(tn=>!tn.isEmpty()),featureIndex:w,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:xt.image,lineAtlas:S,imageAtlas:bt,glyphMap:this.returnDependencies?X:null,iconMap:this.returnDependencies?te:null,glyphPositions:this.returnDependencies?xt.positions:null})}},mt=Gt(B.glyphDependencies,xt=>Object.keys(xt).map(Number));Object.keys(mt).length?u.send("getGlyphs",{uid:this.uid,stacks:mt},(xt,bt)=>{H||(H=xt,X=bt,tt())},void 0,!1,ke):X={};const Qe=Object.keys(B.iconDependencies);Qe.length?u.send("getImages",{icons:Qe,source:this.source,tileID:this.tileID,type:"icons"},(xt,bt)=>{H||(H=xt,te=bt,tt())},void 0,!1,ke):te={};const ut=Object.keys(B.patternDependencies);ut.length?u.send("getImages",{icons:ut,source:this.source,tileID:this.tileID,type:"patterns"},(xt,bt)=>{H||(H=xt,de=bt,tt())},void 0,!1,ke):de={},tt()}}function Gp(n,e,i){const a=new Z(e);for(const u of n)u.recalculate(a,i)}class Bg{constructor(e){this.entries={},this.scheduler=e}request(e,i,a,u){const p=this.entries[e]=this.entries[e]||{callbacks:[]};if(p.result){const[_,w]=p.result;return this.scheduler?this.scheduler.add(()=>{u(_,w)},i):u(_,w),()=>{}}return p.callbacks.push(u),p.cancel||(p.cancel=a((_,w)=>{p.result=[_,w];for(const I of p.callbacks)this.scheduler?this.scheduler.add(()=>{I(_,w)},i):I(_,w);setTimeout(()=>delete this.entries[e],3e3)})),()=>{p.result||(p.callbacks=p.callbacks.filter(_=>_!==u),p.callbacks.length||(p.cancel(),delete this.entries[e]))}}}function Ng(n,e,i){const a=JSON.stringify(n.request);return n.data&&(this.deduped.entries[a]={result:[null,n.data]}),this.deduped.request(a,{type:"parseTile",isSymbolTile:n.isSymbolTile,zoom:n.tileZoom},u=>{const p=_n(n.request,(_,w,I,S)=>{_?u(_):w&&u(null,{vectorTile:i?void 0:new hu(new Wd(w)),rawData:w,cacheControl:I,expires:S})});return()=>{p.cancel(),u()}},e)}const zg=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Hp{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(e,0,2);if(219!==i)throw new Error("Data does not appear to be in a KDBush format.");const u=a>>4;if(1!==u)throw new Error(`Got v${u} data when expected v1.`);const p=zg[15&a];if(!p)throw new Error("Unrecognized array type.");const[_]=new Uint16Array(e,2,1),[w]=new Uint32Array(e,4,1);return new Hp(w,_,p,e)}constructor(e,i=64,a=Float64Array,u){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const p=zg.indexOf(this.ArrayType),_=2*e*this.ArrayType.BYTES_PER_ELEMENT,w=e*this.IndexArrayType.BYTES_PER_ELEMENT,I=(8-w%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+w+I,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+_+w+I),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+w+I,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=i,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return gf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,a,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:_,nodeSize:w}=this,I=[0,p.length-1,0],S=[];for(;I.length;){const B=I.pop()||0,j=I.pop()||0,H=I.pop()||0;if(j-H<=w){for(let ke=H;ke<=j;ke++){const tt=_[2*ke],mt=_[2*ke+1];tt>=e&&tt<=a&&mt>=i&&mt<=u&&S.push(p[ke])}continue}const X=H+j>>1,te=_[2*X],de=_[2*X+1];te>=e&&te<=a&&de>=i&&de<=u&&S.push(p[X]),(0===B?e<=te:i<=de)&&(I.push(H),I.push(X-1),I.push(1-B)),(0===B?a>=te:u>=de)&&(I.push(X+1),I.push(j),I.push(1-B))}return S}within(e,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:_}=this,w=[0,u.length-1,0],I=[],S=a*a;for(;w.length;){const B=w.pop()||0,j=w.pop()||0,H=w.pop()||0;if(j-H<=_){for(let ke=H;ke<=j;ke++)Ug(p[2*ke],p[2*ke+1],e,i)<=S&&I.push(u[ke]);continue}const X=H+j>>1,te=p[2*X],de=p[2*X+1];Ug(te,de,e,i)<=S&&I.push(u[X]),(0===B?e-a<=te:i-a<=de)&&(w.push(H),w.push(X-1),w.push(1-B)),(0===B?e+a>=te:i+a>=de)&&(w.push(X+1),w.push(j),w.push(1-B))}return I}}function gf(n,e,i,a,u,p){if(u-a<=i)return;const _=a+u>>1;_f(n,e,_,a,u,p),gf(n,e,i,a,_-1,1-p),gf(n,e,i,_+1,u,1-p)}function _f(n,e,i,a,u,p){for(;u>a;){if(u-a>600){const S=u-a+1,B=i-a+1,j=Math.log(S),H=.5*Math.exp(2*j/3),X=.5*Math.sqrt(j*H*(S-H)/S)*(B-S/2<0?-1:1);_f(n,e,i,Math.max(a,Math.floor(i-B*H/S+X)),Math.min(u,Math.floor(i+(S-B)*H/S+X)),p)}const _=e[2*i+p];let w=a,I=u;for(ch(n,e,a,i),e[2*u+p]>_&&ch(n,e,a,u);w_;)I--}e[2*a+p]===_?ch(n,e,a,I):(I++,ch(n,e,I,u)),I<=i&&(a=I+1),i<=I&&(u=I-1)}}function ch(n,e,i,a){md(n,i,a),md(e,2*i,2*a),md(e,2*i+1,2*a+1)}function md(n,e,i){const a=n[e];n[e]=n[i],n[i]=a}function Ug(n,e,i,a){const u=n-i,p=e-a;return u*u+p*p}s.ARRAY_TYPE=ma,s.AUTH_ERR_MSG=ft,s.Aabb=ta,s.Actor=class{constructor(n,e,i){this.target=n,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Rt(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Yt()?n:J,this.scheduler=new fy}send(n,e,i,a,u=!1,p){const _=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=p,this.callbacks[_]=i);const w=gn(this.globalScope)?void 0:[];return this.target.postMessage({id:_,type:n,hasCallback:!!i,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ml(e,w)},w),{cancel:()=>{i&&delete this.callbacks[_],this.target.postMessage({id:_,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(n){const e=n.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){const a=this.cancelCallbacks[i];delete this.cancelCallbacks[i],a&&a.cancel()}else if(e.mustQueue||Yt()){const a=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),a&&a.metadata||{type:"message"})}else this.processTask(i,e)}processTask(n,e){if(""===e.type){const i=this.callbacks[n];delete this.callbacks[n],i&&(e.error?i(al(e.error)):i(null,al(e.data)))}else{const i=gn(this.globalScope)?void 0:[],a=e.hasCallback?(p,_)=>{delete this.cancelCallbacks[n],this.target.postMessage({id:n,type:"",sourceMapId:this.mapId,error:p?Ml(p):null,data:Ml(_,i)},i)}:p=>{},u=al(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){const p=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,p[0],u.source)[p[1]](u,a)}else a(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=gu,s.Color=kr,s.ColorMode=pl,s.CullFaceMode=ml,s.DEMData=wu,s.DataConstantProperty=ce,s.DedupedRequest=Bg,s.DepthMode=oc,s.EXTENT=Ii,s.Elevation=class{isDataAvailableAtPoint(n){const e=this._source();if(this.isUsingMockSource()||!e||n.y<0||n.y>1)return!1;const i=e.getSource().maxzoom,a=1<1)return e;const u=a.getSource().maxzoom,p=1<{const p=this.getAtTileOffset(n,u.x,u.y),_=a.upVector(n.canonical,u.x,u.y);return _a(_,_,p*a.upVectorScale(n.canonical,e,i).metersToTile),_}}getForTilePoints(n,e,i,a){if(this.isUsingMockSource())return!1;const u=lh.create(this,n,a);return!!u&&(e.forEach(p=>{p[2]=this.exaggeration()*u.getElevationAt(p[0],p[1],i)}),!0)}getMinMaxForTile(n){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(n);if(!e||!e.dem)return null;const i=e.dem.tree,a=e.tileID,u=1<{let H=S===p-1?S-2:0===S?S:S-1;return H+=j?24575:0,[H,B]};for(let S=0;Sthis._skuTokenExpiresAt}transformRequest(n,e){return this._transformRequestFn&&this._transformRequestFn(n,e)||{url:n}}normalizeStyleURL(n,e){if(!Ct(n))return n;const i=zn(n);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(n,e){if(!Ct(n))return n;const i=zn(n);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(n,e,i,a){if(!Ct(n))return n;const u=zn(n);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),i&&u.params.push(`language=${i}`),a&&u.params.push(`worldview=${a}`),this._makeAPIURL(u,this._customAccessToken||e)}normalizeSpriteURL(n,e,i,a){const u=zn(n);return Ct(n)?(u.path=`/styles/v1${u.path}/sprite${e}${i}`,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=`${e}${i}`,pe(u))}normalizeTileURL(n,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),n&&!Ct(n))return n;const a=zn(n);a.path=a.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&"raster"!==a.authority&&512===i?"@2x":""}${Ne.supported?".webp":"$1"}`),"raster"===a.authority?a.path=`/${C.RASTER_URL_PREFIX}${a.path}`:(a.path=a.path.replace(/^.+\/v4\//,"/"),a.path=`/${C.TILE_URL_VERSION}${a.path}`);const u=this._customAccessToken||function(p){for(const _ of p){const w=_.match(/^access_token=(.*)$/);if(w)return w[1]}return null}(a.params)||C.ACCESS_TOKEN;return C.REQUIRE_ACCESS_TOKEN&&u&&this._skuToken&&a.params.push(`sku=${this._skuToken}`),this._makeAPIURL(a,u)}canonicalizeTileURL(n,e){const i=zn(n);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return n;let a="mapbox://";i.path.match(/^\/raster\/v1\//)?a+=`raster/${i.path.replace(`/${C.RASTER_URL_PREFIX}/`,"")}`:a+=`tiles/${i.path.replace(`/${C.TILE_URL_VERSION}/`,"")}`;let u=i.params;return e&&(u=u.filter(p=>!p.match(/^access_token=/))),u.length&&(a+=`?${u.join("&")}`),a}canonicalizeTileset(n,e){const i=!!e&&Ct(e),a=[];for(const u of n.tiles||[])Bt(u)?a.push(this.canonicalizeTileURL(u,i)):a.push(u);return a}_makeAPIURL(n,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",a=zn(C.API_URL);if(n.protocol=a.protocol,n.authority=a.authority,"http"===n.protocol){const u=n.params.indexOf("secure");u>=0&&n.params.splice(u,1)}if("/"!==a.path&&(n.path=`${a.path}${n.path}`),!C.REQUIRE_ACCESS_TOKEN)return pe(n);if(e=e||C.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===e[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return n.params=n.params.filter(u=>-1===u.indexOf("access_token")),n.params.push(`access_token=${e||""}`),pe(n)}},s.ResourceType=Cn,s.SegmentVector=qo,s.SourceCache=Uc,s.StencilMode=Zp,s.StructArrayLayout1ui2=vo,s.StructArrayLayout2f1f2i16=Pi,s.StructArrayLayout2i4=Vn,s.StructArrayLayout2ui4=_s,s.StructArrayLayout3f12=dr,s.StructArrayLayout3ui6=xi,s.StructArrayLayout4i8=Rn,s.StructArrayLayout5f20=qr,s.Texture=bu,s.Tile=Ig,s.Transitionable=se,s.Uniform1f=wh,s.Uniform1i=class extends Ma{constructor(n){super(n),this.current=0}set(n,e,i){this.fetchUniformLocation(n,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Ma{constructor(n){super(n),this.current=[0,0]}set(n,e,i){this.fetchUniformLocation(n,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Ma{constructor(n){super(n),this.current=[0,0,0]}set(n,e,i){this.fetchUniformLocation(n,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},s.Uniform4f=Aa,s.UniformColor=Xc,s.UniformMatrix2f=class extends Ma{constructor(n){super(n),this.current=Td}set(n,e,i){if(this.fetchUniformLocation(n,e))for(let a=0;a<4;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}},s.UniformMatrix3f=class extends Ma{constructor(n){super(n),this.current=Ch}set(n,e,i){if(this.fetchUniformLocation(n,e))for(let a=0;a<9;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}},s.UniformMatrix4f=class extends Ma{constructor(n){super(n),this.current=am}set(n,e,i){if(this.fetchUniformLocation(n,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let a=1;a<16;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=Ym,s.ValidationError=ai,s.VectorTileFeature=Gr,s.VectorTileWorkerSource=class extends Bi{constructor(n,e,i,a,u){super(),this.actor=n,this.layerIndex=e,this.availableImages=i,this.loadVectorData=u||Ng,this.loading={},this.loaded={},this.deduped=new Bg(n.scheduler),this.isSpriteLoaded=a,this.scheduler=n.scheduler}loadTile(n,e){const i=n.uid,a=n&&n.request,u=a&&a.collectResourceTiming,p=this.loading[i]=new _y(n);p.abort=this.loadVectorData(n,(_,w)=>{const I=!this.loading[i];if(delete this.loading[i],I||_||!w)return p.status="done",I||(this.loaded[i]=p),e(_);const S=w.rawData,B={};w.expires&&(B.expires=w.expires),w.cacheControl&&(B.cacheControl=w.cacheControl),p.vectorTile=w.vectorTile||new hu(new Wd(S));const j=()=>{p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,(H,X)=>{if(H||!X)return e(H);const te={};if(u){const de=ti(a);de.length>0&&(te.resourceTiming=JSON.parse(JSON.stringify(de)))}e(null,Te({rawTileData:S.slice(0)},X,B,te))})};this.isSpriteLoaded?j():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(j,{type:"parseTile",isSymbolTile:n.isSymbolTile,zoom:n.tileZoom}):j()}),this.loaded=this.loaded||{},this.loaded[i]=p})}reloadTile(n,e){const i=this.loaded,a=n.uid,u=this;if(i&&i[a]){const p=i[a];p.showCollisionBoxes=n.showCollisionBoxes,p.enableTerrain=!!n.enableTerrain,p.projection=n.projection,p.tileTransform=kc(n.tileID.canonical,n.projection);const _=(w,I)=>{const S=p.reloadCallback;S&&(delete p.reloadCallback,p.parse(p.vectorTile,u.layerIndex,this.availableImages,u.actor,S)),e(w,I)};"parsing"===p.status?p.reloadCallback=_:"done"===p.status&&(p.vectorTile?p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,_):_())}}abortTile(n,e){const i=n.uid,a=this.loading[i];a&&(a.abort&&a.abort(),delete this.loading[i]),e()}removeTile(n,e){const i=this.loaded,a=n.uid;i&&i[a]&&delete i[a],e()}},s.WritingMode=va,s.ZoomDependentExpression=fo,s.add=$a,s.addDynamicAttributes=nh,s.adjoint=function(n,e){var i=e[0],a=e[1],u=e[2],p=e[3],_=e[4],w=e[5],I=e[6],S=e[7],B=e[8];return n[0]=_*B-w*S,n[1]=u*S-a*B,n[2]=a*w-u*_,n[3]=w*I-p*B,n[4]=i*B-u*I,n[5]=u*p-i*w,n[6]=p*S-_*I,n[7]=a*I-i*S,n[8]=i*_-a*p,n},s.asyncAll=qt,s.bezier=Pe,s.bindAll=Rt,s.boundsAttributes=oh,s.bufferConvexPolygon=function(n,e){const i=[];for(let a=0;avt&&(n.getActor().send("enforceCacheSizeLimit",wt),Fi=0)},s.calculateGlobeLabelMatrix=function(n,e){const{x:i,y:a}=n.point,u=_m(i,a,n.worldSize/n._pixelsPerMercatorPixel,0,0);return eu(u,u,Ld(Ro(e)))},s.calculateGlobeMatrix=function(n){const{x:e,y:i}=n.point,{lng:a,lat:u}=n._center;return _m(e,i,n.worldSize,a,u)},s.calculateGlobeMercatorMatrix=function(n){const e=n.pixelsPerMeter,i=e/dl(1,n.center.lat),a=ga(new Float64Array(16));return Dd(a,a,[n.point.x,n.point.y,0]),Va(a,a,[i,i,e]),Float32Array.from(a)},s.circumferenceAtLatitude=$u,s.clamp=Ye,s.clearTileCache=function(n){if(!er())return;const e=J.caches.delete(Wt);n&&e.catch(n).then(()=>n())},s.clipLine=pg,s.clone=function(n){var e=new ma(16);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],e},s.clone$1=Jt,s.collisionCircleLayout=Xh,s.config=C,s.conjugate=function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n},s.create=function(){var n=new ma(16);return ma!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n},s.create$1=Sf,s.createExpression=ss,s.createLayout=zt,s.createStyleLayer=function(n){return"custom"===n.type?new uy(n):new dy[n.type](n)},s.cross=Md,s.degToRad=Le,s.distance=function(n,e){return Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2])},s.div=function(n,e,i){return n[0]=e[0]/i[0],n[1]=e[1]/i[1],n[2]=e[2]/i[2],n},s.dot=Ga,s.earthRadius=Rl,s.ease=Ae,s.easeCubicInOut=De,s.ecefToLatLng=function([n,e,i]){const a=Math.hypot(n,e,i),u=Math.atan2(n,i),p=.5*Math.PI-Math.acos(-e/a);return new $r(ye(u),ye(p))},s.emitValidationErrors=Ru,s.endsWith=Qt,s.enforceCacheSizeLimit=function(n){lr(),ln&&ln.then(e=>{e.keys().then(i=>{for(let a=0;ap&&(a+=(n[u]-p)*(n[u]-p)),e[u]0){const te=180/a;Dh(X,X,[te/S+1,0,0,0,te/B+1,0,-.5*te/j,.5*te/H,1])}return X[2]=I,X[5]=n.x,X[8]=n.y,X},s.getImage=Xe,s.getJSON=function(n,e){return yn(Te(n,{type:"json"}),e)},s.getLatitudinalLod=function(n){const e=Is-5;n=Ye(n,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(Le(n))),3);return Math.round(i*(Pd.length-1))},s.getMapSessionAPI=Ui,s.getPerformanceMeasurement=ti,s.getProjection=wg,s.getRTLTextPluginStatus=T,s.getReferrer=qn,s.getTilePoint=function(n,{x:e,y:i},a=0){return new ue(((e-a)*n.scale-n.x)*Ii,(i*n.scale-n.y)*Ii)},s.getTileVec3=function(n,e,i=0){return Bu(((e.x-i)*n.scale-n.x)*Ii,(e.y*n.scale-n.y)*Ii,bm(e.z,e.y))},s.getVideo=function(n,e){const i=J.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let a=0;a{}}},s.globeCenterToScreenPoint=function(n){const e=[0,0,0],i=ga(new Float64Array(16));return eu(i,n.pixelMatrix,n.globeMatrix),Yo(e,e,i),new ue(e[0],e[1])},s.globeDenormalizeECEF=Ld,s.globeECEFOrigin=function(n,e){const i=[0,0,0];return Yo(i,i,su(Ro(e.canonical))),Yo(i,i,n),i},s.globeMetersToEcef=Vs,s.globeNormalizeECEF=su,s.globePixelsToTileUnits=function(n,e){return Ii/(512*Math.pow(2,n))*Rh(Ro(e))},s.globePoleMatrixForTile=function(n,e,i){const a=ga(new Float64Array(16)),u=(e/(1<0;return 0===a&&!u&&!_&&p},s.identity=ga,s.identity$1=Sd,s.invert=Ih,s.isFullscreen=function(){return!!J.document.fullscreenElement||!!J.document.webkitFullscreenElement},s.isLngLatBehindGlobe=jf,s.isMapAuthenticated=function(n){return Lt.has(n)},s.isMapboxURL=Ct,s.isSafariWithAntialiasingBug=function(n){const e=n.navigator?n.navigator.userAgent:null;return!!gn(n)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=Fs,s.latLngToECEF=ju,s.len=Ev,s.length=Id,s.length$1=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},s.lngFromMercatorX=Oa,s.loadVectorTile=Ng,s.makeRequest=yn,s.mapValue=function(n,e,i,a,u){return Ye((n-e)/(i-e)*(u-a)+a,a,u)},s.mercatorScale=Fd,s.mercatorXfromLng=Ll,s.mercatorYfromLat=kl,s.mercatorZfromAltitude=dl,s.mul=__,s.mul$1=Cv,s.multiply=eu,s.multiply$1=Dh,s.multiply$2=fm,s.nextPowerOfTwo=St,s.normalize=ea,s.normalize$1=pm,s.normalize$2=x_,s.number=ki,s.ortho=function(n,e,i,a,u,p,_){var w=1/(e-i),I=1/(a-u),S=1/(p-_);return n[0]=-2*w,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*I,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*S,n[11]=0,n[12]=(e+i)*w,n[13]=(u+a)*I,n[14]=(_+p)*S,n[15]=1,n},s.pbf=Qh,s.perspective=function(n,e,i,a,u){var p,_=1/Math.tan(e/2);return n[0]=_/i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=_,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=u&&u!==1/0?(n[10]=(u+a)*(p=1/(a-u)),n[14]=2*u*a*p):(n[10]=-1,n[14]=-2*a),n},s.pick=function(n,e){const i={};for(let a=0;a0&&i[0]<=n.width&&i[1]>0&&i[1]<=n.height&&!jf(n,new $r(n.center.lat,90)),a[0]>0&&a[0]<=n.width&&a[1]>0&&a[1]<=n.height&&!jf(n,new $r(n.center.lat,-90))]},s.polygonContainsPoint=Bl,s.polygonIntersectsBox=Xf,s.polygonIntersectsPolygon=qf,s.polygonizeBounds=function(n,e,i=0,a=!0){const u=new ue(i,i),p=n.sub(u),_=e.add(u),w=[p,new ue(_.x,p.y),_,new ue(p.x,_.y)];return a&&w.push(p.clone()),w},s.posAttributes=Ec,s.postMapLoadEvent=Kn,s.postPerformanceEvent=wi,s.postTurnstileEvent=Pt,s.potpack=_p,s.prevPowerOfTwo=function(n){return n<=1?1:Math.pow(2,Math.floor(Math.log(n)/Math.LN2))},s.radToDeg=ye,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(n){return n({pluginStatus:f,pluginURL:r}),b.on("pluginStateChange",n),n},s.removeAuthState=function(n){Lt.delete(n)},s.renderColorRamp=Wu,s.resample=wm,s.rotateX=tu,s.rotateX$1=Of,s.rotateY=Mh,s.rotateY$1=Rf,s.rotateZ=function(n,e,i){var a=Math.sin(i),u=Math.cos(i),p=e[0],_=e[1],w=e[2],I=e[3],S=e[4],B=e[5],j=e[6],H=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=p*u+S*a,n[1]=_*u+B*a,n[2]=w*u+j*a,n[3]=I*u+H*a,n[4]=S*u-p*a,n[5]=B*u-_*a,n[6]=j*u-w*a,n[7]=H*u-I*a,n},s.rotateZ$1=function(n,e,i){i*=.5;var a=e[0],u=e[1],p=e[2],_=e[3],w=Math.sin(i),I=Math.cos(i);return n[0]=a*I+u*w,n[1]=u*I-a*w,n[2]=p*I+_*w,n[3]=_*I-p*w,n},s.scale=Va,s.scale$1=v_,s.scale$2=_a,s.scaleAndAdd=Ph,s.set=function(n,e,i,a){return n[0]=e,n[1]=i,n[2]=a,n},s.setCacheLimits=function(n,e){wt=n,vt=e},s.setColumn=function(n,e,i){n[4*e+0]=i[0],n[4*e+1]=i[1],n[4*e+2]=i[2],n[4*e+3]=i[3]},s.setRTLTextPlugin=function(n,e,i=!1){if(f===xn||f===Oi||f===ar)throw new Error("setRTLTextPlugin cannot be called multiple times.");r=ir.resolveURL(n),f=xn,po=e,m(),i||O()},s.smoothstep=_t,s.spec=Kt,s.squaredLength=function(n){var e=n[0],i=n[1],a=n[2];return e*e+i*i+a*a},s.storeAuthState=function(n,e){e?Lt.add(n):Lt.delete(n)},s.sub=Pl,s.subtract=Ah,s.symbolSize=fp,s.tileAABB=function(n,e,i,a,u,p,_,w,I){if("globe"===I.name)return function C_(n,e,i){const a=e/n.worldSize,u=n.globeMatrix;if(i.z<=1){const nn=Ro(i).getCorners();return Uf(nn,u,a),ta.fromPoints(nn)}const p=Rd(i),_=Zf(p);Uf(_,u,a);const w=Number.MAX_VALUE,I=[-w,-w,-w],S=[w,w,w];if(p.contains(n.center)){for(const Un of _)Nu(S,S,Un),Sh(I,I,Un);I[2]=0;const nn=n.point,Tn=[nn.x*a,nn.y*a,0];return Nu(S,S,Tn),Sh(I,I,Tn),new ta(S,I)}const B=[u[12]*a,u[13]*a,u[14]*a],j=p.getCenter(),H=Ye(n.center.lat,-Is,Is),X=Ye(j.lat,-Is,Is),te=Ll(n.center.lng),de=kl(H);let ke=te-Ll(j.lng);const tt=de-kl(X);ke>.5?ke-=1:ke<-.5&&(ke+=1);let mt=0;Math.abs(ke)>Math.abs(tt)?mt=ke>=0?1:3:(mt=tt>=0?0:2,Ph(B,B,[u[4]*a,u[5]*a,u[6]*a],-Math.sin(Le(tt>=0?p.getSouth():p.getNorth()))*Ha));const Qe=_[mt],ut=_[(mt+1)%4],xt=new mm(Qe,ut,B),bt=[Od(xt,0)||Qe[0],Od(xt,1)||Qe[1],Od(xt,2)||Qe[2]],tn=Ol(n.zoom);if(tn>0){const nn=function({x:Un,y:fn,z:Pn},On,Bn,Hn,wn){const si=1/(1<.5?Mi=-1:Ji<-.5&&(Mi=1),fi=((fi+Mi)*On-(Hn*=On))*Bn+Hn,ci=((ci+Mi)*On-Hn)*Bn+Hn,Yi=(Yi*On-(wn*=On))*Bn+wn,Qn=(Qn*On-wn)*Bn+wn,[[fi,Qn,0],[ci,Qn,0],[ci,Yi,0],[fi,Yi,0]]}(i,e,n._pixelsPerMercatorPixel,te,de);for(let Un=0;Un<_.length;Un++)ul(_[Un],nn[Un],tn);const Tn=$a([],nn[mt],nn[(mt+1)%4]);_a(Tn,Tn,.5),ul(bt,Tn,tn)}for(const nn of _)Nu(S,S,nn),Sh(I,I,nn);return S[2]=Math.min(Qe[2],ut[2]),Nu(S,S,bt),Sh(I,I,bt),new ta(S,I)}(n,e,new gu(i,a,u));const S=kc({z:i,x:a,y:u},I);return new ta([(p+S.x/S.scale)*e,e*(S.y/S.scale),_],[(p+S.x2/S.scale)*e,e*(S.y2/S.scale),w])},s.tileCornersToBounds=Rd,s.tileTransform=kc,s.transformMat3=function(n,e,i){var a=e[0],u=e[1],p=e[2];return n[0]=a*i[0]+u*i[3]+p*i[6],n[1]=a*i[1]+u*i[4]+p*i[7],n[2]=a*i[2]+u*i[5]+p*i[8],n},s.transformMat4=Yo,s.transformMat4$1=iu,s.transformQuat=y_,s.transitionTileAABBinECEF=zf,s.translate=Dd,s.transpose=function(n,e){if(n===e){var i=e[1],a=e[2],u=e[5];n[1]=e[3],n[2]=e[6],n[3]=i,n[5]=e[7],n[6]=a,n[7]=u}else n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8];return n},s.triggerPluginCompletionEvent=c,s.uniqueId=Re,s.updateGlobeVertexNormal=function(n,e,i,a,u){const p=5*e+2;n.float32[p+0]=i,n.float32[p+1]=a,n.float32[p+2]=u},s.validateCustomStyleLayer=function(n){const e=[],i=n.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===n.render&&e.push({message:`layers.${i}: missing required method "render"`}),n.renderingMode&&"2d"!==n.renderingMode&&"3d"!==n.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},s.validateFilter=n=>Ks(wr(n)),s.validateFog=n=>Ks(gs(n)),s.validateLayer=n=>Ks(Dl(n)),s.validateLight=n=>Ks(yh(n)),s.validateSource=n=>Ks(vc(n)),s.validateStyle=pa,s.validateTerrain=n=>Ks(qc(n)),s.values=Ht,s.vectorTile=Kl,s.version=ie,s.warnOnce=dt,s.window=J,s.wrap=hn}),h(0,function(s){function J(nt){if("number"==typeof nt||"boolean"==typeof nt||"string"==typeof nt||null==nt)return JSON.stringify(nt);if(Array.isArray(nt)){let ve="[";for(const Xe of nt)ve+=`${J(Xe)},`;return`${ve}]`}let ge="{";for(const ve of Object.keys(nt).sort())ge+=`${ve}:${J(nt[ve])},`;return`${ge}}`}function ie(nt){let ge="";for(const ve of s.refProperties)ge+=`/${J(nt[ve])}`;return ge}class Y{constructor(ge){this.keyCache={},ge&&this.replace(ge)}replace(ge){this._layerConfigs={},this._layers={},this.update(ge,[])}update(ge,ve){for(const ft of ge)this._layerConfigs[ft.id]=ft,(this._layers[ft.id]=s.createStyleLayer(ft)).compileFilter(),this.keyCache[ft.id]&&delete this.keyCache[ft.id];for(const ft of ve)delete this.keyCache[ft],delete this._layerConfigs[ft],delete this._layers[ft];this.familiesBySource={};const Xe=function(ft,Ct){const Bt={};for(let Et=0;Etthis._layers[zn.id]),Bt=Ct[0];if("none"===Bt.visibility)continue;const jt=Bt.source||"";let Et=this.familiesBySource[jt];Et||(Et=this.familiesBySource[jt]={});const Xt=Bt.sourceLayer||"_geojsonTileLayer";let Sn=Et[Xt];Sn||(Sn=Et[Xt]=[]),Sn.push(Ct)}}}class C{loadTile(ge,ve){const{uid:Xe,encoding:ft,rawImageData:Ct,padding:Bt,buildQuadTree:jt}=ge,Et=s.window.ImageBitmap&&Ct instanceof s.window.ImageBitmap?this.getImageData(Ct,Bt):Ct;ve(null,new s.DEMData(Xe,Et,ft,Bt<1,jt))}getImageData(ge,ve){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(ge.width,ge.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=ge.width,this.offscreenCanvas.height=ge.height,this.offscreenCanvasContext.drawImage(ge,0,0,ge.width,ge.height);const Xe=this.offscreenCanvasContext.getImageData(-ve,-ve,ge.width+2*ve,ge.height+2*ve);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),Xe}}function Ne(nt,ge){if(0!==nt.length){me(nt[0],ge);for(var ve=1;ve=Math.abs(jt)?ve-Et+jt:jt-Et+ve,ve=Et}ve+Xe>=0!=!!ge&&nt.reverse()}var he=s.getDefaultExportFromCjs(function nt(ge,ve){var Xe,ft=ge&&ge.type;if("FeatureCollection"===ft)for(Xe=0;Xe>31}function gt(nt,ge){for(var ve=nt.loadGeometry(),Xe=nt.type,ft=0,Ct=0,Bt=ve.length,jt=0;jtnt},Ye=Math.fround||(_t=new Float32Array(1),nt=>(_t[0]=+nt,_t[0]));var _t;const hn=3,qt=5,Ht=6;class Te{constructor(ge){this.options=Object.assign(Object.create(Ae),ge),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ge){const{log:ve,minZoom:Xe,maxZoom:ft}=this.options;ve&&console.time("total time");const Ct=`prepare ${ge.length} points`;ve&&console.time(Ct),this.points=ge;const Bt=[];for(let Et=0;Et=Xe;Et--){const Xt=+Date.now();jt=this.trees[Et]=this._createTree(this._cluster(jt,Et)),ve&&console.log("z%d: %d clusters in %dms",Et,jt.numItems,+Date.now()-Xt)}return ve&&console.timeEnd("total time"),this}getClusters(ge,ve){let Xe=((ge[0]+180)%360+360)%360-180;const ft=Math.max(-90,Math.min(90,ge[1]));let Ct=180===ge[2]?180:((ge[2]+180)%360+360)%360-180;const Bt=Math.max(-90,Math.min(90,ge[3]));if(ge[2]-ge[0]>=360)Xe=-180,Ct=180;else if(Xe>Ct){const zn=this.getClusters([Xe,ft,180,Bt],ve),pe=this.getClusters([-180,ft,Ct,Bt],ve);return zn.concat(pe)}const jt=this.trees[this._limitZoom(ve)],Et=jt.range(Fe(Xe),St(Bt),Fe(Ct),St(ft)),Xt=jt.data,Sn=[];for(const zn of Et){const pe=this.stride*zn;Sn.push(Xt[pe+qt]>1?Je(Xt,pe,this.clusterProps):this.points[Xt[pe+hn]])}return Sn}getChildren(ge){const ve=this._getOriginId(ge),Xe=this._getOriginZoom(ge),ft="No cluster with the specified id.",Ct=this.trees[Xe];if(!Ct)throw new Error(ft);const Bt=Ct.data;if(ve*this.stride>=Bt.length)throw new Error(ft);const jt=this.options.radius/(this.options.extent*Math.pow(2,Xe-1)),Et=Ct.within(Bt[ve*this.stride],Bt[ve*this.stride+1],jt),Xt=[];for(const Sn of Et){const zn=Sn*this.stride;Bt[zn+4]===ge&&Xt.push(Bt[zn+qt]>1?Je(Bt,zn,this.clusterProps):this.points[Bt[zn+hn]])}if(0===Xt.length)throw new Error(ft);return Xt}getLeaves(ge,ve,Xe){const ft=[];return this._appendLeaves(ft,ge,ve=ve||10,Xe=Xe||0,0),ft}getTile(ge,ve,Xe){const ft=this.trees[this._limitZoom(ge)],Ct=Math.pow(2,ge),{extent:Bt,radius:jt}=this.options,Et=jt/Bt,Xt=(Xe-Et)/Ct,Sn=(Xe+1+Et)/Ct,zn={features:[]};return this._addTileFeatures(ft.range((ve-Et)/Ct,Xt,(ve+1+Et)/Ct,Sn),ft.data,ve,Xe,Ct,zn),0===ve&&this._addTileFeatures(ft.range(1-Et/Ct,Xt,1,Sn),ft.data,Ct,Xe,Ct,zn),ve===Ct-1&&this._addTileFeatures(ft.range(0,Xt,Et/Ct,Sn),ft.data,-1,Xe,Ct,zn),zn.features.length?zn:null}getClusterExpansionZoom(ge){let ve=this._getOriginZoom(ge)-1;for(;ve<=this.options.maxZoom;){const Xe=this.getChildren(ge);if(ve++,1!==Xe.length)break;ge=Xe[0].properties.cluster_id}return ve}_appendLeaves(ge,ve,Xe,ft,Ct){const Bt=this.getChildren(ve);for(const jt of Bt){const Et=jt.properties;if(Et&&Et.cluster?Ct+Et.point_count<=ft?Ct+=Et.point_count:Ct=this._appendLeaves(ge,Et.cluster_id,Xe,ft,Ct):Ct1;let Sn,zn,pe;if(Xt)Sn=Re(ve,Et,this.clusterProps),zn=ve[Et],pe=ve[Et+1];else{const be=this.points[ve[Et+hn]];Sn=be.properties;const[Ze,Pt]=be.geometry.coordinates;zn=Fe(Ze),pe=St(Pt)}const ze={type:1,geometry:[[Math.round(this.options.extent*(zn*Ct-Xe)),Math.round(this.options.extent*(pe*Ct-ft))]],tags:Sn};let xe;xe=Xt||this.options.generateId?ve[Et+hn]:this.points[ve[Et+hn]].id,void 0!==xe&&(ze.id=xe),Bt.features.push(ze)}}_limitZoom(ge){return Math.max(this.options.minZoom,Math.min(Math.floor(+ge),this.options.maxZoom+1))}_cluster(ge,ve){const{radius:Xe,extent:ft,reduce:Ct,minPoints:Bt}=this.options,jt=Xe/(ft*Math.pow(2,ve)),Et=ge.data,Xt=[],Sn=this.stride;for(let zn=0;znve&&(Ze+=Et[bn+qt])}if(Ze>be&&Ze>=Bt){let Pt,bn=pe*be,Kn=ze*be,Ci=-1;const wi=((zn/Sn|0)<<5)+(ve+1)+this.points.length;for(const cr of xe){const Ui=cr*Sn;if(Et[Ui+2]<=ve)continue;Et[Ui+2]=ve;const Lt=Et[Ui+qt];bn+=Et[Ui]*Lt,Kn+=Et[Ui+1]*Lt,Et[Ui+4]=wi,Ct&&(Pt||(Pt=this._map(Et,zn,!0),Ci=this.clusterProps.length,this.clusterProps.push(Pt)),Ct(Pt,this._map(Et,Ui)))}Et[zn+4]=wi,Xt.push(bn/Ze,Kn/Ze,1/0,wi,-1,Ze),Ct&&Xt.push(Ci)}else{for(let Pt=0;Pt1)for(const Pt of xe){const bn=Pt*Sn;if(!(Et[bn+2]<=ve)){Et[bn+2]=ve;for(let Kn=0;Kn>5}_getOriginZoom(ge){return(ge-this.points.length)%32}_map(ge,ve,Xe){if(ge[ve+qt]>1){const Bt=this.clusterProps[ge[ve+Ht]];return Xe?Object.assign({},Bt):Bt}const ft=this.points[ge[ve+hn]].properties,Ct=this.options.map(ft);return Xe&&Ct===ft?Object.assign({},Ct):Ct}}function Je(nt,ge,ve){return{type:"Feature",id:nt[ge+hn],properties:Re(nt,ge,ve),geometry:{type:"Point",coordinates:[(Xe=nt[ge],360*(Xe-.5)),Ce(nt[ge+1])]}};var Xe}function Re(nt,ge,ve){const Xe=nt[ge+qt],ft=Xe>=1e4?`${Math.round(Xe/1e3)}k`:Xe>=1e3?Math.round(Xe/100)/10+"k":Xe,Ct=nt[ge+Ht],Bt=-1===Ct?{}:Object.assign({},ve[Ct]);return Object.assign(Bt,{cluster:!0,cluster_id:nt[ge+hn],point_count:Xe,point_count_abbreviated:ft})}function Fe(nt){return nt/360+.5}function St(nt){const ge=Math.sin(nt*Math.PI/180),ve=.5-.25*Math.log((1+ge)/(1-ge))/Math.PI;return ve<0?0:ve>1?1:ve}function Ce(nt){const ge=(180-360*nt)*Math.PI/180;return 360*Math.atan(Math.exp(ge))/Math.PI-90}function Rt(nt,ge,ve,Xe){for(var ft,Ct=Xe,Bt=ve-ge>>1,jt=ve-ge,Et=nt[ge],Xt=nt[ge+1],Sn=nt[ve],zn=nt[ve+1],pe=ge+3;peCt)ft=pe,Ct=ze;else if(ze===Ct){var xe=Math.abs(pe-Bt);xeXe&&(ft-ge>3&&Rt(nt,ge,ft,Xe),nt[ft+2]=Ct,ve-ft>3&&Rt(nt,ft,ve,Xe))}function Qt(nt,ge,ve,Xe,ft,Ct){var Bt=ft-ve,jt=Ct-Xe;if(0!==Bt||0!==jt){var Et=((nt-ve)*Bt+(ge-Xe)*jt)/(Bt*Bt+jt*jt);Et>1?(ve=ft,Xe=Ct):Et>0&&(ve+=Bt*Et,Xe+=jt*Et)}return(Bt=nt-ve)*Bt+(jt=ge-Xe)*jt}function Gt(nt,ge,ve,Xe){var ft={id:void 0===nt?null:nt,type:ge,geometry:ve,tags:Xe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Ct){var Bt=Ct.geometry,jt=Ct.type;if("Point"===jt||"MultiPoint"===jt||"LineString"===jt)Zt(Ct,Bt);else if("Polygon"===jt||"MultiLineString"===jt)for(var Et=0;Et0&&(Bt+=Xe?(ft*Xt-Et*Ct)/2:Math.sqrt(Math.pow(Et-ft,2)+Math.pow(Xt-Ct,2))),ft=Et,Ct=Xt}var Sn=ge.length-3;ge[2]=1,Rt(ge,0,Sn,ve),ge[Sn+2]=1,ge.size=Math.abs(Bt),ge.start=0,ge.end=ge.size}function Ot(nt,ge,ve,Xe){for(var ft=0;ft1?1:ve}function Ut(nt,ge,ve,Xe,ft,Ct,Bt,jt){if(Xe/=ge,Ct>=(ve/=ge)&&Bt=Xe)return null;for(var Et=[],Xt=0;Xt=ve&&xe=Xe)){var be=[];if("Point"===pe||"MultiPoint"===pe)ii(zn,be,ve,Xe,ft);else if("LineString"===pe)gn(zn,be,ve,Xe,ft,!1,jt.lineMetrics);else if("MultiLineString"===pe)Jn(zn,be,ve,Xe,ft,!1);else if("Polygon"===pe)Jn(zn,be,ve,Xe,ft,!0);else if("MultiPolygon"===pe)for(var Ze=0;Ze=ve&&Bt<=Xe&&(ge.push(nt[Ct]),ge.push(nt[Ct+1]),ge.push(nt[Ct+2]))}}function gn(nt,ge,ve,Xe,ft,Ct,Bt){for(var jt,Et,Xt=Ft(nt),Sn=0===ft?wt:vt,zn=nt.start,pe=0;peve&&(Et=Sn(Xt,ze,xe,Ze,Pt,ve),Bt&&(Xt.start=zn+jt*Et)):bn>Xe?Kn=ve&&(Et=Sn(Xt,ze,xe,Ze,Pt,ve),Ci=!0),Kn>Xe&&bn<=Xe&&(Et=Sn(Xt,ze,xe,Ze,Pt,Xe),Ci=!0),!Ct&&Ci&&(Bt&&(Xt.end=zn+jt*Et),ge.push(Xt),Xt=Ft(nt)),Bt&&(zn+=jt)}var wi=nt.length-3;ze=nt[wi],xe=nt[wi+1],be=nt[wi+2],(bn=0===ft?ze:xe)>=ve&&bn<=Xe&&Wt(Xt,ze,xe,be),wi=Xt.length-3,Ct&&wi>=3&&(Xt[wi]!==Xt[0]||Xt[wi+1]!==Xt[1])&&Wt(Xt,Xt[0],Xt[1],Xt[2]),Xt.length&&ge.push(Xt)}function Ft(nt){var ge=[];return ge.size=nt.size,ge.start=nt.start,ge.end=nt.end,ge}function Jn(nt,ge,ve,Xe,ft,Ct){for(var Bt=0;BtBt.maxX&&(Bt.maxX=Sn),zn>Bt.maxY&&(Bt.maxY=zn)}return Bt}function Fi(nt,ge,ve,Xe){var ft=ge.geometry,Ct=ge.type,Bt=[];if("Point"===Ct||"MultiPoint"===Ct)for(var jt=0;jt0&&ge.size<(ft?Bt:Xe))ve.numPoints+=ge.length/3;else{for(var jt=[],Et=0;EtBt)&&(ve.numSimplified++,jt.push(ge[Et]),jt.push(ge[Et+1])),ve.numPoints++;ft&&function(Xt,Sn){for(var zn=0,pe=0,ze=Xt.length,xe=ze-2;pe0===Sn)for(pe=0,ze=Xt.length;pe24)throw new Error("maxZoom should be in the 0-24 range");if(ge.promoteId&&ge.generateId)throw new Error("promoteId and generateId cannot be used together.");var ft,Ct,Bt,jt,Et,Xt,Xe=function(ft,Ct){var Bt=[];if("FeatureCollection"===ft.type)for(var jt=0;jt1&&console.time("creation"),pe=this.tiles[zn]=mi(nt,ge,ve,Xe,Et),this.tileCoords.push({z:ge,x:ve,y:Xe}),Xt)){Xt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ge,ve,Xe,pe.numFeatures,pe.numPoints,pe.numSimplified),console.timeEnd("creation"));var ze="z"+ge;this.stats[ze]=(this.stats[ze]||0)+1,this.total++}if(pe.source=nt,ft){if(ge===Et.maxZoom||ge===ft)continue;var xe=1<1&&console.time("clipping");var be,Ze,Pt,bn,Kn,Ci,wi=.5*Et.buffer/Et.extent,cr=.5-wi,Ui=.5+wi,Lt=1+wi;be=Ze=Pt=bn=null,Kn=Ut(nt,Sn,ve-wi,ve+Ui,0,pe.minX,pe.maxX,Et),Ci=Ut(nt,Sn,ve+cr,ve+Lt,0,pe.minX,pe.maxX,Et),nt=null,Kn&&(be=Ut(Kn,Sn,Xe-wi,Xe+Ui,1,pe.minY,pe.maxY,Et),Ze=Ut(Kn,Sn,Xe+cr,Xe+Lt,1,pe.minY,pe.maxY,Et),Kn=null),Ci&&(Pt=Ut(Ci,Sn,Xe-wi,Xe+Ui,1,pe.minY,pe.maxY,Et),bn=Ut(Ci,Sn,Xe+cr,Xe+Lt,1,pe.minY,pe.maxY,Et),Ci=null),Xt>1&&console.timeEnd("clipping"),jt.push(be||[],ge+1,2*ve,2*Xe),jt.push(Ze||[],ge+1,2*ve,2*Xe+1),jt.push(Pt||[],ge+1,2*ve+1,2*Xe),jt.push(bn||[],ge+1,2*ve+1,2*Xe+1)}}},Mn.prototype.getTile=function(nt,ge,ve){var Xe=this.options,ft=Xe.extent,Ct=Xe.debug;if(nt<0||nt>24)return null;var Bt=1<1&&console.log("drilling down to z%d-%d-%d",nt,ge,ve);for(var Et,Xt=nt,Sn=ge,zn=ve;!Et&&Xt>0;)Xt--,Sn=Math.floor(Sn/2),zn=Math.floor(zn/2),Et=this.tiles[qn(Xt,Sn,zn)];return Et&&Et.source?(Ct>1&&console.log("found parent tile z%d-%d-%d",Xt,Sn,zn),Ct>1&&console.time("drilling down"),this.splitTile(Et.source,Xt,Sn,zn,nt,ge,ve),Ct>1&&console.timeEnd("drilling down"),this.tiles[jt]?er(this.tiles[jt],ft):null):null};class _n extends s.VectorTileWorkerSource{constructor(ge,ve,Xe,ft,Ct){super(ge,ve,Xe,ft,yn),Ct&&(this.loadGeoJSON=Ct)}loadData(ge,ve){const Xe=ge&&ge.request,ft=Xe&&Xe.collectResourceTiming;this.loadGeoJSON(ge,(Ct,Bt)=>{if(Ct||!Bt)return ve(Ct);if("object"!=typeof Bt)return ve(new Error(`Input data given to '${ge.source}' is not a valid GeoJSON object.`));{he(Bt,!0);try{if(ge.filter){const Et=s.createExpression(ge.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===Et.result)throw new Error(Et.value.map(Sn=>`${Sn.key}: ${Sn.message}`).join(", "));Bt={type:"FeatureCollection",features:Bt.features.filter(Sn=>Et.value.evaluate({zoom:0},Sn))}}this._geoJSONIndex=ge.cluster?new Te(function({superclusterOptions:Et,clusterProperties:Xt}){if(!Xt||!Et)return Et;const Sn={},zn={},pe={accumulated:null,zoom:0},ze={properties:null},xe=Object.keys(Xt);for(const be of xe){const[Ze,Pt]=Xt[be],bn=s.createExpression(Pt),Kn=s.createExpression("string"==typeof Ze?[Ze,["accumulated"],["get",be]]:Ze);Sn[be]=bn.value,zn[be]=Kn.value}return Et.map=be=>{ze.properties=be;const Ze={};for(const Pt of xe)Ze[Pt]=Sn[Pt].evaluate(pe,ze);return Ze},Et.reduce=(be,Ze)=>{ze.properties=Ze;for(const Pt of xe)pe.accumulated=be[Pt],be[Pt]=zn[Pt].evaluate(pe,ze)},Et}(ge)).load(Bt.features):new Mn(Et=Bt,ge.geojsonVtOptions)}catch(Et){return ve(Et)}this.loaded={};const jt={};if(ft){const Et=s.getPerformanceMeasurement(Xe);Et&&(jt.resourceTiming={},jt.resourceTiming[ge.source]=JSON.parse(JSON.stringify(Et)))}ve(null,jt)}var Et})}reloadTile(ge,ve){const Xe=this.loaded;return Xe&&Xe[ge.uid]?super.reloadTile(ge,ve):this.loadTile(ge,ve)}loadGeoJSON(ge,ve){if(ge.request)s.getJSON(ge.request,ve);else{if("string"!=typeof ge.data)return ve(new Error(`Input data given to '${ge.source}' is not a valid GeoJSON object.`));try{return ve(null,JSON.parse(ge.data))}catch{return ve(new Error(`Input data given to '${ge.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(ge,ve){try{ve(null,this._geoJSONIndex.getClusterExpansionZoom(ge.clusterId))}catch(Xe){ve(Xe)}}getClusterChildren(ge,ve){try{ve(null,this._geoJSONIndex.getChildren(ge.clusterId))}catch(Xe){ve(Xe)}}getClusterLeaves(ge,ve){try{ve(null,this._geoJSONIndex.getLeaves(ge.clusterId,ge.limit,ge.offset))}catch(Xe){ve(Xe)}}}class Hi{constructor(ge){this.self=ge,this.actor=new s.Actor(ge,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:_n},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(ve,Xe)=>{if(this.workerSourceTypes[ve])throw new Error(`Worker source with name "${ve}" already registered.`);this.workerSourceTypes[ve]=Xe},this.self.registerRTLTextPlugin=ve=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=ve.applyArabicShaping,s.plugin.processBidirectionalText=ve.processBidirectionalText,s.plugin.processStyledBidirectionalText=ve.processStyledBidirectionalText}}clearCaches(ge,ve,Xe){delete this.layerIndexes[ge],delete this.availableImages[ge],delete this.workerSources[ge],delete this.demWorkerSources[ge],Xe()}checkIfReady(ge,ve,Xe){Xe()}setReferrer(ge,ve){this.referrer=ve}spriteLoaded(ge,ve){this.isSpriteLoaded[ge]=ve;for(const Xe in this.workerSources[ge]){const ft=this.workerSources[ge][Xe];for(const Ct in ft)ft[Ct]instanceof s.VectorTileWorkerSource&&(ft[Ct].isSpriteLoaded=ve,ft[Ct].fire(new s.Event("isSpriteLoaded")))}}setImages(ge,ve,Xe){this.availableImages[ge]=ve;for(const ft in this.workerSources[ge]){const Ct=this.workerSources[ge][ft];for(const Bt in Ct)Ct[Bt].availableImages=ve}Xe()}enableTerrain(ge,ve,Xe){this.terrain=ve,Xe()}setProjection(ge,ve){this.projections[ge]=s.getProjection(ve)}setLayers(ge,ve,Xe){this.getLayerIndex(ge).replace(ve),Xe()}updateLayers(ge,ve,Xe){this.getLayerIndex(ge).update(ve.layers,ve.removedIds),Xe()}loadTile(ge,ve,Xe){const ft=this.enableTerrain?s.extend({enableTerrain:this.terrain},ve):ve;ft.projection=this.projections[ge]||this.defaultProjection,this.getWorkerSource(ge,ve.type,ve.source).loadTile(ft,Xe)}loadDEMTile(ge,ve,Xe){const ft=this.enableTerrain?s.extend({buildQuadTree:this.terrain},ve):ve;this.getDEMWorkerSource(ge,ve.source).loadTile(ft,Xe)}reloadTile(ge,ve,Xe){const ft=this.enableTerrain?s.extend({enableTerrain:this.terrain},ve):ve;ft.projection=this.projections[ge]||this.defaultProjection,this.getWorkerSource(ge,ve.type,ve.source).reloadTile(ft,Xe)}abortTile(ge,ve,Xe){this.getWorkerSource(ge,ve.type,ve.source).abortTile(ve,Xe)}removeTile(ge,ve,Xe){this.getWorkerSource(ge,ve.type,ve.source).removeTile(ve,Xe)}removeSource(ge,ve,Xe){if(!this.workerSources[ge]||!this.workerSources[ge][ve.type]||!this.workerSources[ge][ve.type][ve.source])return;const ft=this.workerSources[ge][ve.type][ve.source];delete this.workerSources[ge][ve.type][ve.source],void 0!==ft.removeSource?ft.removeSource(ve,Xe):Xe()}loadWorkerSource(ge,ve,Xe){try{this.self.importScripts(ve.url),Xe()}catch(ft){Xe(ft.toString())}}syncRTLPluginState(ge,ve,Xe){try{s.plugin.setState(ve);const ft=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&null!=ft){this.self.importScripts(ft);const Ct=s.plugin.isParsed();Xe(Ct?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ft}`),Ct)}}catch(ft){Xe(ft.toString())}}getAvailableImages(ge){let ve=this.availableImages[ge];return ve||(ve=[]),ve}getLayerIndex(ge){let ve=this.layerIndexes[ge];return ve||(ve=this.layerIndexes[ge]=new Y),ve}getWorkerSource(ge,ve,Xe){return this.workerSources[ge]||(this.workerSources[ge]={}),this.workerSources[ge][ve]||(this.workerSources[ge][ve]={}),this.workerSources[ge][ve][Xe]||(this.workerSources[ge][ve][Xe]=new this.workerSourceTypes[ve]({send:(Ct,Bt,jt,Et,Xt,Sn)=>{this.actor.send(Ct,Bt,jt,ge,Xt,Sn)},scheduler:this.actor.scheduler},this.getLayerIndex(ge),this.getAvailableImages(ge),this.isSpriteLoaded[ge])),this.workerSources[ge][ve][Xe]}getDEMWorkerSource(ge,ve){return this.demWorkerSources[ge]||(this.demWorkerSources[ge]={}),this.demWorkerSources[ge][ve]||(this.demWorkerSources[ge][ve]=new C),this.demWorkerSources[ge][ve]}enforceCacheSizeLimit(ge,ve){s.enforceCacheSizeLimit(ve)}getWorkerPerformanceMetrics(ge,ve,Xe){Xe(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Hi(self)),Hi}),h(0,function(s){function J(f,r){if(Array.isArray(f)){if(!Array.isArray(r)||f.length!==r.length)return!1;for(let c=0;c"u"||typeof document>"u"||!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)||!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var m,b,T=new Blob([""],{type:"text/javascript"}),O=URL.createObjectURL(T);try{b=new Worker(O),m=!0}catch{m=!1}return b&&b.terminate(),URL.revokeObjectURL(O),m}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var m=document.createElement("canvas");m.width=m.height=1;var b=m.getContext("2d");if(!b)return!1;var T=b.getImageData(0,0,1,1);return T&&T.width===m.width}()||(void 0===C[c=r&&r.failIfMajorPerformanceCaveat]&&(C[c]=function(m){var b,O,L,Z,T=(O=m,L=document.createElement("canvas"),(Z=Object.create(Y.webGLContextAttributes)).failIfMajorPerformanceCaveat=O,L.getContext("webgl",Z)||L.getContext("experimental-webgl",Z));if(!T)return!1;try{b=T.createShader(T.VERTEX_SHADER)}catch{return!1}return!(!b||T.isContextLost())&&(T.shaderSource(b,"void main() {}"),T.compileShader(b),!0===T.getShaderParameter(b,T.COMPILE_STATUS))}(c)),!C[c]||document.documentMode));var r,c}var C={};function Ne(f,r,c){const m=s.window.document.createElement(f);return void 0!==r&&(m.className=r),c&&c.appendChild(m),m}function me(f,r,c){const m=s.window.document.createElementNS("http://www.w3.org/2000/svg",f);for(const b of Object.keys(r))m.setAttributeNS(null,b,r[b]);return c&&c.appendChild(m),m}Y.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const he=s.window.document&&s.window.document.documentElement.style,_e=he&&void 0!==he.userSelect?"userSelect":"WebkitUserSelect";let ee;function ae(){he&&_e&&(ee=he[_e],he[_e]="none")}function oe(){he&&_e&&(he[_e]=ee)}function Be(f){f.preventDefault(),f.stopPropagation(),s.window.removeEventListener("click",Be,!0)}function Ie(){s.window.addEventListener("click",Be,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",Be,!0)},0)}function Ee(f,r){const c=f.getBoundingClientRect();return le(f,c,r)}function Ue(f,r){const c=f.getBoundingClientRect(),m=[];for(let b=0;b=0?0:f.button}function le(f,r,c){const m=f.offsetWidth===r.width?1:f.offsetWidth/r.width;return new s.Point((c.clientX-r.left)*m,(c.clientY-r.top)*m)}function ue(f,r){var c=r[0],m=r[1],b=r[2],T=r[3],O=c*T-b*m;return O?(f[0]=T*(O=1/O),f[1]=-m*O,f[2]=-b*O,f[3]=c*O,f):null}function ct(f){const{userImage:r}=f;return!!(r&&r.render&&r.render())&&(f.data.replace(new Uint8Array(r.data.buffer)),!0)}class ht extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(r){if(this.loaded!==r&&(this.loaded=r,r)){for(const{ids:c,callback:m}of this.requestors)this._notify(c,m);this.requestors=[]}}hasImage(r){return!!this.getImage(r)}getImage(r){return this.images[r]}addImage(r,c){this._validate(r,c)&&(this.images[r]=c)}_validate(r,c){let m=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${r}" has invalid "stretchX" value`))),m=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${r}" has invalid "stretchY" value`))),m=!1),this._validateContent(c.content,c)||(this.fire(new s.ErrorEvent(new Error(`Image "${r}" has invalid "content" value`))),m=!1),m}_validateStretch(r,c){if(!r)return!0;let m=0;for(const b of r){if(b[0]{this.ready=!0})}broadcast(r,c,m){s.asyncAll(this.actors,(b,T)=>{b.send(r,c,T)},m=m||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(r=>{r.remove()}),this.actors=[],this.workerPool.release(this.id)}}function qt(f,r,c){return r*(s.EXTENT/(f.tileSize*Math.pow(2,c-f.tileID.overscaledZ)))}hn.Actor=s.Actor;class Ht{constructor(r,c,m,b){this.screenBounds=r,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=m,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,b)}static createFromScreenPoints(r,c){let m,b;if(r instanceof s.Point||"number"==typeof r[0]){const T=s.Point.convert(r);m=[T],b=c.isPointAboveHorizon(T)}else{const T=s.Point.convert(r[0]),O=s.Point.convert(r[1]);m=[T,O],b=s.polygonizeBounds(T,O).every(L=>c.isPointAboveHorizon(L))}return new Ht(m,c.getCameraPoint(),b,c)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(r){return s.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){const c=this.screenBounds[0],m=1===this.screenBounds.length?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],b=s.polygonizeBounds(c,m,0,!1);return this.cameraPoint.y>m.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x=m.x?b[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(b[3]=this.cameraPoint)),s.bufferConvexPolygon(b,r)}bufferedCameraGeometryGlobe(r){const c=this.screenBounds[0],m=1===this.screenBounds.length?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],b=s.polygonizeBounds(c,m,r),T=this.cameraPoint.clone();switch(3*((T.y>c.y)+(T.y>m.y))+((T.x>c.x)+(T.x>m.x))){case 0:b[0]=T,b[4]=T.clone();break;case 1:b.splice(1,0,T);break;case 2:b[1]=T;break;case 3:b.splice(4,0,T);break;case 5:b.splice(2,0,T);break;case 6:b[3]=T;break;case 7:b.splice(3,0,T);break;case 8:b[2]=T}return b}containsTile(r,c,m,b=0){const T=r.queryPadding/c._pixelsPerMercatorPixel+1,O=m?this._bufferedCameraMercator(T,c):this._bufferedScreenMercator(T,c);let L=r.tileID.wrap+(O.unwrapped?b:0);const Z=O.polygon.map(Ke=>s.getTilePoint(r.tileTransform,Ke,L));if(!s.polygonIntersectsBox(Z,0,0,s.EXTENT,s.EXTENT))return;L=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?b:0);const q=this.screenGeometryMercator.polygon.map(Ke=>s.getTileVec3(r.tileTransform,Ke,L)),W=q.map(Ke=>new s.Point(Ke[0],Ke[1])),se=c.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),Oe=s.getTileVec3(r.tileTransform,se,L),$e=q.map(Ke=>{const ce=s.sub(Ke,Ke,Oe);return s.normalize(ce,ce),new s.Ray(Oe,ce)}),We=qt(r,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:W,tilespaceRays:$e,bufferedTilespaceGeometry:Z,bufferedTilespaceBounds:(qe=s.getBounds(Z),qe.min.x=s.clamp(qe.min.x,0,s.EXTENT),qe.min.y=s.clamp(qe.min.y,0,s.EXTENT),qe.max.x=s.clamp(qe.max.x,0,s.EXTENT),qe.max.y=s.clamp(qe.max.y,0,s.EXTENT),qe),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:We};var qe}_bufferedScreenMercator(r,c){const m=Re(r);if(this._screenRaycastCache[m])return this._screenRaycastCache[m];{let b;return b="globe"===c.projection.name?this._projectAndResample(this.bufferedScreenGeometry(r),c):{polygon:this.bufferedScreenGeometry(r).map(T=>c.pointCoordinate3D(T)),unwrapped:!0},this._screenRaycastCache[m]=b,b}}_bufferedCameraMercator(r,c){const m=Re(r);if(this._cameraRaycastCache[m])return this._cameraRaycastCache[m];{let b;return b="globe"===c.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(r),c):{polygon:this.bufferedCameraGeometry(r).map(T=>c.pointCoordinate3D(T)),unwrapped:!0},this._cameraRaycastCache[m]=b,b}}_projectAndResample(r,c){const m=function(T,O){const L=s.multiply([],O.pixelMatrix,O.globeMatrix),Z=[0,-s.GLOBE_RADIUS,0,1],q=[0,s.GLOBE_RADIUS,0,1],W=[0,0,0,1];s.transformMat4$1(Z,Z,L),s.transformMat4$1(q,q,L),s.transformMat4$1(W,W,L);const se=new s.Point(Z[0]/Z[3],Z[1]/Z[3]),Oe=new s.Point(q[0]/q[3],q[1]/q[3]),$e=s.polygonContainsPoint(T,se)&&Z[3]1?Te(T.slice(0,Ke),O):[],rt=Kenew s.Point(Je(Dt.x),Dt.y)),rt=rt.map(Dt=>new s.Point(Je(Dt.x),Dt.y));const ot=[...Ve];0===ot.length&&ot.push(rt[rt.length-1]);const Tt=s.number(ot[ot.length-1].y,(0===rt.length?Ve[0]:rt[0]).y,ce);let Mt;return Mt=$e?[new s.Point(0,Tt),new s.Point(0,0),new s.Point(1,0),new s.Point(1,Tt)]:[new s.Point(1,Tt),new s.Point(1,1),new s.Point(0,1),new s.Point(0,Tt)],ot.push(...Mt),0===rt.length?ot.push(Ve[0]):ot.push(...rt),{polygon:ot.map(Dt=>new s.MercatorCoordinate(Dt.x,Dt.y)),unwrapped:!1}}(r,c);if(m)return m;const b=function(T,O){let L=!1,Z=-1/0,q=0;for(let se=0;seZ&&(Z=T[se].x,q=se);for(let se=0;se.5&&($e.x{se.x-=1}),{polygon:T,unwrapped:L}}(Te(r,c).map(T=>new s.Point(Je(T.x),T.y)),c);return{polygon:b.polygon.map(T=>new s.MercatorCoordinate(T.x,T.y)),unwrapped:b.unwrapped}}}function Te(f,r){return s.resample(f,c=>{const m=r.pointCoordinate3D(c);c.x=m.x,c.y=m.y},1/256)}function Je(f){return f<0?1+f%1:f%1}function Re(f){return 100*f|0}function Fe(f,r,c,m,b){const T=function(O,L){if(O)return b(O);if(L){f.url&&L.tiles&&f.tiles&&delete f.tiles;const Z=s.pick(s.extend(L,f),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);L.vector_layers&&(Z.vectorLayers=L.vector_layers,Z.vectorLayerIds=Z.vectorLayers.map(q=>q.id)),Z.tiles=r.canonicalizeTileset(Z,f.url),b(null,Z)}};return f.url?s.getJSON(r.transformRequest(r.normalizeSourceURL(f.url,null,c,m),s.ResourceType.Source),T):s.exported.frame(()=>T(null,f))}class St{constructor(r,c,m){this.bounds=s.LngLatBounds.convert(this.validateBounds(r)),this.minzoom=c||0,this.maxzoom=m||24}validateBounds(r){return Array.isArray(r)&&4===r.length?[Math.max(-180,r[0]),Math.max(-90,r[1]),Math.min(180,r[2]),Math.min(90,r[3])]:[-180,-90,180,90]}contains(r){const c=Math.pow(2,r.z),m=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*c),b=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*c),T=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*c),O=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*c);return r.x>=m&&r.x=b&&r.y{this._tileJSONRequest=null,this._loaded=!0,b?(c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),m&&2!==m.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${m}`),this.fire(new s.ErrorEvent(b))):T&&(s.extend(this,T),T.bounds&&(this.tileBounds=new St(T.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(T.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(b)})}loaded(){return this._loaded}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(r,c){const m=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),b={request:this.map._requestManager.transformRequest(m,s.ResourceType.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:r.isSymbolTile};if(b.request.collectResourceTiming=this._collectResourceTiming,r.actor&&"expired"!==r.state)"loading"===r.state?r.reloadCallback=c:r.request=r.actor.send("reloadTile",b,T.bind(this));else if(r.actor=this._tileWorkers[m]=this._tileWorkers[m]||this.dispatcher.getActor(),this.dispatcher.ready)r.request=r.actor.send("loadTile",b,T.bind(this),void 0,!0);else{const O=s.loadVectorTile.call({deduped:this._deduped},b,(L,Z)=>{L||!Z?T.call(this,L):(b.data={cacheControl:Z.cacheControl,expires:Z.expires,rawData:Z.rawData.slice(0)},r.actor&&r.actor.send("loadTile",b,T.bind(this),void 0,!0))},!0);r.request={cancel:O}}function T(O,L){return delete r.request,r.aborted?c(null):O&&404!==O.status?c(O):(L&&L.resourceTiming&&(r.resourceTiming=L.resourceTiming),this.map._refreshExpiredTiles&&L&&r.setExpiryData(L),r.loadVectorData(L,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)))}}abortTile(r){r.request&&(r.request.cancel(),delete r.request),r.actor&&r.actor.send("abortTile",{uid:r.uid,type:this.type,source:this.id})}unloadTile(r){r.unloadVectorData(),r.actor&&r.actor.send("removeTile",{uid:r.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class pe extends s.Evented{constructor(r,c,m,b){super(),this.id=r,this.dispatcher=m,this.setEventedParent(b),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},c),s.extend(this,s.pick(c,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Fe(this._options,this.map._requestManager,null,null,(c,m)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new s.ErrorEvent(c)):m&&(s.extend(this,m),m.bounds&&(this.tileBounds=new St(m.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(m.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(c)})}loaded(){return this._loaded}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}loadTile(r,c){const m=s.exported.devicePixelRatio>=2,b=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),m,this.tileSize);r.request=s.getImage(this.map._requestManager.transformRequest(b,s.ResourceType.Tile),(T,O,L,Z)=>(delete r.request,r.aborted?(r.state="unloaded",c(null)):T?(r.state="errored",c(T)):O?(this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:L,expires:Z}),r.setTexture(O,this.map.painter),r.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void c(null)):c(null)))}static loadTileData(r,c,m){r.setTexture(c,m)}static unloadTileData(r,c){r.texture&&c.saveTileTexture(r.texture)}abortTile(r,c){r.request&&(r.request.cancel(),delete r.request),c()}unloadTile(r,c){r.texture&&this.map.painter.saveTileTexture(r.texture),c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function ze(f,r,c,m,b,T,O,L){const Z=[f,c,b,r,m,T,1,1,1],q=[O,L,1],W=s.adjoint([],Z),[se,Oe,$e]=s.transformMat3(q,q,s.transpose(W,W));return s.multiply$1(Z,[se,0,0,0,Oe,0,0,0,$e],Z)}class xe extends s.Evented{constructor(r,c,m,b){super(),this.id=r,this.dispatcher=m,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(b),this.options=c,this._dirty=!1}load(r,c){this._loaded=c||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(m,b)=>{if(this._imageRequest=null,this._loaded=!0,m)this.fire(new s.ErrorEvent(m));else if(b){const{HTMLImageElement:T}=s.window;this.image=b instanceof T?s.exported.getImageData(b):b,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,r&&(this.coordinates=r),this._finishLoading()}})}loaded(){return this._loaded}updateImage(r){return this.image&&r.url?(this._imageRequest&&r.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=r.url,this.load(r.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(r){this.coordinates=r,this._boundsArray=void 0;const c=r.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(m){let b=1/0,T=1/0,O=-1/0,L=-1/0;for(const se of m)b=Math.min(b,se.x),T=Math.min(T,se.y),O=Math.max(O,se.x),L=Math.max(L,se.y);const Z=Math.max(O-b,L-T),q=Math.max(0,Math.floor(-Math.log(Z)/Math.LN2)),W=Math.pow(2,q);return new s.CanonicalTileID(q,Math.floor((b+O)/2*W),Math.floor((T+L)/2*W))}(c),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(r){for(const Z in this.tiles){const q=this.tiles[Z];"loaded"!==q.state&&(q.state="loaded",q.texture=this.texture)}if(this._boundsArray)return;const c=s.tileTransform(this.tileID,this.map.transform.projection),[m,b,T,O]=this.coordinates.map(Z=>{const q=c.projection.project(Z[0],Z[1]);return s.getTilePoint(c,q)._round()});this.perspectiveTransform=function(Z,q,W,se,Oe,$e,We,qe,Ke,ce){const Ve=ze(0,0,Z,0,0,q,Z,q),rt=ze(W,se,Oe,$e,We,qe,Ke,ce);return s.multiply$1(rt,s.adjoint(Ve,Ve),rt),[rt[6]/rt[8]*Z/s.EXTENT,rt[7]/rt[8]*q/s.EXTENT]}(this.width,this.height,m.x,m.y,b.x,b.y,O.x,O.y,T.x,T.y);const L=this._boundsArray=new s.StructArrayLayout4i8;L.emplaceBack(m.x,m.y,0,0),L.emplaceBack(b.x,b.y,s.EXTENT,0),L.emplaceBack(O.x,O.y,0,s.EXTENT),L.emplaceBack(T.x,T.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=r.createVertexBuffer(L,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const r=this.map.painter.context,c=r.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(r,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(r)}loadTile(r,c){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={},c(null)):(r.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const be={vector:zn,raster:pe,"raster-dem":class extends pe{constructor(f,r,c,m){super(f,r,c,m),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTile(f,r){const c=this.map._requestManager.normalizeTileURL(f.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function m(b,T){b&&(f.state="errored",r(b)),T&&(f.dem=T,f.dem.onDeserialize(),f.needsHillshadePrepare=!0,f.needsDEMTextureUpload=!0,f.state="loaded",r(null))}f.request=s.getImage(this.map._requestManager.transformRequest(c,s.ResourceType.Tile),function(b,T,O,L){if(delete f.request,f.aborted)f.state="unloaded",r(null);else if(b)f.state="errored",r(b);else if(T){this.map._refreshExpiredTiles&&f.setExpiryData({cacheControl:O,expires:L});const Z=s.window.ImageBitmap&&T instanceof s.window.ImageBitmap&&(null==mi&&(mi=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.window.createImageBitmap),mi),q=1-(T.width-s.prevPowerOfTwo(T.width))/2;q<1||f.neighboringTiles||(f.neighboringTiles=this._getNeighboringTiles(f.tileID));const W=Z?T:s.exported.getImageData(T,q),se={uid:f.uid,coord:f.tileID,source:this.id,rawImageData:W,encoding:this.encoding,padding:q};f.actor&&"expired"!==f.state||(f.actor=this.dispatcher.getActor(),f.actor.send("loadDEMTile",se,m.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(f){const r=f.canonical,c=Math.pow(2,r.z),m=(r.x-1+c)%c,b=0===r.x?f.wrap-1:f.wrap,T=(r.x+1+c)%c,O=r.x+1===c?f.wrap+1:f.wrap,L={};return L[new s.OverscaledTileID(f.overscaledZ,b,r.z,m,r.y).key]={backfilled:!1},L[new s.OverscaledTileID(f.overscaledZ,O,r.z,T,r.y).key]={backfilled:!1},r.y>0&&(L[new s.OverscaledTileID(f.overscaledZ,b,r.z,m,r.y-1).key]={backfilled:!1},L[new s.OverscaledTileID(f.overscaledZ,f.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},L[new s.OverscaledTileID(f.overscaledZ,O,r.z,T,r.y-1).key]={backfilled:!1}),r.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.ErrorEvent(c));else{const b={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&m&&m.resourceTiming&&m.resourceTiming[this.id]&&(b.resourceTiming=m.resourceTiming[this.id]),this.fire(new s.Event("data",b)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(f,r){const c=f.actor?"reloadTile":"loadTile";f.actor=this.actor,f.request=this.actor.send(c,{type:this.type,uid:f.uid,tileID:f.tileID,tileZoom:f.tileZoom,zoom:f.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(m,b)=>(delete f.request,f.unloadVectorData(),f.aborted?r(null):m?r(m):(f.loadVectorData(b,this.map.painter,"reloadTile"===c),r(null))),void 0,"loadTile"===c)}abortTile(f){f.request&&(f.request.cancel(),delete f.request),f.aborted=!0}unloadTile(f){f.unloadVectorData(),this.actor.send("removeTile",{uid:f.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends xe{constructor(f,r,c,m){super(f,r,c,m),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;const f=this.options;this.urls=[];for(const r of f.urls)this.urls.push(this.map._requestManager.transformRequest(r,s.ResourceType.Source).url);s.getVideo(this.urls,(r,c)=>{this._loaded=!0,r?this.fire(new s.ErrorEvent(r)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(f){if(this.video){const r=this.video.seekable;fr.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=f}}getVideo(){return this.video}onAdd(f){this.map||(this.map=f,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const f=this.map.painter.context,r=f.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(f,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(f)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:xe,canvas:class extends xe{constructor(f,r,c,m){super(f,r,c,m),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some(b=>!Array.isArray(b)||2!==b.length||b.some(T=>"number"!=typeof T))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${f}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(f){this.map=f,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let f=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,f=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,f=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const r=this.map.painter.context;this.texture?(f||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(r,this.canvas,r.gl.RGBA,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const f of[this.canvas.width,this.canvas.height])if(isNaN(f)||f<=0)return!0;return!1}},custom:class extends s.Evented{constructor(f,r,c,m){super(),this.id=f,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=r,this.setEventedParent(m),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new St(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(f){this._map=f,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(f),this.load()}onRemove(f){this._implementation.onRemove&&this._implementation.onRemove(f)}hasTile(f){if(this._implementation.hasTile){const{x:r,y:c,z:m}=f.canonical;return this._implementation.hasTile({x:r,y:c,z:m})}return!this.tileBounds||this.tileBounds.contains(f.canonical)}loadTile(f,r){const{x:c,y:m,z:b}=f.tileID.canonical,T=new s.window.AbortController;f.request=Promise.resolve(this._implementation.loadTile({x:c,y:m,z:b},{signal:T.signal})).then(function(O){return delete f.request,f.aborted?(f.state="unloaded",r(null)):void 0===O?(f.state="errored",r(null)):null===O?(this.loadTileData(f,{width:this.tileSize,height:this.tileSize,data:null}),f.state="loaded",r(null)):(L=O)instanceof s.window.ImageData||L instanceof s.window.HTMLCanvasElement||L instanceof s.window.ImageBitmap||L instanceof s.window.HTMLImageElement?(this.loadTileData(f,O),f.state="loaded",void r(null)):(f.state="errored",r(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)));var L}.bind(this)).catch(O=>{20!==O.code&&(f.state="errored",r(O))}),f.request.cancel=()=>T.abort()}loadTileData(f,r){pe.loadTileData(f,r,this._map.painter)}unloadTileData(f){pe.unloadTileData(f,this._map.painter)}unloadTile(f,r){if(this.unloadTileData(f),this._implementation.unloadTile){const{x:c,y:m,z:b}=f.tileID.canonical;this._implementation.unloadTile({x:c,y:m,z:b})}r()}abortTile(f,r){f.request&&f.request.cancel&&(f.request.cancel(),delete f.request),r()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(f=>({x:f.canonical.x,y:f.canonical.y,z:f.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Ze=function(f,r,c,m){const b=new be[r.type](f,r,c,m);if(b.id!==f)throw new Error(`Expected Source id to be ${f} instead of ${b.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],b),b};function Pt(f,r){const c=s.identity([]);return s.scale(c,c,[.5*f.width,.5*-f.height,1]),s.translate(c,c,[1,-1,0]),s.multiply(c,c,f.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(c)}function bn(f,r,c,m,b,T,O,L=!1){const Z=f.tilesIn(m,O,L);Z.sort(Ci);const q=[];for(const se of Z)q.push({wrappedTileID:se.tile.tileID.wrapped().key,queryResults:se.tile.queryRenderedFeatures(r,c,f._state,se,b,T,Pt(f.transform,se.tile.tileID),L)});const W=function(se){const Oe={},$e={};for(const We of se){const qe=We.queryResults,Ke=We.wrappedTileID,ce=$e[Ke]=$e[Ke]||{};for(const Ve in qe){const rt=qe[Ve],ot=ce[Ve]=ce[Ve]||{},Tt=Oe[Ve]=Oe[Ve]||[];for(const Mt of rt)ot[Mt.featureIndex]||(ot[Mt.featureIndex]=!0,Tt.push(Mt))}}return Oe}(q);for(const se in W)W[se].forEach(Oe=>{const $e=Oe.feature,We=$e.layer;We&&"background"!==We.type&&"sky"!==We.type&&($e.source=We.source,We["source-layer"]&&($e.sourceLayer=We["source-layer"]),$e.state=void 0!==$e.id?f.getFeatureState(We["source-layer"],$e.id):{})});return W}function Kn(f,r){const c=f.getRenderableIds().map(T=>f.getTileByID(T)),m=[],b={};for(let T=0;T{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[cr]}numActive(){return Object.keys(this.active).length}}let Lt;function st(){return Lt||(Lt=new Ui),Lt}function pn(f,r){const c={};for(const m in f)"ref"!==m&&(c[m]=f[m]);return s.refProperties.forEach(m=>{m in r&&(c[m]=r[m])}),c}function mn(f){f=f.slice();const r=Object.create(null);for(let c=0;c0?(b-O)/L:0;return this.points[T].mult(1-Z).add(this.points[c].mult(Z))}}class Ar{constructor(r,c,m){const b=this.boxCells=[],T=this.circleCells=[];this.xCellCount=Math.ceil(r/m),this.yCellCount=Math.ceil(c/m);for(let O=0;Othis.width||b<0||c>this.height)return!T&&[];const L=[];if(r<=0&&c<=0&&this.width<=m&&this.height<=b){if(T)return!0;for(let Z=0;Z0:L}_queryCircle(r,c,m,b,T){const O=r-m,L=r+m,Z=c-m,q=c+m;if(L<0||O>this.width||q<0||Z>this.height)return!b&&[];const W=[];return this._forEachCell(O,Z,L,q,this._queryCellCircle,W,{hitTest:b,circle:{x:r,y:c,radius:m},seenUids:{box:{},circle:{}}},T),b?W.length>0:W}query(r,c,m,b,T){return this._query(r,c,m,b,!1,T)}hitTest(r,c,m,b,T){return this._query(r,c,m,b,!0,T)}hitTestCircle(r,c,m,b){return this._queryCircle(r,c,m,!0,b)}_queryCell(r,c,m,b,T,O,L,Z){const q=L.seenUids,W=this.boxCells[T];if(null!==W){const Oe=this.bboxes;for(const $e of W)if(!q.box[$e]){q.box[$e]=!0;const We=4*$e;if(r<=Oe[We+2]&&c<=Oe[We+3]&&m>=Oe[We+0]&&b>=Oe[We+1]&&(!Z||Z(this.boxKeys[$e]))){if(L.hitTest)return O.push(!0),!0;O.push({key:this.boxKeys[$e],x1:Oe[We],y1:Oe[We+1],x2:Oe[We+2],y2:Oe[We+3]})}}}const se=this.circleCells[T];if(null!==se){const Oe=this.circles;for(const $e of se)if(!q.circle[$e]){q.circle[$e]=!0;const We=3*$e;if(this._circleAndRectCollide(Oe[We],Oe[We+1],Oe[We+2],r,c,m,b)&&(!Z||Z(this.circleKeys[$e]))){if(L.hitTest)return O.push(!0),!0;{const qe=Oe[We],Ke=Oe[We+1],ce=Oe[We+2];O.push({key:this.circleKeys[$e],x1:qe-ce,y1:Ke-ce,x2:qe+ce,y2:Ke+ce})}}}}}_queryCellCircle(r,c,m,b,T,O,L,Z){const q=L.circle,W=L.seenUids,se=this.boxCells[T];if(null!==se){const $e=this.bboxes;for(const We of se)if(!W.box[We]){W.box[We]=!0;const qe=4*We;if(this._circleAndRectCollide(q.x,q.y,q.radius,$e[qe+0],$e[qe+1],$e[qe+2],$e[qe+3])&&(!Z||Z(this.boxKeys[We])))return O.push(!0),!0}}const Oe=this.circleCells[T];if(null!==Oe){const $e=this.circles;for(const We of Oe)if(!W.circle[We]){W.circle[We]=!0;const qe=3*We;if(this._circlesCollide($e[qe],$e[qe+1],$e[qe+2],q.x,q.y,q.radius)&&(!Z||Z(this.circleKeys[We])))return O.push(!0),!0}}}_forEachCell(r,c,m,b,T,O,L,Z){const q=this._convertToXCellCoord(r),W=this._convertToYCellCoord(c),se=this._convertToXCellCoord(m),Oe=this._convertToYCellCoord(b);for(let $e=q;$e<=se;$e++)for(let We=W;We<=Oe;We++)if(T.call(this,r,c,m,b,this.xCellCount*We+$e,O,L,Z))return}_convertToXCellCoord(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_convertToYCellCoord(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_circlesCollide(r,c,m,b,T,O){const L=b-r,Z=T-c,q=m+O;return q*q>L*L+Z*Z}_circleAndRectCollide(r,c,m,b,T,O,L){const Z=(O-b)/2,q=Math.abs(r-(b+Z));if(q>Z+m)return!1;const W=(L-T)/2,se=Math.abs(c-(T+W));if(se>W+m)return!1;if(q<=Z||se<=W)return!0;const Oe=q-Z,$e=se-W;return Oe*Oe+$e*$e<=m*m}}const qi={unknown:0,flipRequired:1,flipNotRequired:2},Bi=Math.tan(85*Math.PI/180);function Kt(f,r,c,m,b,T,O){const L=s.create();if(c)if("globe"===T.name){const Z=s.calculateGlobeLabelMatrix(b,r);s.multiply(L,L,Z)}else{const Z=ue([],O);L[0]=Z[0],L[1]=Z[1],L[4]=Z[2],L[5]=Z[3],m||s.rotateZ(L,L,b.angle)}else s.multiply(L,b.labelPlaneMatrix,f);return L}function Wi(f,r,c,m,b,T,O){const L=Kt(f,r,c,m,b,T,O);return"globe"===T.name&&c||(L[2]=L[6]=L[10]=L[14]=0),L}function rr(f,r,c,m,b,T,O){if(c){if("globe"===T.name){const L=Kt(f,r,c,m,b,T,O);return s.invert(L,L),s.multiply(L,f,L),L}{const L=s.clone(f),Z=s.identity([]);return Z[0]=O[0],Z[1]=O[1],Z[4]=O[2],Z[5]=O[3],s.multiply(L,L,Z),m||s.rotateZ(L,L,-b.angle),L}}return b.glCoordMatrix}function yr(f,r,c,m){const b=[f,r,c,1];c?s.transformMat4$1(b,b,m):je(b,b,m);const T=b[3];return b[0]/=T,b[1]/=T,b[2]/=T,b}function xr(f,r){return Math.min(.5+f/r*.5,1.5)}function Sr(f,r){const c=f[0]/f[3],m=f[1]/f[3];return c>=-r[0]&&c<=r[0]&&m>=-r[1]&&m<=r[1]}function Go(f,r,c,m,b,T,O,L,Z,q){const W=c.transform,se=m?f.textSizeData:f.iconSizeData,Oe=s.evaluateSizeForZoom(se,c.transform.zoom),$e="globe"===W.projection.name,We=[256/c.width*2+1,256/c.height*2+1],qe=m?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;qe.clear();let Ke=null;$e&&(Ke=m?f.text.globeExtVertexArray:f.icon.globeExtVertexArray);const ce=f.lineVertexArray,Ve=m?f.text.placedSymbolArray:f.icon.placedSymbolArray,rt=c.transform.width/c.transform.height;let ot,Tt=!1;for(let Mt=0;MtMath.abs(c)?{useVertical:!0}:f===s.WritingMode.vertical?m>0?{needsFlipping:!0}:null:r!==qi.unknown&&(0===(b=c)||Math.abs(m/b)>Bi)?r===qi.flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null;var b}function Xn(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe,Ke,ce,Ve){const rt=r/24,ot=f.lineOffsetX*rt,Tt=f.lineOffsetY*rt,{lineStartIndex:Mt,glyphStartIndex:Dt,numGlyphs:$t,segment:zt,writingMode:dn,flipState:Vn}=f,on=Mt+f.lineLength,Rn=un=>{if(W){const[Gn,Ln,Wn]=un.up,Di=q.length;s.updateGlobeVertexNormal(W,Di+0,Gn,Ln,Wn),s.updateGlobeVertexNormal(W,Di+1,Gn,Ln,Wn),s.updateGlobeVertexNormal(W,Di+2,Gn,Ln,Wn),s.updateGlobeVertexNormal(W,Di+3,Gn,Ln,Wn)}const[Zn,sn,An]=un.point;s.addDynamicAttributes(q,Zn,sn,An,un.angle)};if($t>1){const un=Eo(rt,L,ot,Tt,c,se,Oe,f,Z,T,$e,qe,!1,Ke,ce,Ve);if(!un)return{notEnoughRoom:!0};if(m&&!c){let[Zn,sn,An]=un.first.point,[Gn,Ln,Wn]=un.last.point;[Zn,sn]=yr(Zn,sn,An,O),[Gn,Ln]=yr(Gn,Ln,Wn,O);const Di=to(dn,Vn,(Gn-Zn)*We,Ln-sn);if(f.flipState=Di&&Di.needsFlipping?qi.flipRequired:qi.flipNotRequired,Di)return Di}Rn(un.first);for(let Zn=Dt+1;Zn0?Gn:Si(Oe,An,Zn,1,b,void 0,Ke,ce.canonical),Wn=to(dn,Vn,(Ln[0]-Zn[0])*We,Ln[1]-Zn[1]);if(f.flipState=Wn&&Wn.needsFlipping?qi.flipRequired:qi.flipNotRequired,Wn)return Wn}const un=we(rt*L.getoffsetX(Dt),ot,Tt,c,se,Oe,zt,Mt,on,Z,T,$e,qe,!1,!1,Ke,ce,Ve);if(!un)return{notEnoughRoom:!0};Rn(un)}return{}}function Ei(f,r,c,m,b){const{x:T,y:O,z:L}=m.projectTilePoint(f.x,f.y,r);if(!b)return yr(T,O,L,c);const[Z,q,W]=b(f);return yr(T+Z,O+q,L+W,c)}function Si(f,r,c,m,b,T,O,L){const Z=Ei(f.sub(r)._unit()._add(f),L,b,O,T);return s.sub(Z,c,Z),s.normalize(Z,Z),s.scaleAndAdd(Z,c,Z,m)}function we(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe,Ke,ce){const Ve=m?f-r:f+r;let rt=Ve>0?1:-1,ot=0;m&&(rt*=-1,ot=Math.PI),rt<0&&(ot+=Math.PI);let Tt=L+O+(rt>0?0:1)|0,Mt=b,Dt=b,$t=0,zt=0;const dn=Math.abs(Ve),Vn=[],on=[];let Rn=T,un=Rn;const Zn=()=>Si(un,Rn,Dt,dn-$t+1,W,Oe,qe,Ke.canonical);for(;$t+zt<=dn;){if(Tt+=rt,Tt=Z)return null;if(Dt=Mt,un=Rn,Vn.push(Dt),$e&&on.push(un),Rn=new s.Point(q.getx(Tt),q.gety(Tt)),Mt=se[Tt],!Mt){const Pi=Ei(Rn,Ke.canonical,W,qe,Oe);Mt=Pi[3]>0?se[Tt]=Pi:Zn()}$t+=zt,zt=s.distance(Dt,Mt)}We&&Oe&&(se[Tt]&&(Mt=Zn(),zt=s.distance(Dt,Mt)),se[Tt]=Mt);const sn=(dn-$t)/zt,An=Rn.sub(un)._mult(sn)._add(un),Gn=s.sub([],Mt,Dt),Ln=s.scaleAndAdd([],Dt,Gn,sn);let Wn=[0,0,1],Di=Gn[0],Gi=Gn[1];if(ce&&(Wn=qe.upVector(Ke.canonical,An.x,An.y),0!==Wn[0]||0!==Wn[1]||1!==Wn[2])){const Pi=[Wn[2],0,-Wn[0]],ur=s.cross([],Wn,Pi);s.normalize(Pi,Pi),s.normalize(ur,ur),Di=s.dot(Gn,Pi),Gi=s.dot(Gn,ur)}if(c){const Pi=s.cross([],Wn,Gn);s.normalize(Pi,Pi),s.scaleAndAdd(Ln,Ln,Pi,c*rt)}const hi=ot+Math.atan2(Gi,Di);return Vn.push(Ln),$e&&on.push(An),{point:Ln,angle:hi,path:Vn,tilePath:on,up:Wn}}function fe(f,r){const c=r.length,m=c+4*f;r.resize(m),r.float32.fill(-1/0,4*c,4*m)}function je(f,r,c){const m=r[0],b=r[1];return f[0]=c[0]*m+c[4]*b+c[12],f[1]=c[1]*m+c[5]*b+c[13],f[3]=c[3]*m+c[7]*b+c[15],f}const lt=100;class an{constructor(r,c,m=new Ar(r.width+200,r.height+200,25),b=new Ar(r.width+200,r.height+200,25)){this.transform=r,this.grid=m,this.ignoredGrid=b,this.pitchfactor=Math.cos(r._pitch)*r.cameraToCenterDistance,this.screenRightBoundary=r.width+lt,this.screenBottomBoundary=r.height+lt,this.gridRightBoundary=r.width+200,this.gridBottomBoundary=r.height+200,this.fogState=c}placeCollisionBox(r,c,m,b,T,O,L,Z){let q=m.projectedAnchorX,W=m.projectedAnchorY,se=m.projectedAnchorZ;const Oe=m.elevation,$e=m.tileID,We=r.getProjection();if(Oe&&$e){const[Mt,Dt,$t]=We.upVector($e.canonical,m.tileAnchorX,m.tileAnchorY),zt=We.upVectorScale($e.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;q+=Mt*Oe*zt,W+=Dt*Oe*zt,se+=$t*Oe*zt}const qe=this.projectAndGetPerspectiveRatio(L,q,W,se,m.tileID,"globe"===We.name||!!Oe||this.transform.pitch>0,We),Ke=O*qe.perspectiveRatio,ce=(m.x1*c+b.x-m.padding)*Ke+qe.point.x,Ve=(m.y1*c+b.y-m.padding)*Ke+qe.point.y,rt=(m.x2*c+b.x+m.padding)*Ke+qe.point.x,ot=(m.y2*c+b.y+m.padding)*Ke+qe.point.y,Tt=qe.perspectiveRatio<=.55||qe.occluded;return!this.isInsideGrid(ce,Ve,rt,ot)||!T&&this.grid.hitTest(ce,Ve,rt,ot,Z)||Tt?{box:[],offscreen:!1,occluded:qe.occluded}:{box:[ce,Ve,rt,ot],offscreen:this.isOffscreen(ce,Ve,rt,ot),occluded:!1}}placeCollisionCircles(r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe){const Ke=[],ce=this.transform.elevation,Ve=r.getProjection(),rt=ce?ce.getAtTileOffsetFunc(qe,this.transform.center.lat,this.transform.worldSize,Ve):null,ot=new s.Point(m.tileAnchorX,m.tileAnchorY);let{x:Tt,y:Mt,z:Dt}=Ve.projectTilePoint(ot.x,ot.y,qe.canonical);if(rt){const[An,Gn,Ln]=rt(ot);Tt+=An,Mt+=Gn,Dt+=Ln}const $t="globe"===Ve.name,zt=this.projectAndGetPerspectiveRatio(L,Tt,Mt,Dt,qe,$t||!!ce||this.transform.pitch>0,Ve),{perspectiveRatio:dn}=zt,Vn=(se?O/dn:O*dn)/s.ONE_EM,on=yr(Tt,Mt,Dt,Z),Rn=zt.signedDistanceFromCamera>0?Eo(Vn,T,m.lineOffsetX*Vn,m.lineOffsetY*Vn,!1,on,ot,m,b,Z,{},ce&&!se?rt:null,se&&!!ce,Ve,qe,se):null;let un=!1,Zn=!1,sn=!0;if(Rn&&!zt.occluded){const An=.5*$e*dn+We,Gn=new s.Point(-100,-100),Ln=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Wn=new vi,{first:Di,last:Gi}=Rn,hi=Di.path.length;let Pi=[];for(let xi=hi-1;xi>=1;xi--)Pi.push(Di.path[xi]);for(let xi=1;xi(rt&&!$t&&(Kr=rt(Wrxi[3]<=0)&&(Pi=[]));let dr=[];if(Pi.length>0){let xi=1/0,Cr=-1/0,Kr=1/0,Wr=-1/0;for(const qr of Pi)xi=Math.min(xi,qr[0]),Kr=Math.min(Kr,qr[1]),Cr=Math.max(Cr,qr[0]),Wr=Math.max(Wr,qr[1]);Cr>=Gn.x&&xi<=Ln.x&&Wr>=Gn.y&&Kr<=Ln.y&&(dr=[Pi.map(qr=>new s.Point(qr[0],qr[1]))],(xiLn.x||KrLn.y)&&(dr=s.clipLine(dr,Gn.x,Gn.y,Ln.x,Ln.y)))}for(const xi of dr){Wn.reset(xi,.25*An);let Cr=0;Cr=Wn.length<=.5*An?1:Math.ceil(Wn.paddedLength/ur)+1;for(let Kr=0;Kr0?(s.transformMat4$1(Z,Z,r),this.fogState&&T&&"globe"!==L.name&&(q=function(Oe,$e,We,qe,Ke,ce){const Ve=ce.calculateFogTileMatrix(Ke),rt=[$e,We,qe];return s.transformMat4(rt,rt,Ve),Pe(Oe,rt,ce.pitch,ce._fov)}(this.fogState,c,m,b,T.toUnwrapped(),this.transform)>.9)):je(Z,Z,r);const W=Z[3];return{point:new s.Point((Z[0]/W+1)/2*this.transform.width+lt,(-Z[1]/W+1)/2*this.transform.height+lt),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(L)/W*.5,1.5),signedDistanceFromCamera:W,occluded:O&&Z[2]>W||q}}isOffscreen(r,c,m,b){return m=this.screenRightBoundary||bthis.screenBottomBoundary}isInsideGrid(r,c,m,b){return m>=0&&r=0&&cm.collisionGroupID===c}}return this.collisionGroups[r]}}function go(f,r,c,m,b){const{horizontalAlign:T,verticalAlign:O}=s.getAnchorAlignment(f),L=-(T-.5)*r,Z=-(O-.5)*c,q=s.evaluateVariableOffset(f,m);return new s.Point(L+q[0]*b,Z+q[1]*b)}function Nr(f,r,c,m,b){const T=new s.Point(f,r);return c&&T._rotate(m?b:-b),T}class co{constructor(r,c,m,b,T){this.transform=r.clone(),this.projection=r.projection.name,this.collisionIndex=new an(this.transform,T),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new vr(m),this.collisionCircleArrays={},this.prevPlacement=b,b&&(b.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(r,c,m,b){const T=m.getBucket(c),O=m.latestFeatureIndex;if(!T||!O||c.id!==T.layerIds[0])return;const L=T.layers[0].layout,Z=m.collisionBoxArray,q=Math.pow(2,this.transform.zoom-m.tileID.overscaledZ),W=m.tileSize/s.EXTENT,se=m.tileID.toUnwrapped();this.transform.setProjection(T.projection);const Oe=($e=m.tileID,We=T.getProjection(),qe=this.transform,We.name===this.projection?qe.calculateProjMatrix($e.toUnwrapped()):Vt(qe,We,$e));var $e,We,qe;const Ke="map"===L.get("text-pitch-alignment"),ce="map"===L.get("text-rotation-alignment");c.compileFilter();const Ve=c.dynamicFilter(),rt=c.dynamicFilterNeedsFeature(),ot=this.transform.calculatePixelsToTileUnitsMatrix(m),Tt=Wi(Oe,m.tileID.canonical,Ke,ce,this.transform,T.getProjection(),ot);let Mt=null;if(Ke){const zt=rr(Oe,m.tileID.canonical,Ke,ce,this.transform,T.getProjection(),ot);Mt=s.multiply([],this.transform.labelPlaneMatrix,zt)}let Dt=null;Ve&&m.latestFeatureIndex&&(Dt={unwrappedTileID:se,dynamicFilter:Ve,dynamicFilterNeedsFeature:rt,featureIndex:m.latestFeatureIndex}),this.retainedQueryData[T.bucketInstanceId]=new Ni(T.bucketInstanceId,O,T.sourceLayerIndex,T.index,m.tileID);const $t={bucket:T,layout:L,posMatrix:Oe,textLabelPlaneMatrix:Tt,labelToScreenMatrix:Mt,clippingData:Dt,scale:q,textPixelRatio:W,holdingForFade:m.holdingForFade(),collisionBoxArray:Z,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(T.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(T.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(T.sourceID)};if(b)for(const zt of T.sortKeyRanges){const{sortKey:dn,symbolInstanceStart:Vn,symbolInstanceEnd:on}=zt;r.push({sortKey:dn,symbolInstanceStart:Vn,symbolInstanceEnd:on,parameters:$t})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:T.symbolInstances.length,parameters:$t})}attemptAnchorPlacement(r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe,Ke,ce,Ve){const{textOffset0:rt,textOffset1:ot,crossTileID:Tt}=Oe,Mt=[rt,ot],Dt=go(r,m,b,Mt,T),$t=this.collisionIndex.placeCollisionBox(We,T,c,Nr(Dt.x,Dt.y,O,L,this.transform.angle),se,Z,q,W.predicate);if(Ke){const zt=We.getSymbolInstanceIconSize(Ve,this.transform.zoom,Oe.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(We,zt,Ke,Nr(Dt.x,Dt.y,O,L,this.transform.angle),se,Z,q,W.predicate).box.length)return}if($t.box.length>0){let zt;return this.prevPlacement&&this.prevPlacement.variableOffsets[Tt]&&this.prevPlacement.placements[Tt]&&this.prevPlacement.placements[Tt].text&&(zt=this.prevPlacement.variableOffsets[Tt].anchor),this.variableOffsets[Tt]={textOffset:Mt,width:m,height:b,anchor:r,textScale:T,prevAnchor:zt},this.markUsedJustification(We,r,Oe,qe),We.allowVerticalPlacement&&(this.markUsedOrientation(We,qe,Oe),this.placedOrientations[Tt]=qe),{shift:Dt,placedGlyphBoxes:$t}}}placeLayerBucketPart(r,c,m,b){const{bucket:T,layout:O,posMatrix:L,textLabelPlaneMatrix:Z,labelToScreenMatrix:q,clippingData:W,textPixelRatio:se,holdingForFade:Oe,collisionBoxArray:$e,partiallyEvaluatedTextSize:We,partiallyEvaluatedIconSize:qe,collisionGroup:Ke}=r.parameters,ce=O.get("text-optional"),Ve=O.get("icon-optional"),rt=O.get("text-allow-overlap"),ot=O.get("icon-allow-overlap"),Tt="map"===O.get("text-rotation-alignment"),Mt="map"===O.get("text-pitch-alignment"),Dt="none"!==O.get("icon-text-fit"),$t="viewport-y"===O.get("symbol-z-order");this.transform.setProjection(T.projection);let zt=rt&&(ot||!T.hasIconData()||Ve),dn=ot&&(rt||!T.hasTextData()||ce);!T.collisionArrays&&$e&&T.deserializeCollisionBoxes($e),m&&b&&T.updateCollisionDebugBuffers(this.transform.zoom,$e);const Vn=(on,Rn,un)=>{const{crossTileID:Zn,numVerticalGlyphVertices:sn}=on;if(W){const mo={zoom:this.transform.zoom,pitch:this.transform.pitch};let jr=null;if(W.dynamicFilterNeedsFeature){const Lr=this.retainedQueryData[T.bucketInstanceId];jr=W.featureIndex.loadFeature({featureIndex:on.featureIndex,bucketIndex:Lr.bucketIndex,sourceLayerIndex:Lr.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,W.dynamicFilter)(mo,jr,this.retainedQueryData[T.bucketInstanceId].tileID.canonical,new s.Point(on.tileAnchorX,on.tileAnchorY),this.transform.calculateDistanceTileData(W.unwrappedTileID)))return this.placements[Zn]=new di(!1,!1,!1,!0),void c.add(Zn)}if(c.has(Zn))return;if(Oe)return void(this.placements[Zn]=new di(!1,!1,!1));let An=!1,Gn=!1,Ln=!0,Wn=!1,Di=!1,Gi=null,hi={box:null,offscreen:null,occluded:null},Pi={box:null,offscreen:null,occluded:null},ur=null,dr=null,xi=null,Cr=0,Kr=0,Wr=0;un.textFeatureIndex?Cr=un.textFeatureIndex:on.useRuntimeCollisionCircles&&(Cr=on.featureIndex),un.verticalTextFeatureIndex&&(Kr=un.verticalTextFeatureIndex);const qr=mo=>{mo.tileID=this.retainedQueryData[T.bucketInstanceId].tileID;const jr=this.transform.elevation;(jr||mo.elevation)&&(mo.elevation=jr?jr.getAtTileOffset(mo.tileID,mo.tileAnchorX,mo.tileAnchorY):0)},ns=un.textBox;if(ns){qr(ns);const mo=Lr=>{let Zo=s.WritingMode.horizontal;if(T.allowVerticalPlacement&&!Lr&&this.prevPlacement){const Ds=this.prevPlacement.placedOrientations[Zn];Ds&&(this.placedOrientations[Zn]=Ds,Zo=Ds,this.markUsedOrientation(T,Zo,on))}return Zo},jr=(Lr,Zo)=>{if(T.allowVerticalPlacement&&sn>0&&un.verticalTextBox){for(const Ds of T.writingModes)if(Ds===s.WritingMode.vertical?(hi=Zo(),Pi=hi):hi=Lr(),hi&&hi.box&&hi.box.length)break}else hi=Lr()};if(O.get("text-variable-anchor")){let Lr=O.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Zn]){const Vr=this.prevPlacement.variableOffsets[Zn];Lr.indexOf(Vr.anchor)>0&&(Lr=Lr.filter(ls=>ls!==Vr.anchor),Lr.unshift(Vr.anchor))}const Zo=(Vr,ls,ll)=>{const Al=T.getSymbolInstanceTextSize(We,on,this.transform.zoom,Rn),Wl=(Vr.x2-Vr.x1)*Al+2*Vr.padding,Qs=(Vr.y2-Vr.y1)*Al+2*Vr.padding,ql=Dt&&!ot?ls:null;ql&&qr(ql);let Yl={box:[],offscreen:!1,occluded:!1};const Ed=rt?2*Lr.length:Lr.length;for(let Lu=0;Lu=Lr.length,on,Rn,T,ll,ql,We,qe);if(vh&&(Yl=vh.placedGlyphBoxes,Yl&&Yl.box&&Yl.box.length)){An=!0,Gi=vh.shift;break}}return Yl};jr(()=>Zo(ns,un.iconBox,s.WritingMode.horizontal),()=>{const Vr=un.verticalTextBox;return Vr&&qr(Vr),T.allowVerticalPlacement&&!(hi&&hi.box&&hi.box.length)&&sn>0&&Vr?Zo(Vr,un.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),hi&&(An=hi.box,Ln=hi.offscreen,Wn=hi.occluded);const Ds=mo(!(!hi||!hi.box));if(!An&&this.prevPlacement){const Vr=this.prevPlacement.variableOffsets[Zn];Vr&&(this.variableOffsets[Zn]=Vr,this.markUsedJustification(T,Vr.anchor,on,Ds))}}else{const Lr=(Zo,Ds)=>{const Vr=T.getSymbolInstanceTextSize(We,on,this.transform.zoom,Rn),ls=this.collisionIndex.placeCollisionBox(T,Vr,Zo,new s.Point(0,0),rt,se,L,Ke.predicate);return ls&&ls.box&&ls.box.length&&(this.markUsedOrientation(T,Ds,on),this.placedOrientations[Zn]=Ds),ls};jr(()=>Lr(ns,s.WritingMode.horizontal),()=>{const Zo=un.verticalTextBox;return T.allowVerticalPlacement&&sn>0&&Zo?(qr(Zo),Lr(Zo,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),mo(!!(hi&&hi.box&&hi.box.length))}}if(ur=hi,An=ur&&ur.box&&ur.box.length>0,Ln=ur&&ur.offscreen,Wn=ur&&ur.occluded,on.useRuntimeCollisionCircles){const mo=T.text.placedSymbolArray.get(on.centerJustifiedTextSymbolIndex>=0?on.centerJustifiedTextSymbolIndex:on.verticalPlacedTextSymbolIndex),jr=s.evaluateSizeForFeature(T.textSizeData,We,mo),Lr=O.get("text-padding");dr=this.collisionIndex.placeCollisionCircles(T,rt,mo,T.lineVertexArray,T.glyphOffsetArray,jr,L,Z,q,m,Mt,Ke.predicate,on.collisionCircleDiameter*jr/s.ONE_EM,Lr,this.retainedQueryData[T.bucketInstanceId].tileID),An=rt||dr.circles.length>0&&!dr.collisionDetected,Ln=Ln&&dr.offscreen,Wn=dr.occluded}if(un.iconFeatureIndex&&(Wr=un.iconFeatureIndex),un.iconBox){const mo=jr=>{qr(jr);const Lr=Dt&&Gi?Nr(Gi.x,Gi.y,Tt,Mt,this.transform.angle):new s.Point(0,0),Zo=T.getSymbolInstanceIconSize(qe,this.transform.zoom,on.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(T,Zo,jr,Lr,ot,se,L,Ke.predicate)};Pi&&Pi.box&&Pi.box.length&&un.verticalIconBox?(xi=mo(un.verticalIconBox),Gn=xi.box.length>0):(xi=mo(un.iconBox),Gn=xi.box.length>0),Ln=Ln&&xi.offscreen,Di=xi.occluded}const _s=ce||0===on.numHorizontalGlyphVertices&&0===sn,vo=Ve||0===on.numIconVertices;if(_s||vo?vo?_s||(Gn=Gn&&An):An=Gn&&An:Gn=An=Gn&&An,An&&ur&&ur.box&&this.collisionIndex.insertCollisionBox(ur.box,O.get("text-ignore-placement"),T.bucketInstanceId,Pi&&Pi.box&&Kr?Kr:Cr,Ke.ID),Gn&&xi&&this.collisionIndex.insertCollisionBox(xi.box,O.get("icon-ignore-placement"),T.bucketInstanceId,Wr,Ke.ID),dr&&(An&&this.collisionIndex.insertCollisionCircles(dr.circles,O.get("text-ignore-placement"),T.bucketInstanceId,Cr,Ke.ID),m)){const mo=T.bucketInstanceId;let jr=this.collisionCircleArrays[mo];void 0===jr&&(jr=this.collisionCircleArrays[mo]=new Ai);for(let Lr=0;Lr=0;--Rn){const un=on[Rn];Vn(T.symbolInstances.get(un),un,T.collisionArrays[un])}}else for(let on=r.symbolInstanceStart;on=0&&(r.text.placedSymbolArray.get(T).crossTileID=se>=0&&T!==se?0:q),O>=0&&(r.text.placedSymbolArray.get(O).crossTileID=se>=0&&O!==se?0:q),L>=0&&(r.text.placedSymbolArray.get(L).crossTileID=se>=0&&L!==se?0:q),Z>=0&&(r.text.placedSymbolArray.get(Z).crossTileID=se>=0&&Z!==se?0:q)}markUsedOrientation(r,c,m){const b=c===s.WritingMode.horizontal||c===s.WritingMode.horizontalOnly?c:0,T=c===s.WritingMode.vertical?c:0,{leftJustifiedTextSymbolIndex:O,centerJustifiedTextSymbolIndex:L,rightJustifiedTextSymbolIndex:Z,verticalPlacedTextSymbolIndex:q}=m,W=r.text.placedSymbolArray;O>=0&&(W.get(O).placedOrientation=b),L>=0&&(W.get(L).placedOrientation=b),Z>=0&&(W.get(Z).placedOrientation=b),q>=0&&(W.get(q).placedOrientation=T)}commit(r){this.commitTime=r,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let m=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const b=c?c.symbolFadeChange(r):1,T=c?c.opacities:{},O=c?c.variableOffsets:{},L=c?c.placedOrientations:{};for(const Z in this.placements){const q=this.placements[Z],W=T[Z];W?(this.opacities[Z]=new Fn(W,b,q.text,q.icon,null,q.clipped),m=m||q.text!==W.text.placed||q.icon!==W.icon.placed):(this.opacities[Z]=new Fn(null,b,q.text,q.icon,q.skipFade,q.clipped),m=m||q.text||q.icon)}for(const Z in T){const q=T[Z];if(!this.opacities[Z]){const W=new Fn(q,b,!1,!1);W.isHidden()||(this.opacities[Z]=W,m=m||q.text.placed||q.icon.placed)}}for(const Z in O)this.variableOffsets[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.variableOffsets[Z]=O[Z]);for(const Z in L)this.placedOrientations[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.placedOrientations[Z]=L[Z]);m?this.lastPlacementChangeTime=r:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:r)}updateLayerOpacities(r,c){const m=new Set;for(const b of c){const T=b.getBucket(r);T&&b.latestFeatureIndex&&r.id===T.layerIds[0]&&this.updateBucketOpacities(T,m,b.collisionBoxArray)}}updateBucketOpacities(r,c,m){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();const b=r.layers[0].layout,T=!!r.layers[0].dynamicFilter(),O=new Fn(null,0,!1,!1,!0),L=b.get("text-allow-overlap"),Z=b.get("icon-allow-overlap"),q=b.get("text-variable-anchor"),W="map"===b.get("text-rotation-alignment"),se="map"===b.get("text-pitch-alignment"),Oe="none"!==b.get("icon-text-fit"),$e=new Fn(null,0,L&&(Z||!r.hasIconData()||b.get("icon-optional")),Z&&(L||!r.hasTextData()||b.get("text-optional")),!0);!r.collisionArrays&&m&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(m);const We=(Ke,ce,Ve)=>{for(let rt=0;rt0||rt>0,zt=Tt>0,dn=this.placedOrientations[ot],Vn=dn===s.WritingMode.vertical,on=dn===s.WritingMode.horizontal||dn===s.WritingMode.horizontalOnly;if(!$t&&!zt||Dt.isHidden()||qe++,$t){const Rn=Or(Dt.text);We(r.text,Ve,Vn?Er:Rn),We(r.text,rt,on?Er:Rn);const un=Dt.text.isHidden(),{leftJustifiedTextSymbolIndex:Zn,centerJustifiedTextSymbolIndex:sn,rightJustifiedTextSymbolIndex:An,verticalPlacedTextSymbolIndex:Gn}=ce,Ln=r.text.placedSymbolArray,Wn=un||Vn?1:0;Zn>=0&&(Ln.get(Zn).hidden=Wn),sn>=0&&(Ln.get(sn).hidden=Wn),An>=0&&(Ln.get(An).hidden=Wn),Gn>=0&&(Ln.get(Gn).hidden=un||on?1:0);const Di=this.variableOffsets[ot];Di&&this.markUsedJustification(r,Di.anchor,ce,dn);const Gi=this.placedOrientations[ot];Gi&&(this.markUsedJustification(r,"left",ce,Gi),this.markUsedOrientation(r,Gi,ce))}if(zt){const Rn=Or(Dt.icon),{placedIconSymbolIndex:un,verticalPlacedIconSymbolIndex:Zn}=ce,sn=r.icon.placedSymbolArray,An=Dt.icon.isHidden()?1:0;un>=0&&(We(r.icon,Tt,Vn?Er:Rn),sn.get(un).hidden=An),Zn>=0&&(We(r.icon,ce.numVerticalIconVertices,on?Er:Rn),sn.get(Zn).hidden=An)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){const Rn=r.collisionArrays[Ke];if(Rn){let un=new s.Point(0,0),Zn=!0;if(Rn.textBox||Rn.verticalTextBox){if(q){const An=this.variableOffsets[ot];An?(un=go(An.anchor,An.width,An.height,An.textOffset,An.textScale),W&&un._rotate(se?this.transform.angle:-this.transform.angle)):Zn=!1}T&&(Zn=!Dt.clipped),Rn.textBox&&uo(r.textCollisionBox.collisionVertexArray,Dt.text.placed,!Zn||Vn,un.x,un.y),Rn.verticalTextBox&&uo(r.textCollisionBox.collisionVertexArray,Dt.text.placed,!Zn||on,un.x,un.y)}const sn=Zn&&!(on||!Rn.verticalIconBox);Rn.iconBox&&uo(r.iconCollisionBox.collisionVertexArray,Dt.icon.placed,sn,Oe?un.x:0,Oe?un.y:0),Rn.verticalIconBox&&uo(r.iconCollisionBox.collisionVertexArray,Dt.icon.placed,!sn,Oe?un.x:0,Oe?un.y:0)}}}if(r.fullyClipped=0===qe,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){const Ke=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=Ke.invProjMatrix,r.placementViewportMatrix=Ke.viewportMatrix,r.collisionCircleArray=Ke.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(r){return 0===this.fadeDuration?1:(r-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(r){return Math.max(0,(this.transform.zoom-r)/1.5)}hasTransitions(r){return this.stale||r-this.lastPlacementChangeTimer}setStale(){this.stale=!0}}function uo(f,r,c,m,b){f.emplaceBack(r?1:0,c?1:0,m||0,b||0),f.emplaceBack(r?1:0,c?1:0,m||0,b||0),f.emplaceBack(r?1:0,c?1:0,m||0,b||0),f.emplaceBack(r?1:0,c?1:0,m||0,b||0)}const Jr=Math.pow(2,25),kr=Math.pow(2,24),To=Math.pow(2,17),ds=Math.pow(2,16),xo=Math.pow(2,9),zi=Math.pow(2,8),Fr=Math.pow(2,1);function Or(f){if(0===f.opacity&&!f.placed)return 0;if(1===f.opacity&&f.placed)return 4294967295;const r=f.placed?1:0,c=Math.floor(127*f.opacity);return c*Jr+r*kr+c*To+r*ds+c*xo+r*zi+c*Fr+r}const Er=0;class so{constructor(r){this._sortAcrossTiles="viewport-y"!==r.layout.get("symbol-z-order")&&void 0!==r.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(r,c,m,b,T){const O=this._bucketParts;for(;this._currentTileIndexL.sortKey-Z.sortKey));this._currentPartIndex{const O=s.exported.now()-b;return!this._forceFullPlacement&&O>2};for(;this._currentPlacementIndex>=0;){const O=c[r[this._currentPlacementIndex]],L=this.placement.collisionIndex.transform.zoom;if("symbol"===O.type&&(!O.minzoom||O.minzoom<=L)&&(!O.maxzoom||O.maxzoom>L)){if(this._inProgressLayer||(this._inProgressLayer=new so(O)),this._inProgressLayer.continuePlacement(m[O.source],this.placement,this._showCollisionBoxes,O,T))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(r){return this.placement.commit(r),this.placement}}const Po=512/s.EXTENT/2;class Hr{constructor(r,c,m){this.tileID=r,this.bucketInstanceId=m,this.index=new s.KDBush(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const b=r.canonical.x*s.EXTENT,T=r.canonical.y*s.EXTENT;for(let O=0;Or.overscaledZ)for(const L in O){const Z=O[L];Z.tileID.isChildOf(r)&&Z.findMatches(c.symbolInstances,r,b)}else{const L=O[r.scaledTo(Number(T)).key];L&&L.findMatches(c.symbolInstances,r,b)}}for(let T=0;T{c[m]=!0});for(const m in this.layerIndexes)c[m]||delete this.layerIndexes[m]}}const li=(f,r)=>s.emitValidationErrors(f,r&&r.filter(c=>"source.canvas"!==c.identifier)),Zi=s.pick(En,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Rr=s.pick(En,["setCenter","setZoom","setBearing","setPitch"]),_o={version:8,layers:[],sources:{}},rs={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class zr extends s.Evented{constructor(r,c={}){super(),this.map=r,this.dispatcher=new hn(st(),this),this.imageManager=new ht,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(r._requestManager,c.localFontFamily?s.LocalGlyphMode.all:c.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,c.localFontFamily||c.localIdeographFontFamily),this.crossTileSymbolIndex=new gr,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const m=this;this._rtlTextPluginCallback=zr.registerForPluginStateChange(b=>{m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:b.pluginStatus,pluginURL:b.pluginURL},(T,O)=>{if(s.triggerPluginCompletionEvent(T),O&&O.every(L=>L))for(const L in m._sourceCaches){const Z=m._sourceCaches[L],q=Z.getSource().type;"vector"!==q&&"geojson"!==q||Z.reload()}})}),this.on("data",b=>{if("source"!==b.dataType||"metadata"!==b.sourceDataType)return;const T=this.getSource(b.sourceId);if(T&&T.vectorLayerIds)for(const O in this._layers){const L=this._layers[O];L.source===T.id&&this._validateLayer(L)}})}loadURL(r,c={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const m="boolean"==typeof c.validate?c.validate:!s.isMapboxURL(r);r=this.map._requestManager.normalizeStyleURL(r,c.accessToken);const b=this.map._requestManager.transformRequest(r,s.ResourceType.Style);this._request=s.getJSON(b,(T,O)=>{this._request=null,T?this.fire(new s.ErrorEvent(T)):O&&this._load(O,m)})}loadJSON(r,c={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(r,!1!==c.validate)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(_o,!1)}_updateLayerCount(r,c){const m=c?1:-1;r.is3D()&&(this._num3DLayers+=m),"circle"===r.type&&(this._numCircleLayers+=m),"symbol"===r.type&&(this._numSymbolLayers+=m)}_load(r,c){if(c&&li(this,s.validateStyle(r)))return;this._loaded=!0,this.stylesheet=s.clone$1(r),this._updateMapProjection();for(const b in r.sources)this.addSource(b,r.sources[b],{validate:!1});this._changed=!1,r.sprite?this._loadSprite(r.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(r.glyphs);const m=mn(this.stylesheet.layers);this._order=m.map(b=>b.id),this._layers={},this._serializedLayers={};for(const b of m){const T=s.createStyleLayer(b);T.setEventedParent(this,{layer:{id:T.id}}),this._layers[T.id]=T,this._serializedLayers[T.id]=T.serialize(),this._updateLayerCount(T,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ye(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}setProjection(r){r?this.stylesheet.projection=r:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(r){this._spriteRequest=function(c,m,b){let T,O,L;const Z=s.exported.devicePixelRatio>1?"@2x":"";let q=s.getJSON(m.transformRequest(m.normalizeSpriteURL(c,Z,".json"),s.ResourceType.SpriteJSON),(Oe,$e)=>{q=null,L||(L=Oe,T=$e,se())}),W=s.getImage(m.transformRequest(m.normalizeSpriteURL(c,Z,".png"),s.ResourceType.SpriteImage),(Oe,$e)=>{W=null,L||(L=Oe,O=$e,se())});function se(){if(L)b(L);else if(T&&O){const Oe=s.exported.getImageData(O),$e={};for(const We in T){const{width:qe,height:Ke,x:ce,y:Ve,sdf:rt,pixelRatio:ot,stretchX:Tt,stretchY:Mt,content:Dt}=T[We],$t=new s.RGBAImage({width:qe,height:Ke});s.RGBAImage.copy(Oe,$t,{x:ce,y:Ve},{x:0,y:0},{width:qe,height:Ke}),$e[We]={data:$t,pixelRatio:ot,sdf:rt,stretchX:Tt,stretchY:Mt,content:Dt}}b(null,$e)}}return{cancel(){q&&(q.cancel(),q=null),W&&(W.cancel(),W=null)}}}(r,this.map._requestManager,(c,m)=>{if(this._spriteRequest=null,c)this.fire(new s.ErrorEvent(c));else if(m)for(const b in m)this.imageManager.addImage(b,m[b]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(r){const c=this.getSource(r.source);if(!c)return;const m=r.sourceLayer;m&&("geojson"===c.type||c.vectorLayerIds&&-1===c.vectorLayerIds.indexOf(m))&&this.fire(new s.ErrorEvent(new Error(`Source layer "${m}" does not exist on source "${c.id}" as specified by style layer "${r.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const r in this._sourceCaches)if(!this._sourceCaches[r].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(r){const c=[];for(const m of r){const b=this._layers[m];"custom"!==b.type&&c.push(b.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const r in this._sourceCaches)if(this._sourceCaches[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(r){return!!this.terrain&&("function"==typeof r.isLayerDraped?r.isLayerDraped():rs[r.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(r){if(!this._loaded)return;const c=this._changed;if(this._changed){const b=Object.keys(this._updatedLayers),T=Object.keys(this._removedLayers);(b.length||T.length)&&this._updateWorkerLayers(b,T);for(const O in this._updatedSources){const L=this._updatedSources[O];"reload"===L?this._reloadSource(O):"clear"===L&&this._clearSource(O)}this._updateTilesForChangedImages();for(const O in this._updatedPaintProps)this._layers[O].updateTransitions(r);this.light.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this._resetUpdates()}const m={};for(const b in this._sourceCaches){const T=this._sourceCaches[b];m[b]=T.used,T.used=!1}for(const b of this._order){const T=this._layers[b];if(T.recalculate(r,this._availableImages),!T.isHidden(r.zoom)){const L=this._getLayerSourceCache(T);L&&(L.used=!0)}const O=this.map.painter;if(O){const L=T.getProgramIds();if(!L)continue;const Z=T.getProgramConfiguration(r.zoom);for(const q of L)O.useProgram(q,Z)}}for(const b in m){const T=this._sourceCaches[b];m[b]!==T.used&&T.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:T.getSource().id}))}this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.z=r.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),c&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const r=Object.keys(this._changedImages);if(r.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],r);this._changedImages={}}}_updateWorkerLayers(r,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(r),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(r){if(this._checkLoaded(),li(this,s.validateStyle(r)))return!1;(r=s.clone$1(r)).layers=mn(r.layers);const c=function(b,T){if(!b)return[{command:En.setStyle,args:[T]}];let O=[];try{if(!J(b.version,T.version))return[{command:En.setStyle,args:[T]}];J(b.center,T.center)||O.push({command:En.setCenter,args:[T.center]}),J(b.zoom,T.zoom)||O.push({command:En.setZoom,args:[T.zoom]}),J(b.bearing,T.bearing)||O.push({command:En.setBearing,args:[T.bearing]}),J(b.pitch,T.pitch)||O.push({command:En.setPitch,args:[T.pitch]}),J(b.sprite,T.sprite)||O.push({command:En.setSprite,args:[T.sprite]}),J(b.glyphs,T.glyphs)||O.push({command:En.setGlyphs,args:[T.glyphs]}),J(b.transition,T.transition)||O.push({command:En.setTransition,args:[T.transition]}),J(b.light,T.light)||O.push({command:En.setLight,args:[T.light]}),J(b.fog,T.fog)||O.push({command:En.setFog,args:[T.fog]}),J(b.projection,T.projection)||O.push({command:En.setProjection,args:[T.projection]});const L={},Z=[];!function(se,Oe,$e,We){let qe;for(qe in Oe=Oe||{},se=se||{})se.hasOwnProperty(qe)&&(Oe.hasOwnProperty(qe)||gi(qe,$e,We));for(qe in Oe){if(!Oe.hasOwnProperty(qe))continue;const Ke=Oe[qe];se.hasOwnProperty(qe)?J(se[qe],Ke)||("geojson"===se[qe].type&&"geojson"===Ke.type&&Li(se,Oe,qe)?$e.push({command:En.setGeoJSONSourceData,args:[qe,Ke.data]}):_i(qe,Oe,$e,We)):ti(qe,Oe,$e)}}(b.sources,T.sources,Z,L);const q=[];b.layers&&b.layers.forEach(se=>{se.source&&L[se.source]?O.push({command:En.removeLayer,args:[se.id]}):q.push(se)});let W=b.terrain;W&&L[W.source]&&(O.push({command:En.setTerrain,args:[void 0]}),W=void 0),O=O.concat(Z),J(W,T.terrain)||O.push({command:En.setTerrain,args:[T.terrain]}),function(se,Oe,$e){Oe=Oe||[];const We=(se=se||[]).map(ir),qe=Oe.map(ir),Ke=se.reduce(Dr,{}),ce=Oe.reduce(Dr,{}),Ve=We.slice(),rt=Object.create(null);let ot,Tt,Mt,Dt,$t,zt,dn;for(ot=0,Tt=0;ot!(b.command in Rr));if(0===c.length)return!1;const m=c.filter(b=>!(b.command in Zi));if(m.length>0)throw new Error(`Unimplemented: ${m.map(b=>b.command).join(", ")}.`);return c.forEach(b=>{"setTransition"!==b.command&&"setProjection"!==b.command&&this[b.command].apply(this,b.args)}),this.stylesheet=r,this._updateMapProjection(),!0}addImage(r,c){return this.getImage(r)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(r,c),this._afterImageUpdated(r),this)}updateImage(r,c){this.imageManager.updateImage(r,c)}getImage(r){return this.imageManager.getImage(r)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r),this._afterImageUpdated(r),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(),this._changedImages[r]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(r,c,m={}){if(this._checkLoaded(),void 0!==this.getSource(r))throw new Error("There is already a source with this ID");if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(s.validateSource,`sources.${r}`,c,null,m))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const b=Ze(r,c,this.dispatcher,this);b.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r),source:b.serialize(),sourceId:r}));const T=O=>{const L=(O?"symbol:":"other:")+r,Z=this._sourceCaches[L]=new s.SourceCache(L,b,O);(O?this._symbolSourceCaches:this._otherSourceCaches)[r]=Z,Z.style=this,Z.onAdd(this.map)};T(!1),"vector"!==c.type&&"geojson"!==c.type||T(!0),b.onAdd&&b.onAdd(this.map),this._changed=!0}removeSource(r){this._checkLoaded();const c=this.getSource(r);if(!c)throw new Error("There is no source with this ID");for(const b in this._layers)if(this._layers[b].source===r)return this.fire(new s.ErrorEvent(new Error(`Source "${r}" cannot be removed while layer "${b}" is using it.`)));if(this.terrain&&this.terrain.get().source===r)return this.fire(new s.ErrorEvent(new Error(`Source "${r}" cannot be removed while terrain is using it.`)));const m=this._getSourceCaches(r);for(const b of m)delete this._sourceCaches[b.id],delete this._updatedSources[b.id],b.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:b.getSource().id})),b.setEventedParent(null),b.clearTiles();return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(r,c){this._checkLoaded(),this.getSource(r).setData(c),this._changed=!0}getSource(r){const c=this._getSourceCache(r);return c&&c.getSource()}_getSources(){const r=[];for(const c in this._otherSourceCaches){const m=this._getSourceCache(c);m&&r.push(m.getSource())}return r}addLayer(r,c,m={}){this._checkLoaded();const b=r.id;if(this.getLayer(b))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${b}" already exists on this map`)));let T;if("custom"===r.type){if(li(this,s.validateCustomStyleLayer(r)))return;T=s.createStyleLayer(r)}else{if("object"==typeof r.source&&(this.addSource(b,r.source),r=s.clone$1(r),r=s.extend(r,{source:b})),this._validate(s.validateLayer,`layers.${b}`,r,{arrayIndex:-1},m))return;T=s.createStyleLayer(r),this._validateLayer(T),T.setEventedParent(this,{layer:{id:b}}),this._serializedLayers[T.id]=T.serialize(),this._updateLayerCount(T,!0)}const O=c?this._order.indexOf(c):this._order.length;if(c&&-1===O)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`)));this._order.splice(O,0,b),this._layerOrderChanged=!0,this._layers[b]=T;const L=this._getLayerSourceCache(T);if(this._removedLayers[b]&&T.source&&L&&"custom"!==T.type){const Z=this._removedLayers[b];delete this._removedLayers[b],Z.type!==T.type?this._updatedSources[T.source]="clear":(this._updatedSources[T.source]="reload",L.pause())}this._updateLayer(T),T.onAdd&&T.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(r,c){if(this._checkLoaded(),this._changed=!0,!this._layers[r])return void this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be moved.`)));if(r===c)return;const m=this._order.indexOf(r);this._order.splice(m,1);const b=c?this._order.indexOf(c):this._order.length;c&&-1===b?this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`))):(this._order.splice(b,0,r),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(r){this._checkLoaded();const c=this._layers[r];if(!c)return void this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be removed.`)));c.setEventedParent(null),this._updateLayerCount(c,!1);const m=this._order.indexOf(r);this._order.splice(m,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[r]=c,delete this._layers[r],delete this._serializedLayers[r],delete this._updatedLayers[r],delete this._updatedPaintProps[r],c.onRemove&&c.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(r){return this._layers[r]}hasLayer(r){return r in this._layers}hasLayerType(r){for(const c in this._layers)if(this._layers[c].type===r)return!0;return!1}setLayerZoomRange(r,c,m){this._checkLoaded();const b=this.getLayer(r);b?b.minzoom===c&&b.maxzoom===m||(null!=c&&(b.minzoom=c),null!=m&&(b.maxzoom=m),this._updateLayer(b)):this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(r,c,m={}){this._checkLoaded();const b=this.getLayer(r);if(b){if(!J(b.filter,c))return null==c?(b.filter=void 0,void this._updateLayer(b)):void(this._validate(s.validateFilter,`layers.${b.id}.filter`,c,{layerType:b.type},m)||(b.filter=s.clone$1(c),this._updateLayer(b)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be filtered.`)))}getFilter(r){const c=this.getLayer(r);return c&&s.clone$1(c.filter)}setLayoutProperty(r,c,m,b={}){this._checkLoaded();const T=this.getLayer(r);T?J(T.getLayoutProperty(c),m)||(T.setLayoutProperty(c,m,b),this._updateLayer(T)):this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(r,c){const m=this.getLayer(r);if(m)return m.getLayoutProperty(c);this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style.`)))}setPaintProperty(r,c,m,b={}){this._checkLoaded();const T=this.getLayer(r);T?J(T.getPaintProperty(c),m)||(T.setPaintProperty(c,m,b)&&this._updateLayer(T),this._changed=!0,this._updatedPaintProps[r]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(r,c){const m=this.getLayer(r);return m&&m.getPaintProperty(c)}setFeatureState(r,c){this._checkLoaded();const m=r.source,b=r.sourceLayer,T=this.getSource(m);if(!T)return void this.fire(new s.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const O=T.type;if("geojson"===O&&b)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===O&&!b)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===r.id&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const L=this._getSourceCaches(m);for(const Z of L)Z.setFeatureState(b,r.id,c)}removeFeatureState(r,c){this._checkLoaded();const m=r.source,b=this.getSource(m);if(!b)return void this.fire(new s.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const T=b.type,O="vector"===T?r.sourceLayer:void 0;if("vector"===T&&!O)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&"string"!=typeof r.id&&"number"!=typeof r.id)return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const L=this._getSourceCaches(m);for(const Z of L)Z.removeFeatureState(O,r.id,c)}getFeatureState(r){this._checkLoaded();const c=r.source,m=r.sourceLayer,b=this.getSource(c);if(b){if("vector"!==b.type||m)return void 0===r.id&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(c)[0].getFeatureState(m,r.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const r={};for(const c in this._sourceCaches){const m=this._sourceCaches[c].getSource();r[m.id]||(r[m.id]=m.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:r,layers:this._serializeLayers(this._order)},c=>void 0!==c)}_updateLayer(r){this._updatedLayers[r.id]=!0;const c=this._getLayerSourceCache(r);r.source&&!this._updatedSources[r.source]&&c&&"raster"!==c.getSource().type&&(this._updatedSources[r.source]="reload",c.pause()),this._changed=!0,r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(r){const c=O=>"fill-extrusion"===this._layers[O].type,m={},b=[];for(let O=this._order.length-1;O>=0;O--){const L=this._order[O];if(c(L)){m[L]=O;for(const Z of r){const q=Z[L];if(q)for(const W of q)b.push(W)}}}b.sort((O,L)=>L.intersectionZ-O.intersectionZ);const T=[];for(let O=this._order.length-1;O>=0;O--){const L=this._order[O];if(c(L))for(let Z=b.length-1;Z>=0;Z--){const q=b[Z].feature;if(m[q.layer.id]{const q=this.getLayer(Z);return q&&q.is3D()}):this.has3DLayers(),L=Ht.createFromScreenPoints(r,m);for(const Z in this._sourceCaches){const q=this._sourceCaches[Z].getSource().id;c.layers&&!b[q]||T.push(bn(this._sourceCaches[Z],this._layers,this._serializedLayers,L,c,m,O,!!this.map._showQueryGeometry))}return this.placement&&T.push(function(Z,q,W,se,Oe,$e,We){const qe={},Ke=$e.queryRenderedSymbols(se),ce=[];for(const Ve of Object.keys(Ke).map(Number))ce.push(We[Ve]);ce.sort(Ci);for(const Ve of ce){const rt=Ve.featureIndex.lookupSymbolFeatures(Ke[Ve.bucketInstanceId],q,Ve.bucketIndex,Ve.sourceLayerIndex,Oe.filter,Oe.layers,Oe.availableImages,Z);for(const ot in rt){const Tt=qe[ot]=qe[ot]||[],Mt=rt[ot];Mt.sort((Dt,$t)=>{const zt=Ve.featureSortOrder;if(zt){const dn=zt.indexOf(Dt.featureIndex);return zt.indexOf($t.featureIndex)-dn}return $t.featureIndex-Dt.featureIndex});for(const Dt of Mt)Tt.push(Dt)}}for(const Ve in qe)qe[Ve].forEach(rt=>{const ot=rt.feature,Tt=W(Z[Ve]);if(!Tt)return;const Mt=Tt.getFeatureState(ot.layer["source-layer"],ot.id);ot.source=ot.layer.source,ot.layer["source-layer"]&&(ot.sourceLayer=ot.layer["source-layer"]),ot.state=Mt});return qe}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),L.screenGeometry,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(T)}querySourceFeatures(r,c){c&&c.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",c.filter,null,c);const m=this._getSourceCaches(r);let b=[];for(const T of m)b=b.concat(Kn(T,c));return b}addSourceType(r,c,m){return zr.getSourceType(r)?m(new Error(`A source type called "${r}" already exists.`)):(zr.setSourceType(r,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:r,url:c.workerSourceURL},m):m(null,null))}getLight(){return this.light.getLight()}setLight(r,c={}){this._checkLoaded();const m=this.light.getLight();let b=!1;for(const O in r)if(!J(r[O],m[O])){b=!0;break}if(!b)return;const T=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(r,c),this.light.updateTransitions(T)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,c=1){if(this._checkLoaded(),!r)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let m=r;if(1===c){if("object"==typeof m.source){const b="terrain-dem-src";this.addSource(b,m.source),m=s.clone$1(m),m=s.extend(m,{source:b})}if(this._validate(s.validateTerrain,"terrain",m))return}if(!this.terrain||this.terrain&&c!==this.terrain.drapeRenderMode){if(!m)return;this._createTerrain(m,c)}else{const b=this.terrain,T=b.get();for(const O of Object.keys(s.spec.terrain))!m.hasOwnProperty(O)&&s.spec.terrain[O].default&&(m[O]=s.spec.terrain[O].default);for(const O in m)if(!J(m[O],T[O])){b.set(m),this.stylesheet.terrain=m;const L=this._setTransitionParameters({duration:0});b.updateTransitions(L);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(r){const c=this.fog=new _t(r,this.map.transform);this.stylesheet.fog=r;const m=this._setTransitionParameters({duration:0});c.updateTransitions(m)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const r of this.map._markers)r._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(r){if(this._checkLoaded(),!r)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog,m=c.get();0===Object.keys(r).length&&c.set(r);for(const b in r)if(!J(r[b],m[b])){c.set(r),this.stylesheet.fog=r;const T=this._setTransitionParameters({duration:0});c.updateTransitions(T);break}}else this._createFog(r);this._markersNeedUpdate=!0}_setTransitionParameters(r){return{now:s.exported.now(),transition:s.extend(r,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const r=this._order.filter(m=>this.isLayerDraped(this._layers[m])),c=this._order.filter(m=>!this.isLayerDraped(this._layers[m]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...r),this._drapedFirstOrder.push(...c)}_createTerrain(r,c){const m=this.terrain=new De(r,c);this.stylesheet.terrain=r,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const b=this._setTransitionParameters({duration:0});m.updateTransitions(b)}_force3DLayerUpdate(){for(const r in this._layers){const c=this._layers[r];"fill-extrusion"===c.type&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const r in this._layers){const c=this._layers[r];"symbol"===c.type&&this._updateLayer(c)}}_validate(r,c,m,b,T={}){return(!T||!1!==T.validate)&&li(this,r.call(s.validateStyle,s.extend({key:c,style:this.serialize(),value:m,styleSpec:s.spec},b)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this._sourceCaches)this._sourceCaches[r].clearTiles(),this._sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(r){const c=this._getSourceCaches(r);for(const m of c)m.clearTiles()}_reloadSource(r){const c=this._getSourceCaches(r);for(const m of c)m.resume(),m.reload()}_reloadSources(){for(const r of this._getSources())r.reload&&r.reload()}_updateSources(r){for(const c in this._sourceCaches)this._sourceCaches[c].update(r)}_generateCollisionBoxes(){for(const r in this._sourceCaches){const c=this._sourceCaches[r];c.resume(),c.reload()}}_updatePlacement(r,c,m,b,T=!1){let O=!1,L=!1;const Z={};for(const q of this._order){const W=this._layers[q];if("symbol"!==W.type)continue;if(!Z[W.source]){const Oe=this._getLayerSourceCache(W);if(!Oe)continue;Z[W.source]=Oe.getRenderableIds(!0).map($e=>Oe.getTileByID($e)).sort(($e,We)=>We.tileID.overscaledZ-$e.tileID.overscaledZ||($e.tileID.isLessThan(We.tileID)?-1:1))}const se=this.crossTileSymbolIndex.addLayer(W,Z[W.source],r.center.lng,r.projection);O=O||se}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),T=T||this._layerOrderChanged||0===m,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(T||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),r.zoom))&&(this.pauseablePlacement=new Gs(r,this._order,T,c,m,b,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Z),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),L=!0),O&&this.pauseablePlacement.placement.setStale()),L||O)for(const q of this._order){const W=this._layers[q];"symbol"===W.type&&this.placement.updateLayerOpacities(W,Z[W.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const r in this._sourceCaches)this._sourceCaches[r].releaseSymbolFadeTiles()}getImages(r,c,m){this.imageManager.getImages(c.icons,m),this._updateTilesForChangedImages();const b=T=>{T&&T.setDependencies(c.tileID.key,c.type,c.icons)};b(this._otherSourceCaches[c.source]),b(this._symbolSourceCaches[c.source])}getGlyphs(r,c,m){this.glyphManager.getGlyphs(c.stacks,m)}getResource(r,c,m){return s.makeRequest(c,m)}_getSourceCache(r){return this._otherSourceCaches[r]}_getLayerSourceCache(r){return"symbol"===r.type?this._symbolSourceCaches[r.source]:this._otherSourceCaches[r.source]}_getSourceCaches(r){const c=[];return this._otherSourceCaches[r]&&c.push(this._otherSourceCaches[r]),this._symbolSourceCaches[r]&&c.push(this._symbolSourceCaches[r]),c}_isSourceCacheLoaded(r){const c=this._getSourceCaches(r);return 0===c.length?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${r}'`))),!1):c.every(m=>m.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}zr.getSourceType=function(f){return be[f]},zr.setSourceType=function(f,r){be[f]=r},zr.registerForPluginStateChange=s.registerForPluginStateChange;var ko="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#define HALF_PI PI/2.0\n#define QUARTER_PI PI/4.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0",br="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",bo="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\nconst float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",Oo="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",Ti="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif";let Ns={},Xo={};const os=[];Ho(ko,os),Ho(bo,os),Ho(Oo,os),Ho(Ti,os),Ns=hr("",bo),Xo=hr(Ti,Oo);const Br=hr("\n#if __VERSION__ >=300\n#define varying in\n#define gl_FragColor glFragColor\n#define texture2D texture\n#define textureCube texture\nout vec4 glFragColor;\n#endif\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}","\n#if __VERSION__ >=300\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),zs=ko,ws="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif";var Fo={background:hr("uniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nvarying vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform vec4 u_color;varying vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(u_color);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:hr("uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:hr("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:hr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:hr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:hr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:hr("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:hr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:hr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:hr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:hr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:hr("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:hr("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:hr("varying vec4 v_color;\n#ifdef RENDER_SHADOWS\nvarying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\nvoid main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvec3 normal=v_normal;\n#endif\nfloat z;vec4 color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);\n#else\ncolor=v_color;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef ZERO_ROOF_RADIUS\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#endif\ncolor.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nv_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(color,NdotL);\n#else\nv_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_color*=u_opacity;\n#ifdef ZERO_ROOF_RADIUS\nv_roof_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef LIGHTING_3D_MODE\nv_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));\n#else\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:hr("uniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,v_NdotL)*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_NdotL=NdotL;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:hr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:hr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\ngl_FragColor=apply_lighting(gl_FragColor);\n#endif\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:hr("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nuniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture2D(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);\n#ifdef RENDER_LINE_BORDER_AUTO\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}\n#else\nout_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);\n#endif\n}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nattribute highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:hr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:hr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:hr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:hr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:hr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}"),terrainRaster:hr("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef RENDER_SHADOWS\ncolor.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nconst float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=wireframeOffset;\n#endif\nv_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}"),terrainDepth:hr("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:hr("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",br),skyboxGradient:hr("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",br),skyboxCapture:hr("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:hr("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#else\ncolor=texture2D(u_image0,v_pos0);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nattribute vec3 a_globe_pos;attribute vec2 a_uv;\n#else\nattribute vec2 a_pos;\n#endif\nvarying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nglobe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}"),globeAtmosphere:hr("uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:\n(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:\nuv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}","attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}")};function Ho(f,r){const c=f.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let m of c)if(m=m.trim(),"#"===m[0]&&m.includes("if")&&!m.includes("endif")){m=m.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const b=m.split(" ");for(const T of b)r.includes(T)||r.push(T)}}function hr(f,r){const c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,m=r.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),b={},T=[...os];return Ho(f,T),Ho(r,T),{fragmentSource:f=f.replace(c,(O,L,Z,q,W)=>(b[W]=!0,"define"===L?`\n#ifndef HAS_UNIFORM_u_${W}\nvarying ${Z} ${q} ${W};\n#else\nuniform ${Z} ${q} u_${W};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${W}\n ${Z} ${q} ${W} = u_${W};\n#endif\n`)),vertexSource:r=r.replace(c,(O,L,Z,q,W)=>{const se="float"===q?"vec2":"vec4",Oe=W.match(/color/)?"color":se;return b[W]?"define"===L?`\n#ifndef HAS_UNIFORM_u_${W}\nuniform lowp float u_${W}_t;\nattribute ${Z} ${se} a_${W};\nvarying ${Z} ${q} ${W};\n#else\nuniform ${Z} ${q} u_${W};\n#endif\n`:"vec4"===Oe?`\n#ifndef HAS_UNIFORM_u_${W}\n ${W} = a_${W};\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${W}\n ${W} = unpack_mix_${Oe}(a_${W}, u_${W}_t);\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`:"define"===L?`\n#ifndef HAS_UNIFORM_u_${W}\nuniform lowp float u_${W}_t;\nattribute ${Z} ${se} a_${W};\n#else\nuniform ${Z} ${q} u_${W};\n#endif\n`:"vec4"===Oe?`\n#ifndef HAS_UNIFORM_u_${W}\n ${Z} ${q} ${W} = a_${W};\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${W}\n ${Z} ${q} ${W} = unpack_mix_${Oe}(a_${W}, u_${W}_t);\n#else\n ${Z} ${q} ${W} = u_${W};\n#endif\n`}),staticAttributes:m,usedDefines:T}}class Ps{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(r,c,m,b,T,O,L){this.context=r;let Z=this.boundPaintVertexBuffers.length!==b.length;for(let W=0;!Z&&W{const rt=ce.paint.get("hillshade-shadow-color"),ot=ce.paint.get("hillshade-highlight-color"),Tt=ce.paint.get("hillshade-accent-color");let Mt=ce.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===ce.paint.get("hillshade-illumination-anchor")&&(Mt-=qe.transform.angle);const Dt=!qe.options.moving;return{u_matrix:Ve||qe.transform.calculateProjMatrix(Ke.tileID.toUnwrapped(),Dt),u_image:0,u_latrange:Qo(0,Ke.tileID),u_light:[ce.paint.get("hillshade-exaggeration"),Mt],u_shadow:rt,u_highlight:ot,u_accent:Tt}})(f,c,m,f.terrain?r.projMatrix:null);f.prepareDrawProgram(L,W,r.toUnwrapped());const{tileBoundsBuffer:Oe,tileBoundsIndexBuffer:$e,tileBoundsSegments:We}=f.getTileBoundsBuffers(c);W.draw(L,Z.TRIANGLES,b,T,O,s.CullFaceMode.disabled,se,m.id,Oe,$e,We)}function Cs(f,r,c){if(!r.needsDEMTextureUpload)return;const m=f.context,b=m.gl;m.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||f.getTileTexture(c.stride);const T=c.getPixels();r.demTexture?r.demTexture.update(T,{premultiply:!1}):r.demTexture=new s.Texture(m,T,b.RGBA,{premultiply:!1}),r.needsDEMTextureUpload=!1}function or(f,r,c,m,b,T){const O=f.context,L=O.gl;if(!r.dem)return;const Z=r.dem;if(O.activeTexture.set(L.TEXTURE1),Cs(f,r,Z),!r.demTexture)return;r.demTexture.bind(L.NEAREST,L.CLAMP_TO_EDGE);const q=Z.dim;O.activeTexture.set(L.TEXTURE0);let W=r.fbo;if(!W){const We=new s.Texture(O,{width:q,height:q,data:null},L.RGBA);We.bind(L.LINEAR,L.CLAMP_TO_EDGE),W=r.fbo=O.createFramebuffer(q,q,!0),W.colorAttachment.set(We.texture)}O.bindFramebuffer.set(W.framebuffer),O.viewport.set([0,0,q,q]);const{tileBoundsBuffer:se,tileBoundsIndexBuffer:Oe,tileBoundsSegments:$e}=f.getMercatorTileBoundsBuffers();f.useProgram("hillshadePrepare").draw(O,L.TRIANGLES,m,b,T,s.CullFaceMode.disabled,((We,qe)=>{const Ke=qe.stride,ce=s.create();return s.ortho(ce,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(ce,ce,[0,-s.EXTENT,0]),{u_matrix:ce,u_image:1,u_dimension:[Ke,Ke],u_zoom:We.overscaledZ,u_unpack:qe.unpackVector}})(r.tileID,Z),c.id,se,Oe,$e),r.needsHillshadePrepare=!1}const Qa=f=>({u_matrix:new s.UniformMatrix4f(f),u_image0:new s.Uniform1i(f),u_skirt_height:new s.Uniform1f(f)}),Os=(f,r)=>({u_matrix:f,u_image0:0,u_skirt_height:r}),ia=(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We)=>({u_proj_matrix:Float32Array.from(f),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(m),u_merc_matrix:c,u_zoom_transition:b,u_merc_center:T,u_image0:0,u_frustum_tl:O,u_frustum_tr:L,u_frustum_br:Z,u_frustum_bl:q,u_globe_pos:W,u_globe_radius:se,u_viewport:Oe,u_grid_matrix:We?Float32Array.from(We):new Float32Array(9),u_skirt_height:$e});function Ur(f,r){return null!=f&&null!=r&&!(!f.hasData()||!r.hasData())&&null!=f.demTexture&&null!=r.demTexture&&f.tileID.key!==r.tileID.key}const fs=new class{constructor(){this.operations={}}newMorphing(f,r,c,m,b){if(f in this.operations){const T=this.operations[f];T.to.tileID.key!==c.tileID.key&&(T.queued=c)}else this.operations[f]={startTime:m,phase:0,duration:b,from:r,to:c,queued:null}}getMorphValuesForProxy(f){if(!(f in this.operations))return null;const r=this.operations[f];return{from:r.from,to:r.to,phase:r.phase}}update(f){for(const r in this.operations){const c=this.operations[r];for(c.phase=(f-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,f)){delete this.operations[r];break}}}_nextOp(f,r){return!!f.queued&&(f.from=f.to,f.to=f.queued,f.queued=null,f.phase=0,f.startTime=r,!0)}_validOp(f){return f.from.hasData()&&f.to.hasData()}},Do={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Hs(f){return 6*Math.pow(1.5,22-f)}function Io(f,r){const c=1<({u_matrix:f});function Bo(f,r,c,m,b){if(b>0){const T=s.exported.now(),O=(T-f.timeAdded)/b,L=r?(T-r.timeAdded)/b:-1,Z=c.getSource(),q=m.coveringZoomLevel({tileSize:Z.tileSize,roundZoom:Z.roundZoom}),W=!r||Math.abs(r.tileID.overscaledZ-q)>Math.abs(f.tileID.overscaledZ-q),se=W&&f.refreshedUponExpiration?1:s.clamp(W?O:1-L,0,1);return f.refreshedUponExpiration&&O>=1&&(f.refreshedUponExpiration=!1),r?{opacity:1,mix:1-se}:{opacity:se,mix:0}}return{opacity:1,mix:0}}class yo extends s.SourceCache{constructor(r){const c={type:"raster-dem",maxzoom:r.transform.maxZoom},m=new hn(st(),null),b=Ze("mock-dem",c,m,r.style);super("mock-dem",b,!1),b.setEventedParent(this),this._sourceLoaded=!0}_loadTile(r,c){r.state="loaded",c(null)}}class ra extends s.SourceCache{constructor(r){const c=Ze("proxy",{type:"geojson",maxzoom:r.transform.maxZoom},new hn(st(),null),r.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=r,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(r,c,m){if(r.freezeTileCoverage)return;this.transform=r;const b=r.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((T,O)=>{if(T[O.key]="",!this._tiles[O.key]){const L=new s.Tile(O,this._source.tileSize*O.overscaleFactor(),r.tileZoom);L.state="loaded",this._tiles[O.key]=L}return T},{});for(const T in this._tiles)T in b||(this.freeFBO(T),this._tiles[T].unloadVectorData(),delete this._tiles[T])}freeFBO(r){const c=this.proxyCachedFBO[r];if(void 0!==c){const m=Object.values(c);this.renderCachePool.push(...m),delete this.proxyCachedFBO[r]}}deallocRenderCache(){this.renderCache.forEach(r=>r.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Rs extends s.OverscaledTileID{constructor(r,c,m){super(r.overscaledZ,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y),this.proxyTileKey=c,this.projMatrix=m}}class Ls extends s.Elevation{constructor(r,c){super(),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[m,b,T]=function(Z){const q=new s.StructArrayLayout2i4,W=new s.StructArrayLayout3ui6;q.reserve(17161),W.reserve(33800);const Oe=s.EXTENT/128,$e=s.EXTENT+Oe/2,We=$e+Oe;for(let Ke=-Oe;Ke$e||Ke<0||Ke>$e?24575:0,rt=s.clamp(Math.round(ce),0,s.EXTENT),ot=s.clamp(Math.round(Ke),0,s.EXTENT);q.emplaceBack(rt+Ve,ot)}const qe=(Ke,ce)=>{const Ve=131*ce+Ke;W.emplaceBack(Ve+1,Ve,Ve+131),W.emplaceBack(Ve+131,Ve+131+1,Ve+1)};for(let Ke=1;Ke<129;Ke++)for(let ce=1;ce<129;ce++)qe(ce,Ke);return[0,129].forEach(Ke=>{for(let ce=0;ce<130;ce++)qe(ce,Ke),qe(Ke,ce)}),[q,W,32768]}(),O=r.context;this.gridBuffer=O.createVertexBuffer(m,s.posAttributes.members),this.gridIndexBuffer=O.createIndexBuffer(b),this.gridSegments=s.SegmentVector.simpleSegment(0,0,m.length,b.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,m.length,T),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new ra(c.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,s.EXTENT,0,s.EXTENT,0,1);const L=O.gl;this._overlapStencilMode=new s.StencilMode({func:L.GEQUAL,mask:255},0,255,L.KEEP,L.KEEP,L.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new yo(c.map)}set style(r){r.on("data",this._onStyleDataEvent.bind(this)),r.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=r,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,c,m){if(r&&r.terrain){this._style!==r&&(this.style=r),this.enabled=!0;const b=r.terrain.properties;this.sourceCache=0===r.terrain.drapeRenderMode?this._mockSourceCache:r._getSourceCache(b.get("source")),this._exaggeration=b.get("exaggeration");const T=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const O=this.getScaledDemTileSize();this.sourceCache.update(c,O,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,T(),this._initializing=!0),T(),c.updateElevation(!0,m),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(r){this._findCoveringTileCache[r]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const r=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==r.efficiency&&s.warnOnce(`Terrain render cache efficiency is not optimal (${r.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${r.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(r){r.coord&&"source"===r.dataType?this._clearRenderCacheForTile(r.sourceCacheId,r.coord):"style"===r.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const r in this._style._sourceCaches)this._style._sourceCaches[r].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(r=>r.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const r=2*this.proxySourceCache.getSource().tileSize;return[r,r]}set useVertexMorphing(r){this._useVertexMorphing=r}updateTileBinding(r){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,m=this.painter.transform;this._initializing&&(this._initializing=0===m._centerAltitude&&-1===this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(m.center),-1),this._emptyDEMTextureDirty=!this._initializing);const b=this.proxyCoords=c.getIds().map(Z=>{const q=c.getTileByID(Z).tileID;return q.projMatrix=m.calculateProjMatrix(q.toUnwrapped()),q});(function(Z,q){const W=q.transform.pointCoordinate(q.transform.getCameraPoint()),se=new s.Point(W.x,W.y);Z.sort((Oe,$e)=>{if($e.overscaledZ-Oe.overscaledZ)return $e.overscaledZ-Oe.overscaledZ;const We=new s.Point(Oe.canonical.x+(1<{this.proxyToSource[Z.key]={}}),this.terrainTileForTile={};const O=this._style._sourceCaches;for(const Z in O){const q=O[Z];if(!q.used||(q!==this.sourceCache&&this.resetTileLookupCache(q.id),this._setupProxiedCoordsForOrtho(q,r[Z],T),q.usedForTerrain))continue;const W=r[Z];q.getSource().reparseOverscaled&&this._assignTerrainTiles(W)}this.proxiedCoords[c.id]=b.map(Z=>new Rs(Z,Z.key,this.orthoMatrix)),this._assignTerrainTiles(b),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(T),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const L={};this._visibleDemTiles=[];for(const Z of this.proxyCoords){const q=this.terrainTileForTile[Z.key];if(!q)continue;const W=q.tileID.key;W in L||(this._visibleDemTiles.push(q),L[W]=W)}}_assignTerrainTiles(r){this._initializing||r.forEach(c=>{if(this.terrainTileForTile[c.key])return;const m=this._findTileCoveringTileID(c,this.sourceCache);m&&(this.terrainTileForTile[c.key]=m)})}_prepareDEMTextures(){const r=this.painter.context,c=r.gl;for(const m in this.terrainTileForTile){const b=this.terrainTileForTile[m],T=b.dem;!T||b.demTexture&&!b.needsDEMTextureUpload||(r.activeTexture.set(c.TEXTURE1),Cs(this.painter,b,T))}}_prepareDemTileUniforms(r,c,m,b){if(!c||null==c.demTexture)return!1;const T=r.tileID.canonical,O=Math.pow(2,c.tileID.canonical.z-T.z),L=b||"";return m[`u_dem_tl${L}`]=[T.x*O%1,T.y*O%1],m[`u_dem_scale${L}`]=O,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const r=this.painter.context,c=r.gl;if(!this._emptyDepthBufferTexture){const m=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(r,m,c.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let r=0;const c=this._visibleDemTiles.reduce((m,b)=>{if(!b.dem)return m;const T=b.dem.tree.minimums[0];return T>0&&r++,m+T},0);return r?c/r:0}_updateEmptyDEMTexture(){const r=this.painter.context,c=r.gl;r.activeTexture.set(c.TEXTURE2);const m=this._getLoadedAreaMinimum(),b=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(m,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let T=this._emptyDEMTexture;return T?T.update(b,{premultiply:!1}):T=this._emptyDEMTexture=new s.Texture(r,b,c.RGBA,{premultiply:!1}),T}setupElevationDraw(r,c,m){const b=this.painter.context,T=b.gl,O=(L=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(L),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var L;O.u_dem_size=this.sourceCache.getSource().tileSize,O.u_exaggeration=this.exaggeration();let Z=null,q=null,W=1;if(m&&m.morphing&&this._useVertexMorphing){const se=m.morphing.srcDemTile,Oe=m.morphing.dstDemTile;W=m.morphing.phase,se&&Oe&&(this._prepareDemTileUniforms(r,se,O,"_prev")&&(q=se),this._prepareDemTileUniforms(r,Oe,O)&&(Z=Oe))}if(q&&Z?(b.activeTexture.set(T.TEXTURE2),Z.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE,T.NEAREST),b.activeTexture.set(T.TEXTURE4),q.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE,T.NEAREST),O.u_dem_lerp=W):(Z=this.terrainTileForTile[r.tileID.key],b.activeTexture.set(T.TEXTURE2),(this._prepareDemTileUniforms(r,Z,O)?Z.demTexture:this.emptyDEMTexture).bind(T.NEAREST,T.CLAMP_TO_EDGE)),b.activeTexture.set(T.TEXTURE3),m&&m.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE),this._depthFBO&&(O.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE),O.u_depth_size_inv=[1,1]),m&&m.useMeterToDem&&Z){const se=(1<{if(ce===Zn)return;const An=[Do[Zn],"PROJECTION_GLOBE_VIEW"];ot&&An.push("CUSTOM_ANTIALIASING"),sn&&An.push(Do[Ve]),Ke=q.useProgram("globeRaster",null,An),ce=Zn},Mt=q.colorModeForRenderPass(),Dt=new s.DepthMode(qe.LEQUAL,s.DepthMode.ReadWrite,q.depthRangeFor3D);fs.update($e);const $t=s.calculateGlobeMercatorMatrix(rt),zt=[s.mercatorXfromLng(rt.center.lng),s.mercatorYfromLat(rt.center.lat)],dn=Ve?[!1,!0]:[!1],Vn=q.globeSharedBuffers,on=[rt.width*s.exported.devicePixelRatio,rt.height*s.exported.devicePixelRatio],Rn=Float32Array.from(rt.globeMatrix),un={useDenormalizedUpVectorScale:!0};if(dn.forEach(Zn=>{const sn=q.transform,An=Hs(sn.zoom)*W.exaggeration();ce=-1;const Gn=Zn?qe.LINES:qe.TRIANGLES;for(const Ln of Oe){const Wn=se.getTile(Ln),Di=s.StencilMode.disabled,Gi=W.prevTerrainTileForTile[Ln.key],hi=W.terrainTileForTile[Ln.key];Ur(Gi,hi)&&fs.newMorphing(Ln.key,Gi,hi,$e,250),We.activeTexture.set(qe.TEXTURE0),Wn.texture.bind(qe.LINEAR,qe.CLAMP_TO_EDGE);const Pi=fs.getMorphValuesForProxy(Ln.key),ur=Pi?1:0;Pi&&s.extend$1(un,{morphing:{srcDemTile:Pi.from,dstDemTile:Pi.to,phase:s.easeCubicInOut(Pi.phase)}});const dr=s.tileCornersToBounds(Ln.canonical),xi=s.getLatitudinalLod(dr.getCenter().lat),Cr=s.getGridMatrix(Ln.canonical,dr,xi,sn.worldSize/sn._pixelsPerMercatorPixel),Kr=s.globeNormalizeECEF(s.globeTileBounds(Ln.canonical)),Wr=ia(sn.projMatrix,Rn,$t,Kr,s.globeToMercatorTransition(sn.zoom),zt,sn.frustumCorners.TL,sn.frustumCorners.TR,sn.frustumCorners.BR,sn.frustumCorners.BL,sn.globeCenterInViewSpace,sn.globeRadius,on,An,Cr);if(Tt(ur,Zn),W.setupElevationDraw(Wn,Ke,un),q.prepareDrawProgram(We,Ke,Ln.toUnwrapped()),Vn){const[qr,ns,_s]=Zn?Vn.getWirefameBuffers(q.context,xi):Vn.getGridBuffers(xi,0!==An);Ke.draw(We,Gn,Dt,Di,Mt,s.CullFaceMode.backCCW,Wr,"globe_raster",qr,ns,_s)}}}),Vn){const Zn=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ot&&Zn.push("CUSTOM_ANTIALIASING"),Ke=q.useProgram("globeRaster",null,Zn);for(const sn of Oe){const{x:An,y:Gn,z:Ln}=sn.canonical,Wn=0===Gn,Di=Gn===(1<Wr.draw(We,qe.TRIANGLES,Dt,s.StencilMode.disabled,Mt,s.CullFaceMode.disabled,ia(rt.projMatrix,xi,xi,Cr,0,zt,rt.frustumCorners.TL,rt.frustumCorners.TR,rt.frustumCorners.BR,rt.frustumCorners.BL,rt.globeCenterInViewSpace,rt.globeRadius,on,0),"globe_pole_raster",qr,Pi,ur);W.setupElevationDraw(dr,Ke,un),q.prepareDrawProgram(We,Ke,sn.toUnwrapped()),Wn&&Kr(Ke,Gi),Di&&(xi=s.scale(s.create(),xi,[1,-1,1]),Kr(Ke,hi))}}}}(b,T,O,L,Z);else{const q=b.context,W=q.gl;let se,Oe;const $e=b.options.showTerrainWireframe?2:0,We=(rt,ot)=>{if(Oe===rt)return;const Tt=[Do[rt]];ot&&Tt.push(Do[$e]),se=b.useProgram("terrainRaster",null,Tt),Oe=rt},qe=b.colorModeForRenderPass(),Ke=new s.DepthMode(W.LEQUAL,s.DepthMode.ReadWrite,b.depthRangeFor3D);fs.update(Z);const ce=b.transform,Ve=Hs(ce.zoom)*T.exaggeration();($e?[!1,!0]:[!1]).forEach(rt=>{Oe=-1;const ot=rt?W.LINES:W.TRIANGLES,[Tt,Mt]=rt?T.getWirefameBuffer():[T.gridIndexBuffer,T.gridSegments];for(const Dt of L){const $t=O.getTile(Dt),zt=s.StencilMode.disabled,dn=T.prevTerrainTileForTile[Dt.key],Vn=T.terrainTileForTile[Dt.key];Ur(dn,Vn)&&fs.newMorphing(Dt.key,dn,Vn,Z,250),q.activeTexture.set(W.TEXTURE0),$t.texture.bind(W.LINEAR,W.CLAMP_TO_EDGE,W.LINEAR_MIPMAP_NEAREST);const on=fs.getMorphValuesForProxy(Dt.key),Rn=on?1:0;let un;on&&(un={morphing:{srcDemTile:on.from,dstDemTile:on.to,phase:s.easeCubicInOut(on.phase)}});const Zn=Os(Dt.projMatrix,Io(Dt.canonical,ce.renderWorldCopies)?Ve/10:Ve);We(Rn,rt),T.setupElevationDraw($t,se,un),b.prepareDrawProgram(q,se,Dt.toUnwrapped()),se.draw(q,ot,Ke,zt,qe,s.CullFaceMode.backCCW,Zn,"terrain_raster",T.gridBuffer,Tt,Mt)}})}}(c,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(0===this._drapedRenderBatches.length)return r+1;this.renderingToTexture=!0;const c=this.painter,m=this.painter.context,b=this.proxySourceCache,T=this.proxiedCoords[b.id],O=this._drapedRenderBatches.shift(),L=[],Z=c.style.order;let q=0;for(const W of T){const se=b.getTileByID(W.proxyTileKey),Oe=b.proxyCachedFBO[W.key]?b.proxyCachedFBO[W.key][r]:void 0,$e=void 0!==Oe?b.renderCache[Oe]:this.pool[q++],We=void 0!==Oe;if(se.texture=$e.tex,We&&!$e.dirty){L.push(se.tileID);continue}let qe;m.bindFramebuffer.set($e.fb.framebuffer),this.renderedToTile=!1,$e.dirty&&(m.clear({color:s.Color.transparent,stencil:0}),$e.dirty=!1);for(let Ke=O.start;Ke<=O.end;++Ke){const ce=c.style._layers[Z[Ke]];if(ce.isHidden(c.transform.zoom))continue;const Ve=c.style._getLayerSourceCache(ce),rt=Ve?this.proxyToSource[W.key][Ve.id]:[W];if(!rt)continue;const ot=rt;m.viewport.set([0,0,$e.fb.width,$e.fb.height]),qe!==(Ve?Ve.id:null)&&(this._setupStencil($e,rt,ce,Ve),qe=Ve?Ve.id:null),c.renderLayer(c,Ve,ce,ot)}this.renderedToTile?($e.dirty=!0,L.push(se.tileID)):We||--q,5===q&&(q=0,this.renderToBackBuffer(L))}return this.renderToBackBuffer(L),this.renderingToTexture=!1,m.bindFramebuffer.set(null),m.viewport.set([0,0,c.width,c.height]),O.end+1}postRender(){}renderCacheEfficiency(r){const c=r.order.length;if(0===c)return{efficiency:100};let m,b=0,T=0,O=!1;for(let L=0;Lc.dem).forEach(c=>{r=Math.min(r,c.dem.tree.minimums[0])}),0===r?r:(r-30)*this._exaggeration}raycast(r,c,m){if(!this._visibleDemTiles)return null;const b=this._visibleDemTiles.filter(T=>T.dem).map(T=>{const O=T.tileID,L=1<(null!==T.t?T.t:Number.MAX_VALUE)-(null!==O.t?O.t:Number.MAX_VALUE));for(const T of b){if(null==T.t)return null;const O=T.tile.dem.tree.raycast(T.minx,T.miny,T.maxx,T.maxy,r,c,m);if(null!=O)return O}return null}_createFBO(){const r=this.painter.context,c=r.gl,m=this.drapeBufferSize;r.activeTexture.set(c.TEXTURE0);const b=new s.Texture(r,{width:m[0],height:m[1],data:null},c.RGBA);b.bind(c.LINEAR,c.CLAMP_TO_EDGE);const T=r.createFramebuffer(m[0],m[1],!1);return T.colorAttachment.set(b.texture),T.depthAttachment=new Et(r,T.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=r.createRenderbuffer(r.gl.DEPTH_STENCIL,m[0],m[1]),this._stencilRef=0,T.depthAttachment.set(this._sharedDepthStencil),r.clear({stencil:0})):T.depthAttachment.set(this._sharedDepthStencil),r.extTextureFilterAnisotropic&&!r.extTextureFilterAnisotropicForceOff&&c.texParameterf(c.TEXTURE_2D,r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.extTextureFilterAnisotropicMax),{fb:T,tex:b,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._layers[r],m=c.isHidden(this.painter.transform.zoom);return"custom"===c.type?!m&&c.shouldRedrape():!m&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(const m of this._style._getSources())if(m instanceof zn){r=!0;break}if(!r)return;const c={};for(let m=0;mc.renderCachePool.length){const O=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let L=0;L=0;O--){const L=m[O];if(c.getTileByID(L.key),void 0!==c.proxyCachedFBO[L.key]){const Z=r[L.key],q=this.proxyToSource[L.key];let W=0;for(const se in q){const Oe=q[se],$e=Z[se];if(!$e||$e.length!==Oe.length||Oe.some((We,qe)=>We!==$e[qe]||b[se]&&b[se].hasOwnProperty(We.key))){W=-1;break}++W}for(const se in c.proxyCachedFBO[L.key])c.renderCache[c.proxyCachedFBO[L.key][se]].dirty=W<0||W!==Object.values(Z).length}}const T=[...this._drapedRenderBatches];T.sort((O,L)=>L.end-L.start-(O.end-O.start));for(const O of T)for(const L of m){if(c.proxyCachedFBO[L.key])continue;let Z=c.renderCachePool.pop();void 0===Z&&c.renderCache.length<50&&(Z=c.renderCache.length,c.renderCache.push(this._createFBO())),void 0!==Z&&(c.proxyCachedFBO[L.key]={},c.proxyCachedFBO[L.key][O.start]=Z,c.renderCache[Z].dirty=!0)}this._tilesDirty={}}_setupStencil(r,c,m,b){if(!b||!this._sourceTilesOverlap[b.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const T=this.painter.context,O=T.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let L;if(m.isTileClipped())L=c.length,this._overlapStencilMode.test={func:O.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);L=1,this._overlapStencilMode.test={func:O.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+L>255&&(T.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=L,this._overlapStencilMode.ref=this._stencilRef,m.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(r){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[r.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(r,c){const m=this.painter,b=this.painter.context,T=b.gl;m._tileClippingMaskIDs={},b.setColorMode(s.ColorMode.disabled),b.setDepthMode(s.DepthMode.disabled);const O=m.useProgram("clippingMask");for(const L of r){const Z=m._tileClippingMaskIDs[L.key]=--c;O.draw(b,T.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:T.ALWAYS,mask:0},Z,255,T.KEEP,T.KEEP,T.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,el(L.projMatrix),"$clipping",m.tileExtentBuffer,m.quadTriangleIndexBuffer,m.tileExtentSegments)}}pointCoordinate(r){const c=this.painter.transform;if(r.x<0||r.x>c.width||r.y<0||r.y>c.height)return null;const m=[r.x,r.y,1,1];s.transformMat4$1(m,m,c.pixelMatrixInverse),s.scale$1(m,m,1/m[3]),m[0]/=c.worldSize,m[1]/=c.worldSize;const b=c._camera.position,T=s.mercatorZfromAltitude(1,c.center.lat),O=[b[0],b[1],b[2]/T,0],L=s.subtract([],m.slice(0,3),O);s.normalize(L,L);const Z=this.raycast(O,L,this._exaggeration);return null!==Z&&Z?(s.scaleAndAdd(O,O,L,Z),O[3]=O[2],O[2]*=T,O):null}drawDepth(){const r=this.painter,c=r.context,m=this.proxySourceCache,b=Math.ceil(r.width),T=Math.ceil(r.height);if(!this._depthFBO||this._depthFBO.width===b&&this._depthFBO.height===T||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const O=c.gl,L=c.createFramebuffer(b,T,!0);c.activeTexture.set(O.TEXTURE0);const Z=new s.Texture(c,{width:b,height:T,data:null},O.RGBA);Z.bind(O.NEAREST,O.CLAMP_TO_EDGE),L.colorAttachment.set(Z.texture);const q=c.createRenderbuffer(c.gl.DEPTH_COMPONENT16,b,T);L.depthAttachment.set(q),this._depthFBO=L,this._depthTexture=Z}c.bindFramebuffer.set(this._depthFBO.framebuffer),c.viewport.set([0,0,b,T]),function(O,L,Z,q){if("globe"===O.transform.projection.name)return;const W=O.context,se=W.gl;W.clear({depth:1});const Oe=O.useProgram("terrainDepth"),$e=new s.DepthMode(se.LESS,s.DepthMode.ReadWrite,O.depthRangeFor3D);for(const We of q){const qe=Z.getTile(We),Ke=Os(We.projMatrix,0);L.setupElevationDraw(qe,Oe),Oe.draw(W,se.TRIANGLES,$e,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,Ke,"terrain_depth",L.gridBuffer,L.gridIndexBuffer,L.gridNoSkirtSegments)}}(r,this,m,this.proxyCoords)}_setupProxiedCoordsForOrtho(r,c,m){if(r.getSource()instanceof xe)return this._setupProxiedCoordsForImageSource(r,c,m);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};const b=this.proxiedCoords[r.id]=[],T=this.proxyCoords;for(let L=0;L(W.min.x=Math.min(W.min.x,se.x-L.x),W.min.y=Math.min(W.min.y,se.y-L.y),W.max.x=Math.max(W.max.x,se.x-L.x),W.max.y=Math.max(W.max.y,se.y-L.y),W),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),q=(W,se)=>{const Oe=W.wrap+W.canonical.x/(1<qe+Z.max.x||$e+WeKe+Z.max.y};for(let W=0;WO.key===c.tileID.key);if(T)return T}if(c.tileID.key!==r.key){const T=r.canonical.z-c.tileID.canonical.z;let O,L,Z;b=s.create();const q=c.tileID.wrap-r.wrap<0?(O=s.EXTENT>>T,L=O*((c.tileID.canonical.x<=se){const Oe=r.canonical.z-se;c.getSource().reparseOverscaled?(L=Math.max(r.canonical.z+2,c.transform.tileZoom),O=new s.OverscaledTileID(L,r.wrap,se,r.canonical.x>>Oe,r.canonical.y>>Oe)):0!==Oe&&(L=se,O=new s.OverscaledTileID(L,r.wrap,se,r.canonical.x>>Oe,r.canonical.y>>Oe))}O.key!==r.key&&(q.push(O.key),m=c.getTile(O))}const W=se=>{q.forEach(Oe=>{b[Oe]=se}),q.length=0};for(L-=1;L>=Z&&(!m||!m.hasData());L--){m&&W(m.tileID.key);const se=O.calculateScaledKey(L);if(m=c.getTileByID(se),m&&m.hasData())break;const Oe=b[se];if(null===Oe)break;void 0===Oe?q.push(se):m=c.getTileByID(Oe)}return W(m?m.tileID.key:null),m&&m.hasData()?m:null}findDEMTileFor(r){return this.enabled?this._findTileCoveringTileID(r,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(r,c){let m=this._tilesDirty[r];m||(m=this._tilesDirty[r]={}),m[c.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const r=function(c){let m=0;const b=new s.StructArrayLayout2ui4,T=131;for(let O=1;O<129;O++){for(let L=1;L<129;L++)m=O*T+L,b.emplaceBack(m,m+1),b.emplaceBack(m,m+T),b.emplaceBack(m+1,m+T),128===O&&b.emplaceBack(m+T,m+T+1);b.emplaceBack(m+1,m+1+T)}return b}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(r),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,r.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class ki{static cacheKey(r,c,m,b){let T=`${c}${b?b.cacheKey:""}`;for(const O of m)r.usedDefines.includes(O)&&(T+=`/${O}`);return T}constructor(r,c,m,b,T,O){const L=r.gl;this.program=L.createProgram();const Z=function(ce){const Ve=[];for(let rt=0;rt`#define ${ce}`));const Oe=r.isWebGL2?"#version 300 es\n":"",$e=Oe+se.concat(r.extStandardDerivatives&&0===Oe.length?"#extension GL_OES_standard_derivatives : enable\n".concat(ws):ws,ws,zs,Br.fragmentSource,Xo.fragmentSource,m.fragmentSource).join("\n"),We=Oe+se.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",zs,Br.vertexSource,Xo.vertexSource,Ns.vertexSource,m.vertexSource).join("\n"),qe=L.createShader(L.FRAGMENT_SHADER);if(L.isContextLost())return void(this.failedToCreate=!0);L.shaderSource(qe,$e),L.compileShader(qe),L.attachShader(this.program,qe);const Ke=L.createShader(L.VERTEX_SHADER);if(L.isContextLost())this.failedToCreate=!0;else{L.shaderSource(Ke,We),L.compileShader(Ke),L.attachShader(this.program,Ke),this.attributes={},this.numAttributes=W.length;for(let ce=0;ce({u_tile_tl_up:new s.Uniform3f(ce),u_tile_tr_up:new s.Uniform3f(ce),u_tile_br_up:new s.Uniform3f(ce),u_tile_bl_up:new s.Uniform3f(ce),u_tile_up_scale:new s.Uniform1f(ce)}))(r)),O.includes("FOG")&&(this.fogUniforms=(ce=>({u_fog_matrix:new s.UniformMatrix4f(ce),u_fog_range:new s.Uniform2f(ce),u_fog_color:new s.Uniform4f(ce),u_fog_horizon_blend:new s.Uniform1f(ce),u_fog_temporal_offset:new s.Uniform1f(ce),u_frustum_tl:new s.Uniform3f(ce),u_frustum_tr:new s.Uniform3f(ce),u_frustum_br:new s.Uniform3f(ce),u_frustum_bl:new s.Uniform3f(ce),u_globe_pos:new s.Uniform3f(ce),u_globe_radius:new s.Uniform1f(ce),u_globe_transition:new s.Uniform1f(ce),u_is_globe:new s.Uniform1i(ce),u_viewport:new s.Uniform2f(ce)}))(r))}var ce}setTerrainUniformValues(r,c){if(!this.terrainUniforms)return;const m=this.terrainUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const b in c)m[b]&&m[b].set(this.program,b,c[b])}}setGlobeUniformValues(r,c){if(!this.globeUniforms)return;const m=this.globeUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const b in c)m[b]&&m[b].set(this.program,b,c[b])}}setFogUniformValues(r,c){if(!this.fogUniforms)return;const m=this.fogUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const b in c)m[b].set(this.program,b,c[b])}}draw(r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe){const Ke=r.gl;if(this.failedToCreate)return;r.program.set(this.program),r.setDepthMode(m),r.setStencilMode(b),r.setColorMode(T),r.setCullFace(O);for(const Ve of Object.keys(this.fixedUniforms))this.fixedUniforms[Ve].set(this.program,Ve,L[Ve]);We&&We.setUniforms(this.program,r,this.binderUniforms,Oe,{zoom:$e});const ce={[Ke.LINES]:2,[Ke.TRIANGLES]:3,[Ke.LINE_STRIP]:1}[c];for(const Ve of se.get()){const rt=Ve.vaos||(Ve.vaos={});(rt[Z]||(rt[Z]=new Ps)).bind(r,this,q,We?We.getPaintVertexBuffers():[],W,Ve.vertexOffset,qe||[]),Ke.drawElements(c,Ve.primitiveLength*ce,Ke.UNSIGNED_SHORT,Ve.primitiveOffset*ce*2)}}}function Ws(f,r){const c=Math.pow(2,r.tileID.overscaledZ),m=r.tileSize*Math.pow(2,f.transform.tileZoom)/c,b=m*(r.tileID.canonical.x+r.tileID.wrap*c),T=m*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_tile_units_to_pixels:1/qt(r,1,f.transform.tileZoom),u_pixel_coord_upper:[b>>16,T>>16],u_pixel_coord_lower:[65535&b,65535&T]}}const v=s.create(),M=(f,r,c,m,b,T,O,L,Z,q,W)=>{const se=r.style.light,Oe=se.properties.get("position"),$e=[Oe.x,Oe.y,Oe.z],We=s.create$1();"viewport"===se.properties.get("anchor")&&(s.fromRotation(We,-r.transform.angle),s.transformMat3($e,$e,We));const qe=se.properties.get("color"),Ke=r.transform,ce={u_matrix:f,u_lightpos:$e,u_lightintensity:se.properties.get("intensity"),u_lightcolor:[qe.r,qe.g,qe.b],u_vertical_gradient:+c,u_opacity:m,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:v,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:b,u_edge_radius:T};return"globe"===Ke.projection.name&&(ce.u_tile_id=[O.canonical.x,O.canonical.y,1<{const Oe=M(f,r,c,m,b,T,O,Z,q,W,se),$e={u_height_factor:-Math.pow(2,O.overscaledZ)/L.tileSize/8};return s.extend(Oe,Ws(r,L),$e)},A=f=>({u_matrix:f}),G=(f,r,c)=>s.extend(A(f),Ws(r,c)),It=(f,r)=>({u_matrix:f,u_world:r}),Yn=(f,r,c,m)=>s.extend(G(f,r,c),{u_world:m}),pi=s.create(),tr=(f,r,c,m,b,T)=>{const O=f.transform,L="globe"===O.projection.name;let Z;if("map"===T.paint.get("circle-pitch-alignment"))if(L){const W=s.globePixelsToTileUnits(O.zoom,r.canonical)*O._pixelsPerMercatorPixel;Z=Float32Array.from([W,0,0,W])}else Z=O.calculatePixelsToTileUnitsMatrix(c);else Z=new Float32Array([O.pixelsToGLUnits[0],0,0,O.pixelsToGLUnits[1]]);const q={u_camera_to_center_distance:O.cameraToCenterDistance,u_matrix:f.translatePosMatrix(r.projMatrix,c,T.paint.get("circle-translate"),T.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:Z,u_inv_rot_matrix:pi,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(L){q.u_inv_rot_matrix=m,q.u_merc_center=b,q.u_tile_id=[r.canonical.x,r.canonical.y,1<{const r=[];return"map"===f.paint.get("circle-pitch-alignment")&&r.push("PITCH_WITH_MAP"),"map"===f.paint.get("circle-pitch-scale")&&r.push("SCALE_WITH_MAP"),r},Mo=(f,r,c,m)=>{const b=s.EXTENT/c.tileSize;return{u_matrix:f,u_camera_to_center_distance:r.getCameraToCenterDistance(m),u_extrude_scale:[r.pixelsToGLUnits[0]/b,r.pixelsToGLUnits[1]/b]}},oa=(f,r,c=1)=>({u_matrix:f,u_color:r,u_overlay:0,u_overlay_scale:c}),Es=s.create(),ks=(f,r,c,m,b,T,O)=>{const L=f.transform,Z="globe"===L.projection.name,q=Z?s.globePixelsToTileUnits(L.zoom,r.canonical)*L._pixelsPerMercatorPixel:qt(c,1,T),W={u_matrix:r.projMatrix,u_extrude_scale:q,u_intensity:O,u_inv_rot_matrix:Es,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(Z){W.u_inv_rot_matrix=m,W.u_merc_center=b,W.u_tile_id=[r.canonical.x,r.canonical.y,1<{const L=f.transform,Z=L.calculatePixelsToTileUnitsMatrix(r);return{u_matrix:yl(f,r,c,m),u_pixels_to_tile_units:Z,u_device_pixel_ratio:T,u_units_to_pixels:[1/L.pixelsToGLUnits[0],1/L.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:b,u_texsize:Ba(c)?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:da(r,f.transform),u_alpha_discard_threshold:0,u_trim_offset:O}},tl=(f,r,c,m,b)=>{const T=f.transform;return{u_matrix:yl(f,r,c,m),u_texsize:r.imageAtlasTexture.size,u_pixels_to_tile_units:T.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:b,u_image:0,u_tile_units_to_pixels:da(r,T),u_units_to_pixels:[1/T.pixelsToGLUnits[0],1/T.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function da(f,r){return 1/qt(f,1,r.tileZoom)}function yl(f,r,c,m){return f.translatePosMatrix(m||r.tileID.projMatrix,r,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}function Ba(f){const r=f.paint.get("line-dasharray").value;return r.value||"constant"!==r.kind}const vl=(f,r,c,m,b,T)=>{return{u_matrix:f,u_tl_parent:r,u_scale_parent:c,u_fade_t:m.mix,u_opacity:m.opacity*b.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:b.paint.get("raster-brightness-min"),u_brightness_high:b.paint.get("raster-brightness-max"),u_saturation_factor:(L=b.paint.get("raster-saturation"),L>0?1-1/(1.001-L):-L),u_contrast_factor:(O=b.paint.get("raster-contrast"),O>0?1/(1-O):1+O),u_spin_weights:Ts(b.paint.get("raster-hue-rotate")),u_perspective_transform:T};var O,L};function Ts(f){f*=Math.PI/180;const r=Math.sin(f),c=Math.cos(f);return[(2*c+1)/3,(-Math.sqrt(3)*r-c+1)/3,(Math.sqrt(3)*r-c+1)/3]}const cc=s.create(),ha=(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe)=>{const Ke=b.transform,ce={u_is_size_zoom_constant:+("constant"===f||"source"===f),u_is_size_feature_constant:+("constant"===f||"camera"===f),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:Ke.cameraToCenterDistance,u_rotate_symbol:+c,u_aspect_ratio:Ke.width/Ke.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:T,u_label_plane_matrix:O,u_coord_matrix:L,u_is_text:+Z,u_pitch_with_map:+m,u_texsize:q,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:cc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:cc,u_up_vector:[0,-1,0]};return"globe"===qe.name&&(ce.u_tile_id=[W.canonical.x,W.canonical.y,1<s.extend(ha(f,r,c,m,b,T,O,L,Z,q,se,Oe,$e,We,qe,Ke),{u_gamma_scale:m?b.transform.cameraToCenterDistance*Math.cos(b.terrain?0:b.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+W}),uc=(f,r,c,m,b,T,O,L,Z,q,W,se,Oe,$e,We,qe)=>s.extend(Ca(f,r,c,m,b,T,O,L,!0,Z,!0,W,se,Oe,$e,We,qe),{u_texsize_icon:q,u_texture_icon:1}),Ea=(f,r,c)=>({u_matrix:f,u_opacity:r,u_color:c}),dc=(f,r,c,m,b)=>s.extend(function(T,O,L){const Z=O.imageManager.getPattern(T.toString()),{width:q,height:W}=O.imageManager.getPixelSize(),se=Math.pow(2,L.tileID.overscaledZ),Oe=L.tileSize*Math.pow(2,O.transform.tileZoom)/se,$e=Oe*(L.tileID.canonical.x+L.tileID.wrap*se),We=Oe*L.tileID.canonical.y;return{u_image:0,u_pattern_tl:Z.tl,u_pattern_br:Z.br,u_texsize:[q,W],u_pattern_size:Z.displaySize,u_tile_units_to_pixels:1/qt(L,1,O.transform.tileZoom),u_pixel_coord_upper:[$e>>16,We>>16],u_pixel_coord_lower:[65535&$e,65535&We]}}(m,c,b),{u_matrix:f,u_opacity:r}),fa={fillExtrusion:f=>({u_matrix:new s.UniformMatrix4f(f),u_lightpos:new s.Uniform3f(f),u_lightintensity:new s.Uniform1f(f),u_lightcolor:new s.Uniform3f(f),u_vertical_gradient:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f),u_edge_radius:new s.Uniform1f(f),u_ao:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_up_dir:new s.Uniform3f(f),u_height_lift:new s.Uniform1f(f)}),fillExtrusionPattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_lightpos:new s.Uniform3f(f),u_lightintensity:new s.Uniform1f(f),u_lightcolor:new s.Uniform3f(f),u_vertical_gradient:new s.Uniform1f(f),u_height_factor:new s.Uniform1f(f),u_edge_radius:new s.Uniform1f(f),u_ao:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_up_dir:new s.Uniform3f(f),u_height_lift:new s.Uniform1f(f),u_image:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f)}),fill:f=>({u_matrix:new s.UniformMatrix4f(f)}),fillPattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_image:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f)}),fillOutline:f=>({u_matrix:new s.UniformMatrix4f(f),u_world:new s.Uniform2f(f)}),fillOutlinePattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_world:new s.Uniform2f(f),u_image:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f)}),circle:f=>({u_camera_to_center_distance:new s.Uniform1f(f),u_extrude_scale:new s.UniformMatrix2f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_up_dir:new s.Uniform3f(f)}),collisionBox:f=>({u_matrix:new s.UniformMatrix4f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_extrude_scale:new s.Uniform2f(f)}),collisionCircle:f=>({u_matrix:new s.UniformMatrix4f(f),u_inv_matrix:new s.UniformMatrix4f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_viewport_size:new s.Uniform2f(f)}),debug:f=>({u_color:new s.UniformColor(f),u_matrix:new s.UniformMatrix4f(f),u_overlay:new s.Uniform1i(f),u_overlay_scale:new s.Uniform1f(f)}),clippingMask:f=>({u_matrix:new s.UniformMatrix4f(f)}),heatmap:f=>({u_extrude_scale:new s.Uniform1f(f),u_intensity:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_up_dir:new s.Uniform3f(f)}),heatmapTexture:f=>({u_image:new s.Uniform1i(f),u_color_ramp:new s.Uniform1i(f),u_opacity:new s.Uniform1f(f)}),hillshade:f=>({u_matrix:new s.UniformMatrix4f(f),u_image:new s.Uniform1i(f),u_latrange:new s.Uniform2f(f),u_light:new s.Uniform2f(f),u_shadow:new s.UniformColor(f),u_highlight:new s.UniformColor(f),u_accent:new s.UniformColor(f)}),hillshadePrepare:f=>({u_matrix:new s.UniformMatrix4f(f),u_image:new s.Uniform1i(f),u_dimension:new s.Uniform2f(f),u_zoom:new s.Uniform1f(f),u_unpack:new s.Uniform4f(f)}),line:f=>({u_matrix:new s.UniformMatrix4f(f),u_pixels_to_tile_units:new s.UniformMatrix2f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_units_to_pixels:new s.Uniform2f(f),u_dash_image:new s.Uniform1i(f),u_gradient_image:new s.Uniform1i(f),u_image_height:new s.Uniform1f(f),u_texsize:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f),u_alpha_discard_threshold:new s.Uniform1f(f),u_trim_offset:new s.Uniform2f(f)}),linePattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_texsize:new s.Uniform2f(f),u_pixels_to_tile_units:new s.UniformMatrix2f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_image:new s.Uniform1i(f),u_units_to_pixels:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f),u_alpha_discard_threshold:new s.Uniform1f(f)}),raster:f=>({u_matrix:new s.UniformMatrix4f(f),u_tl_parent:new s.Uniform2f(f),u_scale_parent:new s.Uniform1f(f),u_fade_t:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f),u_image0:new s.Uniform1i(f),u_image1:new s.Uniform1i(f),u_brightness_low:new s.Uniform1f(f),u_brightness_high:new s.Uniform1f(f),u_saturation_factor:new s.Uniform1f(f),u_contrast_factor:new s.Uniform1f(f),u_spin_weights:new s.Uniform3f(f),u_perspective_transform:new s.Uniform2f(f)}),symbolIcon:f=>({u_is_size_zoom_constant:new s.Uniform1i(f),u_is_size_feature_constant:new s.Uniform1i(f),u_size_t:new s.Uniform1f(f),u_size:new s.Uniform1f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_rotate_symbol:new s.Uniform1i(f),u_aspect_ratio:new s.Uniform1f(f),u_fade_change:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_label_plane_matrix:new s.UniformMatrix4f(f),u_coord_matrix:new s.UniformMatrix4f(f),u_is_text:new s.Uniform1i(f),u_pitch_with_map:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_camera_forward:new s.Uniform3f(f),u_tile_matrix:new s.UniformMatrix4f(f),u_up_vector:new s.Uniform3f(f),u_ecef_origin:new s.Uniform3f(f),u_texture:new s.Uniform1i(f)}),symbolSDF:f=>({u_is_size_zoom_constant:new s.Uniform1i(f),u_is_size_feature_constant:new s.Uniform1i(f),u_size_t:new s.Uniform1f(f),u_size:new s.Uniform1f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_rotate_symbol:new s.Uniform1i(f),u_aspect_ratio:new s.Uniform1f(f),u_fade_change:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_label_plane_matrix:new s.UniformMatrix4f(f),u_coord_matrix:new s.UniformMatrix4f(f),u_is_text:new s.Uniform1i(f),u_pitch_with_map:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_texture:new s.Uniform1i(f),u_gamma_scale:new s.Uniform1f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_tile_id:new s.Uniform3f(f),u_zoom_transition:new s.Uniform1f(f),u_inv_rot_matrix:new s.UniformMatrix4f(f),u_merc_center:new s.Uniform2f(f),u_camera_forward:new s.Uniform3f(f),u_tile_matrix:new s.UniformMatrix4f(f),u_up_vector:new s.Uniform3f(f),u_ecef_origin:new s.Uniform3f(f),u_is_halo:new s.Uniform1i(f)}),symbolTextAndIcon:f=>({u_is_size_zoom_constant:new s.Uniform1i(f),u_is_size_feature_constant:new s.Uniform1i(f),u_size_t:new s.Uniform1f(f),u_size:new s.Uniform1f(f),u_camera_to_center_distance:new s.Uniform1f(f),u_rotate_symbol:new s.Uniform1i(f),u_aspect_ratio:new s.Uniform1f(f),u_fade_change:new s.Uniform1f(f),u_matrix:new s.UniformMatrix4f(f),u_label_plane_matrix:new s.UniformMatrix4f(f),u_coord_matrix:new s.UniformMatrix4f(f),u_is_text:new s.Uniform1i(f),u_pitch_with_map:new s.Uniform1i(f),u_texsize:new s.Uniform2f(f),u_texsize_icon:new s.Uniform2f(f),u_texture:new s.Uniform1i(f),u_texture_icon:new s.Uniform1i(f),u_gamma_scale:new s.Uniform1f(f),u_device_pixel_ratio:new s.Uniform1f(f),u_is_halo:new s.Uniform1i(f)}),background:f=>({u_matrix:new s.UniformMatrix4f(f),u_opacity:new s.Uniform1f(f),u_color:new s.UniformColor(f)}),backgroundPattern:f=>({u_matrix:new s.UniformMatrix4f(f),u_opacity:new s.Uniform1f(f),u_image:new s.Uniform1i(f),u_pattern_tl:new s.Uniform2f(f),u_pattern_br:new s.Uniform2f(f),u_texsize:new s.Uniform2f(f),u_pattern_size:new s.Uniform2f(f),u_pixel_coord_upper:new s.Uniform2f(f),u_pixel_coord_lower:new s.Uniform2f(f),u_tile_units_to_pixels:new s.Uniform1f(f)}),terrainRaster:Qa,terrainDepth:Qa,skybox:f=>({u_matrix:new s.UniformMatrix4f(f),u_sun_direction:new s.Uniform3f(f),u_cubemap:new s.Uniform1i(f),u_opacity:new s.Uniform1f(f),u_temporal_offset:new s.Uniform1f(f)}),skyboxGradient:f=>({u_matrix:new s.UniformMatrix4f(f),u_color_ramp:new s.Uniform1i(f),u_center_direction:new s.Uniform3f(f),u_radius:new s.Uniform1f(f),u_opacity:new s.Uniform1f(f),u_temporal_offset:new s.Uniform1f(f)}),skyboxCapture:f=>({u_matrix_3f:new s.UniformMatrix3f(f),u_sun_direction:new s.Uniform3f(f),u_sun_intensity:new s.Uniform1f(f),u_color_tint_r:new s.Uniform4f(f),u_color_tint_m:new s.Uniform4f(f),u_luminance:new s.Uniform1f(f)}),globeRaster:f=>({u_proj_matrix:new s.UniformMatrix4f(f),u_globe_matrix:new s.UniformMatrix4f(f),u_normalize_matrix:new s.UniformMatrix4f(f),u_merc_matrix:new s.UniformMatrix4f(f),u_zoom_transition:new s.Uniform1f(f),u_merc_center:new s.Uniform2f(f),u_image0:new s.Uniform1i(f),u_grid_matrix:new s.UniformMatrix3f(f),u_skirt_height:new s.Uniform1f(f),u_frustum_tl:new s.Uniform3f(f),u_frustum_tr:new s.Uniform3f(f),u_frustum_br:new s.Uniform3f(f),u_frustum_bl:new s.Uniform3f(f),u_globe_pos:new s.Uniform3f(f),u_globe_radius:new s.Uniform1f(f),u_viewport:new s.Uniform2f(f)}),globeAtmosphere:f=>({u_frustum_tl:new s.Uniform3f(f),u_frustum_tr:new s.Uniform3f(f),u_frustum_br:new s.Uniform3f(f),u_frustum_bl:new s.Uniform3f(f),u_horizon:new s.Uniform1f(f),u_transition:new s.Uniform1f(f),u_fadeout_range:new s.Uniform1f(f),u_color:new s.Uniform4f(f),u_high_color:new s.Uniform4f(f),u_space_color:new s.Uniform4f(f),u_star_intensity:new s.Uniform1f(f),u_star_density:new s.Uniform1f(f),u_star_size:new s.Uniform1f(f),u_temporal_offset:new s.Uniform1f(f),u_horizon_angle:new s.Uniform1f(f),u_rotation_matrix:new s.UniformMatrix4f(f)})};let Na;function xl(f,r,c,m,b,T,O){const L=f.context,Z=L.gl,q=f.transform,W=f.useProgram("collisionBox"),se=[];let Oe=0,$e=0;for(let ot=0;ot0){const on=s.create(),Rn=zt;s.mul(on,Dt.placementInvProjMatrix,q.glCoordMatrix),s.mul(on,on,Dt.placementViewportMatrix),se.push({circleArray:Vn,circleOffset:$e,transform:Rn,invTransform:on,projection:Dt.getProjection()}),Oe+=Vn.length/4,$e=Oe}dn&&(f.terrain&&f.terrain.setupElevationDraw(Mt,W),W.draw(L,Z.LINES,s.DepthMode.disabled,s.StencilMode.disabled,f.colorModeForRenderPass(),s.CullFaceMode.disabled,Mo(zt,q,Mt,Dt.getProjection()),c.id,dn.layoutVertexBuffer,dn.indexBuffer,dn.segments,null,q.zoom,null,[dn.collisionVertexBuffer,dn.collisionVertexBufferExt]))}if(!O||!se.length)return;const We=f.useProgram("collisionCircle"),qe=new s.StructArrayLayout2f1f2i16;qe.resize(4*Oe),qe._trim();let Ke=0;for(const ot of se)for(let Tt=0;Tt=0&&(We[ot.associatedIconIndex]={x:on,y:Rn,z:un,angle:Ln})}else fe(Dt,Oe)}if(W){$e.clear();const rt=f.icon.placedSymbolArray;for(let ot=0;oton.sortKey-Rn.sortKey);for(const on of zt){const Rn=on.state;if(f.terrain&&f.terrain.setupElevationDraw(Rn.tile,Rn.program,{useDepthForOcclusion:!$t,labelPlaneMatrixInv:Rn.labelPlaneMatrixInv}),Oe.activeTexture.set($e.TEXTURE0),Rn.atlasTexture.bind(Rn.atlasInterpolation,$e.CLAMP_TO_EDGE),Rn.atlasTextureIcon&&(Oe.activeTexture.set($e.TEXTURE1),Rn.atlasTextureIcon&&Rn.atlasTextureIcon.bind(Rn.atlasInterpolationIcon,$e.CLAMP_TO_EDGE)),Rn.isSDF){const un=Rn.uniformValues;Rn.hasHalo&&(un.u_is_halo=1,za(Rn.buffers,on.segments,c,f,Rn.program,Tt,W,se,un)),un.u_is_halo=0}za(Rn.buffers,on.segments,c,f,Rn.program,Tt,W,se,Rn.uniformValues)}}function za(f,r,c,m,b,T,O,L,Z){const q=m.context,W=[f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer,f.globeExtVertexBuffer];b.draw(q,q.gl.TRIANGLES,T,O,L,s.CullFaceMode.disabled,Z,c.id,f.layoutVertexBuffer,f.indexBuffer,r,c.paint,m.transform.zoom,f.programConfigurations.get(c.id),W)}function Mu(f,r,c,m,b,T,O){const L=f.context.gl,Z=c.paint.get("fill-pattern"),q=Z&&Z.constantOr(1);let W,se,Oe,$e,We;O?(se=q&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",W=L.LINES):(se=q?"fillPattern":"fill",W=L.TRIANGLES);for(const qe of m){const Ke=r.getTile(qe);if(q&&!Ke.patternsLoaded())continue;const ce=Ke.getBucket(c);if(!ce)continue;f.prepareDrawTile();const Ve=ce.programConfigurations.get(c.id),rt=f.useProgram(se,Ve);q&&(f.context.activeTexture.set(L.TEXTURE0),Ke.imageAtlasTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE),Ve.updatePaintBuffers());const ot=Z.constantOr(null);if(ot&&Ke.imageAtlas){const Mt=Ke.imageAtlas.patternPositions[ot.toString()];Mt&&Ve.setConstantPatternPositions(Mt)}const Tt=f.translatePosMatrix(qe.projMatrix,Ke,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(O){$e=ce.indexBuffer2,We=ce.segments2;const Mt=f.terrain&&f.terrain.renderingToTexture?f.terrain.drapeBufferSize:[L.drawingBufferWidth,L.drawingBufferHeight];Oe="fillOutlinePattern"===se&&q?Yn(Tt,f,Ke,Mt):It(Tt,Mt)}else $e=ce.indexBuffer,We=ce.segments,Oe=q?G(Tt,f,Ke):A(Tt);f.prepareDrawProgram(f.context,rt,qe.toUnwrapped()),rt.draw(f.context,W,b,f.stencilModeForClipping(qe),T,s.CullFaceMode.disabled,Oe,c.id,ce.layoutVertexBuffer,$e,We,c.paint,f.transform.zoom,Ve)}}function Ua(f,r,c,m,b,T,O){const L=f.context,Z=L.gl,q=f.transform,W=c.paint.get("fill-extrusion-pattern"),se=W.constantOr(1),Oe=c.paint.get("fill-extrusion-opacity"),$e=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),c.paint.get("fill-extrusion-ambient-occlusion-radius")],We=c.layout.get("fill-extrusion-edge-radius"),qe=We>0&&!c.paint.get("fill-extrusion-rounded-roof"),Ke=qe?0:We,ce="globe"===q.projection.name?s.fillExtrusionHeightLift():0,Ve="globe"===q.projection.name,rt=Ve?s.globeToMercatorTransition(q.zoom):0,ot=[s.mercatorXfromLng(q.center.lng),s.mercatorYfromLat(q.center.lat)],Tt=[];Ve&&Tt.push("PROJECTION_GLOBE_VIEW"),$e[0]>0&&Tt.push("FAUX_AO"),qe&&Tt.push("ZERO_ROOF_RADIUS");for(const Mt of m){const Dt=r.getTile(Mt),$t=Dt.getBucket(c);if(!$t||$t.projection.name!==q.projection.name)continue;const zt=$t.programConfigurations.get(c.id),dn=f.useProgram(se?"fillExtrusionPattern":"fillExtrusion",zt,Tt);if(f.terrain){const An=f.terrain;if(f.style.terrainSetForDrapingOnly())An.setupElevationDraw(Dt,dn,{useMeterToDem:!0});else{if(!$t.enableTerrain)continue;if(An.setupElevationDraw(Dt,dn,{useMeterToDem:!0}),Vl(L,r,Mt,$t,c,An),!$t.centroidVertexBuffer){const Gn=dn.attributes.a_centroid_pos;void 0!==Gn&&Z.vertexAttrib2f(Gn,0,0)}}}se&&(f.context.activeTexture.set(Z.TEXTURE0),Dt.imageAtlasTexture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE),zt.updatePaintBuffers());const Vn=W.constantOr(null);if(Vn&&Dt.imageAtlas){const An=Dt.imageAtlas.patternPositions[Vn.toString()];An&&zt.setConstantPatternPositions(An)}const on=f.translatePosMatrix(Mt.projMatrix,Dt,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Rn=q.projection.createInversionMatrix(q,Mt.canonical),un=c.paint.get("fill-extrusion-vertical-gradient"),Zn=se?D(on,f,un,Oe,$e,Ke,Mt,Dt,ce,rt,ot,Rn):M(on,f,un,Oe,$e,Ke,Mt,ce,rt,ot,Rn);f.prepareDrawProgram(L,dn,Mt.toUnwrapped());const sn=[];f.terrain&&sn.push($t.centroidVertexBuffer),Ve&&sn.push($t.layoutVertexExtBuffer),dn.draw(L,L.gl.TRIANGLES,b,T,O,s.CullFaceMode.backCCW,Zn,c.id,$t.layoutVertexBuffer,$t.indexBuffer,$t.segments,c.paint,f.transform.zoom,zt,sn)}}function Vl(f,r,c,m,b,T){const O=[ce=>{let Ve=ce.canonical.x-1,rt=ce.wrap;return Ve<0&&(Ve=(1<{let Ve=ce.canonical.x+1,rt=ce.wrap;return Ve===1<new s.OverscaledTileID(ce.overscaledZ,ce.wrap,ce.canonical.z,ce.canonical.x,(0===ce.canonical.y?1<new s.OverscaledTileID(ce.overscaledZ,ce.wrap,ce.canonical.z,ce.canonical.x,ce.canonical.y===(1<{const Ve=r.getSource().minzoom,rt=Tt=>{const Mt=r.getTileByID(Tt);if(Mt&&Mt.hasData())return Mt.getBucket(b)},ot=[0,-1,1];for(const Tt of ot){if(ce.overscaledZ+Tt(Z[0]=Math.min(ce.min.y,Ve.min.y),Z[1]=Math.max(ce.max.y,Ve.max.y),Z[2]=s.EXTENT-Ve.min.x>ce.max.x?Ve.min.x-s.EXTENT:ce.max.x,Z),W=(ce,Ve)=>(Z[0]=Math.min(ce.min.x,Ve.min.x),Z[1]=Math.max(ce.max.x,Ve.max.x),Z[2]=s.EXTENT-Ve.min.y>ce.max.y?Ve.min.y-s.EXTENT:ce.max.y,Z),se=[(ce,Ve)=>q(ce,Ve),(ce,Ve)=>q(Ve,ce),(ce,Ve)=>W(ce,Ve),(ce,Ve)=>W(Ve,ce)],Oe=new s.Point(0,0);let $e,We,qe;const Ke=(ce,Ve,rt,ot,Tt)=>{const Mt=[[ot?rt:ce,ot?ce:rt,0],[ot?rt:Ve,ot?Ve:rt,0]],Dt=Tt<0?s.EXTENT+Tt:Tt,$t=[ot?Dt:(ce+Ve)/2,ot?(ce+Ve)/2:Dt,0];return 0===rt&&Tt<0||0!==rt&&Tt>0?T.getForTilePoints(qe,[$t],!0,We):Mt.push($t),T.getForTilePoints(c,Mt,!0,$e),Math.max(Mt[0][2],Mt[1][2],$t[2])/T.exaggeration()};for(let ce=0;ce<4;ce++){const Ve=(ce<2?1:5)-ce,rt=m.borders[ce];if(0===rt.length)continue;const ot=qe=O[ce](c),Tt=L(ot);if(!(Tt&&Tt instanceof s.FillExtrusionBucket&&Tt.enableTerrain)||m.borderDoneWithNeighborZ[ce]===Tt.canonical.z&&Tt.borderDoneWithNeighborZ[Ve]===m.canonical.z||(We=T.findDEMTileFor(ot),!We||!We.dem))continue;if(!$e){const zt=T.findDEMTileFor(c);if(!zt||!zt.dem)return;$e=zt}const Mt=Tt.borders[Ve];let Dt=0;const $t=Tt.borderDoneWithNeighborZ[Ve]!==m.canonical.z;if(m.canonical.z===Tt.canonical.z){for(let zt=0;ztVn[0]+3));)$t&&Tt.encodeCentroid(void 0,on,!1),Dt++;if(on&&DtVn[1]-3)&&(un++,++Dt!==Mt.length);)on=Tt.featuresOnBorder[Mt[Dt]];if(on=Tt.featuresOnBorder[Mt[Rn]],dn.intersectsCount()>1||on.intersectsCount()>1||1!==un){1!==un&&(Dt=Rn),m.encodeCentroid(void 0,dn,!1),$t&&Tt.encodeCentroid(void 0,on,!1);continue}const Zn=se[ce](dn,on),sn=ce%2?s.EXTENT-1:0;Oe.x=Ke(Zn[0],Math.min(s.EXTENT-1,Zn[1]),sn,ce<2,Zn[2]),Oe.y=0,m.encodeCentroid(Oe,dn,!1),$t&&Tt.encodeCentroid(Oe,on,!1)}else m.encodeCentroid(void 0,dn,!1)}m.borderDoneWithNeighborZ[ce]=Tt.canonical.z,m.needsCentroidUpdate=!0,$t&&(Tt.borderDoneWithNeighborZ[Ve]=m.canonical.z,Tt.needsCentroidUpdate=!0)}else{for(const zt of rt)m.encodeCentroid(void 0,m.featuresOnBorder[zt],!1);if($t){for(const zt of Mt)Tt.encodeCentroid(void 0,Tt.featuresOnBorder[zt],!1);Tt.borderDoneWithNeighborZ[Ve]=m.canonical.z,Tt.needsCentroidUpdate=!0}m.borderDoneWithNeighborZ[ce]=Tt.canonical.z,m.needsCentroidUpdate=!0}}(m.needsCentroidUpdate||!m.centroidVertexBuffer&&0!==m.centroidVertexArray.length)&&m.uploadCentroid(f)}const sa=new s.Color(1,0,0,1),bl=new s.Color(0,1,0,1),vd=new s.Color(0,0,1,1),Gc=new s.Color(1,0,1,1),fc=new s.Color(0,1,1,1);function Au(f,r,c){const m=f.context,b=f.transform,T=m.gl,O="globe"===b.projection.name,L=O?["PROJECTION_GLOBE_VIEW"]:null;let Z=c.projMatrix;if(O&&s.globeToMercatorTransition(b.zoom)>0){const dn=s.transitionTileAABBinECEF(c.canonical,b),Vn=s.globeDenormalizeECEF(dn);Z=s.multiply(new Float32Array(16),b.globeMatrix,Vn),s.multiply(Z,b.projMatrix,Z)}const q=f.useProgram("debug",null,L),W=r.getTileByID(c.key);f.terrain&&f.terrain.setupElevationDraw(W,q);const se=s.DepthMode.disabled,Oe=s.StencilMode.disabled,$e=f.colorModeForRenderPass();m.activeTexture.set(T.TEXTURE0),f.emptyTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),O?W._makeGlobeTileDebugBuffers(f.context,b):W._makeDebugTileBoundsBuffers(f.context,b.projection);const qe=W._tileDebugBuffer||f.debugBuffer,Ke=W._tileDebugIndexBuffer||f.debugIndexBuffer,ce=W._tileDebugSegments||f.debugSegments;q.draw(m,T.LINE_STRIP,se,Oe,$e,s.CullFaceMode.disabled,oa(Z,s.Color.red),"$debug",qe,Ke,ce,null,null,null,[W._globeTileDebugBorderBuffer]);const Ve=W.latestRawTileData,rt=Math.floor((Ve&&Ve.byteLength||0)/1024),ot=r.getTile(c).tileSize,Tt=512/Math.min(ot,512)*(c.overscaledZ/b.zoom)*.5;let Mt=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(Mt+=` => ${c.overscaledZ}`),Mt+=` ${rt}kb`,function(dn,Vn){dn.initDebugOverlayCanvas();const on=dn.debugOverlayCanvas,Rn=dn.context.gl,un=dn.debugOverlayCanvas.getContext("2d");un.clearRect(0,0,on.width,on.height),un.shadowColor="white",un.shadowBlur=2,un.lineWidth=1.5,un.strokeStyle="white",un.textBaseline="top",un.font="bold 36px Open Sans, sans-serif",un.fillText(Vn,5,5),un.strokeText(Vn,5,5),dn.debugOverlayTexture.update(on),dn.debugOverlayTexture.bind(Rn.LINEAR,Rn.CLAMP_TO_EDGE)}(f,Mt);const Dt=W._tileDebugTextBuffer||f.debugBuffer,$t=W._tileDebugTextIndexBuffer||f.quadTriangleIndexBuffer,zt=W._tileDebugTextSegments||f.debugSegments;q.draw(m,T.TRIANGLES,se,Oe,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,oa(Z,s.Color.transparent,Tt),"$debug",Dt,$t,zt,null,null,null,[W._globeTileDebugTextBuffer])}function wl(f,r,c,m){il(f,0,r+c/2,f.transform.width,c,m)}function $l(f,r,c,m){il(f,r-c/2,0,c,f.transform.height,m)}function il(f,r,c,m,b,T){const O=f.context,L=O.gl;L.enable(L.SCISSOR_TEST),L.scissor(r*s.exported.devicePixelRatio,c*s.exported.devicePixelRatio,m*s.exported.devicePixelRatio,b*s.exported.devicePixelRatio),O.clear({color:T}),L.disable(L.SCISSOR_TEST)}const xd=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:pc}=xd;function qs(f,r,c,m){f.emplaceBack(r,c,m)}class Ta{constructor(r){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,qs(this.vertexArray,-1,-1,1),qs(this.vertexArray,1,-1,1),qs(this.vertexArray,-1,1,1),qs(this.vertexArray,1,1,1),qs(this.vertexArray,-1,-1,-1),qs(this.vertexArray,1,-1,-1),qs(this.vertexArray,-1,1,-1),qs(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=r.createVertexBuffer(this.vertexArray,pc),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function Zs(f,r,c,m,b,T){const O=f.gl,L=r.paint.get("sky-atmosphere-color"),Z=r.paint.get("sky-atmosphere-halo-color"),q=r.paint.get("sky-atmosphere-sun-intensity"),W={u_matrix_3f:s.fromMat4(s.create$1(),m),u_sun_direction:b,u_sun_intensity:q,u_color_tint_r:[(We=L).r,We.g,We.b,We.a],u_color_tint_m:[(qe=Z).r,qe.g,qe.b,qe.a],u_luminance:5e-5};var We,qe;O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+T,r.skyboxTexture,0),c.draw(f,O.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,W,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const N=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class ne{constructor(r){const c=new s.StructArrayLayout5f20;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const m=new s.StructArrayLayout3ui6;m.emplaceBack(0,1,2),m.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(c,N.members),this.indexBuffer=r.createIndexBuffer(m),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const it={symbol:function(f,r,c,m,b){if("translucent"!==f.renderPass)return;const T=s.StencilMode.disabled,O=f.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(L,Z,q,W,se,Oe,$e){const We=Z.transform,qe="map"===se,Ke="map"===Oe;for(const ce of L){const Ve=W.getTile(ce),rt=Ve.getBucket(q);if(!rt||!rt.text||!rt.text.segments.get().length)continue;const ot=s.evaluateSizeForZoom(rt.textSizeData,We.zoom),Tt=Dn(ce,rt.getProjection(),We),Mt=We.calculatePixelsToTileUnitsMatrix(Ve),Dt=Kt(Tt,Ve.tileID.canonical,Ke,qe,We,rt.getProjection(),Mt),$t="none"!==q.layout.get("icon-text-fit")&&rt.hasIconData();if(ot){const zt=Math.pow(2,We.zoom-Ve.tileID.overscaledZ);Us(rt,qe,Ke,$e,s.symbolSize,We,Dt,ce,zt,ot,$t)}}}(m,f,c,r,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),b),0!==c.paint.get("icon-opacity").constantOr(1)&&Ao(f,r,c,m,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),T,O),0!==c.paint.get("text-opacity").constantOr(1)&&Ao(f,r,c,m,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),T,O),r.map.showCollisionBoxes&&(xl(f,r,c,m,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),xl(f,r,c,m,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(f,r,c,m){if("translucent"!==f.renderPass)return;const b=c.paint.get("circle-opacity"),T=c.paint.get("circle-stroke-width"),O=c.paint.get("circle-stroke-opacity"),L=void 0!==c.layout.get("circle-sort-key").constantOr(1);if(0===b.constantOr(1)&&(0===T.constantOr(1)||0===O.constantOr(1)))return;const Z=f.context,q=Z.gl,W=f.transform,se=f.depthModeForSublayer(0,s.DepthMode.ReadOnly),Oe=s.StencilMode.disabled,$e=f.colorModeForRenderPass(),We="globe"===W.projection.name,qe=[s.mercatorXfromLng(W.center.lng),s.mercatorYfromLat(W.center.lat)],Ke=[];for(let Ve=0;VeVe.sortKey-rt.sortKey);const ce={useDepthForOcclusion:!We};for(const Ve of Ke){const{programConfiguration:rt,program:ot,layoutVertexBuffer:Tt,globeExtVertexBuffer:Mt,indexBuffer:Dt,uniformValues:$t,tile:zt}=Ve.state,dn=Ve.segments;f.terrain&&f.terrain.setupElevationDraw(zt,ot,ce),f.prepareDrawProgram(Z,ot,zt.tileID.toUnwrapped()),ot.draw(Z,q.TRIANGLES,se,Oe,$e,s.CullFaceMode.disabled,$t,c.id,Tt,Dt,dn,c.paint,W.zoom,rt,[Mt])}},heatmap:function(f,r,c,m){if(0!==c.paint.get("heatmap-opacity"))if("offscreen"===f.renderPass){const b=f.context,T=b.gl,O=s.StencilMode.disabled,L=new s.ColorMode([T.ONE,T.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function($e,We,qe,Ke){const ce=$e.gl,Ve=We.width*Ke,rt=We.height*Ke;$e.activeTexture.set(ce.TEXTURE1),$e.viewport.set([0,0,Ve,rt]);let ot=qe.heatmapFbo;if(!ot||ot&&(ot.width!==Ve||ot.height!==rt)){ot&&ot.destroy();const Tt=ce.createTexture();ce.bindTexture(ce.TEXTURE_2D,Tt),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_WRAP_S,ce.CLAMP_TO_EDGE),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_WRAP_T,ce.CLAMP_TO_EDGE),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_MIN_FILTER,ce.LINEAR),ce.texParameteri(ce.TEXTURE_2D,ce.TEXTURE_MAG_FILTER,ce.LINEAR),ot=qe.heatmapFbo=$e.createFramebuffer(Ve,rt,!1),function(Mt,Dt,$t,zt,dn,Vn){const on=Mt.gl;on.texImage2D(on.TEXTURE_2D,0,Mt.isWebGL2&&Mt.extRenderToTextureHalfFloat?on.RGBA16F:on.RGBA,dn,Vn,0,on.RGBA,Mt.extRenderToTextureHalfFloat?Mt.isWebGL2?on.HALF_FLOAT:Mt.extTextureHalfFloat.HALF_FLOAT_OES:on.UNSIGNED_BYTE,null),zt.colorAttachment.set($t)}($e,0,Tt,ot,Ve,rt)}else ce.bindTexture(ce.TEXTURE_2D,ot.colorAttachment.get()),$e.bindFramebuffer.set(ot.framebuffer)})(b,f,c,"globe"===f.transform.projection.name?.5:.25),b.clear({color:s.Color.transparent});const Z=f.transform,q="globe"===Z.projection.name,W=q?["PROJECTION_GLOBE_VIEW"]:null,se=q?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,Oe=[s.mercatorXfromLng(Z.center.lng),s.mercatorYfromLat(Z.center.lat)];for(let $e=0;$e{const Tt=[];Ba(ot)&&Tt.push("RENDER_LINE_DASH"),ot.paint.get("line-gradient")&&Tt.push("RENDER_LINE_GRADIENT");const Mt=ot.paint.get("line-trim-offset");0===Mt[0]&&0===Mt[1]||Tt.push("RENDER_LINE_TRIM_OFFSET");const Dt=ot.paint.get("line-pattern").constantOr(1),$t=1!==ot.paint.get("line-opacity").constantOr(1);return!Dt&&$t&&Tt.push("RENDER_LINE_ALPHA_DISCARD"),Tt})(c);let rt=Ve.includes("RENDER_LINE_ALPHA_DISCARD");f.terrain&&f.terrain.clipOrMaskOverlapStencilType()&&(rt=!1);for(const ot of m){const Tt=r.getTile(ot);if($e&&!Tt.patternsLoaded())continue;const Mt=Tt.getBucket(c);if(!Mt)continue;f.prepareDrawTile();const Dt=Mt.programConfigurations.get(c.id),$t=f.useProgram(qe,Dt,Ve),zt=Oe.constantOr(null);if(zt&&Tt.imageAtlas){const An=Tt.imageAtlas.patternPositions[zt.toString()];An&&Dt.setConstantPatternPositions(An)}const dn=q.constantOr(null),Vn=se.constantOr(null);if(!$e&&dn&&Vn&&Tt.lineAtlas){const An=Tt.lineAtlas.getDash(dn,Vn);An&&Dt.setConstantPatternPositions(An)}let[on,Rn]=c.paint.get("line-trim-offset");("round"===Vn||"square"===Vn)&&on!==Rn&&(0===on&&(on-=1),1===Rn&&(Rn+=1));const un=f.terrain?ot.projMatrix:null,Zn=$e?tl(f,Tt,c,un,Z):Fa(f,Tt,c,un,Mt.lineClipsArray.length,Z,[on,Rn]);if(We){const An=Mt.gradients[c.id];let Gn=An.texture;if(c.gradientVersion!==An.version){let Ln=256;if(c.stepInterpolant){const Wn=r.getSource().maxzoom,Di=ot.canonical.z===Wn?Math.ceil(1<{$t.draw(Ke,ce.TRIANGLES,O,An,L,s.CullFaceMode.disabled,Zn,c.id,Mt.layoutVertexBuffer,Mt.indexBuffer,Mt.segments,c.paint,f.transform.zoom,Dt,[Mt.layoutVertexBuffer2])};if(rt){const An=f.stencilModeForClipping(ot).ref;0===An&&f.terrain&&Ke.clear({stencil:0});const Gn={func:ce.EQUAL,mask:255};Zn.u_alpha_discard_threshold=.8,sn(new s.StencilMode(Gn,An,255,ce.KEEP,ce.KEEP,ce.INVERT)),Zn.u_alpha_discard_threshold=0,sn(new s.StencilMode(Gn,An,255,ce.KEEP,ce.KEEP,ce.KEEP))}else sn(f.stencilModeForClipping(ot))}rt&&(f.resetStencilClippingMasks(),f.terrain&&Ke.clear({stencil:0}))},fill:function(f,r,c,m){const b=c.paint.get("fill-color"),T=c.paint.get("fill-opacity");if(0===T.constantOr(1))return;const O=f.colorModeForRenderPass(),L=c.paint.get("fill-pattern"),Z=f.opaquePassEnabledForLayer()&&!L.constantOr(1)&&1===b.constantOr(s.Color.transparent).a&&1===T.constantOr(0)?"opaque":"translucent";if(f.renderPass===Z){const q=f.depthModeForSublayer(1,"opaque"===f.renderPass?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Mu(f,r,c,m,q,O,!1)}if("translucent"===f.renderPass&&c.paint.get("fill-antialias")){const q=f.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Mu(f,r,c,m,q,O,!0)}},"fill-extrusion":function(f,r,c,m){const b=c.paint.get("fill-extrusion-opacity");if(0!==b&&"translucent"===f.renderPass){const T=new s.DepthMode(f.context.gl.LEQUAL,s.DepthMode.ReadWrite,f.depthRangeFor3D);if(1!==b||c.paint.get("fill-extrusion-pattern").constantOr(1))Ua(f,r,c,m,T,s.StencilMode.disabled,s.ColorMode.disabled),Ua(f,r,c,m,T,f.stencilModeFor3D(),f.colorModeForRenderPass()),f.resetStencilClippingMasks();else{const O=f.colorModeForRenderPass();Ua(f,r,c,m,T,s.StencilMode.disabled,O)}}},hillshade:function(f,r,c,m){if("offscreen"!==f.renderPass&&"translucent"!==f.renderPass)return;const b=f.context,T=f.depthModeForSublayer(0,s.DepthMode.ReadOnly),O=f.colorModeForRenderPass(),L=f.terrain&&f.terrain.renderingToTexture,[Z,q]="translucent"!==f.renderPass||L?[{},m]:f.stencilConfigForOverlap(m);for(const W of q){const se=r.getTile(W);if(se.needsHillshadePrepare&&"offscreen"===f.renderPass)or(f,se,c,T,s.StencilMode.disabled,O);else if("translucent"===f.renderPass){const Oe=L&&f.terrain?f.terrain.stencilModeForRTTOverlap(W):Z[W.overscaledZ];hs(f,W,se,c,T,Oe,O)}}b.viewport.set([0,0,f.width,f.height]),f.resetStencilClippingMasks()},raster:function(f,r,c,m,b,T){if("translucent"!==f.renderPass||0===c.paint.get("raster-opacity")||!m.length)return;const O=f.context,L=O.gl,Z=r.getSource(),q=f.useProgram("raster"),W=f.colorModeForRenderPass(),se=f.terrain&&f.terrain.renderingToTexture,[Oe,$e]=Z instanceof xe||se?[{},m]:f.stencilConfigForOverlap(m),We=$e[$e.length-1].overscaledZ,qe=!f.options.moving;for(const Ke of $e){const ce=se?s.DepthMode.disabled:f.depthModeForSublayer(Ke.overscaledZ-We,1===c.paint.get("raster-opacity")?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,L.LESS),Ve=Ke.toUnwrapped(),rt=r.getTile(Ke);if(se&&(!rt||!rt.hasData()))continue;const ot=se?Ke.projMatrix:f.transform.calculateProjMatrix(Ve,qe),Tt=f.terrain&&se?f.terrain.stencilModeForRTTOverlap(Ke):Oe[Ke.overscaledZ],Mt=T?0:c.paint.get("raster-fade-duration");rt.registerFadeDuration(Mt);const Dt=r.findLoadedParent(Ke,0),$t=Bo(rt,Dt,r,f.transform,Mt);let zt,dn;f.terrain&&f.terrain.prepareDrawTile();const Vn="nearest"===c.paint.get("raster-resampling")?L.NEAREST:L.LINEAR;O.activeTexture.set(L.TEXTURE0),rt.texture.bind(Vn,L.CLAMP_TO_EDGE),O.activeTexture.set(L.TEXTURE1),Dt?(Dt.texture.bind(Vn,L.CLAMP_TO_EDGE),zt=Math.pow(2,Dt.tileID.overscaledZ-rt.tileID.overscaledZ),dn=[rt.tileID.canonical.x*zt%1,rt.tileID.canonical.y*zt%1]):rt.texture.bind(Vn,L.CLAMP_TO_EDGE),rt.texture.useMipmap&&O.extTextureFilterAnisotropic&&f.transform.pitch>20&&L.texParameterf(L.TEXTURE_2D,O.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,O.extTextureFilterAnisotropicMax);const on=vl(ot,dn||[0,0],zt||1,$t,c,Z instanceof xe?Z.perspectiveTransform:[0,0]);if(f.prepareDrawProgram(O,q,Ve),Z instanceof xe)Z.boundsBuffer&&Z.boundsSegments&&q.draw(O,L.TRIANGLES,ce,s.StencilMode.disabled,W,s.CullFaceMode.disabled,on,c.id,Z.boundsBuffer,f.quadTriangleIndexBuffer,Z.boundsSegments);else{const{tileBoundsBuffer:Rn,tileBoundsIndexBuffer:un,tileBoundsSegments:Zn}=f.getTileBoundsBuffers(rt);q.draw(O,L.TRIANGLES,ce,Tt,W,s.CullFaceMode.disabled,on,c.id,Rn,un,Zn)}}f.resetStencilClippingMasks()},background:function(f,r,c,m){const b=c.paint.get("background-color"),T=c.paint.get("background-opacity");if(0===T)return;const O=f.context,L=O.gl,Z=f.transform,q=Z.tileSize,W=c.paint.get("background-pattern");if(f.isPatternMissing(W))return;const se=!W&&1===b.a&&1===T&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==se)return;const Oe=s.StencilMode.disabled,$e=f.depthModeForSublayer(0,"opaque"===se?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),We=f.colorModeForRenderPass(),qe=f.useProgram(W?"backgroundPattern":"background");let Ke,ce=m;ce||(Ke=f.getBackgroundTiles(),ce=Object.values(Ke).map(Ve=>Ve.tileID)),W&&(O.activeTexture.set(L.TEXTURE0),f.imageManager.bind(f.context));for(const Ve of ce){const rt=Ve.toUnwrapped(),ot=m?Ve.projMatrix:f.transform.calculateProjMatrix(rt);f.prepareDrawTile();const Tt=r?r.getTile(Ve):Ke?Ke[Ve.key]:new s.Tile(Ve,q,Z.zoom,f),Mt=W?dc(ot,T,f,W,{tileID:Ve,tileSize:q}):Ea(ot,T,b);f.prepareDrawProgram(O,qe,rt);const{tileBoundsBuffer:Dt,tileBoundsIndexBuffer:$t,tileBoundsSegments:zt}=f.getTileBoundsBuffers(Tt);qe.draw(O,L.TRIANGLES,$e,Oe,We,s.CullFaceMode.disabled,Mt,c.id,Dt,$t,zt)}},sky:function(f,r,c){const m=f.transform,b="mercator"===m.projection.name||"globe"===m.projection.name?1:s.smoothstep(7,8,m.zoom),T=c.paint.get("sky-opacity")*b;if(0===T)return;const O=f.context,L=c.paint.get("sky-type"),Z=new s.DepthMode(O.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),q=f.frameCounter/1e3%1;"atmosphere"===L?"offscreen"===f.renderPass?c.needsSkyboxCapture(f)&&(function(W,se,Oe,$e){const We=W.context,qe=We.gl;let Ke=se.skyboxFbo;if(!Ke){Ke=se.skyboxFbo=We.createFramebuffer(32,32,!1),se.skyboxGeometry=new Ta(We),se.skyboxTexture=We.gl.createTexture(),qe.bindTexture(qe.TEXTURE_CUBE_MAP,se.skyboxTexture),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_WRAP_S,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_WRAP_T,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_MIN_FILTER,qe.LINEAR),qe.texParameteri(qe.TEXTURE_CUBE_MAP,qe.TEXTURE_MAG_FILTER,qe.LINEAR);for(let ot=0;ot<6;++ot)qe.texImage2D(qe.TEXTURE_CUBE_MAP_POSITIVE_X+ot,0,qe.RGBA,32,32,0,qe.RGBA,qe.UNSIGNED_BYTE,null)}We.bindFramebuffer.set(Ke.framebuffer),We.viewport.set([0,0,32,32]);const ce=se.getCenter(W,!0),Ve=W.useProgram("skyboxCapture"),rt=new Float64Array(16);s.identity(rt),s.rotateY(rt,rt,.5*-Math.PI),Zs(We,se,Ve,rt,ce,0),s.identity(rt),s.rotateY(rt,rt,.5*Math.PI),Zs(We,se,Ve,rt,ce,1),s.identity(rt),s.rotateX(rt,rt,.5*-Math.PI),Zs(We,se,Ve,rt,ce,2),s.identity(rt),s.rotateX(rt,rt,.5*Math.PI),Zs(We,se,Ve,rt,ce,3),s.identity(rt),Zs(We,se,Ve,rt,ce,4),s.identity(rt),s.rotateY(rt,rt,Math.PI),Zs(We,se,Ve,rt,ce,5),We.viewport.set([0,0,W.width,W.height])}(f,c),c.markSkyboxValid(f)):"sky"===f.renderPass&&function(W,se,Oe,$e,We){const qe=W.context,Ke=qe.gl,ce=W.transform,Ve=W.useProgram("skybox");qe.activeTexture.set(Ke.TEXTURE0),Ke.bindTexture(Ke.TEXTURE_CUBE_MAP,se.skyboxTexture);const rt={u_matrix:ce.skyboxMatrix,u_sun_direction:se.getCenter(W,!1),u_cubemap:0,u_opacity:$e,u_temporal_offset:We};W.prepareDrawProgram(qe,Ve),Ve.draw(qe,Ke.TRIANGLES,Oe,s.StencilMode.disabled,W.colorModeForRenderPass(),s.CullFaceMode.backCW,rt,"skybox",se.skyboxGeometry.vertexBuffer,se.skyboxGeometry.indexBuffer,se.skyboxGeometry.segment)}(f,c,Z,T,q):"gradient"===L&&"sky"===f.renderPass&&function(W,se,Oe,$e,We){const qe=W.context,Ke=qe.gl,ce=W.transform,Ve=W.useProgram("skyboxGradient");se.skyboxGeometry||(se.skyboxGeometry=new Ta(qe)),qe.activeTexture.set(Ke.TEXTURE0);let rt=se.colorRampTexture;rt||(rt=se.colorRampTexture=new s.Texture(qe,se.colorRamp,Ke.RGBA)),rt.bind(Ke.LINEAR,Ke.CLAMP_TO_EDGE);const ot=(Tt=ce.skyboxMatrix,Mt=se.getCenter(W,!1),Dt=se.paint.get("sky-gradient-radius"),$t=$e,zt=We,{u_matrix:Tt,u_color_ramp:0,u_center_direction:Mt,u_radius:s.degToRad(Dt),u_opacity:$t,u_temporal_offset:zt});var Tt,Mt,Dt,$t,zt;W.prepareDrawProgram(qe,Ve),Ve.draw(qe,Ke.TRIANGLES,Oe,s.StencilMode.disabled,W.colorModeForRenderPass(),s.CullFaceMode.backCW,ot,"skyboxGradient",se.skyboxGeometry.vertexBuffer,se.skyboxGeometry.indexBuffer,se.skyboxGeometry.segment)}(f,c,Z,T,q)},debug:function(f,r,c){for(let m=0;mb)return void(this.transform.fogCullDistSq=null);const T=m+.78*(b-m);this.transform.fogCullDistSq=T*T}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(r,c){if(this.width=r*s.exported.devicePixelRatio,this.height=c*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const m of this.style.order)this.style._layers[m].resize()}setup(){const r=this.context,c=new s.StructArrayLayout2i4;c.emplaceBack(0,0),c.emplaceBack(s.EXTENT,0),c.emplaceBack(0,s.EXTENT),c.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=r.createVertexBuffer(c,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const m=new s.StructArrayLayout2i4;m.emplaceBack(0,0),m.emplaceBack(s.EXTENT,0),m.emplaceBack(0,s.EXTENT),m.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=r.createVertexBuffer(m,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const b=new s.StructArrayLayout2i4;b.emplaceBack(-1,-1),b.emplaceBack(1,-1),b.emplaceBack(-1,1),b.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(b,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const T=new s.StructArrayLayout4i8;T.emplaceBack(0,0,0,0),T.emplaceBack(s.EXTENT,0,s.EXTENT,0),T.emplaceBack(0,s.EXTENT,0,s.EXTENT),T.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=r.createVertexBuffer(T,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const O=new s.StructArrayLayout3ui6;O.emplaceBack(0,1,2),O.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(O);const L=new s.StructArrayLayout1ui2;for(const q of[0,1,3,2,0])L.emplaceBack(q);this.debugIndexBuffer=r.createIndexBuffer(L),this.emptyTexture=new s.Texture(r,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA),this.identityMat=s.create();const Z=this.context.gl;this.stencilClearMode=new s.StencilMode({func:Z.ALWAYS,mask:0},0,255,Z.ZERO,Z.ZERO,Z.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new ne(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(r){return r._makeTileBoundsBuffers(this.context,this.transform.projection),r._tileBoundsBuffer?{tileBoundsBuffer:r._tileBoundsBuffer,tileBoundsIndexBuffer:r._tileBoundsIndexBuffer,tileBoundsSegments:r._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const r=this.context,c=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(r,c.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,el(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(r,c,m){if(!c||this.currentStencilSource===c.id||!r.isTileClipped()||!m||0===m.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let L=!1;for(const Z of m)if(void 0===this._tileClippingMaskIDs[Z.key]){L=!0;break}if(!L)return}this.currentStencilSource=c.id;const b=this.context,T=b.gl;this.nextStencilID+m.length>256&&this.clearStencil(),b.setColorMode(s.ColorMode.disabled),b.setDepthMode(s.DepthMode.disabled);const O=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const L of m){const Z=c.getTile(L),q=this._tileClippingMaskIDs[L.key]=this.nextStencilID++,{tileBoundsBuffer:W,tileBoundsIndexBuffer:se,tileBoundsSegments:Oe}=this.getTileBoundsBuffers(Z);O.draw(b,T.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:T.ALWAYS,mask:0},q,255,T.KEEP,T.KEEP,T.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,el(L.projMatrix),"$clipping",W,se,Oe)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,c=this.context.gl;return new s.StencilMode({func:c.NOTEQUAL,mask:255},r,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(r){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(r);const c=this.context.gl;return new s.StencilMode({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(r){const c=this.context.gl,m=r.sort((O,L)=>L.overscaledZ-O.overscaledZ),b=m[m.length-1].overscaledZ,T=m[0].overscaledZ-b+1;if(T>1){this.currentStencilSource=void 0,this.nextStencilID+T>256&&this.clearStencil();const O={};for(let L=0;L=0;this.currentLayer--){const q=this.style._layers[m[this.currentLayer]],W=r._getLayerSourceCache(q);if(q.isSky())continue;const se=W?O[W.id]:void 0;this._renderTileClippingMasks(q,W,se),this.renderLayer(this,W,q,se)}if(this.style.fog&&this.transform.projection.supportsFog&&function(q,W){const se=q.context,Oe=se.gl,$e=q.transform,We=new s.DepthMode(Oe.LEQUAL,s.DepthMode.ReadOnly,[0,1]),qe=q.useProgram("globeAtmosphere",null,"globe"===$e.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),Ke=s.globeToMercatorTransition($e.zoom),ce=W.properties.get("color").toArray01(),Ve=W.properties.get("high-color").toArray01(),rt=W.properties.get("space-color").toArray01PremultipliedAlpha(),ot=s.identity$1([]);s.rotateY$1(ot,ot,-s.degToRad($e._center.lng)),s.rotateX$1(ot,ot,s.degToRad($e._center.lat)),s.rotateZ$1(ot,ot,$e.angle),s.rotateX$1(ot,ot,-$e._pitch);const Tt=s.fromQuat(new Float32Array(16),ot),Mt=s.mapValue(W.properties.get("star-intensity"),0,1,0,.25),$t=s.mapValue(W.properties.get("horizon-blend"),0,1,5e-4,.25),zt=s.globeUseCustomAntiAliasing(q,se,$e)&&5e-4===$t?$e.worldSize/(2*Math.PI*1.025)-1:$e.globeRadius,dn=q.frameCounter/1e3%1,Vn=s.length($e.globeCenterInViewSpace),on=Math.sqrt(Math.pow(Vn,2)-Math.pow(zt,2)),Rn=Math.acos(on/Vn),un={u_frustum_tl:$e.frustumCorners.TL,u_frustum_tr:$e.frustumCorners.TR,u_frustum_br:$e.frustumCorners.BR,u_frustum_bl:$e.frustumCorners.BL,u_horizon:$e.frustumCorners.horizon,u_transition:Ke,u_fadeout_range:$t,u_color:ce,u_high_color:Ve,u_space_color:rt,u_star_intensity:Mt,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:dn,u_horizon_angle:Rn,u_rotation_matrix:Tt};q.prepareDrawProgram(se,qe);const Zn=q.atmosphereBuffer;Zn&&qe.draw(se,Oe.TRIANGLES,We,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,un,"skybox",Zn.vertexBuffer,Zn.indexBuffer,Zn.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const se=r._getLayerSourceCache(W);se&&!W.isHidden(this.transform.zoom)&&(!q||q.getSource().maxzoom0?c.pop():null}isPatternMissing(r){return null===r||void 0!==r&&!this.imageManager.getPattern(r.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const r=this.terrain&&this.terrain.renderingToTexture,c=this.terrain&&0===this.terrain.exaggeration(),m=this.style&&this.style.fog,b=[];return this.terrainRenderModeElevated()&&b.push("TERRAIN"),"globe"===this.transform.projection.name&&b.push("GLOBE"),c&&b.push("ZERO_EXAGGERATION"),m&&!r&&0!==m.getOpacity(this.transform.pitch)&&b.push("FOG"),r&&b.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&b.push("OVERDRAW_INSPECTOR"),b}useProgram(r,c,m){this.cache=this.cache||{};const b=m||[],T=this.currentGlobalDefines().concat(b),O=ki.cacheKey(Fo[r],r,T,c);return this.cache[O]||(this.cache[O]=new ki(this.context,r,Fo[r],c,fa[r],T)),this.cache[O]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(r,c,m){if(this.terrain&&this.terrain.renderingToTexture)return;const b=this.style.fog;if(b){const T=b.getOpacity(this.transform.pitch),O=((L,Z,q,W,se,Oe,$e,We,qe,Ke,ce)=>{const Ve=L.transform,rt=Z.properties.get("color").toArray01();rt[3]=W;const ot=L.frameCounter/1e3%1;return{u_fog_matrix:q?Ve.calculateFogTileMatrix(q):L.identityMat,u_fog_range:Z.getFovAdjustedRange(Ve._fov),u_fog_color:rt,u_fog_horizon_blend:Z.properties.get("horizon-blend"),u_fog_temporal_offset:ot,u_frustum_tl:se,u_frustum_tr:Oe,u_frustum_br:$e,u_frustum_bl:We,u_globe_pos:qe,u_globe_radius:Ke,u_viewport:ce,u_globe_transition:s.globeToMercatorTransition(Ve.zoom),u_is_globe:+("globe"===Ve.projection.name)}})(this,b,m,T,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);c.setFogUniformValues(r,O)}}setTileLoadedFlag(r){this.tileLoaded=r}saveCanvasCopy(){const r=this.canvasCopy();r&&(this.frameCopies.push(r),this.tileLoaded=!1)}canvasCopy(){const r=this.context.gl,c=r.createTexture();return r.bindTexture(r.TEXTURE_2D,c),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,0,0,r.drawingBufferWidth,r.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const r=this.style&&this.style.fog;return!!r&&0!==r.getOpacity(this.transform.pitch)}getBackgroundTiles(){const r=this._backgroundTiles,c=this._backgroundTiles={},m=this.transform.coveringTiles({tileSize:512});for(const b of m)c[b.key]=r[b.key]||new s.Tile(b,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}}class He{constructor(r=0,c=0,m=0,b=0){if(isNaN(r)||r<0||isNaN(c)||c<0||isNaN(m)||m<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=c,this.left=m,this.right=b}interpolate(r,c,m){return null!=c.top&&null!=r.top&&(this.top=s.number(r.top,c.top,m)),null!=c.bottom&&null!=r.bottom&&(this.bottom=s.number(r.bottom,c.bottom,m)),null!=c.left&&null!=r.left&&(this.left=s.number(r.left,c.left,m)),null!=c.right&&null!=r.right&&(this.right=s.number(r.right,c.right,m)),this}getCenter(r,c){const m=s.clamp((this.left+r-this.right)/2,0,r),b=s.clamp((this.top+c-this.bottom)/2,0,c);return new s.Point(m,b)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new He(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function At(f,r){const c=s.getColumn(f,3);s.fromQuat(f,r),s.setColumn(f,3,c)}function cn(f,r){const c=s.identity$1([]);return s.rotateZ$1(c,c,-r),s.rotateX$1(c,c,-f),c}function ri(f,r){const c=[f[0],f[1],0],m=[r[0],r[1],0];if(s.length(c)>=1e-15){const O=s.normalize([],c);s.scale$2(m,O,s.dot(m,O)),r[0]=m[0],r[1]=m[1]}const b=s.cross([],r,f);if(s.len(b)<1e-15)return null;const T=Math.atan2(-b[1],b[0]);return cn(Math.atan2(Math.sqrt(f[0]*f[0]+f[1]*f[1]),-f[2]),T)}class fr{constructor(r,c){this.position=r,this.orientation=c}get position(){return this._position}set position(r){if(r){const c=r instanceof s.MercatorCoordinate?r:new s.MercatorCoordinate(r[0],r[1],r[2]);this._renderWorldCopies&&(c.x=s.wrap(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(r,c){if(this.orientation=null,!this.position)return;const m=this.position,b=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(r)):0,T=s.MercatorCoordinate.fromLngLat(r,b),O=[T.x-m.x,T.y-m.y,T.z-m.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=ri(O,c)}setPitchBearing(r,c){this.orientation=cn(s.degToRad(r),s.degToRad(-c))}}class Xi{constructor(r,c){this._transform=s.identity([]),this.orientation=c,this.position=r}get mercatorPosition(){const r=this.position;return new s.MercatorCoordinate(r[0],r[1],r[2])}get position(){const r=s.getColumn(this._transform,3);return[r[0],r[1],r[2]]}set position(r){var c;r&&s.setColumn(this._transform,3,[(c=r)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||s.identity$1([]),r&&At(this._transform,this._orientation)}getPitchBearing(){const r=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2])}}setPitchBearing(r,c){this._orientation=cn(r,c),At(this._transform,this._orientation)}forward(){const r=s.getColumn(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){const r=s.getColumn(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){const r=s.getColumn(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,c){const m=new Float64Array(16);return s.invert(m,this.getWorldToCamera(r,c)),m}getWorldToCameraPosition(r,c,m){const b=this.position;s.scale$2(b,b,-r);const T=new Float64Array(16);return s.fromScaling(T,[m,m,m]),s.translate(T,T,b),T[10]*=c,T}getWorldToCamera(r,c){const m=new Float64Array(16),b=new Float64Array(4),T=this.position;return s.conjugate(b,this._orientation),s.scale$2(T,T,-r),s.fromQuat(m,b),s.translate(m,m,T),m[1]*=-1,m[5]*=-1,m[9]*=-1,m[13]*=-1,m[8]*=c,m[9]*=c,m[10]*=c,m[11]*=c,m}getCameraToClipPerspective(r,c,m,b){const T=new Float64Array(16);return s.perspective(T,r,c,m,b),T}getDistanceToElevation(r,c=!1){const m=0===r?0:s.mercatorZfromAltitude(r,c?s.latFromMercatorY(this.position[1]):this.position[1]),b=this.forward();return(m-this.position[2])/b[2]}clone(){return new Xi([...this.position],[...this.orientation])}}function pr(f,r){const c=Vi(f.projection,f.zoom,f.width,f.height),m=function(T,O,L,Z,q){const W=new s.LngLat(L.lng-180*Tr,L.lat),se=new s.LngLat(L.lng+180*Tr,L.lat),Oe=T.project(W.lng,W.lat),$e=T.project(se.lng,se.lat),We=-Math.atan2($e.y-Oe.y,$e.x-Oe.x),qe=s.MercatorCoordinate.fromLngLat(L);qe.y=s.clamp(qe.y,-1+Tr,1-Tr);const Ke=qe.toLngLat(),ce=T.project(Ke.lng,Ke.lat),Ve=s.MercatorCoordinate.fromLngLat(Ke);Ve.x+=Tr;const rt=Ve.toLngLat(),ot=T.project(rt.lng,rt.lat),Tt=ao(ot.x-ce.x,ot.y-ce.y,We),Mt=s.MercatorCoordinate.fromLngLat(Ke);Mt.y+=Tr;const Dt=Mt.toLngLat(),$t=T.project(Dt.lng,Dt.lat),zt=ao($t.x-ce.x,$t.y-ce.y,We),dn=Math.abs(Tt.x)/Math.abs(zt.y),Vn=s.identity([]);s.rotateZ(Vn,Vn,-We*(1-(q?0:Z)));const on=s.identity([]);return s.scale(on,on,[1,1-(1-dn)*Z,1]),on[4]=-zt.x/zt.y*Z,s.rotateZ(on,on,We),s.multiply(on,Vn,on),on}(f.projection,0,f.center,c,r),b=sr(f);return s.scale(m,m,[b,b,1]),m}function sr(f){const r=f.projection,c=Vi(f.projection,f.zoom,f.width,f.height),m=ho(r,f.center),b=ho(r,s.LngLat.convert(r.center));return Math.pow(2,m*c+(1-c)*b)}function Vi(f,r,c,m,b=1/0){const T=f.range;if(!T)return 0;const O=Math.min(b,Math.max(c,m)),L=Math.log(O/1024)/Math.LN2;return s.smoothstep(T[0]+L,T[1]+L,r)}const Tr=1/4e4;function ho(f,r){const c=s.clamp(r.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),m=new s.LngLat(r.lng-180*Tr,c),b=new s.LngLat(r.lng+180*Tr,c),T=f.project(m.lng,c),O=f.project(b.lng,c),L=s.MercatorCoordinate.fromLngLat(m),Z=s.MercatorCoordinate.fromLngLat(b),q=O.x-T.x,W=O.y-T.y,se=Z.x-L.x,Oe=Z.y-L.y,$e=Math.sqrt((se*se+Oe*Oe)/(q*q+W*W));return Math.log($e)/Math.LN2}function ao(f,r,c){const m=Math.cos(c),b=Math.sin(c);return{x:f*m-r*b,y:f*b+r*m}}class ps{constructor(r,c,m,b,T,O,L){this.tileSize=512,this._renderWorldCopies=void 0===T||T,this._minZoom=r||0,this._maxZoom=c||22,this._minPitch=m??0,this._maxPitch=b??60,this.setProjection(O),this.setMaxBounds(L),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new He,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Xi,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const r=new ps(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return r._elevation=this._elevation,r._centerAltitude=this._centerAltitude,r._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,r.tileSize=this.tileSize,r.mercatorFromTransition=this.mercatorFromTransition,r.width=this.width,r.height=this.height,r.cameraElevationReference=this.cameraElevationReference,r._center=this._center,r._setZoom(this.zoom),r._seaLevelZoom=this._seaLevelZoom,r.angle=this.angle,r._fov=this._fov,r._pitch=this._pitch,r._nearZ=this._nearZ,r._farZ=this._farZ,r._averageElevation=this._averageElevation,r._unmodified=this._unmodified,r._edgeInsets=this._edgeInsets.clone(),r._camera=this._camera.clone(),r._calcMatrices(),r.freezeTileCoverage=this.freezeTileCoverage,r.frustumCorners=this.frustumCorners,r}get elevation(){return this._elevation}set elevation(r){this._elevation!==r&&(this._elevation=r,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(r,c=!1){const m=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||m)&&this._updateCameraOnTerrain(),(r||m)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const m=!J(c,this.getProjection());return m&&this._calcMatrices(),this.mercatorFromTransition=!1,m}setMercatorFromTransition(){const r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const c=r!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(r){this._minZoom!==r&&(this._minZoom=r,this.zoom=Math.max(this.zoom,r))}get maxZoom(){return this._maxZoom}set maxZoom(r){this._maxZoom!==r&&(this._maxZoom=r,this.zoom=Math.min(this.zoom,r))}get minPitch(){return this._minPitch}set minPitch(r){this._minPitch!==r&&(this._minPitch=r,this.pitch=Math.max(this.pitch,r))}get maxPitch(){return this._maxPitch}set maxPitch(r){this._maxPitch!==r&&(this._maxPitch=r,this.pitch=Math.min(this.pitch,r))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(r){void 0===r?r=!0:null===r&&(r=!1),this._renderWorldCopies=r}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get cameraWorldSize(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(r){this.rotation=r}get rotation(){return-this.angle/Math.PI*180}set rotation(r){const c=-r*Math.PI/180;var m,b,T,O,L,Z,q,W,se,Oe;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=(m=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m),b=this.rotationMatrix,O=this.angle,L=(T=this.rotationMatrix)[0],Z=T[1],q=T[2],W=T[3],se=Math.sin(O),Oe=Math.cos(O),b[0]=L*Oe+q*se,b[1]=Z*Oe+W*se,b[2]=L*-se+q*Oe,b[3]=Z*-se+W*Oe)}get pitch(){return this._pitch/Math.PI*180}set pitch(r){const c=s.clamp(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const r=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/r)}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=s.degToRad(r),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(r){this._averageElevation=r,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(r){const c=Math.min(Math.max(r,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(r){this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const r=this._elevation;this._centerAltitude=r.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=r.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const r=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],m=this.horizonLineFromTop();let b=0,T=0;for(let O=0;Or.maxzoom&&(c=r.maxzoom);const O=this.locationCoordinate(this.center),L=this.center.lat,Z=1<{const Gn=new s.MercatorCoordinate(sn.x+25e-6,sn.y,sn.z),Ln=new s.MercatorCoordinate(sn.x,sn.y+25e-6,sn.z),Wn=sn.toLngLat(),Di=Gn.toLngLat(),Gi=Ln.toLngLat(),hi=this.locationCoordinate(Wn),Pi=this.locationCoordinate(Di),ur=this.locationCoordinate(Gi),dr=Math.hypot(Pi.x-hi.x,Pi.y-hi.y),xi=Math.hypot(ur.x-hi.x,ur.y-hi.y);return Math.sqrt(dr*xi)*Tt/25e-6},Dt=sn=>{const An=rt,Gn=ot;return{aabb:s.tileAABB(this,Z,0,0,0,sn,Gn,An,this.projection),zoom:0,x:0,y:0,minZ:Gn,maxZ:An,wrap:sn,fullyVisible:!1}},$t=[];let zt=[];const dn=c,Vn=r.reparseOverscaled?m:c,on=sn=>sn*sn,Rn=on((qe-this._centerAltitude)*We),un=sn=>{if(!this._elevation||!sn.tileID||!T)return;const An=this._elevation.getMinMaxForTile(sn.tileID),Gn=sn.aabb;An?(Gn.min[2]=An.min,Gn.max[2]=An.max,Gn.center[2]=(Gn.min[2]+Gn.max[2])/2):(sn.shouldSplit=Zn(sn),sn.shouldSplit||(Gn.min[2]=Gn.max[2]=Gn.center[2]=this._centerAltitude))},Zn=sn=>{if(sn.zoom=.9)return!0}else if(b&&(Ln=on(sn.aabb.distanceZ(Ke)*We)),this.projection.isReprojectedInTileSpace&&m<=5){const hi=Math.pow(2,sn.zoom),Pi=Mt(new s.MercatorCoordinate((sn.x+.5)/hi,(sn.y+.5)/hi));Wn=Pi>.85?1:Pi}const Di=An*An+Gn*Gn+Ln;return Di{if(Pi*on(.707)0;){const sn=$t.pop(),An=sn.x,Gn=sn.y;let Ln=sn.fullyVisible;if(!Ln){const Wn=sn.aabb.intersects(Oe);if(0===Wn)continue;Ln=2===Wn}if(sn.zoom!==dn&&Zn(sn))for(let Wn=0;Wn<4;Wn++){const Di=(An<<1)+Wn%2,Gi=(Gn<<1)+(Wn>>1),hi={aabb:T?sn.aabb.quadrant(Wn):s.tileAABB(this,Z,sn.zoom+1,Di,Gi,sn.wrap,sn.minZ,sn.maxZ,this.projection),zoom:sn.zoom+1,x:Di,y:Gi,wrap:sn.wrap,fullyVisible:Ln,tileID:void 0,shouldSplit:void 0,minZ:sn.minZ,maxZ:sn.maxZ};b&&!W&&(hi.tileID=new s.OverscaledTileID(sn.zoom+1===dn?Vn:sn.zoom+1,sn.wrap,sn.zoom+1,Di,Gi),un(hi)),$t.push(hi)}else{const Wn=sn.zoom===dn?Vn:sn.zoom;if(r.minzoom&&r.minzoom>Wn)continue;const Di=q[0]-(.5+An+(sn.wrap<{const Ln=[0,0,0,1],Wn=[s.EXTENT,s.EXTENT,0,1],Di=this.calculateFogTileMatrix(Gn.tileID.toUnwrapped());s.transformMat4$1(Ln,Ln,Di),s.transformMat4$1(Wn,Wn,Di);const Gi=s.getAABBPointSquareDist(Ln,Wn);if(0===Gi)return!0;let hi=!1;const Pi=this._elevation;if(Pi&&Gi>sn&&0!==An){const ur=this.calculateProjMatrix(Gn.tileID.toUnwrapped());let dr;r.isTerrainDEM||(dr=Pi.getMinMaxForTile(Gn.tileID)),dr||(dr={min:ot,max:rt});const xi=s.furthestTileCorner(this.rotation),Cr=[xi[0]*s.EXTENT,xi[1]*s.EXTENT,dr.max];s.transformMat4(Cr,Cr,ur),hi=(1-Cr[1])*this.height*.5sn.distanceSq-An.distanceSq).map(sn=>sn.tileID)}resize(r,c){this.width=r,this.height=c,this.pixelsToGLUnits=[2/r,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(r){return Math.pow(2,r)}scaleZoom(r){return Math.log(r)/Math.LN2}project(r){const c=s.clamp(r.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),m=this.projection.project(r.lng,c);return new s.Point(m.x*this.worldSize,m.y*this.worldSize)}unproject(r){return this.projection.unproject(r.x/this.worldSize,r.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,c){let m,b;const T=this.centerPoint;if("globe"===this.projection.name){const L=this.worldSize;m=(c.x-T.x)/L,b=(c.y-T.y)/L}else{const L=this.pointCoordinate(c),Z=this.pointCoordinate(T);m=L.x-Z.x,b=L.y-Z.y}const O=this.locationCoordinate(r);this.setLocation(new s.MercatorCoordinate(O.x-m,O.y-b))}setLocation(r){this.center=this.coordinateLocation(r),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(r){return this.projection.locationPoint(this,r)}locationPoint3D(r){return this.projection.locationPoint(this,r,!0)}pointLocation(r){return this.coordinateLocation(this.pointCoordinate(r))}pointLocation3D(r){return this.coordinateLocation(this.pointCoordinate3D(r))}locationCoordinate(r,c){const m=c?s.mercatorZfromAltitude(c,r.lat):void 0,b=this.projection.project(r.lng,r.lat);return new s.MercatorCoordinate(b.x,b.y,m)}coordinateLocation(r){return this.projection.unproject(r.x,r.y)}pointRayIntersection(r,c){const m=c??this._centerAltitude,b=[r.x,r.y,0,1],T=[r.x,r.y,1,1];s.transformMat4$1(b,b,this.pixelMatrixInverse),s.transformMat4$1(T,T,this.pixelMatrixInverse);const O=T[3];s.scale$1(b,b,1/b[3]),s.scale$1(T,T,1/O);const L=b[2],Z=T[2];return{p0:b,p1:T,t:L===Z?0:(m-L)/(Z-L)}}screenPointToMercatorRay(r){const c=[r.x,r.y,0,1],m=[r.x,r.y,1,1];return s.transformMat4$1(c,c,this.pixelMatrixInverse),s.transformMat4$1(m,m,this.pixelMatrixInverse),s.scale$1(c,c,1/c[3]),s.scale$1(m,m,1/m[3]),c[2]=s.mercatorZfromAltitude(c[2],this._center.lat)*this.worldSize,m[2]=s.mercatorZfromAltitude(m[2],this._center.lat)*this.worldSize,s.scale$1(c,c,1/this.worldSize),s.scale$1(m,m,1/this.worldSize),new s.Ray([c[0],c[1],c[2]],s.normalize([],s.sub([],m,c)))}rayIntersectionCoordinate(r){const{p0:c,p1:m,t:b}=r,T=s.mercatorZfromAltitude(c[2],this._center.lat),O=s.mercatorZfromAltitude(m[2],this._center.lat);return new s.MercatorCoordinate(s.number(c[0],m[0],b)/this.worldSize,s.number(c[1],m[1],b)/this.worldSize,s.number(T,O,b))}pointCoordinate(r,c=this._centerAltitude){return this.projection.pointCoordinate(this,r.x,r.y,c)}pointCoordinate3D(r){if(!this.elevation)return this.pointCoordinate(r);let c=this.projection.pointCoordinate3D(this,r.x,r.y);if(c)return new s.MercatorCoordinate(c[0],c[1],c[2]);let m=0,b=this.horizonLineFromTop();if(r.y>b)return this.pointCoordinate(r);const T=.02*b,O=r.clone();for(let L=0;L<10&&b-m>T;L++){O.y=s.number(m,b,.66);const Z=this.projection.pointCoordinate3D(this,O.x,O.y);Z?(b=O.y,c=Z):m=O.y}return c?new s.MercatorCoordinate(c[0],c[1],c[2]):this.pointCoordinate(r)}isPointAboveHorizon(r){return this.projection.isPointAboveHorizon(this,r)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(r);const c=this.pointCoordinate(r);return c.y>=0&&c.y<=1}_coordinatePoint(r,c){const m=c&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,b=[r.x*this.worldSize,r.y*this.worldSize,m+r.toAltitude(),1];return s.transformMat4$1(b,b,this.pixelMatrix),b[3]>0?new s.Point(b[0]/b[3],b[1]/b[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:r,left:c}=this._edgeInsets,m=this.height-this._edgeInsets.bottom,b=this.width-this._edgeInsets.right,T=this.pointLocation3D(new s.Point(c,r)),O=this.pointLocation3D(new s.Point(b,r)),L=this.pointLocation3D(new s.Point(b,m)),Z=this.pointLocation3D(new s.Point(c,m));let q=Math.min(T.lng,O.lng,L.lng,Z.lng),W=Math.max(T.lng,O.lng,L.lng,Z.lng),se=Math.min(T.lat,O.lat,L.lat,Z.lat),Oe=Math.max(T.lat,O.lat,L.lat,Z.lat);const $e=Math.pow(2,-this.zoom)/16*270,We="globe"===this.projection.name?1:4,qe=(Ke,ce,Ve,rt,ot)=>{const Tt=(Ke+Ve)/2,Mt=(ce+rt)/2,Dt=new s.Point(Tt,Mt),{lng:$t,lat:zt}=this.pointLocation3D(Dt),dn=Math.max(0,q-$t,se-zt,$t-W,zt-Oe);q=Math.min(q,$t),W=Math.max(W,$t),se=Math.min(se,zt),Oe=Math.max(Oe,zt),(ot$e)&&(qe(Ke,ce,Tt,Mt,ot+1),qe(Tt,Mt,Ve,rt,ot+1))};if(qe(c,r,b,r,1),qe(b,r,b,m,1),qe(b,m,c,m,1),qe(c,m,c,r,1),"globe"===this.projection.name){const[Ke,ce]=s.polesInViewport(this);Ke?(Oe=90,W=180,q=-180):ce&&(se=-90,W=180,q=-180)}return new s.LngLatBounds(new s.LngLat(q,se),new s.LngLat(W,Oe))}_getBoundsRectangular(r,c){const{top:m,left:b}=this._edgeInsets,T=this.height-this._edgeInsets.bottom,O=this.width-this._edgeInsets.right,L=new s.Point(b,m),Z=new s.Point(O,m),q=new s.Point(O,T),W=new s.Point(b,T);let se=this.pointCoordinate(L,r),Oe=this.pointCoordinate(Z,r);const $e=this.pointCoordinate(q,c),We=this.pointCoordinate(W,c),qe=(Ke,ce)=>(ce.y-Ke.y)/(ce.x-Ke.x);return se.y>1&&Oe.y>=0?se=new s.MercatorCoordinate((1-We.y)/qe(We,se)+We.x,1):se.y<0&&Oe.y<=1&&(se=new s.MercatorCoordinate(-We.y/qe(We,se)+We.x,0)),Oe.y>1&&se.y>=0?Oe=new s.MercatorCoordinate((1-$e.y)/qe($e,Oe)+$e.x,1):Oe.y<0&&se.y<=1&&(Oe=new s.MercatorCoordinate(-$e.y/qe($e,Oe)+$e.x,0)),(new s.LngLatBounds).extend(this.coordinateLocation(se)).extend(this.coordinateLocation(Oe)).extend(this.coordinateLocation(We)).extend(this.coordinateLocation($e))}_getBoundsRectangularTerrain(){const r=this.elevation;if(!r.visibleDemTiles.length||r.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=r.visibleDemTiles.reduce((m,b)=>{if(b.dem){const T=b.dem.tree;m.min=Math.min(m.min,T.minimums[0]),m.max=Math.max(m.max,T.maximums[0])}return m},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*r.exaggeration(),c.max*r.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(r=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,m=this.height/2-c*(1-this._horizonShift);return r?Math.max(0,m):m}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLngse&&(L=se-q),se-W$e&&(O=$e-Z),$e-Oe.5?rt-1:rt,ot>.5?ot-1:ot,0]),this.alignedProjMatrix=Tt,L=s.create(),s.scale(L,L,[this.width/2,-this.height/2,1]),s.translate(L,L,[1,-1,0]),this.labelPlaneMatrix=L,L=s.create(),s.scale(L,L,[1,-1,1]),s.translate(L,L,[-1,-1,0]),s.scale(L,L,[2/this.width,2/this.height,1]),this.glCoordMatrix=L,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},L=s.invert(new Float64Array(16),this.pixelMatrix),!L)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=L,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const Mt=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(Mt,Mt,T),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=L;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const r=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,m=this._camera.position,b=1/this.height/this._pixelsPerMercatorPixel,T=[r,r,c];s.scale$2(T,T,b),s.scale$2(m,m,-1),s.multiply$2(m,m,T);const O=s.create();s.translate(O,O,m),s.scale(O,O,T),this.mercatorFogMatrix=O,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,c,b)}_computeCameraPosition(r){const c=(r=r||this.pixelsPerMeter)/this.pixelsPerMeter,m=this._camera.forward(),b=this.point,T=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-r/this.worldSize*this._centerAltitude;return[b.x/this.worldSize-m[0]*T,b.y/this.worldSize-m[1]*T,r/this.worldSize*this._centerAltitude-m[2]*T]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),m=this._camera.position[2],b=r[2];let T=1;this.projection.wrap&&(this.center=this.center.wrap()),b>0&&(T=Math.min((c-m)/b,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,r,T),this._updateStateFromCamera()}_updateStateFromCamera(){const r=this._camera.position,c=this._camera.forward(),{pitch:m,bearing:b}=this._camera.getPitchBearing(),T=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,O=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),L=Math.max((r[2]-T)/Math.cos(m),O),Z=this._zoomFromMercatorZ(L);s.scaleAndAdd(r,r,c,L),this._pitch=s.clamp(m,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(b,-Math.PI,Math.PI),this._setZoom(s.clamp(Z,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(r){return Math.pow(2,r)*this.tileSize}_mercatorZfromZoom(r){return this.cameraToCenterDistance/this._worldSizeFromZoom(r)}_minimumHeightOverTerrain(){const r=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(r)}_zoomFromMercatorZ(r){return this.scaleZoom(this.cameraToCenterDistance/(r*this.tileSize))}zoomFromMercatorZAdjusted(r){let c=0,m=s.GLOBE_ZOOM_THRESHOLD_MAX,b=0,T=1/0;for(;m-c>1e-6&&m>c;){const O=c+.5*(m-c),L=this.tileSize*Math.pow(2,O),Z=this.getCameraToCenterDistance(this.projection,O,L),q=this.scaleZoom(Z/(r*this.tileSize)),W=Math.abs(O-q);Wq||Oe.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(r,c){const m=s.length(s.sub([],this._camera.position,r)),b=this._zoomFromMercatorZ(m)+c;return m-this._mercatorZfromZoom(b)}getCameraPoint(){if("globe"===this.projection.name){const r=function([c,m,b],T){const O=[c,m,b,1];s.transformMat4$1(O,O,T);const L=O[3]=Math.max(O[3],1e-6);return O[0]/=L,O[1]/=L,O[2]/=L,O}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(r[0],r[1])}{const r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,r))}}getCameraToCenterDistance(r,c=this.zoom,m=this.worldSize){const b=Vi(r,c,this.width,this.height,1024),T=r.pixelSpaceConversion(this.center.lat,m,b);return.5/Math.tan(.5*this._fov)*this.height*T}getWorldToCameraMatrix(){const r=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&s.multiply(r,r,this.globeMatrix),r}}function ss(f,r){let c=!1,m=null;const b=()=>{m=null,c&&(f(),m=setTimeout(b,r),c=!1)};return()=>(c=!0,m||b(),m)}class No{constructor(r){this._hashName=r&&encodeURIComponent(r),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=ss(this._updateHashUnthrottled.bind(this),300)}addTo(r){return this._map=r,s.window.addEventListener("hashchange",this._onHashChange,!1),r.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const r=this._map;if(!r)return"";const c=fo(r);if(this._hashName){const m=this._hashName;let b=!1;const T=s.window.location.hash.slice(1).split("&").map(O=>{const L=O.split("=")[0];return L===m?(b=!0,`${L}=${c}`):O}).filter(O=>O);return b||T.push(`${m}=${c}`),`#${T.join("&")}`}return`#${c}`}_getCurrentHash(){const r=s.window.location.hash.replace("#","");if(this._hashName){let c;return r.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(c=m)}),(c&&c[1]||"").split("/")}return r.split("/")}_onHashChange(){const r=this._map;if(!r)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(m=>isNaN(m))){const m=r.dragRotate.isEnabled()&&r.touchZoomRotate.isEnabled()?+(c[3]||0):r.getBearing();return r.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:m,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const r=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,r)}}function fo(f,r){const c=f.getCenter(),m=Math.round(100*f.getZoom())/100,b=Math.ceil((m*Math.LN2+Math.log(512/360/.5))/Math.LN10),T=Math.pow(10,b),O=Math.round(c.lng*T)/T,L=Math.round(c.lat*T)/T,Z=f.getBearing(),q=f.getPitch();let W=r?`/${O}/${L}/${m}`:`${m}/${L}/${O}`;return(Z||q)&&(W+="/"+Math.round(10*Z)/10),q&&(W+=`/${Math.round(q)}`),W}const as={linearity:.3,easing:s.bezier(0,0,.3,1)},Ys=s.extend({deceleration:2500,maxSpeed:1400},as),mc=s.extend({deceleration:20,maxSpeed:1400},as),ai=s.extend({deceleration:1e3,maxSpeed:360},as),Js=s.extend({deceleration:1e3,maxSpeed:90},as);class Su{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,c=s.exported.now();for(;r.length>0&&c-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:T}of this._inertiaBuffer)c.zoom+=T.zoomDelta||0,c.bearing+=T.bearingDelta||0,c.pitch+=T.pitchDelta||0,T.panDelta&&c.pan._add(T.panDelta),T.around&&(c.around=T.around),T.pinchAround&&(c.pinchAround=T.pinchAround);const m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,b={};if(c.pan.mag()){const T=Cl(c.pan.mag(),m,s.extend({},Ys,r||{}));b.offset=c.pan.mult(T.amount/c.pan.mag()),b.center=this._map.transform.center,es(b,T)}if(c.zoom){const T=Cl(c.zoom,m,mc);b.zoom=this._map.transform.zoom+T.amount,es(b,T)}if(c.bearing){const T=Cl(c.bearing,m,ai);b.bearing=this._map.transform.bearing+s.clamp(T.amount,-179,179),es(b,T)}if(c.pitch){const T=Cl(c.pitch,m,Js);b.pitch=this._map.transform.pitch+T.amount,es(b,T)}if(b.zoom||b.bearing){const T=void 0===c.pinchAround?c.around:c.pinchAround;b.around=T?this._map.unproject(T):this._map.getCenter()}return this.clear(),b.noMoveStart=!0,b}}function es(f,r){(!f.duration||f.durationc.unproject(Z)),L=T.reduce((Z,q,W,se)=>Z.add(q.div(se.length)),new s.Point(0,0));super(r,{points:T,point:L,lngLats:O,lngLat:c.unproject(L),originalEvent:m}),this._defaultPrevented=!1}}class $i extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,c,m){super(r,{originalEvent:m}),this._defaultPrevented=!1}}class gc{constructor(r,c){this._map=r,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(r){return this._firePreventable(new $i(r.type,this._map,r))}mousedown(r,c){return this._mousedownPos=c,this._firePreventable(new zo(r.type,this._map,r))}mouseup(r){this._map.fire(new zo(r.type,this._map,r))}preclick(r){const c=s.extend({},r);c.type="preclick",this._map.fire(new zo(c.type,this._map,c))}click(r,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(r),this._map.fire(new zo(r.type,this._map,r)))}dblclick(r){return this._firePreventable(new zo(r.type,this._map,r))}mouseover(r){this._map.fire(new zo(r.type,this._map,r))}mouseout(r){this._map.fire(new zo(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Za(r.type,this._map,r))}touchmove(r){this._map.fire(new Za(r.type,this._map,r))}touchend(r){this._map.fire(new Za(r.type,this._map,r))}touchcancel(r){this._map.fire(new Za(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class _c{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(r){this._map.fire(new zo(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._map.fire(new zo(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class bd{constructor(r,c){this._map=r,this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,c){this.isEnabled()&&r.shiftKey&&0===r.button&&(ae(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(r,c){if(!this._active)return;const m=c,b=this._startPos,T=this._lastPos;if(!b||!T||T.equals(m)||!this._box&&m.dist(b){this._box&&(this._box.style.transform=`translate(${O}px,${Z}px)`,this._box.style.width=L-O+"px",this._box.style.height=q-Z+"px")})}mouseupWindow(r,c){if(!this._active)return;const m=this._startPos,b=c;if(m&&0===r.button){if(this.reset(),Ie(),m.x!==b.x||m.y!==b.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:r})),{cameraAnimation:T=>T.fitScreenCoordinates(m,b,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}keydown(r){this._active&&27===r.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",r))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),oe(),delete this._startPos,delete this._lastPos}_fireEvent(r,c){return this._map.fire(new s.Event(r,{originalEvent:c}))}}function Hc(f,r){const c={};for(let m=0;mthis.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=r.timeStamp),m.length===this.numTouches&&(this.centroid=function(b){const T=new s.Point(0,0);for(const O of b)T._add(O);return T.div(b.length)}(c),this.touches=Hc(m,c)))}touchmove(r,c,m){if(this.aborted||!this.centroid)return;const b=Hc(m,c);for(const T in this.touches){const O=b[T];(!O||O.dist(this.touches[T])>30)&&(this.aborted=!0)}}touchend(r,c,m){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),0===m.length){const b=!this.aborted&&this.centroid;if(this.reset(),b)return b}}}class Tl{constructor(r){this.singleTap=new El(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(r,c,m){this.singleTap.touchstart(r,c,m)}touchmove(r,c,m){this.singleTap.touchmove(r,c,m)}touchend(r,c,m){const b=this.singleTap.touchend(r,c,m);if(b){const T=r.timeStamp-this.lastTime<500,O=!this.lastTap||this.lastTap.dist(b)<30;if(T&&O||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}class rl{constructor(){this._zoomIn=new Tl({numTouches:1,numTaps:2}),this._zoomOut=new Tl({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,c,m){this._zoomIn.touchstart(r,c,m),this._zoomOut.touchstart(r,c,m)}touchmove(r,c,m){this._zoomIn.touchmove(r,c,m),this._zoomOut.touchmove(r,c,m)}touchend(r,c,m){const b=this._zoomIn.touchend(r,c,m),T=this._zoomOut.touchend(r,c,m);return b?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:O=>O.easeTo({duration:300,zoom:O.getZoom()+1,around:O.unproject(b)},{originalEvent:r})}):T?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:O=>O.easeTo({duration:300,zoom:O.getZoom()-1,around:O.unproject(T)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const wd={0:1,2:2};class ol{constructor(r){this.reset(),this._clickTolerance=r.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(r,c){return!1}_move(r,c){return{}}mousedown(r,c){if(this._lastPoint)return;const m=et(r);this._correctButton(r,m)&&(this._lastPoint=c,this._eventButton=m)}mousemoveWindow(r,c){const m=this._lastPoint;if(m)if(r.preventDefault(),null!=this._eventButton&&function(b,T){const O=wd[T];return void 0===b.buttons||(b.buttons&O)!==O}(r,this._eventButton))this.reset();else if(this._moved||!(c.dist(m)0&&(this._active=!0);const b=Hc(m,c),T=new s.Point(0,0),O=new s.Point(0,0);let L=0;for(const q in b){const W=b[q],se=this._touches[q];se&&(T._add(W),O._add(W.sub(se)),L++,b[q]=W)}if(this._touches=b,L{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class wr{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(r){}_move(r,c,m){return{}}touchstart(r,c,m){this._firstTwoTouches||m.length<2||(this._firstTwoTouches=[m[0].identifier,m[1].identifier],this._start([c[0],c[1]]))}touchmove(r,c,m){const b=this._firstTwoTouches;if(!b)return;r.preventDefault();const[T,O]=b,L=sl(m,c,T),Z=sl(m,c,O);if(!L||!Z)return;const q=this._aroundCenter?null:L.add(Z).div(2);return this._move([L,Z],q,r)}touchend(r,c,m){if(!this._firstTwoTouches)return;const[b,T]=this._firstTwoTouches,O=sl(m,c,b),L=sl(m,c,T);O&&L||(this._active&&Ie(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&"center"===r.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function sl(f,r,c){for(let m=0;mMath.abs(f.x)}class Hl extends wr{constructor(r){super(),this._map=r}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(r){this._lastPoints=r,ms(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,c,m){const b=this._lastPoints;if(!b)return;const T=r[0].sub(b[0]),O=r[1].sub(b[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&m.touches.length<3||(this._valid=this.gestureBeginsVertically(T,O,m.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:(T.y+O.y)/2*-.5})}gestureBeginsVertically(r,c,m){if(void 0!==this._valid)return this._valid;const b=r.mag()>=2,T=c.mag()>=2;if(!b&&!T)return;if(!b||!T)return null==this._firstMove&&(this._firstMove=m),m-this._firstMove<100&&void 0;const O=r.y>0==c.y>0;return ms(r)&&ms(c)&&O}}const vc={panStep:100,bearingStep:15,pitchStep:10};class _h{constructor(){const r=vc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let c=0,m=0,b=0,T=0,O=0;switch(r.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:r.shiftKey?m=-1:(r.preventDefault(),T=-1);break;case 39:r.shiftKey?m=1:(r.preventDefault(),T=1);break;case 38:r.shiftKey?b=1:(r.preventDefault(),O=-1);break;case 40:r.shiftKey?b=-1:(r.preventDefault(),O=1);break;default:return}return this._rotationDisabled&&(m=0,b=0),{cameraAnimation:L=>{const Z=L.getZoom();L.easeTo({duration:300,easeId:"keyboardHandler",easing:yh,zoom:c?Math.round(Z)+c*(r.shiftKey?2:1):Z,bearing:L.getBearing()+m*this._bearingStep,pitch:L.getPitch()+b*this._pitchStep,offset:[-T*this._panStep,-O*this._panStep],center:L.getCenter()},{originalEvent:r})}}}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 yh(f){return f*(2-f)}const qc=4.000244140625;class gs{constructor(r,c){this._map=r,this._el=r.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&"center"===r.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=r.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const m=s.exported.now(),b=m-(this._lastWheelEventTime||0);this._lastWheelEventTime=m,0!==c&&c%qc==0?this._type="wheel":0!==c&&Math.abs(c)<4?this._type="trackpad":b>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(b*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),r.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=r,this._delta-=c,this._active||this._start(r)),r.preventDefault()}_onTimeout(r){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)}_start(r){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 c=Ee(this._el,r);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._map.transform;"wheel"===this._type&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(0!==this._delta){const Z="wheel"===this._type&&Math.abs(this._delta)>qc?this._wheelZoomRate:this._defaultZoomRate;let q=2/(1+Math.exp(-Math.abs(this._delta*Z)));this._delta<0&&0!==q&&(q=1/q);const W=c(),se=Math.pow(2,W),Oe="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):se;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(Oe*q))),"wheel"===this._type&&(this._startZoom=W,this._easing=this._smoothOutEasing(200)),this._delta=0}const m="number"==typeof this._targetZoom?this._targetZoom:c(),b=this._startZoom,T=this._easing;let O,L=!1;if("wheel"===this._type&&b&&T){const Z=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),q=T(Z);O=s.number(b,m,q),Z<1?this._frameId||(this._frameId=!0):L=!0}else O=m,L=!0;return this._active=!0,L&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!L,zoomDelta:O-c(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let c=s.ease;if(this._prevEase){const m=this._prevEase,b=(s.exported.now()-m.start)/m.duration,T=m.easing(b+.01)-m.easing(b),O=.27/Math.sqrt(T*T+1e-4)*.01,L=Math.sqrt(.0729-O*O);c=s.bezier(O,L,.25,1)}return this._prevEase={start:s.exported.now(),duration:r,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=Ne("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Da{constructor(r,c){this._clickZoom=r,this._tapZoom=c}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 ts{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(r,c){return r.preventDefault(),{cameraAnimation:m=>{m.easeTo({duration:300,zoom:m.getZoom()+(r.shiftKey?-1:1),around:m.unproject(c)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Il{constructor(){this._tap=new Tl({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(r,c,m){this._swipePoint||(this._tapTime&&r.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?m.length>0&&(this._swipePoint=c[0],this._swipeTouch=m[0].identifier):this._tap.touchstart(r,c,m))}touchmove(r,c,m){if(this._tapTime){if(this._swipePoint){if(m[0].identifier!==this._swipeTouch)return;const b=c[0],T=b.y-this._swipePoint.y;return this._swipePoint=b,r.preventDefault(),this._active=!0,{zoomDelta:T/128}}}else this._tap.touchmove(r,c,m)}touchend(r,c,m){this._tapTime?this._swipePoint&&0===m.length&&this.reset():this._tap.touchend(r,c,m)&&(this._tapTime=r.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pa{constructor(r,c,m){this._el=r,this._mousePan=c,this._touchPan=m}enable(r){this._inertiaOptions=r||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Cd{constructor(r,c,m){this._pitchWithRotate=r.pitchWithRotate,this._mouseRotate=c,this._mousePitch=m}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ou{constructor(r,c,m,b){this._el=r,this._touchZoom=c,this._touchRotate=m,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const Ks=f=>f.zoom||f.drag||f.pitch||f.rotate;class Ru extends s.Event{}class Yc{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,c){const m=s.sub([],c,r);this.radius=s.length(m[2]<0?s.div([],m,this.constants):[m[0],m[1],0])}projectRay(r){s.div(r,r,this.constants),s.normalize(r,r),s.mul$1(r,r,this.constants);const c=s.scale$2([],r,this.radius);if(c[2]>0){const m=s.scale$2([],[0,0,1],s.dot(c,[0,0,1])),b=s.scale$2([],s.normalize([],[c[0],c[1],0]),this.radius),T=s.add([],c,s.scale$2([],s.sub([],s.add([],b,m),c),2));c[0]=T[0],c[1]=T[1]}return c}}function js(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class Xs{constructor(r,c){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Su(r),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Yc,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),s.bindAll(["handleEvent","handleWindowEvent"],this);const m=this._el;this._listeners=[[m,"touchstart",{passive:!0}],[m,"touchmove",{passive:!1}],[m,"touchend",void 0],[m,"touchcancel",void 0],[m,"mousedown",void 0],[m,"mousemove",void 0],[m,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[m,"mouseover",void 0],[m,"mouseout",void 0],[m,"dblclick",void 0],[m,"click",void 0],[m,"keydown",{capture:!1}],[m,"keyup",void 0],[m,"wheel",{passive:!1}],[m,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[b,T,O]of this._listeners)b.addEventListener(T,b===s.window.document?this.handleWindowEvent:this.handleEvent,O)}destroy(){for(const[r,c,m]of this._listeners)r.removeEventListener(c,r===s.window.document?this.handleWindowEvent:this.handleEvent,m)}_addDefaultHandlers(r){const c=this._map,m=c.getCanvasContainer();this._add("mapEvent",new gc(c,r));const b=c.boxZoom=new bd(c,r);this._add("boxZoom",b);const T=new rl,O=new ts;c.doubleClickZoom=new Da(O,T),this._add("tapZoom",T),this._add("clickZoom",O);const L=new Il;this._add("tapDragZoom",L);const Z=c.touchPitch=new Hl(c);this._add("touchPitch",Z);const q=new Wc(r),W=new Pu(r);c.dragRotate=new Cd(r,q,W),this._add("mouseRotate",q,["mousePitch"]),this._add("mousePitch",W,["mouseRotate"]);const se=new aa(r),Oe=new jn(c,r);c.dragPan=new pa(m,se,Oe),this._add("mousePan",se),this._add("touchPan",Oe,["touchZoom","touchRotate"]);const $e=new Dl,We=new Uo;c.touchZoomRotate=new Ou(m,We,$e,L),this._add("touchRotate",$e,["touchPan","touchZoom"]),this._add("touchZoom",We,["touchPan","touchRotate"]),this._add("blockableMapEvent",new _c(c));const qe=c.scrollZoom=new gs(c,this);this._add("scrollZoom",qe,["mousePan"]);const Ke=c.keyboard=new _h;this._add("keyboard",Ke);for(const ce of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])r.interactive&&r[ce]&&c[ce].enable(r[ce])}_add(r,c,m){this._handlers.push({handlerName:r,handler:c,allowed:m}),this._handlersById[r]=c}stop(r){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ks(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(r,c,m){for(const b in r)if(b!==m&&(!c||c.indexOf(b)<0))return!0;return!1}handleWindowEvent(r){this.handleEvent(r,`${r.type}Window`)}_getMapTouches(r){const c=[];for(const m of r)this._el.contains(m.target)&&c.push(m);return c}handleEvent(r,c){this._updatingCamera=!0;const m="renderFrame"===r.type,b=m?void 0:r,T={needsRenderFrame:!1},O={},L={},Z=r.touches?this._getMapTouches(r.touches):void 0,q=Z?Ue(this._el,Z):m?void 0:Ee(this._el,r);for(const{handlerName:Oe,handler:$e,allowed:We}of this._handlers){if(!$e.isEnabled())continue;let qe;this._blockedByActive(L,We,Oe)?$e.reset():$e[c||r.type]&&(qe=$e[c||r.type](r,q,Z),this.mergeHandlerResult(T,O,qe,Oe,b),qe&&qe.needsRenderFrame&&this._triggerRenderFrame()),(qe||$e.isActive())&&(L[Oe]=$e)}const W={};for(const Oe in this._previousActiveHandlers)L[Oe]||(W[Oe]=b);this._previousActiveHandlers=L,(Object.keys(W).length||js(T))&&(this._changes.push([T,O,W]),this._triggerRenderFrame()),(Object.keys(L).length||js(T))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:se}=T;se&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],se(this._map))}mergeHandlerResult(r,c,m,b,T){if(!m)return;s.extend(r,m);const O={handlerName:b,originalEvent:m.originalEvent||T};void 0!==m.zoomDelta&&(c.zoom=O),void 0!==m.panDelta&&(c.drag=O),void 0!==m.pitchDelta&&(c.pitch=O),void 0!==m.bearingDelta&&(c.rotate=O)}_applyChanges(){const r={},c={},m={};for(const[b,T,O]of this._changes)b.panDelta&&(r.panDelta=(r.panDelta||new s.Point(0,0))._add(b.panDelta)),b.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+b.zoomDelta),b.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+b.bearingDelta),b.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+b.pitchDelta),void 0!==b.around&&(r.around=b.around),void 0!==b.aroundCoord&&(r.aroundCoord=b.aroundCoord),void 0!==b.pinchAround&&(r.pinchAround=b.pinchAround),b.noInertia&&(r.noInertia=b.noInertia),s.extend(c,T),s.extend(m,O);this._updateMapTransform(r,c,m),this._changes=[]}_updateMapTransform(r,c,m){const b=this._map,T=b.transform,O=Ve=>[Ve.x,Ve.y,Ve.z];if((Ve=>{const rt=this._eventsInProgress.drag;return rt&&!this._handlersById[rt.handlerName].isActive()})()&&!js(r)){const Ve=T.zoom;T.cameraElevationReference="sea",T.recenterOnTerrain(),T.cameraElevationReference="ground",Ve!==T.zoom&&this._map._update(!0)}if(T._isCameraConstrained&&b._stop(!0),!js(r))return void this._fireEvents(c,m,!0);let{panDelta:L,zoomDelta:Z,bearingDelta:q,pitchDelta:W,around:se,aroundCoord:Oe,pinchAround:$e}=r;T._isCameraConstrained&&(Z>0&&(Z=0),T._isCameraConstrained=!1),void 0!==$e&&(se=$e),(Z||(Ve=>c.drag&&!this._eventsInProgress.drag)())&&se&&(this._dragOrigin=O(T.pointCoordinate3D(se)),this._trackingEllipsoid.setup(T._camera.position,this._dragOrigin)),T.cameraElevationReference="sea",b._stop(!0),se=se||b.transform.centerPoint,q&&(T.bearing+=q),W&&(T.pitch+=W),T._updateCameraState();const We=[0,0,0];if(L)if("mercator"===T.projection.name){const Ve=this._trackingEllipsoid.projectRay(T.screenPointToMercatorRay(se).dir),rt=this._trackingEllipsoid.projectRay(T.screenPointToMercatorRay(se.sub(L)).dir);We[0]=rt[0]-Ve[0],We[1]=rt[1]-Ve[1]}else{const Ve=T.pointCoordinate(se);if("globe"===T.projection.name){L=L.rotate(-T.angle);const rt=T._pixelsPerMercatorPixel/T.worldSize;We[0]=-L.x*s.mercatorScale(s.latFromMercatorY(Ve.y))*rt,We[1]=-L.y*s.mercatorScale(T.center.lat)*rt}else{const rt=T.pointCoordinate(se.sub(L));Ve&&rt&&(We[0]=rt.x-Ve.x,We[1]=rt.y-Ve.y)}}const qe=T.zoom,Ke=[0,0,0];if(Z){const Ve=O(Oe||T.pointCoordinate3D(se)),rt={dir:s.normalize([],s.sub([],Ve,T._camera.position))};if(rt.dir[2]<0){const ot=T.zoomDeltaToMovement(Ve,Z);s.scale$2(Ke,rt.dir,ot)}}const ce=s.add(We,We,Ke);T._translateCameraConstrained(ce),Z&&Math.abs(T.zoom-qe)>1e-4&&T.recenterOnTerrain(),T.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(c,m,!0)}_fireEvents(r,c,m){const b=Ks(this._eventsInProgress),T=Ks(r),O={};for(const W in r){const{originalEvent:se}=r[W];this._eventsInProgress[W]||(O[`${W}start`]=se),this._eventsInProgress[W]=r[W]}!b&&T&&this._fireEvent("movestart",T.originalEvent);for(const W in O)this._fireEvent(W,O[W]);T&&this._fireEvent("move",T.originalEvent);for(const W in r){const{originalEvent:se}=r[W];this._fireEvent(W,se)}const L={};let Z;for(const W in this._eventsInProgress){const{handlerName:se,originalEvent:Oe}=this._eventsInProgress[W];this._handlersById[se].isActive()||(delete this._eventsInProgress[W],Z=c[se]||Oe,L[`${W}end`]=Z)}for(const W in L)this._fireEvent(W,L[W]);const q=Ks(this._eventsInProgress);if(m&&(b||T)&&!q){this._updatingCamera=!0;const W=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),se=Oe=>0!==Oe&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new Ru("renderFrame",{timeStamp:r})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Ia="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Jc extends s.Evented{constructor(r,c){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=!1!==c.respectPrefersReducedMotion,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(r,c){return this.jumpTo({center:r},c)}panBy(r,c,m){return r=s.Point.convert(r).mult(-1),this.panTo(this.transform.center,s.extend({offset:r},c),m)}panTo(r,c,m){return this.easeTo(s.extend({center:r},c),m)}getZoom(){return this.transform.zoom}setZoom(r,c){return this.jumpTo({zoom:r},c),this}zoomTo(r,c,m){return this.easeTo(s.extend({zoom:r},c),m)}zoomIn(r,c){return this.zoomTo(this.getZoom()+1,r,c),this}zoomOut(r,c){return this.zoomTo(this.getZoom()-1,r,c),this}getBearing(){return this.transform.bearing}setBearing(r,c){return this.jumpTo({bearing:r},c),this}getPadding(){return this.transform.padding}setPadding(r,c){return this.jumpTo({padding:r},c),this}rotateTo(r,c,m){return this.easeTo(s.extend({bearing:r},c),m)}resetNorth(r,c){return this.rotateTo(0,s.extend({duration:1e3},r),c),this}resetNorthPitch(r,c){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},r),c),this}snapToNorth(r,c){return Math.abs(this.getBearing())r.aspect?m/(2*Math.tan(.5*r.fovX)*r.aspect):b/(2*Math.tan(.5*r.fovY)*r.aspect)}_cameraForBoundsOnGlobe(r,c,m,b,T,O){const L=r.clone(),Z=this._extendCameraOptions(O);L.bearing=b,L.pitch=T;const q=s.LngLat.convert(c),W=s.LngLat.convert(m),se=.5*(q.lat+W.lat),Oe=.5*(q.lng+W.lng),$e=s.latLngToECEF(se,Oe),We=s.normalize([],$e),qe=s.normalize([],s.cross([],We,[0,1,0])),Ke=s.cross([],qe,We),ce=[qe[0],qe[1],qe[2],0,Ke[0],Ke[1],Ke[2],0,We[0],We[1],We[2],0,0,0,0,1],Ve=[$e,s.latLngToECEF(q.lat,q.lng),s.latLngToECEF(W.lat,q.lng),s.latLngToECEF(W.lat,W.lng),s.latLngToECEF(q.lat,W.lng),s.latLngToECEF(se,q.lng),s.latLngToECEF(se,W.lng),s.latLngToECEF(q.lat,Oe),s.latLngToECEF(W.lat,Oe)];let rt=s.Aabb.fromPoints(Ve.map(Ln=>[s.dot(qe,Ln),s.dot(Ke,Ln),s.dot(We,Ln)]));const ot=s.transformMat4([],rt.center,ce);0===s.squaredLength(ot)&&s.set(ot,0,0,1),s.normalize(ot,ot),s.scale$2(ot,ot,s.GLOBE_RADIUS),L.center=s.ecefToLatLng(ot);const Tt=L.getWorldToCameraMatrix(),Mt=s.invert(new Float64Array(16),Tt);rt=s.Aabb.applyTransform(rt,s.multiply([],Tt,ce)),s.transformMat4(ot,ot,Tt);const Dt=.5*(rt.max[2]-rt.min[2]),$t=this._minimumAABBFrustumDistance(L,rt),zt=s.scale$2([],[0,0,1],Dt),dn=s.add(zt,ot,zt),Vn=$t+(0===L.pitch?0:s.distance(ot,dn)),on=L.globeCenterInViewSpace,Rn=s.sub([],ot,[on[0],on[1],on[2]]);s.normalize(Rn,Rn),s.scale$2(Rn,Rn,Vn);const un=s.add([],ot,Rn);s.transformMat4(un,un,Mt);const Zn=s.earthRadius/s.GLOBE_RADIUS,sn=s.length(un),An=s.mercatorZfromAltitude(Math.max(sn*Zn-s.earthRadius,Number.EPSILON),0),Gn=Math.min(L.zoomFromMercatorZAdjusted(An),Z.maxZoom);return Gn>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(L.setProjection({name:"mercator"}),L.zoom=Gn,this._cameraForBounds(L,c,m,b,T,O)):{center:L.center,zoom:Gn,bearing:b,pitch:T}}queryTerrainElevation(r,c){const m=this.transform.elevation;return m?(c=s.extend({},{exaggerated:!0},c),m.getAtPoint(s.MercatorCoordinate.fromLngLat(r),null,c.exaggerated)):null}_cameraForBounds(r,c,m,b,T,O){if("globe"===r.projection.name)return this._cameraForBoundsOnGlobe(r,c,m,b,T,O);const L=r.clone(),Z=this._extendCameraOptions(O),q=L.padding;L.bearing=b,L.pitch=T;const W=s.LngLat.convert(c),se=s.LngLat.convert(m),Oe=new s.LngLat(W.lng,se.lat),$e=new s.LngLat(se.lng,W.lat),We=L.project(W),qe=L.project(se),Ke=this.queryTerrainElevation(W),ce=this.queryTerrainElevation(se),Ve=this.queryTerrainElevation(Oe),rt=this.queryTerrainElevation($e),ot=[[We.x,We.y,Math.min(Ke||0,ce||0,Ve||0,rt||0)],[qe.x,qe.y,Math.max(Ke||0,ce||0,Ve||0,rt||0)]];let Tt=s.Aabb.fromPoints(ot);const Mt=L.getWorldToCameraMatrix(),Dt=s.invert(new Float64Array(16),Mt);Tt=s.Aabb.applyTransform(Tt,Mt);const $t=s.sub([],Tt.max,Tt.min),zt=q.left||0,dn=q.right||0,Vn=q.bottom||0,on=q.top||0,{left:Rn,right:un,top:Zn,bottom:sn}=Z.padding,An=.5*(zt+dn),Gn=.5*(on+Vn),Ln=Math.min(L.scaleZoom(L.scale*Math.min((L.width-(zt+dn+Rn+un))/$t[0],(L.height-(Vn+on+sn+Zn))/$t[1])),Z.maxZoom),Wn=L.scale/L.zoomScale(Ln);Tt=new s.Aabb([Tt.min[0]-(Rn+An)*Wn,Tt.min[1]-(sn+Gn)*Wn,Tt.min[2]],[Tt.max[0]+(un+An)*Wn,Tt.max[1]+(Zn+Gn)*Wn,Tt.max[2]]);const Di=.5*$t[2],Gi=this._minimumAABBFrustumDistance(L,Tt),hi=[0,0,1,0];s.transformMat4$1(hi,hi,Mt),s.normalize$2(hi,hi);const Pi=s.scale$2([],hi,Gi+Di),ur=s.add([],Tt.center,Pi),dr=("number"==typeof Z.offset.x&&"number"==typeof Z.offset.y?new s.Point(Z.offset.x,Z.offset.y):s.Point.convert(Z.offset)).rotate(-s.degToRad(b));Tt.center[0]-=dr.x*Wn,Tt.center[1]+=dr.y*Wn,s.transformMat4(Tt.center,Tt.center,Dt),s.transformMat4(ur,ur,Dt);const xi=[Tt.center[0],Tt.center[1],ur[2]*L.pixelsPerMeter];s.scale$2(xi,xi,1/L.worldSize);const Cr=s.lngFromMercatorX(xi[0]),Kr=s.latFromMercatorY(xi[1]),Wr=Math.min(L._zoomFromMercatorZ(xi[2]),Z.maxZoom),qr=new s.LngLat(Cr,Kr);return L.mercatorFromTransition&&Wr<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(L.setProjection({name:"globe"}),L.zoom=Wr,this._cameraForBounds(L,c,m,b,T,O)):{center:qr,zoom:Wr,bearing:b,pitch:T}}fitBounds(r,c,m){const b=this.cameraForBounds(r,c);return this._fitInternal(b,c,m)}fitScreenCoordinates(r,c,m,b,T){const O=s.Point.convert(r),L=s.Point.convert(c),Z=new s.Point(Math.min(O.x,L.x),Math.min(O.y,L.y)),q=new s.Point(Math.max(O.x,L.x),Math.max(O.y,L.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(O,L))return this;const W=this.transform.pointLocation3D(Z),se=this.transform.pointLocation3D(q),Oe=this.transform.pointLocation3D(new s.Point(Z.x,q.y)),$e=this.transform.pointLocation3D(new s.Point(q.x,Z.y)),We=[Math.min(W.lng,se.lng,Oe.lng,$e.lng),Math.min(W.lat,se.lat,Oe.lat,$e.lat)],qe=[Math.max(W.lng,se.lng,Oe.lng,$e.lng),Math.max(W.lat,se.lat,Oe.lat,$e.lat)],Ke=b&&b.pitch?b.pitch:this.getPitch(),ce=this._cameraForBounds(this.transform,We,qe,m,Ke,b);return this._fitInternal(ce,b,T)}_fitInternal(r,c,m){return r?(delete(c=s.extend(r,c)).padding,c.linear?this.easeTo(c,m):this.flyTo(c,m)):this}jumpTo(r,c){this.stop();const m=r.preloadOnly?this.transform.clone():this.transform;let b=!1,T=!1,O=!1;return"zoom"in r&&m.zoom!==+r.zoom&&(b=!0,m.zoom=+r.zoom),void 0!==r.center&&(m.center=s.LngLat.convert(r.center)),"bearing"in r&&m.bearing!==+r.bearing&&(T=!0,m.bearing=+r.bearing),"pitch"in r&&m.pitch!==+r.pitch&&(O=!0,m.pitch=+r.pitch),null==r.padding||m.isPaddingEqual(r.padding)||(m.padding=r.padding),r.preloadOnly?(this._preloadTiles(m),this):(this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),b&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),T&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),O&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(Ia),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,c){const m=this.transform;if(!m.projection.supportsFreeCamera)return s.warnOnce(Ia),this;this.stop();const b=m.zoom,T=m.pitch,O=m.bearing;m.setFreeCameraOptions(r);const L=b!==m.zoom,Z=T!==m.pitch,q=O!==m.bearing;return this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),L&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),q&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),Z&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)),this}easeTo(r,c){this._stop(!1,r.easeId),(!1===(r=s.extend({offset:[0,0],duration:500,easing:s.ease},r)).animate||this._prefersReducedMotion(r))&&(r.duration=0);const m=this.transform,b=this.getZoom(),T=this.getBearing(),O=this.getPitch(),L=this.getPadding(),Z="zoom"in r?+r.zoom:b,q="bearing"in r?this._normalizeBearing(r.bearing,T):T,W="pitch"in r?+r.pitch:O,se="padding"in r?r.padding:m.padding,Oe=s.Point.convert(r.offset);let $e,We,qe;if("globe"===m.projection.name){const zt=s.MercatorCoordinate.fromLngLat(m.center),dn=Oe.rotate(-m.angle);zt.x+=dn.x/m.worldSize,zt.y+=dn.y/m.worldSize;const Vn=zt.toLngLat(),on=s.LngLat.convert(r.center||Vn);this._normalizeCenter(on),$e=m.centerPoint.add(dn),We=new s.Point(zt.x,zt.y).mult(m.worldSize),qe=new s.Point(s.mercatorXfromLng(on.lng),s.mercatorYfromLat(on.lat)).mult(m.worldSize).sub(We)}else{$e=m.centerPoint.add(Oe);const zt=m.pointLocation($e),dn=s.LngLat.convert(r.center||zt);this._normalizeCenter(dn),We=m.project(zt),qe=m.project(dn).sub(We)}const Ke=m.zoomScale(Z-b);let ce,Ve;r.around&&(ce=s.LngLat.convert(r.around),Ve=m.locationPoint(ce));const rt=this._zooming||Z!==b,ot=this._rotating||T!==q,Tt=this._pitching||W!==O,Mt=!m.isPaddingEqual(se),Dt=zt=>dn=>{if(rt&&(zt.zoom=s.number(b,Z,dn)),ot&&(zt.bearing=s.number(T,q,dn)),Tt&&(zt.pitch=s.number(O,W,dn)),Mt&&(zt.interpolatePadding(L,se,dn),$e=zt.centerPoint.add(Oe)),ce)zt.setLocationAtPoint(ce,Ve);else{const Vn=zt.zoomScale(zt.zoom-b),on=Z>b?Math.min(2,Ke):Math.max(.5,Ke),Rn=Math.pow(on,1-dn),un=zt.unproject(We.add(qe.mult(dn*Rn)).mult(Vn));zt.setLocationAtPoint(zt.renderWorldCopies?un.wrap():un,$e)}return r.preloadOnly||this._fireMoveEvents(c),zt};if(r.preloadOnly){const zt=this._emulate(Dt,r.duration,m);return this._preloadTiles(zt),this}const $t={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=rt,this._rotating=ot,this._pitching=Tt,this._padding=Mt,this._easeId=r.easeId,this._prepareEase(c,r.noMoveStart,$t),this._ease(Dt(m),zt=>{m.recenterOnTerrain(),this._afterEase(c,zt)},r),this}_prepareEase(r,c,m={}){this._moving=!0,this.transform.cameraElevationReference="sea",c||m.moving||this.fire(new s.Event("movestart",r)),this._zooming&&!m.zooming&&this.fire(new s.Event("zoomstart",r)),this._rotating&&!m.rotating&&this.fire(new s.Event("rotatestart",r)),this._pitching&&!m.pitching&&this.fire(new s.Event("pitchstart",r))}_fireMoveEvents(r){this.fire(new s.Event("move",r)),this._zooming&&this.fire(new s.Event("zoom",r)),this._rotating&&this.fire(new s.Event("rotate",r)),this._pitching&&this.fire(new s.Event("pitch",r))}_afterEase(r,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const m=this._zooming,b=this._rotating,T=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,m&&this.fire(new s.Event("zoomend",r)),b&&this.fire(new s.Event("rotateend",r)),T&&this.fire(new s.Event("pitchend",r)),this.fire(new s.Event("moveend",r))}flyTo(r,c){if(this._prefersReducedMotion(r)){const Ln=s.pick(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ln,c)}this.stop(),r=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},r);const m=this.transform,b=this.getZoom(),T=this.getBearing(),O=this.getPitch(),L=this.getPadding(),Z="zoom"in r?s.clamp(+r.zoom,m.minZoom,m.maxZoom):b,q="bearing"in r?this._normalizeBearing(r.bearing,T):T,W="pitch"in r?+r.pitch:O,se="padding"in r?r.padding:m.padding,Oe=m.zoomScale(Z-b),$e=s.Point.convert(r.offset);let We=m.centerPoint.add($e);const qe=m.pointLocation(We),Ke=s.LngLat.convert(r.center||qe);this._normalizeCenter(Ke);const ce=m.project(qe),Ve=m.project(Ke).sub(ce);let rt=r.curve;const ot=Math.max(m.width,m.height),Tt=ot/Oe,Mt=Ve.mag();if("minZoom"in r){const Ln=s.clamp(Math.min(r.minZoom,b,Z),m.minZoom,m.maxZoom),Wn=ot/m.zoomScale(Ln-b);rt=Math.sqrt(Wn/Mt*2)}const Dt=rt*rt;function $t(Ln){const Wn=(Tt*Tt-ot*ot+(Ln?-1:1)*Dt*Dt*Mt*Mt)/(2*(Ln?Tt:ot)*Dt*Mt);return Math.log(Math.sqrt(Wn*Wn+1)-Wn)}function zt(Ln){return(Math.exp(Ln)-Math.exp(-Ln))/2}function dn(Ln){return(Math.exp(Ln)+Math.exp(-Ln))/2}const Vn=$t(0);let on=function(Ln){return dn(Vn)/dn(Vn+rt*Ln)},Rn=function(Ln){return ot*((dn(Vn)*(zt(Wn=Vn+rt*Ln)/dn(Wn))-zt(Vn))/Dt)/Mt;var Wn},un=($t(1)-Vn)/rt;if(Math.abs(Mt)<1e-6||!isFinite(un)){if(Math.abs(ot-Tt)<1e-6)return this.easeTo(r,c);const Ln=Ttr.maxDuration&&(r.duration=0);const Zn=T!==q,sn=W!==O,An=!m.isPaddingEqual(se),Gn=Ln=>Wn=>{const Di=Wn*un,Gi=1/on(Di);Ln.zoom=1===Wn?Z:b+Ln.scaleZoom(Gi),Zn&&(Ln.bearing=s.number(T,q,Wn)),sn&&(Ln.pitch=s.number(O,W,Wn)),An&&(Ln.interpolatePadding(L,se,Wn),We=Ln.centerPoint.add($e));const hi=1===Wn?Ke:Ln.unproject(ce.add(Ve.mult(Rn(Di))).mult(Gi));return Ln.setLocationAtPoint(Ln.renderWorldCopies?hi.wrap():hi,We),Ln._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(c),Ln};if(r.preloadOnly){const Ln=this._emulate(Gn,r.duration,m);return this._preloadTiles(Ln),this}return this._zooming=!0,this._rotating=Zn,this._pitching=sn,this._padding=An,this._prepareEase(c,!1),this._ease(Gn(m),()=>this._afterEase(c),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const m=this._onEaseEnd;this._onEaseEnd=void 0,m.call(this,c)}if(!r){const m=this.handlers;m&&m.stop(!1)}return this}_ease(r,c,m){!1===m.animate||0===m.duration?(r(1),c()):(this._easeStart=s.exported.now(),this._easeOptions=m,this._onEaseFrame=r,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const r=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,c){r=s.wrap(r,-180,180);const m=Math.abs(r-c);return Math.abs(r-360-c)180?-360:m<-180?360:0}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(r&&r.essential)}_emulate(r,c,m){const b=Math.ceil(15*c/1e3),T=[],O=r(m.clone());for(let L=0;L<=b;L++){const Z=O(L/b);T.push(Z.clone())}return T}}class ui{constructor(r={}){this.options=r,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(r){const c=this.options&&this.options.compact;return this._map=r,this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=Ne("button","mapboxgl-ctrl-attrib-button",this._container),Ne("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Ne("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===c&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(r,c){const m=this._map._getUIString(`AttributionControl.${c}`);r.setAttribute("aria-label",m),r.removeAttribute("title"),r.firstElementChild&&r.firstElementChild.setAttribute("title",m)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(r){const m=c.reduce((b,T,O)=>(T.value&&(b+=`${T.key}=${T.value}${Ob.length-T.length),r=r.filter((b,T)=>{for(let O=T+1;O=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=[...this.options.customAttribution,...r]:r.unshift(this.options.customAttribution));const m=r.join(" | ");m!==this._attribHTML&&(this._attribHTML=m,r.length?(this._innerContainer.innerHTML=m,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class xc{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(r){this._map=r,this._container=Ne("div","mapboxgl-ctrl");const c=Ne("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(r){r&&"metadata"!==r.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const r=this._map.style._sourceCaches;if(0===Object.entries(r).length)return!0;for(const c in r){const m=r[c].getSource();if(m.hasOwnProperty("mapbox_logo")&&!m.mapbox_logo)return!1}return!0}_updateCompact(){const r=this._container.children;if(r.length){const c=r[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class Kc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const c=++this._id;return this._queue.push({callback:r,id:c,cancelled:!1}),c}remove(r){const c=this._currentlyRunning,m=c?this._queue.concat(c):this._queue;for(const b of m)if(b.id===r)return void(b.cancelled=!0)}run(r=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const m of c)if(!m.cancelled&&(m.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ml(f,r,c){if(f=new s.LngLat(f.lng,f.lat),r){const m=new s.LngLat(f.lng-360,f.lat),b=new s.LngLat(f.lng+360,f.lat),T=360*Math.ceil(Math.abs(f.lng-c.center.lng)/360),O=c.locationPoint(f).distSqr(r),L=r.x<0||r.y<0||r.x>c.width||r.y>c.height;c.locationPoint(m).distSqr(r)180;){const m=c.locationPoint(f);if(m.x>=0&&m.y>=0&&m.x<=c.width&&m.y<=c.height)break;f.lng>c.center.lng?f.lng-=360:f.lng+=360}return f}const al={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%)"};class R extends s.Evented{constructor(r,c){if(super(),(r instanceof s.window.HTMLElement||c)&&(r=s.extend({element:r},c)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=r&&r.occludedOpacity||.2,r&&r.element)this._element=r.element,this._offset=s.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=Ne("div");const b=41,T=27,O=me("svg",{display:"block",height:b*this._scale+"px",width:T*this._scale+"px",viewBox:`0 0 ${T} ${b}`},this._element),L=me("radialGradient",{id:"shadowGradient"},me("defs",{},O));me("stop",{offset:"10%","stop-opacity":.4},L),me("stop",{offset:"100%","stop-opacity":.05},L),me("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},O),me("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},O),me("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},O),me("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},O),this._offset=s.Point.convert(r&&r.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",b=>{b.preventDefault()}),this._element.addEventListener("mousedown",b=>{b.preventDefault()});const m=this._element.classList;for(const b in al)m.remove(`mapboxgl-marker-anchor-${b}`);m.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(r){return r===this._map||(this.remove(),this._map=r,r.getCanvasContainer().appendChild(this._element),r.on("move",this._updateMoving),r.on("moveend",this._update),r.on("remove",this._clearFadeTimer),r._addMarker(this),this.setDraggable(this._draggable),this._update(),r.on("click",this._onMapClick)),this}remove(){const r=this._map;return r&&(r.off("click",this._onMapClick),r.off("move",this._updateMoving),r.off("moveend",this._update),r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler),r.off("mouseup",this._onUp),r.off("touchend",this._onUp),r.off("mousemove",this._onMove),r.off("touchmove",this._onMove),r.off("remove",this._clearFadeTimer),r._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=s.LngLat.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const b=Math.sqrt(Math.pow(13.5,2)/2);r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[b,-1*(24.6+b)],"bottom-right":[-b,-1*(24.6+b)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=r,r._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(r){const c=r.code,m=r.charCode||r.keyCode;"Space"!==c&&"Enter"!==c&&32!==m&&13!==m||this.togglePopup()}_onMapClick(r){const c=r.originalEvent.target,m=this._element;this._popup&&(c===m||m.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const r=this._popup;return r?(r.isOpen()?(r.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(r.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const r=this._map,c=this._pos;if(!r||!c)return!1;const m=r.unproject(c),b=r.getFreeCameraOptions();if(!b.position)return!1;const T=b.position.toLngLat();return T.distanceTo(m)<.9*T.distanceTo(this._lngLat)}_evaluateOpacity(){const r=this._map;if(!r)return;const c=this._pos;if(!c||c.x<0||c.x>r.transform.width||c.y<0||c.y>r.transform.height)return void this._clearFadeTimer();const m=r.unproject(c);let b;r._showingGlobe()&&s.isLngLatBehindGlobe(r.transform,this._lngLat)?b=0:(b=1-r._queryFogOpacity(m),r.transform._terrainEnabled()&&r.getTerrain()&&this._behindTerrain()&&(b*=this._occludedOpacity)),this._element.style.opacity=`${b}`,this._element.style.pointerEvents=b>0?"auto":"none",this._popup&&this._popup._setOpacity(b),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const r=this._pos;if(!r||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${r.x}px,${r.y}px)\n ${al[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${c.x}px,${c.y}px)\n `}_calculateXYTransform(){const r=this._pos,c=this._map,m=this.getPitchAlignment();if(!c||!r||"map"!==m)return"";if(!c._showingGlobe()){const Z=c.getPitch();return Z?`rotateX(${Z}deg)`:""}const b=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),T=r.sub(s.globeCenterToScreenPoint(c.transform)),O=Math.abs(T.x)+Math.abs(T.y);if(0===O)return"";const L=b/O;return`rotateX(${-T.y*L}deg) rotateY(${T.x*L}deg)`}_calculateZTransform(){const r=this._pos,c=this._map;if(!c||!r)return"";let m=0;const b=this.getRotationAlignment();if("map"===b)if(c._showingGlobe()){const T=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),O=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(T);m=s.radToDeg(Math.atan2(O.y,O.x))-90}else m=-c.getBearing();else if("horizon"===b){const T=s.smoothstep(4,6,c.getZoom()),O=s.globeCenterToScreenPoint(c.transform);O.y+=T*c.transform.height;const L=r.sub(O),Z=s.radToDeg(Math.atan2(L.y,L.x));m=(Z>90?Z-270:Z+90)*(1-T)}return m+=this._rotation,m?`rotateZ(${m}deg)`:""}_update(r){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Ml(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),!0===r?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=s.Point.convert(r),this._update(),this}_onMove(r){const c=this._map;if(!c)return;const m=this._pointerdownPos,b=this._positionDelta;if(m&&b){if(!this._isDragging){const T=this._clickTolerance||c._clickTolerance;if(r.point.dist(m)=this._endTime)return this._end;const c=s.easeCubicInOut((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(r){return r>=this._startTime&&r<=this._endTime}jumpTo(r){this._startTime=-1/0,this._endTime=-1/0,this._start=r,this._end=r}easeTo(r,c,m){this._start=this.getValue(c),this._end=r,this._startTime=c,this._endTime=c+m}}const Me={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Ge={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},en={showCompass:!0,showZoom:!0,visualizePitch:!1};class $n{constructor(r,c,m=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new Wc({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,m&&(this.mousePitch=new Pu({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(r,c){this.mouseRotate.mousedown(r,c),this.mousePitch&&this.mousePitch.mousedown(r,c),ae()}move(r,c){const m=this.map,b=this.mouseRotate.mousemoveWindow(r,c),T=b&&b.bearingDelta;if(T&&m.setBearing(m.getBearing()+T),this.mousePitch){const O=this.mousePitch.mousemoveWindow(r,c),L=O&&O.pitchDelta;L&&m.setPitch(m.getPitch()+L)}}off(){const r=this.element;r.removeEventListener("mousedown",this.mousedown),r.removeEventListener("touchstart",this.touchstart,{passive:!1}),r.removeEventListener("touchmove",this.touchmove),r.removeEventListener("touchend",this.touchend),r.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){oe(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(r){this.down(s.extend({},r,{ctrlKey:!0,preventDefault:()=>r.preventDefault()}),Ee(this.element,r)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(r){this.move(r,Ee(this.element,r))}mouseup(r){this.mouseRotate.mouseupWindow(r),this.mousePitch&&this.mousePitch.mouseupWindow(r),this.offTemp()}touchstart(r){1!==r.targetTouches.length?this.reset():(this._startPos=this._lastPos=Ue(this.element,r.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>r.preventDefault()},this._startPos))}touchmove(r){1!==r.targetTouches.length?this.reset():(this._lastPos=Ue(this.element,r.targetTouches)[0],this.move({preventDefault:()=>r.preventDefault()},this._lastPos))}touchend(r){0===r.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=f.minPitch&&null!=f.maxPitch&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=f.minPitch&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=f.maxPitch&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(f.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(f.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new ps(f.minZoom,f.maxZoom,f.minPitch,f.maxPitch,f.renderWorldCopies),f),this._interactive=f.interactive,this._minTileCacheSize=f.minTileCacheSize,this._maxTileCacheSize=f.maxTileCacheSize,this._failIfMajorPerformanceCaveat=f.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=f.preserveDrawingBuffer,this._antialias=f.antialias,this._useWebGL2=f.useWebGL2,this._trackResize=f.trackResize,this._bearingSnap=f.bearingSnap,this._refreshExpiredTiles=f.refreshExpiredTiles,this._fadeDuration=f.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=f.crossSourceCollisions,this._collectResourceTiming=f.collectResourceTiming,this._optimizeForTerrain=f.optimizeForTerrain,this._language=this._parseLanguage(f.language),this._worldview=f.worldview,this._renderTaskQueue=new Kc,this._domRenderTaskQueue=new Kc,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},Me,f.locale),this._clickTolerance=f.clickTolerance,this._cooperativeGestures=f.cooperativeGestures,this._performanceMetricsCollection=f.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new K(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(f.transformRequest,f.accessToken,f.testMode),this._silenceAuthErrors=!!f.testMode,"string"==typeof f.container){if(this._container=s.window.document.getElementById(f.container),!this._container)throw new Error(`Container '${f.container}' not found.`)}else{if(!(f.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),f.maxBounds&&this.setMaxBounds(f.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),void 0!==s.window&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Xs(this,f),this._localFontFamily=f.localFontFamily,this._localIdeographFontFamily=f.localIdeographFontFamily,f.style&&this.setStyle(f.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),f.projection&&this.setProjection(f.projection),this._hash=f.hash&&new No("string"==typeof f.hash&&f.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch}),f.bounds&&(this.resize(),this.fitBounds(f.bounds,s.extend({},f.fitBoundsOptions,{duration:0})))),this.resize(),f.attributionControl&&this.addControl(new ui({customAttribution:f.customAttribution})),this._logoControl=new xc,this.addControl(this._logoControl,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",r=>{this._update("style"===r.dataType),this.fire(new s.Event(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new s.Event(`${r.dataType}dataloading`,r))})}_getMapId(){return this._mapId}addControl(f,r){if(void 0===r&&(r=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=f.onAdd(this);this._controls.push(f);const m=this._controlPositions[r];return-1!==r.indexOf("bottom")?m.insertBefore(c,m.firstChild):m.appendChild(c),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(f);return r>-1&&this._controls.splice(r,1),f.onRemove(this),this}hasControl(f){return this._controls.indexOf(f)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(f){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new s.Event("movestart",f)).fire(new s.Event("move",f)),this.fire(new s.Event("resize",f)),r&&this.fire(new s.Event("moveend",f)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(f){return this.transform.setMaxBounds(s.LngLatBounds.convert(f)),this._update()}setMinZoom(f){if((f=f??-2)>=-2&&f<=this.transform.maxZoom)return this.transform.minZoom=f,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f?this.setZoom(f):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(f){if((f=f??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(f>=0&&f<=this.transform.maxPitch)return this.transform.minPitch=f,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(f>=this.transform.minPitch)return this.transform.maxPitch=f,this._update(),this.getPitch()>f?this.setPitch(f):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(f){return this.transform.renderWorldCopies=f,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(f){return"auto"===f?s.window.navigator.language:Array.isArray(f)?0===f.length?void 0:f.map(r=>"auto"===r?s.window.navigator.language:r):f}setLanguage(f){const r=this._parseLanguage(f);if(!this.style||r===this._language)return this;this._language=r,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(f){return this.style&&f!==this._worldview?(this._worldview=f,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(f){return this._lazyInitEmptyStyle(),f?"string"==typeof f&&(f={name:f}):f=null,this._useExplicitProjection=!!f,this._prioritizeAndUpdateProjection(f,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const f=this.transform,r=f.projection.name;let c;"globe"===r&&f.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(f.setMercatorFromTransition(),c=!0):"mercator"===r&&f.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(f),this.style.applyProjectionUpdate(),r){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(f){return this.transform.locationPoint3D(s.LngLat.convert(f))}unproject(f){return this.transform.pointLocation3D(s.Point.convert(f))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(f,r,c){if("mouseenter"===f||"mouseover"===f){let m=!1;const b=O=>{const L=r.filter(q=>this.getLayer(q)),Z=L.length?this.queryRenderedFeatures(O.point,{layers:L}):[];Z.length?m||(m=!0,c.call(this,new zo(f,this,O.originalEvent,{features:Z}))):m=!1},T=()=>{m=!1};return{layers:new Set(r),listener:c,delegates:{mousemove:b,mouseout:T}}}if("mouseleave"===f||"mouseout"===f){let m=!1;const b=O=>{const L=r.filter(Z=>this.getLayer(Z));(L.length?this.queryRenderedFeatures(O.point,{layers:L}):[]).length?m=!0:m&&(m=!1,c.call(this,new zo(f,this,O.originalEvent)))},T=O=>{m&&(m=!1,c.call(this,new zo(f,this,O.originalEvent)))};return{layers:new Set(r),listener:c,delegates:{mousemove:b,mouseout:T}}}{const m=b=>{const T=r.filter(L=>this.getLayer(L)),O=T.length?this.queryRenderedFeatures(b.point,{layers:T}):[];O.length&&(b.features=O,c.call(this,b),delete b.features)};return{layers:new Set(r),listener:c,delegates:{[f]:m}}}}on(f,r,c){if(void 0===c)return super.on(f,r);Array.isArray(r)||(r=[r]);const m=this._createDelegatedListener(f,r,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(m);for(const b in m.delegates)this.on(b,m.delegates[b]);return this}once(f,r,c){if(void 0===c)return super.once(f,r);Array.isArray(r)||(r=[r]);const m=this._createDelegatedListener(f,r,c);for(const b in m.delegates)this.once(b,m.delegates[b]);return this}off(f,r,c){if(void 0===c)return super.off(f,r);r=new Set(Array.isArray(r)?r:[r]);const m=(T,O)=>{if(T.size!==O.size)return!1;for(const L of T)if(!O.has(L))return!1;return!0},b=this._delegatedListeners?this._delegatedListeners[f]:void 0;return b&&(T=>{for(let O=0;O{b?this.fire(new s.ErrorEvent(b)):T&&this._updateDiff(T,r)})}else"object"==typeof f&&this._updateDiff(f,r)}_updateDiff(f,r){try{this.style.setState(f)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(f,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(f,r){return this._lazyInitEmptyStyle(),this.style.addSource(f,r),this._update(!0)}isSourceLoaded(f){return!!this.style&&this.style._isSourceCacheLoaded(f)}areTilesLoaded(){const f=this.style&&this.style._sourceCaches;for(const r in f){const c=f[r]._tiles;for(const m in c){const b=c[m];if("loaded"!==b.state&&"errored"!==b.state)return!1}}return!0}addSourceType(f,r,c){this._lazyInitEmptyStyle(),this.style.addSourceType(f,r,c)}removeSource(f){return this.style.removeSource(f),this._updateTerrain(),this._update(!0)}getSource(f){return this.style.getSource(f)}addImage(f,r,{pixelRatio:c=1,sdf:m=!1,stretchX:b,stretchY:T,content:O}={}){if(this._lazyInitEmptyStyle(),r instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&r instanceof s.window.ImageBitmap){const{width:L,height:Z,data:q}=s.exported.getImageData(r);this.style.addImage(f,{data:new s.RGBAImage({width:L,height:Z},q),pixelRatio:c,stretchX:b,stretchY:T,content:O,sdf:m,version:0})}else if(void 0===r.width||void 0===r.height)this.fire(new s.ErrorEvent(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`")));else{const{width:L,height:Z}=r,q=r;this.style.addImage(f,{data:new s.RGBAImage({width:L,height:Z},new Uint8Array(q.data)),pixelRatio:c,stretchX:b,stretchY:T,content:O,sdf:m,version:0,userImage:q}),q.onAdd&&q.onAdd(this,f)}}updateImage(f,r){const c=this.style.getImage(f);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const m=r instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&r instanceof s.window.ImageBitmap?s.exported.getImageData(r):r,{width:b,height:T}=m;void 0!==b&&void 0!==T?b===c.data.width&&T===c.data.height?(c.data.replace(m.data,!(r instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&r instanceof s.window.ImageBitmap)),this.style.updateImage(f,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${b}, ${T})\n must be that same as the previous version of the image\n (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(f){return f?!!this.style.getImage(f):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(f)}loadImage(f,r){s.getImage(this._requestManager.transformRequest(f,s.ResourceType.Image),(c,m)=>{r(c,m instanceof s.window.HTMLImageElement?s.exported.getImageData(m):m)})}listImages(){return this.style.listImages()}addLayer(f,r){return this._lazyInitEmptyStyle(),this.style.addLayer(f,r),this._update(!0)}moveLayer(f,r){return this.style.moveLayer(f,r),this._update(!0)}removeLayer(f){return this.style.removeLayer(f),this._update(!0)}getLayer(f){return this.style.getLayer(f)}setLayerZoomRange(f,r,c){return this.style.setLayerZoomRange(f,r,c),this._update(!0)}setFilter(f,r,c={}){return this.style.setFilter(f,r,c),this._update(!0)}getFilter(f){return this.style.getFilter(f)}setPaintProperty(f,r,c,m={}){return this.style.setPaintProperty(f,r,c,m),this._update(!0)}getPaintProperty(f,r){return this.style.getPaintProperty(f,r)}setLayoutProperty(f,r,c,m={}){return this.style.setLayoutProperty(f,r,c,m),this._update(!0)}getLayoutProperty(f,r){return this.style.getLayoutProperty(f,r)}setLight(f,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(f,r),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(f){return this._lazyInitEmptyStyle(),!f&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(f),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(f){return this._lazyInitEmptyStyle(),this.style.setFog(f),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(f){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(f),this.transform):0}setFeatureState(f,r){return this.style.setFeatureState(f,r),this._update()}removeFeatureState(f,r){return this.style.removeFeatureState(f,r),this._update()}getFeatureState(f){return this.style.getFeatureState(f)}_updateContainerDimensions(){if(!this._container)return;const f=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300;let c,m,b,T=this._container;for(;T&&(!m||!b);){const O=s.window.getComputedStyle(T).transform;O&&"none"!==O&&(c=O.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&"0"!==c[0]&&"1"!==c[0]&&(m=c[0]),c[3]&&"0"!==c[3]&&"1"!==c[3]&&(b=c[3])),T=T.parentElement}this._containerWidth=m?Math.abs(f/m):f,this._containerHeight=b?Math.abs(r/b):r}_detectMissingCSS(){"rgb(250, 128, 114)"!==s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const f=this._container;f.classList.add("mapboxgl-map"),(this._missingCSSCanary=Ne("div","mapboxgl-canary",f)).style.visibility="hidden",this._detectMissingCSS();const r=this._canvasContainer=Ne("div","mapboxgl-canvas-container",f);this._interactive&&r.classList.add("mapboxgl-interactive"),this._canvas=Ne("canvas","mapboxgl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=Ne("div","mapboxgl-control-container",f),m=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(b=>{m[b]=Ne("div",`mapboxgl-ctrl-${b}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(f,r){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(f),this._canvas.height=c*Math.ceil(r),this._canvas.style.width=`${f}px`,this._canvas.style.height=`${r}px`}_addMarker(f){this._markers.push(f)}_removeMarker(f){const r=this._markers.indexOf(f);-1!==r&&this._markers.splice(r,1)}_addPopup(f){this._popups.push(f)}_removePopup(f){const r=this._popups.indexOf(f);-1!==r&&this._popups.splice(r,1)}_setupPainter(){const f=s.extend({},ie.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._useWebGL2&&this._canvas.getContext("webgl2",f),c=r||this._canvas.getContext("webgl",f)||this._canvas.getContext("experimental-webgl",f);c?(this._useWebGL2&&!r&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new Q(c,this.transform,!!r),this.on("data",m=>{"source"===m.dataType&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(f){f.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:f}))}_contextRestored(f){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:f}))}_onMapScroll(f){if(f.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(f){return this.style?(this._styleDirty=this._styleDirty||f,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(f){return this._update(),this._renderTaskQueue.add(f)}_cancelRenderFrame(f){this._renderTaskQueue.remove(f)}_requestDomTask(f){!this.loaded()||this.loaded()&&!this.isMoving()?f():this._domRenderTaskQueue.add(f)}_render(f){let r;const c=this.painter.context.extTimerQuery,m=s.exported.now();if(this.listens("gpu-timing-frame")&&(r=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(f),this._domRenderTaskQueue.run(f),this._removed)return;this._updateProjectionTransition();const b=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const L=this.transform.zoom,Z=this.transform.pitch,q=s.exported.now(),W=new s.EvaluationParameters(L,{now:q,fadeDuration:b,pitch:Z,transition:this.style.getTransition()});this.style.update(W)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let T=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),T=this._updateAverageElevation(m),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):T=this._updateAverageElevation(m),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,b,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:b,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const L=s.exported.now()-m;c.endQueryEXT(c.TIME_ELAPSED_EXT,r),setTimeout(()=>{const Z=c.getQueryObjectEXT(r,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(r),this.fire(new s.Event("gpu-timing-frame",{cpuTime:L,gpuTime:Z})),s.window.performance.mark("frame-gpu",{startTime:m,detail:{gpuTime:Z}})},50)}if(this.listens("gpu-timing-layer")){const L=this.painter.collectGpuTimers();setTimeout(()=>{const Z=this.painter.queryGpuTimers(L);this.fire(new s.Event("gpu-timing-layer",{layerTimes:Z}))},50)}if(this.listens("gpu-timing-deferred-render")){const L=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const Z=this.painter.queryGpuTimeDeferredRender(L);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:Z}))},50)}const O=this._sourcesDirty||this._styleDirty||this._placementDirty||T;if(O||this._repaint)this.triggerRepaint();else{const L=!this.isMoving()&&this.loaded();if(L&&(T=this._updateAverageElevation(m,!0)),T)this.triggerRepaint();else if(this._triggerFrame(!1),L&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const Z=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:Z})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||O||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(f){for(const r of this._markers)f&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(const r of this._popups)!f||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(f,r=!1){const c=m=>(this.transform.averageElevation=m,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&c(0);if((r||f-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(f)){const m=this.transform.averageElevation;let b=this.transform.sampleAverageElevation(),T=!1;this.transform.elevation&&(T=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(b)?b=0:this._averageElevationLastSampledAt=f;const O=Math.abs(m-b);if(O>1){if(this._isInitialLoad||T)return this._averageElevation.jumpTo(b),c(b);this._averageElevation.easeTo(b,f,300)}else if(O>1e-4)return this._averageElevation.jumpTo(b),c(b)}return!!this._averageElevation.isEasing(f)&&c(this._averageElevation.getValue(f))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,f=>{if(f&&(f.message===s.AUTH_ERR_MSG||401===f.status)){const r=this.painter.context.gl;s.storeAuthState(r,!1),this._logoControl instanceof xc&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const f=this._isDragging();this.painter.updateTerrain(this.style,f)}_calculateSpeedIndex(){const f=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());const c=this.painter.context.gl,m=c.createFramebuffer();function b(T){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,T,0);const O=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,O),O}return c.bindFramebuffer(c.FRAMEBUFFER,m),this._canvasPixelComparison(b(f),r.canvasCopies.map(b),r.timeStamps)}_canvasPixelComparison(f,r,c){let m=c[1]-c[0];const b=f.length/4;for(let T=0;T{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(r)}))}_preloadTiles(f){const r=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(r,(c,m)=>c._preloadTiles(f,m),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(f){this._trackResize&&this.resize({originalEvent:f})._update()}_onVisibilityChange(){"hidden"===s.window.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(f){this._showTileBoundaries!==f&&(this._showTileBoundaries=f,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(f){this._showTerrainWireframe!==f&&(this._showTerrainWireframe=f,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(f){this._speedIndexTiming!==f&&(this._speedIndexTiming=f,this._update())}get showPadding(){return!!this._showPadding}set showPadding(f){this._showPadding!==f&&(this._showPadding=f,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(f){this._showCollisionBoxes!==f&&(this._showCollisionBoxes=f,f?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(f){this._showOverdrawInspector!==f&&(this._showOverdrawInspector=f,this._update())}get repaint(){return!!this._repaint}set repaint(f){this._repaint!==f&&(this._repaint=f,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(f){this._vertices=f,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(f){this._showTileAABBs!==f&&(this._showTileAABBs=f,f&&this._update())}_setCacheLimits(f,r){s.setCacheLimits(f,r)}get version(){return s.version}},NavigationControl:class{constructor(f){this.options=s.extend({},en,f),this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",r=>{this._map&&this._map.zoomIn({},{originalEvent:r})}),Ne("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",r=>{this._map&&this._map.zoomOut({},{originalEvent:r})}),Ne("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",r=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:r}):c.resetNorth({},{originalEvent:r}))}),this._compassIcon=Ne("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const f=this._map;if(!f)return;const r=f.getZoom(),c=r===f.getMaxZoom(),m=r===f.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=m,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",m.toString())}_rotateCompassArrow(){const f=this._map;if(!f)return;const r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(f.transform.pitch*(Math.PI/180)),.5)}) rotateX(${f.transform.pitch}deg) rotateZ(${f.transform.angle*(180/Math.PI)}deg)`:`rotate(${f.transform.angle*(180/Math.PI)}deg)`;f._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(f){return this._map=f,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),f.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&f.on("pitch",this._rotateCompassArrow),f.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new $n(f,this._compass,this.options.visualizePitch)),this._container}onRemove(){const f=this._map;f&&(this._container.remove(),this.options.showZoom&&f.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&f.off("pitch",this._rotateCompassArrow),f.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(f,r){const c=Ne("button",f,this._container);return c.type="button",c.addEventListener("click",r),c}_setButtonTitle(f,r){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${r}`);f.setAttribute("aria-label",c),f.firstElementChild&&f.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(f){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},xn,f),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ss(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(f){return this._map=f,this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(f){const r=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,f(c)};void 0!==this._supportsGeolocation?f(this._supportsGeolocation):void 0!==s.window.navigator.permissions?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>r("denied"!==c.state)).catch(()=>r()):r()}_isOutOfMapMaxBounds(f){const r=this._map.getMaxBounds(),c=f.coords;return!!r&&(c.longituder.getEast()||c.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(f){if(this._map){if(this._isOutOfMapMaxBounds(f))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",f)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=f,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(f),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(f),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",f)),this._finish()}}_updateCamera(f){const r=new s.LngLat(f.coords.longitude,f.coords.latitude),c=f.coords.accuracy,m=this._map.getBearing(),b=s.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(c),b,{geolocateSource:!0})}_updateMarker(f){if(f){const r=new s.LngLat(f.coords.longitude,f.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=f.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const f=this._map.transform,r=s.mercatorZfromAltitude(1,f._center.lat)*f.worldSize,c=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(f){if(this._map){if(this.options.trackUserLocation)if(1===f.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===f.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",f)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(f){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",r=>r.preventDefault()),this._geolocateButton=Ne("button","mapboxgl-ctrl-geolocate",this._container),Ne("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===f){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ne("div","mapboxgl-user-location"),this._dotElement.appendChild(Ne("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(Ne("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new R({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=Ne("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new R({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||"ACTIVE_LOCK"!==this._watchState||r.originalEvent&&"resize"===r.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(f){this._userLocationDotMarker&&(f.webkitCompassHeading?this._heading=f.webkitCompassHeading:!0===f.absolute&&(this._heading=-1*f.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let f;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(f={maximumAge:6e5,timeout:0},this._noTimeout=!0):(f=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,f),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const f=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==s.window.DeviceMotionEvent&&"function"==typeof s.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(r=>{"granted"===r&&f()}).catch(console.error):f()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ui,ScaleControl:class{constructor(f){this.options=s.extend({},Oi,f),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const f=this.options.maxWidth||100,r=this._map,c=r._containerHeight/2,m=r._containerWidth/2-f/2,b=r.unproject([m,c]),T=r.unproject([m+f,c]),O=b.distanceTo(T);if("imperial"===this.options.unit){const L=3.2808*O;L>5280?this._setScale(f,L/5280,"mile"):this._setScale(f,L,"foot")}else"nautical"===this.options.unit?this._setScale(f,O/1852,"nautical-mile"):O>=1e3?this._setScale(f,O/1e3,"kilometer"):this._setScale(f,O,"meter")}_setScale(f,r,c){this._map._requestDomTask(()=>{const m=function(T){const O=Math.pow(10,`${Math.floor(T)}`.length-1);let L=T/O;return L=L>=10?10:L>=5?5:L>=3?3:L>=2?2:L>=1?1:function(Z){const q=Math.pow(10,Math.ceil(-Math.log(Z)/Math.LN10));return Math.round(Z*q)/q}(L),O*L}(r),b=m/r;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==c?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(m):`${m} ${ar[c]}`,this._container.style.width=f*b+"px"})}onAdd(f){return this._map=f,this._language=f.getLanguage(),this._container=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-scale",f.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(f){this._language=f,this._update()}setUnit(f){this.options.unit=f,this._update()}},FullscreenControl:class{constructor(f){this._fullscreen=!1,f&&f.container&&(f.container instanceof s.window.HTMLElement?this._container=f.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=Ne("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const f=this._fullscreenButton=Ne("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Ne("span","mapboxgl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",f)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(f){super(),this.options=s.extend(Object.create(U),f),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(f&&f.className?f.className.trim().split(/\s+/):[])}addTo(f){return this._map&&this.remove(),this._map=f,this.options.closeOnClick&&f.on("preclick",this._onClose),this.options.closeOnMove&&f.on("move",this._onClose),f.on("remove",this.remove),this._update(),f._addPopup(this),this._focusFirstElement(),this._trackPointer?(f.on("mousemove",this._onMouseEvent),f.on("mouseup",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")):f.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const f=this._map;return f&&(f.off("move",this._update),f.off("move",this._onClose),f.off("preclick",this._onClose),f.off("click",this._onClose),f.off("remove",this.remove),f.off("mousemove",this._onMouseEvent),f.off("mouseup",this._onMouseEvent),f.off("drag",this._onMouseEvent),f._canvasContainer&&f._canvasContainer.classList.remove("mapboxgl-track-pointer"),f._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(f){this._lngLat=s.LngLat.convert(f),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const f=this._map;return f&&(f.off("move",this._update),f.on("mousemove",this._onMouseEvent),f.on("drag",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(f){return this.setDOMContent(s.window.document.createTextNode(f))}setHTML(f){const r=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let m;for(c.innerHTML=f;m=c.firstChild,m;)r.appendChild(m);return this.setDOMContent(r)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=Ne("div","mapboxgl-popup-content",this._container||void 0);if(r.appendChild(f),this.options.closeButton){const c=this._closeButton=Ne("button","mapboxgl-popup-close-button",r);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(f){return this._classList.add(f),this._updateClassList(),this}removeClassName(f){return this._classList.delete(f),this._updateClassList(),this}setOffset(f){return this.options.offset=f,this._update(),this}toggleClassName(f){let r;return this._classList.delete(f)?r=!1:(this._classList.add(f),r=!0),this._updateClassList(),r}_onMouseEvent(f){this._update(f.point)}_getAnchor(f){if(this.options.anchor)return this.options.anchor;const r=this._map,c=this._container,m=this._pos;if(!r||!c||!m)return"bottom";const b=c.offsetWidth,T=c.offsetHeight,O=m.xr.transform.width-b/2;if(m.y+fr.transform.height-T){if(O)return"bottom-left";if(L)return"bottom-right"}return O?"left":L?"right":"bottom"}_updateClassList(){const f=this._container;if(!f)return;const r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),f.className=r.join(" ")}_update(f){const r=this._map,c=this._content;if(!r||!this._lngLat&&!this._trackPointer||!c)return;let m=this._container;if(m||(m=this._container=Ne("div","mapboxgl-popup",r.getContainer()),this._tip=Ne("div","mapboxgl-popup-tip",m),m.appendChild(c)),this.options.maxWidth&&m.style.maxWidth!==this.options.maxWidth&&(m.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ml(this._lngLat,this._pos,r.transform)),!this._trackPointer||f){const b=this._pos=this._trackPointer&&f?f:r.project(this._lngLat),T=z(this.options.offset),O=this._anchor=this._getAnchor(T.y),L=z(this.options.offset,O),Z=b.add(L).round();r._requestDomTask(()=>{this._container&&O&&(this._container.style.transform=`${al[O]} translate(${Z.x}px,${Z.y}px)`)})}if(!this._marker&&r._showingGlobe()){const b=s.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(b)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const f=this._container.querySelector($);f&&f.focus()}_onClose(){this.remove()}_setOpacity(f){this._container&&(this._container.style.opacity=`${f}`),this._content&&(this._content.style.pointerEvents=f?"auto":"none")}},Marker:R,Style:zr,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:fr,Evented:s.Evented,config:s.config,prewarm:function(){st().acquire(cr)},clearPrewarmedResources:function(){const f=Lt;f&&(f.isPreloaded()&&1===f.numActive()?(f.release(cr),Lt=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(f){s.config.ACCESS_TOKEN=f},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(f){s.config.API_URL=f},get workerCount(){return Ui.workerCount},set workerCount(f){Ui.workerCount=f},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){s.config.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage(f){s.clearTileCache(f)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return po}),x}()},5619:(Nn,yt,k)=>{"use strict";k.d(yt,{X:()=>h});var x=k(8645);class h extends x.x{constructor(s){super(),this._value=s}get value(){return this.getValue()}_subscribe(s){const J=super._subscribe(s);return!J.closed&&s.next(this._value),J}getValue(){const{hasError:s,thrownError:J,_value:ie}=this;if(s)throw J;return this._throwIfClosed(),ie}next(s){super.next(this._value=s)}}},5592:(Nn,yt,k)=>{"use strict";k.d(yt,{y:()=>C});var x=k(305),h=k(7394),y=k(4850),s=k(8407),J=k(2653),ie=k(4674),Y=k(1441);let C=(()=>{class _e{constructor(ae){ae&&(this._subscribe=ae)}lift(ae){const oe=new _e;return oe.source=this,oe.operator=ae,oe}subscribe(ae,oe,Be){const Ie=function he(_e){return _e&&_e instanceof x.Lv||function me(_e){return _e&&(0,ie.m)(_e.next)&&(0,ie.m)(_e.error)&&(0,ie.m)(_e.complete)}(_e)&&(0,h.Nn)(_e)}(ae)?ae:new x.Hp(ae,oe,Be);return(0,Y.x)(()=>{const{operator:Ee,source:Ue}=this;Ie.add(Ee?Ee.call(Ie,Ue):Ue?this._subscribe(Ie):this._trySubscribe(Ie))}),Ie}_trySubscribe(ae){try{return this._subscribe(ae)}catch(oe){ae.error(oe)}}forEach(ae,oe){return new(oe=Ne(oe))((Be,Ie)=>{const Ee=new x.Hp({next:Ue=>{try{ae(Ue)}catch(et){Ie(et),Ee.unsubscribe()}},error:Ie,complete:Be});this.subscribe(Ee)})}_subscribe(ae){var oe;return null===(oe=this.source)||void 0===oe?void 0:oe.subscribe(ae)}[y.L](){return this}pipe(...ae){return(0,s.U)(ae)(this)}toPromise(ae){return new(ae=Ne(ae))((oe,Be)=>{let Ie;this.subscribe(Ee=>Ie=Ee,Ee=>Be(Ee),()=>oe(Ie))})}}return _e.create=ee=>new _e(ee),_e})();function Ne(_e){var ee;return null!==(ee=_e??J.config.Promise)&&void 0!==ee?ee:Promise}},8645:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>Y});var x=k(5592),h=k(7394);const s=(0,k(2306).d)(Ne=>function(){Ne(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var J=k(9039),ie=k(1441);let Y=(()=>{class Ne extends x.y{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(he){const _e=new C(this,this);return _e.operator=he,_e}_throwIfClosed(){if(this.closed)throw new s}next(he){(0,ie.x)(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const _e of this.currentObservers)_e.next(he)}})}error(he){(0,ie.x)(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=he;const{observers:_e}=this;for(;_e.length;)_e.shift().error(he)}})}complete(){(0,ie.x)(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:he}=this;for(;he.length;)he.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var he;return(null===(he=this.observers)||void 0===he?void 0:he.length)>0}_trySubscribe(he){return this._throwIfClosed(),super._trySubscribe(he)}_subscribe(he){return this._throwIfClosed(),this._checkFinalizedStatuses(he),this._innerSubscribe(he)}_innerSubscribe(he){const{hasError:_e,isStopped:ee,observers:ae}=this;return _e||ee?h.Lc:(this.currentObservers=null,ae.push(he),new h.w0(()=>{this.currentObservers=null,(0,J.P)(ae,he)}))}_checkFinalizedStatuses(he){const{hasError:_e,thrownError:ee,isStopped:ae}=this;_e?he.error(ee):ae&&he.complete()}asObservable(){const he=new x.y;return he.source=this,he}}return Ne.create=(me,he)=>new C(me,he),Ne})();class C extends Y{constructor(me,he){super(),this.destination=me,this.source=he}next(me){var he,_e;null===(_e=null===(he=this.destination)||void 0===he?void 0:he.next)||void 0===_e||_e.call(he,me)}error(me){var he,_e;null===(_e=null===(he=this.destination)||void 0===he?void 0:he.error)||void 0===_e||_e.call(he,me)}complete(){var me,he;null===(he=null===(me=this.destination)||void 0===me?void 0:me.complete)||void 0===he||he.call(me)}_subscribe(me){var he,_e;return null!==(_e=null===(he=this.source)||void 0===he?void 0:he.subscribe(me))&&void 0!==_e?_e:h.Lc}}},305:(Nn,yt,k)=>{"use strict";k.d(yt,{Hp:()=>Be,Lv:()=>_e});var x=k(4674),h=k(7394),y=k(2653),s=k(3894),J=k(2420);const ie=Ne("C",void 0,void 0);function Ne(le,ue,ct){return{kind:le,value:ue,error:ct}}var me=k(7599),he=k(1441);class _e extends h.w0{constructor(ue){super(),this.isStopped=!1,ue?(this.destination=ue,(0,h.Nn)(ue)&&ue.add(this)):this.destination=et}static create(ue,ct,ht){return new Be(ue,ct,ht)}next(ue){this.isStopped?Ue(function C(le){return Ne("N",le,void 0)}(ue),this):this._next(ue)}error(ue){this.isStopped?Ue(function Y(le){return Ne("E",void 0,le)}(ue),this):(this.isStopped=!0,this._error(ue))}complete(){this.isStopped?Ue(ie,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(ue){this.destination.next(ue)}_error(ue){try{this.destination.error(ue)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const ee=Function.prototype.bind;function ae(le,ue){return ee.call(le,ue)}class oe{constructor(ue){this.partialObserver=ue}next(ue){const{partialObserver:ct}=this;if(ct.next)try{ct.next(ue)}catch(ht){Ie(ht)}}error(ue){const{partialObserver:ct}=this;if(ct.error)try{ct.error(ue)}catch(ht){Ie(ht)}else Ie(ue)}complete(){const{partialObserver:ue}=this;if(ue.complete)try{ue.complete()}catch(ct){Ie(ct)}}}class Be extends _e{constructor(ue,ct,ht){let Le;if(super(),(0,x.m)(ue)||!ue)Le={next:ue??void 0,error:ct??void 0,complete:ht??void 0};else{let ye;this&&y.config.useDeprecatedNextContext?(ye=Object.create(ue),ye.unsubscribe=()=>this.unsubscribe(),Le={next:ue.next&&ae(ue.next,ye),error:ue.error&&ae(ue.error,ye),complete:ue.complete&&ae(ue.complete,ye)}):Le=ue}this.destination=new oe(Le)}}function Ie(le){y.config.useDeprecatedSynchronousErrorHandling?(0,he.O)(le):(0,s.h)(le)}function Ue(le,ue){const{onStoppedNotification:ct}=y.config;ct&&me.z.setTimeout(()=>ct(le,ue))}const et={closed:!0,next:J.Z,error:function Ee(le){throw le},complete:J.Z}},7394:(Nn,yt,k)=>{"use strict";k.d(yt,{Lc:()=>ie,w0:()=>J,Nn:()=>Y});var x=k(4674);const y=(0,k(2306).d)(Ne=>function(he){Ne(this),this.message=he?`${he.length} errors occurred during unsubscription:\n${he.map((_e,ee)=>`${ee+1}) ${_e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=he});var s=k(9039);class J{constructor(me){this.initialTeardown=me,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let me;if(!this.closed){this.closed=!0;const{_parentage:he}=this;if(he)if(this._parentage=null,Array.isArray(he))for(const ae of he)ae.remove(this);else he.remove(this);const{initialTeardown:_e}=this;if((0,x.m)(_e))try{_e()}catch(ae){me=ae instanceof y?ae.errors:[ae]}const{_finalizers:ee}=this;if(ee){this._finalizers=null;for(const ae of ee)try{C(ae)}catch(oe){me=me??[],oe instanceof y?me=[...me,...oe.errors]:me.push(oe)}}if(me)throw new y(me)}}add(me){var he;if(me&&me!==this)if(this.closed)C(me);else{if(me instanceof J){if(me.closed||me._hasParent(this))return;me._addParent(this)}(this._finalizers=null!==(he=this._finalizers)&&void 0!==he?he:[]).push(me)}}_hasParent(me){const{_parentage:he}=this;return he===me||Array.isArray(he)&&he.includes(me)}_addParent(me){const{_parentage:he}=this;this._parentage=Array.isArray(he)?(he.push(me),he):he?[he,me]:me}_removeParent(me){const{_parentage:he}=this;he===me?this._parentage=null:Array.isArray(he)&&(0,s.P)(he,me)}remove(me){const{_finalizers:he}=this;he&&(0,s.P)(he,me),me instanceof J&&me._removeParent(this)}}J.EMPTY=(()=>{const Ne=new J;return Ne.closed=!0,Ne})();const ie=J.EMPTY;function Y(Ne){return Ne instanceof J||Ne&&"closed"in Ne&&(0,x.m)(Ne.remove)&&(0,x.m)(Ne.add)&&(0,x.m)(Ne.unsubscribe)}function C(Ne){(0,x.m)(Ne)?Ne():Ne.unsubscribe()}},2653:(Nn,yt,k)=>{"use strict";k.d(yt,{config:()=>x});const x={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2572:(Nn,yt,k)=>{"use strict";k.d(yt,{a:()=>me});var x=k(5592),h=k(7453),y=k(7715),s=k(2737),J=k(7400),ie=k(4564),Y=k(2714),C=k(8251),Ne=k(7103);function me(...ee){const ae=(0,ie.yG)(ee),oe=(0,ie.jO)(ee),{args:Be,keys:Ie}=(0,h.D)(ee);if(0===Be.length)return(0,y.D)([],ae);const Ee=new x.y(function he(ee,ae,oe=s.y){return Be=>{_e(ae,()=>{const{length:Ie}=ee,Ee=new Array(Ie);let Ue=Ie,et=Ie;for(let le=0;le{const ue=(0,y.D)(ee[le],ae);let ct=!1;ue.subscribe((0,C.x)(Be,ht=>{Ee[le]=ht,ct||(ct=!0,et--),et||Be.next(oe(Ee.slice()))},()=>{--Ue||Be.complete()}))},Be)},Be)}}(Be,ae,Ie?Ue=>(0,Y.n)(Ie,Ue):s.y));return oe?Ee.pipe((0,J.Z)(oe)):Ee}function _e(ee,ae,oe){ee?(0,Ne.f)(oe,ee,ae):ae()}},5211:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>J});var x=k(7537),y=k(4564),s=k(7715);function J(...ie){return function h(){return(0,x.J)(1)}()((0,s.D)(ie,(0,y.yG)(ie)))}},4911:(Nn,yt,k)=>{"use strict";k.d(yt,{P:()=>y});var x=k(5592),h=k(4829);function y(s){return new x.y(J=>{(0,h.Xf)(s()).subscribe(J)})}},6232:(Nn,yt,k)=>{"use strict";k.d(yt,{E:()=>h});const h=new(k(5592).y)(J=>J.complete())},9315:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>C});var x=k(5592),h=k(7453),y=k(4829),s=k(4564),J=k(8251),ie=k(7400),Y=k(2714);function C(...Ne){const me=(0,s.jO)(Ne),{args:he,keys:_e}=(0,h.D)(Ne),ee=new x.y(ae=>{const{length:oe}=he;if(!oe)return void ae.complete();const Be=new Array(oe);let Ie=oe,Ee=oe;for(let Ue=0;Ue{et||(et=!0,Ee--),Be[Ue]=le},()=>Ie--,void 0,()=>{(!Ie||!et)&&(Ee||ae.next(_e?(0,Y.n)(_e,Be):Be),ae.complete())}))}});return me?ee.pipe((0,ie.Z)(me)):ee}},7715:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>ht});var x=k(4829),h=k(7103),y=k(9360),s=k(8251);function J(Le,ye=0){return(0,y.e)((gt,De)=>{gt.subscribe((0,s.x)(De,Pe=>(0,h.f)(De,Le,()=>De.next(Pe),ye),()=>(0,h.f)(De,Le,()=>De.complete(),ye),Pe=>(0,h.f)(De,Le,()=>De.error(Pe),ye)))})}function ie(Le,ye=0){return(0,y.e)((gt,De)=>{De.add(Le.schedule(()=>gt.subscribe(De),ye))})}var Ne=k(5592),he=k(4971),_e=k(4674);function ae(Le,ye){if(!Le)throw new Error("Iterable cannot be null");return new Ne.y(gt=>{(0,h.f)(gt,ye,()=>{const De=Le[Symbol.asyncIterator]();(0,h.f)(gt,ye,()=>{De.next().then(Pe=>{Pe.done?gt.complete():gt.next(Pe.value)})},0,!0)})})}var oe=k(8382),Be=k(4026),Ie=k(4266),Ee=k(3664),Ue=k(5726),et=k(9853),le=k(541);function ht(Le,ye){return ye?function ct(Le,ye){if(null!=Le){if((0,oe.c)(Le))return function Y(Le,ye){return(0,x.Xf)(Le).pipe(ie(ye),J(ye))}(Le,ye);if((0,Ie.z)(Le))return function me(Le,ye){return new Ne.y(gt=>{let De=0;return ye.schedule(function(){De===Le.length?gt.complete():(gt.next(Le[De++]),gt.closed||this.schedule())})})}(Le,ye);if((0,Be.t)(Le))return function C(Le,ye){return(0,x.Xf)(Le).pipe(ie(ye),J(ye))}(Le,ye);if((0,Ue.D)(Le))return ae(Le,ye);if((0,Ee.T)(Le))return function ee(Le,ye){return new Ne.y(gt=>{let De;return(0,h.f)(gt,ye,()=>{De=Le[he.h](),(0,h.f)(gt,ye,()=>{let Pe,Ae;try{({value:Pe,done:Ae}=De.next())}catch(Ye){return void gt.error(Ye)}Ae?gt.complete():gt.next(Pe)},0,!0)}),()=>(0,_e.m)(De?.return)&&De.return()})}(Le,ye);if((0,le.L)(Le))return function ue(Le,ye){return ae((0,le.Q)(Le),ye)}(Le,ye)}throw(0,et.z)(Le)}(Le,ye):(0,x.Xf)(Le)}},2438:(Nn,yt,k)=>{"use strict";k.d(yt,{R:()=>me});var x=k(4829),h=k(5592),y=k(1631),s=k(4266),J=k(4674),ie=k(7400);const Y=["addListener","removeListener"],C=["addEventListener","removeEventListener"],Ne=["on","off"];function me(oe,Be,Ie,Ee){if((0,J.m)(Ie)&&(Ee=Ie,Ie=void 0),Ee)return me(oe,Be,Ie).pipe((0,ie.Z)(Ee));const[Ue,et]=function ae(oe){return(0,J.m)(oe.addEventListener)&&(0,J.m)(oe.removeEventListener)}(oe)?C.map(le=>ue=>oe[le](Be,ue,Ie)):function _e(oe){return(0,J.m)(oe.addListener)&&(0,J.m)(oe.removeListener)}(oe)?Y.map(he(oe,Be)):function ee(oe){return(0,J.m)(oe.on)&&(0,J.m)(oe.off)}(oe)?Ne.map(he(oe,Be)):[];if(!Ue&&(0,s.z)(oe))return(0,y.z)(le=>me(le,Be,Ie))((0,x.Xf)(oe));if(!Ue)throw new TypeError("Invalid event target");return new h.y(le=>{const ue=(...ct)=>le.next(1et(ue)})}function he(oe,Be){return Ie=>Ee=>oe[Ie](Be,Ee)}},4829:(Nn,yt,k)=>{"use strict";k.d(yt,{Xf:()=>ee});var x=k(7582),h=k(4266),y=k(4026),s=k(5592),J=k(8382),ie=k(5726),Y=k(9853),C=k(3664),Ne=k(541),me=k(4674),he=k(3894),_e=k(4850);function ee(le){if(le instanceof s.y)return le;if(null!=le){if((0,J.c)(le))return function ae(le){return new s.y(ue=>{const ct=le[_e.L]();if((0,me.m)(ct.subscribe))return ct.subscribe(ue);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(le);if((0,h.z)(le))return function oe(le){return new s.y(ue=>{for(let ct=0;ct{le.then(ct=>{ue.closed||(ue.next(ct),ue.complete())},ct=>ue.error(ct)).then(null,he.h)})}(le);if((0,ie.D)(le))return Ee(le);if((0,C.T)(le))return function Ie(le){return new s.y(ue=>{for(const ct of le)if(ue.next(ct),ue.closed)return;ue.complete()})}(le);if((0,Ne.L)(le))return function Ue(le){return Ee((0,Ne.Q)(le))}(le)}throw(0,Y.z)(le)}function Ee(le){return new s.y(ue=>{(function et(le,ue){var ct,ht,Le,ye;return(0,x.mG)(this,void 0,void 0,function*(){try{for(ct=(0,x.KL)(le);!(ht=yield ct.next()).done;)if(ue.next(ht.value),ue.closed)return}catch(gt){Le={error:gt}}finally{try{ht&&!ht.done&&(ye=ct.return)&&(yield ye.call(ct))}finally{if(Le)throw Le.error}}ue.complete()})})(le,ue).catch(ct=>ue.error(ct))})}},2096:(Nn,yt,k)=>{"use strict";k.d(yt,{of:()=>y});var x=k(4564),h=k(7715);function y(...s){const J=(0,x.yG)(s);return(0,h.D)(s,J)}},8251:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>h});var x=k(305);function h(s,J,ie,Y,C){return new y(s,J,ie,Y,C)}class y extends x.Lv{constructor(J,ie,Y,C,Ne,me){super(J),this.onFinalize=Ne,this.shouldUnsubscribe=me,this._next=ie?function(he){try{ie(he)}catch(_e){J.error(_e)}}:super._next,this._error=C?function(he){try{C(he)}catch(_e){J.error(_e)}finally{this.unsubscribe()}}:super._error,this._complete=Y?function(){try{Y()}catch(he){J.error(he)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var J;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:ie}=this;super.unsubscribe(),!ie&&(null===(J=this.onFinalize)||void 0===J||J.call(this))}}}},6328:(Nn,yt,k)=>{"use strict";k.d(yt,{b:()=>y});var x=k(1631),h=k(4674);function y(s,J){return(0,h.m)(J)?(0,x.z)(s,J,1):(0,x.z)(s,1)}},3997:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>s});var x=k(2737),h=k(9360),y=k(8251);function s(ie,Y=x.y){return ie=ie??J,(0,h.e)((C,Ne)=>{let me,he=!0;C.subscribe((0,y.x)(Ne,_e=>{const ee=Y(_e);(he||!ie(me,ee))&&(he=!1,me=ee,Ne.next(_e))}))})}function J(ie,Y){return ie===Y}},2181:(Nn,yt,k)=>{"use strict";k.d(yt,{h:()=>y});var x=k(9360),h=k(8251);function y(s,J){return(0,x.e)((ie,Y)=>{let C=0;ie.subscribe((0,h.x)(Y,Ne=>s.call(J,Ne,C++)&&Y.next(Ne)))})}},4716:(Nn,yt,k)=>{"use strict";k.d(yt,{x:()=>h});var x=k(9360);function h(y){return(0,x.e)((s,J)=>{try{s.subscribe(J)}finally{J.add(y)}})}},7398:(Nn,yt,k)=>{"use strict";k.d(yt,{U:()=>y});var x=k(9360),h=k(8251);function y(s,J){return(0,x.e)((ie,Y)=>{let C=0;ie.subscribe((0,h.x)(Y,Ne=>{Y.next(s.call(J,Ne,C++))}))})}},7537:(Nn,yt,k)=>{"use strict";k.d(yt,{J:()=>y});var x=k(1631),h=k(2737);function y(s=1/0){return(0,x.z)(h.y,s)}},1631:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>C});var x=k(7398),h=k(4829),y=k(9360),s=k(7103),J=k(8251),Y=k(4674);function C(Ne,me,he=1/0){return(0,Y.m)(me)?C((_e,ee)=>(0,x.U)((ae,oe)=>me(_e,ae,ee,oe))((0,h.Xf)(Ne(_e,ee))),he):("number"==typeof me&&(he=me),(0,y.e)((_e,ee)=>function ie(Ne,me,he,_e,ee,ae,oe,Be){const Ie=[];let Ee=0,Ue=0,et=!1;const le=()=>{et&&!Ie.length&&!Ee&&me.complete()},ue=ht=>Ee<_e?ct(ht):Ie.push(ht),ct=ht=>{ae&&me.next(ht),Ee++;let Le=!1;(0,h.Xf)(he(ht,Ue++)).subscribe((0,J.x)(me,ye=>{ee?.(ye),ae?ue(ye):me.next(ye)},()=>{Le=!0},void 0,()=>{if(Le)try{for(Ee--;Ie.length&&Ee<_e;){const ye=Ie.shift();oe?(0,s.f)(me,oe,()=>ct(ye)):ct(ye)}le()}catch(ye){me.error(ye)}}))};return Ne.subscribe((0,J.x)(me,ue,()=>{et=!0,le()})),()=>{Be?.()}}(_e,ee,Ne,he)))}},3020:(Nn,yt,k)=>{"use strict";k.d(yt,{B:()=>J});var x=k(4829),h=k(8645),y=k(305),s=k(9360);function J(Y={}){const{connector:C=(()=>new h.x),resetOnError:Ne=!0,resetOnComplete:me=!0,resetOnRefCountZero:he=!0}=Y;return _e=>{let ee,ae,oe,Be=0,Ie=!1,Ee=!1;const Ue=()=>{ae?.unsubscribe(),ae=void 0},et=()=>{Ue(),ee=oe=void 0,Ie=Ee=!1},le=()=>{const ue=ee;et(),ue?.unsubscribe()};return(0,s.e)((ue,ct)=>{Be++,!Ee&&!Ie&&Ue();const ht=oe=oe??C();ct.add(()=>{Be--,0===Be&&!Ee&&!Ie&&(ae=ie(le,he))}),ht.subscribe(ct),!ee&&Be>0&&(ee=new y.Hp({next:Le=>ht.next(Le),error:Le=>{Ee=!0,Ue(),ae=ie(et,Ne,Le),ht.error(Le)},complete:()=>{Ie=!0,Ue(),ae=ie(et,me),ht.complete()}}),(0,x.Xf)(ue).subscribe(ee))})(_e)}}function ie(Y,C,...Ne){if(!0===C)return void Y();if(!1===C)return;const me=new y.Hp({next:()=>{me.unsubscribe(),Y()}});return(0,x.Xf)(C(...Ne)).subscribe(me)}},4664:(Nn,yt,k)=>{"use strict";k.d(yt,{w:()=>s});var x=k(4829),h=k(9360),y=k(8251);function s(J,ie){return(0,h.e)((Y,C)=>{let Ne=null,me=0,he=!1;const _e=()=>he&&!Ne&&C.complete();Y.subscribe((0,y.x)(C,ee=>{Ne?.unsubscribe();let ae=0;const oe=me++;(0,x.Xf)(J(ee,oe)).subscribe(Ne=(0,y.x)(C,Be=>C.next(ie?ie(ee,Be,oe,ae++):Be),()=>{Ne=null,_e()}))},()=>{he=!0,_e()}))})}},8180:(Nn,yt,k)=>{"use strict";k.d(yt,{q:()=>s});var x=k(6232),h=k(9360),y=k(8251);function s(J){return J<=0?()=>x.E:(0,h.e)((ie,Y)=>{let C=0;ie.subscribe((0,y.x)(Y,Ne=>{++C<=J&&(Y.next(Ne),J<=C&&Y.complete())}))})}},4552:(Nn,yt,k)=>{"use strict";k.d(yt,{l:()=>x});const x={now:()=>(x.delegate||Date).now(),delegate:void 0}},7599:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>x});const x={setTimeout(h,y,...s){const{delegate:J}=x;return J?.setTimeout?J.setTimeout(h,y,...s):setTimeout(h,y,...s)},clearTimeout(h){const{delegate:y}=x;return(y?.clearTimeout||clearTimeout)(h)},delegate:void 0}},4971:(Nn,yt,k)=>{"use strict";k.d(yt,{h:()=>h});const h=function x(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},4850:(Nn,yt,k)=>{"use strict";k.d(yt,{L:()=>x});const x="function"==typeof Symbol&&Symbol.observable||"@@observable"},4564:(Nn,yt,k)=>{"use strict";k.d(yt,{_6:()=>ie,jO:()=>s,yG:()=>J});var x=k(4674);function y(Y){return Y[Y.length-1]}function s(Y){return(0,x.m)(y(Y))?Y.pop():void 0}function J(Y){return function h(Y){return Y&&(0,x.m)(Y.schedule)}(y(Y))?Y.pop():void 0}function ie(Y,C){return"number"==typeof y(Y)?Y.pop():C}},7453:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>J});const{isArray:x}=Array,{getPrototypeOf:h,prototype:y,keys:s}=Object;function J(Y){if(1===Y.length){const C=Y[0];if(x(C))return{args:C,keys:null};if(function ie(Y){return Y&&"object"==typeof Y&&h(Y)===y}(C)){const Ne=s(C);return{args:Ne.map(me=>C[me]),keys:Ne}}}return{args:Y,keys:null}}},9039:(Nn,yt,k)=>{"use strict";function x(h,y){if(h){const s=h.indexOf(y);0<=s&&h.splice(s,1)}}k.d(yt,{P:()=>x})},2306:(Nn,yt,k)=>{"use strict";function x(h){const s=h(J=>{Error.call(J),J.stack=(new Error).stack});return s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s}k.d(yt,{d:()=>x})},2714:(Nn,yt,k)=>{"use strict";function x(h,y){return h.reduce((s,J,ie)=>(s[J]=y[ie],s),{})}k.d(yt,{n:()=>x})},1441:(Nn,yt,k)=>{"use strict";k.d(yt,{O:()=>s,x:()=>y});var x=k(2653);let h=null;function y(J){if(x.config.useDeprecatedSynchronousErrorHandling){const ie=!h;if(ie&&(h={errorThrown:!1,error:null}),J(),ie){const{errorThrown:Y,error:C}=h;if(h=null,Y)throw C}}else J()}function s(J){x.config.useDeprecatedSynchronousErrorHandling&&h&&(h.errorThrown=!0,h.error=J)}},7103:(Nn,yt,k)=>{"use strict";function x(h,y,s,J=0,ie=!1){const Y=y.schedule(function(){s(),ie?h.add(this.schedule(null,J)):this.unsubscribe()},J);if(h.add(Y),!ie)return Y}k.d(yt,{f:()=>x})},2737:(Nn,yt,k)=>{"use strict";function x(h){return h}k.d(yt,{y:()=>x})},4266:(Nn,yt,k)=>{"use strict";k.d(yt,{z:()=>x});const x=h=>h&&"number"==typeof h.length&&"function"!=typeof h},5726:(Nn,yt,k)=>{"use strict";k.d(yt,{D:()=>h});var x=k(4674);function h(y){return Symbol.asyncIterator&&(0,x.m)(y?.[Symbol.asyncIterator])}},4674:(Nn,yt,k)=>{"use strict";function x(h){return"function"==typeof h}k.d(yt,{m:()=>x})},8382:(Nn,yt,k)=>{"use strict";k.d(yt,{c:()=>y});var x=k(4850),h=k(4674);function y(s){return(0,h.m)(s[x.L])}},3664:(Nn,yt,k)=>{"use strict";k.d(yt,{T:()=>y});var x=k(4971),h=k(4674);function y(s){return(0,h.m)(s?.[x.h])}},2664:(Nn,yt,k)=>{"use strict";k.d(yt,{b:()=>y});var x=k(5592),h=k(4674);function y(s){return!!s&&(s instanceof x.y||(0,h.m)(s.lift)&&(0,h.m)(s.subscribe))}},4026:(Nn,yt,k)=>{"use strict";k.d(yt,{t:()=>h});var x=k(4674);function h(y){return(0,x.m)(y?.then)}},541:(Nn,yt,k)=>{"use strict";k.d(yt,{L:()=>s,Q:()=>y});var x=k(7582),h=k(4674);function y(J){return(0,x.FC)(this,arguments,function*(){const Y=J.getReader();try{for(;;){const{value:C,done:Ne}=yield(0,x.qq)(Y.read());if(Ne)return yield(0,x.qq)(void 0);yield yield(0,x.qq)(C)}}finally{Y.releaseLock()}})}function s(J){return(0,h.m)(J?.getReader)}},9360:(Nn,yt,k)=>{"use strict";k.d(yt,{A:()=>h,e:()=>y});var x=k(4674);function h(s){return(0,x.m)(s?.lift)}function y(s){return J=>{if(h(J))return J.lift(function(ie){try{return s(ie,this)}catch(Y){this.error(Y)}});throw new TypeError("Unable to lift unknown Observable type")}}},7400:(Nn,yt,k)=>{"use strict";k.d(yt,{Z:()=>s});var x=k(7398);const{isArray:h}=Array;function s(J){return(0,x.U)(ie=>function y(J,ie){return h(ie)?J(...ie):J(ie)}(J,ie))}},2420:(Nn,yt,k)=>{"use strict";function x(){}k.d(yt,{Z:()=>x})},8407:(Nn,yt,k)=>{"use strict";k.d(yt,{U:()=>y,z:()=>h});var x=k(2737);function h(...s){return y(s)}function y(s){return 0===s.length?x.y:1===s.length?s[0]:function(ie){return s.reduce((Y,C)=>C(Y),ie)}}},3894:(Nn,yt,k)=>{"use strict";k.d(yt,{h:()=>y});var x=k(2653),h=k(7599);function y(s){h.z.setTimeout(()=>{const{onUnhandledError:J}=x.config;if(!J)throw s;J(s)})}},9853:(Nn,yt,k)=>{"use strict";function x(h){return new TypeError(`You provided ${null!==h&&"object"==typeof h?"an invalid object":`'${h}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}k.d(yt,{z:()=>x})},863:(Nn,yt,k)=>{var x={"./ion-accordion_2.entry.js":[8484,8592,8484],"./ion-action-sheet.entry.js":[9882,8592,9882],"./ion-alert.entry.js":[6304,8592,6304],"./ion-app_8.entry.js":[5860,8592,5860],"./ion-avatar_3.entry.js":[3544,3544],"./ion-back-button.entry.js":[505,8592,505],"./ion-backdrop.entry.js":[469,469],"./ion-breadcrumb_2.entry.js":[9857,8592,9857],"./ion-button_2.entry.js":[1372,1372],"./ion-card_5.entry.js":[3150,3150],"./ion-checkbox.entry.js":[7635,8592,7635],"./ion-chip.entry.js":[6673,6673],"./ion-col_3.entry.js":[1315,1315],"./ion-datetime-button.entry.js":[433,1207,433],"./ion-datetime_3.entry.js":[7059,1207,8592,7059],"./ion-fab_3.entry.js":[4087,8592,4087],"./ion-img.entry.js":[1745,1745],"./ion-infinite-scroll_2.entry.js":[9352,8592,9352],"./ion-input.entry.js":[4530,8592,4530],"./ion-item-option_3.entry.js":[8633,8592,8633],"./ion-item_8.entry.js":[5962,8592,5962],"./ion-loading.entry.js":[3483,3483],"./ion-menu_3.entry.js":[2939,8592,8382],"./ion-modal.entry.js":[8577,8592,8577],"./ion-nav_2.entry.js":[5675,8592,5675],"./ion-picker-column-internal.entry.js":[9992,8592,9992],"./ion-picker-internal.entry.js":[9820,9820],"./ion-popover.entry.js":[185,185],"./ion-progress-bar.entry.js":[5454,5454],"./ion-radio_2.entry.js":[4458,8592,4458],"./ion-range.entry.js":[7666,8592,7666],"./ion-refresher_2.entry.js":[7219,8592,7219],"./ion-reorder_2.entry.js":[2975,8592,2975],"./ion-ripple-effect.entry.js":[7465,7465],"./ion-route_4.entry.js":[4764,4764],"./ion-searchbar.entry.js":[3998,8592,3998],"./ion-segment_2.entry.js":[3672,8592,3672],"./ion-select_3.entry.js":[6754,8592,6754],"./ion-spinner.entry.js":[9588,8592,9588],"./ion-split-pane.entry.js":[9793,9793],"./ion-tab-bar_2.entry.js":[4090,8592,4090],"./ion-tab_2.entry.js":[2841,2841],"./ion-text.entry.js":[8811,8811],"./ion-textarea.entry.js":[3734,8592,3734],"./ion-toast.entry.js":[6642,6642],"./ion-toggle.entry.js":[8866,8592,8866]};function h(y){if(!k.o(x,y))return Promise.resolve().then(()=>{var ie=new Error("Cannot find module '"+y+"'");throw ie.code="MODULE_NOT_FOUND",ie});var s=x[y],J=s[0];return Promise.all(s.slice(1).map(k.e)).then(()=>k(J))}h.keys=()=>Object.keys(x),h.id=863,Nn.exports=h},6814:(Nn,yt,k)=>{"use strict";k.d(yt,{Do:()=>Be,EM:()=>Xo,HT:()=>s,JF:()=>ws,JJ:()=>Po,K0:()=>ie,Mx:()=>Ar,O5:()=>Eo,PM:()=>bo,S$:()=>ee,V_:()=>C,Ye:()=>Ie,b0:()=>oe,bD:()=>_o,ez:()=>Rr,q:()=>y,sg:()=>xr,tP:()=>vn,uU:()=>ds,w_:()=>J});var x=k(2029);let h=null;function y(){return h}function s(N){h||(h=N)}class J{}const ie=new x.OlP("DocumentToken");let Y=(()=>{var N;class ne{historyGo(Q){throw new Error("Not implemented")}}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275prov=x.Yz7({token:N,factory:function(){return(0,x.f3M)(Ne)},providedIn:"platform"}),ne})();const C=new x.OlP("Location Initialized");let Ne=(()=>{var N;class ne extends Y{constructor(){super(),this._doc=(0,x.f3M)(ie),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return y().getBaseHref(this._doc)}onPopState(Q){const He=y().getGlobalEventTarget(this._doc,"window");return He.addEventListener("popstate",Q,!1),()=>He.removeEventListener("popstate",Q)}onHashChange(Q){const He=y().getGlobalEventTarget(this._doc,"window");return He.addEventListener("hashchange",Q,!1),()=>He.removeEventListener("hashchange",Q)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(Q){this._location.pathname=Q}pushState(Q,He,At){this._history.pushState(Q,He,At)}replaceState(Q,He,At){this._history.replaceState(Q,He,At)}forward(){this._history.forward()}back(){this._history.back()}historyGo(Q=0){this._history.go(Q)}getState(){return this._history.state}}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275prov=x.Yz7({token:N,factory:function(){return new N},providedIn:"platform"}),ne})();function me(N,ne){if(0==N.length)return ne;if(0==ne.length)return N;let it=0;return N.endsWith("/")&&it++,ne.startsWith("/")&&it++,2==it?N+ne.substring(1):1==it?N+ne:N+"/"+ne}function he(N){const ne=N.match(/#|\?|$/),it=ne&&ne.index||N.length;return N.slice(0,it-("/"===N[it-1]?1:0))+N.slice(it)}function _e(N){return N&&"?"!==N[0]?"?"+N:N}let ee=(()=>{var N;class ne{historyGo(Q){throw new Error("Not implemented")}}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275prov=x.Yz7({token:N,factory:function(){return(0,x.f3M)(oe)},providedIn:"root"}),ne})();const ae=new x.OlP("appBaseHref");let oe=(()=>{var N;class ne extends ee{constructor(Q,He){super(),this._platformLocation=Q,this._removeListenerFns=[],this._baseHref=He??this._platformLocation.getBaseHrefFromDOM()??(0,x.f3M)(ie).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(Q){this._removeListenerFns.push(this._platformLocation.onPopState(Q),this._platformLocation.onHashChange(Q))}getBaseHref(){return this._baseHref}prepareExternalUrl(Q){return me(this._baseHref,Q)}path(Q=!1){const He=this._platformLocation.pathname+_e(this._platformLocation.search),At=this._platformLocation.hash;return At&&Q?`${He}${At}`:He}pushState(Q,He,At,cn){const ri=this.prepareExternalUrl(At+_e(cn));this._platformLocation.pushState(Q,He,ri)}replaceState(Q,He,At,cn){const ri=this.prepareExternalUrl(At+_e(cn));this._platformLocation.replaceState(Q,He,ri)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(Q=0){this._platformLocation.historyGo?.(Q)}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.LFG(Y),x.LFG(ae,8))},N.\u0275prov=x.Yz7({token:N,factory:N.\u0275fac,providedIn:"root"}),ne})(),Be=(()=>{var N;class ne extends ee{constructor(Q,He){super(),this._platformLocation=Q,this._baseHref="",this._removeListenerFns=[],null!=He&&(this._baseHref=He)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(Q){this._removeListenerFns.push(this._platformLocation.onPopState(Q),this._platformLocation.onHashChange(Q))}getBaseHref(){return this._baseHref}path(Q=!1){let He=this._platformLocation.hash;return null==He&&(He="#"),He.length>0?He.substring(1):He}prepareExternalUrl(Q){const He=me(this._baseHref,Q);return He.length>0?"#"+He:He}pushState(Q,He,At,cn){let ri=this.prepareExternalUrl(At+_e(cn));0==ri.length&&(ri=this._platformLocation.pathname),this._platformLocation.pushState(Q,He,ri)}replaceState(Q,He,At,cn){let ri=this.prepareExternalUrl(At+_e(cn));0==ri.length&&(ri=this._platformLocation.pathname),this._platformLocation.replaceState(Q,He,ri)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(Q=0){this._platformLocation.historyGo?.(Q)}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.LFG(Y),x.LFG(ae,8))},N.\u0275prov=x.Yz7({token:N,factory:N.\u0275fac}),ne})(),Ie=(()=>{var N;class ne{constructor(Q){this._subject=new x.vpe,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=Q;const He=this._locationStrategy.getBaseHref();this._basePath=function le(N){if(new RegExp("^(https?:)?//").test(N)){const[,it]=N.split(/\/\/[^\/]+/);return it}return N}(he(et(He))),this._locationStrategy.onPopState(At=>{this._subject.emit({url:this.path(!0),pop:!0,state:At.state,type:At.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(Q=!1){return this.normalize(this._locationStrategy.path(Q))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(Q,He=""){return this.path()==this.normalize(Q+_e(He))}normalize(Q){return ne.stripTrailingSlash(function Ue(N,ne){if(!N||!ne.startsWith(N))return ne;const it=ne.substring(N.length);return""===it||["/",";","?","#"].includes(it[0])?it:ne}(this._basePath,et(Q)))}prepareExternalUrl(Q){return Q&&"/"!==Q[0]&&(Q="/"+Q),this._locationStrategy.prepareExternalUrl(Q)}go(Q,He="",At=null){this._locationStrategy.pushState(At,"",Q,He),this._notifyUrlChangeListeners(this.prepareExternalUrl(Q+_e(He)),At)}replaceState(Q,He="",At=null){this._locationStrategy.replaceState(At,"",Q,He),this._notifyUrlChangeListeners(this.prepareExternalUrl(Q+_e(He)),At)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(Q=0){this._locationStrategy.historyGo?.(Q)}onUrlChange(Q){return this._urlChangeListeners.push(Q),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(He=>{this._notifyUrlChangeListeners(He.url,He.state)})),()=>{const He=this._urlChangeListeners.indexOf(Q);this._urlChangeListeners.splice(He,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(Q="",He){this._urlChangeListeners.forEach(At=>At(Q,He))}subscribe(Q,He,At){return this._subject.subscribe({next:Q,error:He,complete:At})}}return(N=ne).normalizeQueryParams=_e,N.joinWithSlash=me,N.stripTrailingSlash=he,N.\u0275fac=function(Q){return new(Q||N)(x.LFG(ee))},N.\u0275prov=x.Yz7({token:N,factory:function(){return function Ee(){return new Ie((0,x.LFG)(ee))}()},providedIn:"root"}),ne})();function et(N){return N.replace(/\/index.html$/,"")}var ct=function(N){return N[N.Decimal=0]="Decimal",N[N.Percent=1]="Percent",N[N.Currency=2]="Currency",N[N.Scientific=3]="Scientific",N}(ct||{}),Le=function(N){return N[N.Format=0]="Format",N[N.Standalone=1]="Standalone",N}(Le||{}),ye=function(N){return N[N.Narrow=0]="Narrow",N[N.Abbreviated=1]="Abbreviated",N[N.Wide=2]="Wide",N[N.Short=3]="Short",N}(ye||{}),gt=function(N){return N[N.Short=0]="Short",N[N.Medium=1]="Medium",N[N.Long=2]="Long",N[N.Full=3]="Full",N}(gt||{}),De=function(N){return N[N.Decimal=0]="Decimal",N[N.Group=1]="Group",N[N.List=2]="List",N[N.PercentSign=3]="PercentSign",N[N.PlusSign=4]="PlusSign",N[N.MinusSign=5]="MinusSign",N[N.Exponential=6]="Exponential",N[N.SuperscriptingExponent=7]="SuperscriptingExponent",N[N.PerMille=8]="PerMille",N[N.Infinity=9]="Infinity",N[N.NaN=10]="NaN",N[N.TimeSeparator=11]="TimeSeparator",N[N.CurrencyDecimal=12]="CurrencyDecimal",N[N.CurrencyGroup=13]="CurrencyGroup",N}(De||{});function Je(N,ne){return Yt((0,x.cg1)(N)[x.wAp.DateFormat],ne)}function Re(N,ne){return Yt((0,x.cg1)(N)[x.wAp.TimeFormat],ne)}function Fe(N,ne){return Yt((0,x.cg1)(N)[x.wAp.DateTimeFormat],ne)}function St(N,ne){const it=(0,x.cg1)(N),Q=it[x.wAp.NumberSymbols][ne];if(typeof Q>"u"){if(ne===De.CurrencyDecimal)return it[x.wAp.NumberSymbols][De.Decimal];if(ne===De.CurrencyGroup)return it[x.wAp.NumberSymbols][De.Group]}return Q}function kt(N){if(!N[x.wAp.ExtraData])throw new Error(`Missing extra locale data for the locale "${N[x.wAp.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Yt(N,ne){for(let it=ne;it>-1;it--)if(typeof N[it]<"u")return N[it];throw new Error("Locale data API: locale data undefined")}function Ut(N){const[ne,it]=N.split(":");return{hours:+ne,minutes:+it}}const Jn=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Wt={},wt=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var vt=function(N){return N[N.Short=0]="Short",N[N.ShortGMT=1]="ShortGMT",N[N.Long=2]="Long",N[N.Extended=3]="Extended",N}(vt||{}),ln=function(N){return N[N.FullYear=0]="FullYear",N[N.Month=1]="Month",N[N.Date=2]="Date",N[N.Hours=3]="Hours",N[N.Minutes=4]="Minutes",N[N.Seconds=5]="Seconds",N[N.FractionalSeconds=6]="FractionalSeconds",N[N.Day=7]="Day",N}(ln||{}),ni=function(N){return N[N.DayPeriods=0]="DayPeriods",N[N.Days=1]="Days",N[N.Months=2]="Months",N[N.Eras=3]="Eras",N}(ni||{});function er(N,ne,it,Q){let He=function pe(N){if(xe(N))return N;if("number"==typeof N&&!isNaN(N))return new Date(N);if("string"==typeof N){if(N=N.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(N)){const[He,At=1,cn=1]=N.split("-").map(ri=>+ri);return lr(He,At-1,cn)}const it=parseFloat(N);if(!isNaN(N-it))return new Date(it);let Q;if(Q=N.match(Jn))return function ze(N){const ne=new Date(0);let it=0,Q=0;const He=N[8]?ne.setUTCFullYear:ne.setFullYear,At=N[8]?ne.setUTCHours:ne.setHours;N[9]&&(it=Number(N[9]+N[10]),Q=Number(N[9]+N[11])),He.call(ne,Number(N[1]),Number(N[2])-1,Number(N[3]));const cn=Number(N[4]||0)-it,ri=Number(N[5]||0)-Q,fr=Number(N[6]||0),Xi=Math.floor(1e3*parseFloat("0."+(N[7]||0)));return At.call(ne,cn,ri,fr,Xi),ne}(Q)}const ne=new Date(N);if(!xe(ne))throw new Error(`Unable to convert "${N}" into a date`);return ne}(N);ne=mi(it,ne)||ne;let ri,cn=[];for(;ne;){if(ri=wt.exec(ne),!ri){cn.push(ne);break}{cn=cn.concat(ri.slice(1));const pr=cn.pop();if(!pr)break;ne=pr}}let fr=He.getTimezoneOffset();Q&&(fr=Xt(Q,fr),He=function zn(N,ne,it){const Q=it?-1:1,He=N.getTimezoneOffset();return function Sn(N,ne){return(N=new Date(N.getTime())).setMinutes(N.getMinutes()+ne),N}(N,Q*(Xt(ne,He)-He))}(He,Q,!0));let Xi="";return cn.forEach(pr=>{const sr=function Et(N){if(jt[N])return jt[N];let ne;switch(N){case"G":case"GG":case"GGG":ne=_n(ni.Eras,ye.Abbreviated);break;case"GGGG":ne=_n(ni.Eras,ye.Wide);break;case"GGGGG":ne=_n(ni.Eras,ye.Narrow);break;case"y":ne=qn(ln.FullYear,1,0,!1,!0);break;case"yy":ne=qn(ln.FullYear,2,0,!0,!0);break;case"yyy":ne=qn(ln.FullYear,3,0,!1,!0);break;case"yyyy":ne=qn(ln.FullYear,4,0,!1,!0);break;case"Y":ne=Bt(1);break;case"YY":ne=Bt(2,!0);break;case"YYY":ne=Bt(3);break;case"YYYY":ne=Bt(4);break;case"M":case"L":ne=qn(ln.Month,1,1);break;case"MM":case"LL":ne=qn(ln.Month,2,1);break;case"MMM":ne=_n(ni.Months,ye.Abbreviated);break;case"MMMM":ne=_n(ni.Months,ye.Wide);break;case"MMMMM":ne=_n(ni.Months,ye.Narrow);break;case"LLL":ne=_n(ni.Months,ye.Abbreviated,Le.Standalone);break;case"LLLL":ne=_n(ni.Months,ye.Wide,Le.Standalone);break;case"LLLLL":ne=_n(ni.Months,ye.Narrow,Le.Standalone);break;case"w":ne=Ct(1);break;case"ww":ne=Ct(2);break;case"W":ne=Ct(1,!0);break;case"d":ne=qn(ln.Date,1);break;case"dd":ne=qn(ln.Date,2);break;case"c":case"cc":ne=qn(ln.Day,1);break;case"ccc":ne=_n(ni.Days,ye.Abbreviated,Le.Standalone);break;case"cccc":ne=_n(ni.Days,ye.Wide,Le.Standalone);break;case"ccccc":ne=_n(ni.Days,ye.Narrow,Le.Standalone);break;case"cccccc":ne=_n(ni.Days,ye.Short,Le.Standalone);break;case"E":case"EE":case"EEE":ne=_n(ni.Days,ye.Abbreviated);break;case"EEEE":ne=_n(ni.Days,ye.Wide);break;case"EEEEE":ne=_n(ni.Days,ye.Narrow);break;case"EEEEEE":ne=_n(ni.Days,ye.Short);break;case"a":case"aa":case"aaa":ne=_n(ni.DayPeriods,ye.Abbreviated);break;case"aaaa":ne=_n(ni.DayPeriods,ye.Wide);break;case"aaaaa":ne=_n(ni.DayPeriods,ye.Narrow);break;case"b":case"bb":case"bbb":ne=_n(ni.DayPeriods,ye.Abbreviated,Le.Standalone,!0);break;case"bbbb":ne=_n(ni.DayPeriods,ye.Wide,Le.Standalone,!0);break;case"bbbbb":ne=_n(ni.DayPeriods,ye.Narrow,Le.Standalone,!0);break;case"B":case"BB":case"BBB":ne=_n(ni.DayPeriods,ye.Abbreviated,Le.Format,!0);break;case"BBBB":ne=_n(ni.DayPeriods,ye.Wide,Le.Format,!0);break;case"BBBBB":ne=_n(ni.DayPeriods,ye.Narrow,Le.Format,!0);break;case"h":ne=qn(ln.Hours,1,-12);break;case"hh":ne=qn(ln.Hours,2,-12);break;case"H":ne=qn(ln.Hours,1);break;case"HH":ne=qn(ln.Hours,2);break;case"m":ne=qn(ln.Minutes,1);break;case"mm":ne=qn(ln.Minutes,2);break;case"s":ne=qn(ln.Seconds,1);break;case"ss":ne=qn(ln.Seconds,2);break;case"S":ne=qn(ln.FractionalSeconds,1);break;case"SS":ne=qn(ln.FractionalSeconds,2);break;case"SSS":ne=qn(ln.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":ne=nt(vt.Short);break;case"ZZZZZ":ne=nt(vt.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":ne=nt(vt.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":ne=nt(vt.Long);break;default:return null}return jt[N]=ne,ne}(pr);Xi+=sr?sr(He,it,fr):"''"===pr?"'":pr.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),Xi}function lr(N,ne,it){const Q=new Date(0);return Q.setFullYear(N,ne,it),Q.setHours(0,0,0),Q}function mi(N,ne){const it=function Ae(N){return(0,x.cg1)(N)[x.wAp.LocaleId]}(N);if(Wt[it]=Wt[it]||{},Wt[it][ne])return Wt[it][ne];let Q="";switch(ne){case"shortDate":Q=Je(N,gt.Short);break;case"mediumDate":Q=Je(N,gt.Medium);break;case"longDate":Q=Je(N,gt.Long);break;case"fullDate":Q=Je(N,gt.Full);break;case"shortTime":Q=Re(N,gt.Short);break;case"mediumTime":Q=Re(N,gt.Medium);break;case"longTime":Q=Re(N,gt.Long);break;case"fullTime":Q=Re(N,gt.Full);break;case"short":const He=mi(N,"shortTime"),At=mi(N,"shortDate");Q=Fi(Fe(N,gt.Short),[He,At]);break;case"medium":const cn=mi(N,"mediumTime"),ri=mi(N,"mediumDate");Q=Fi(Fe(N,gt.Medium),[cn,ri]);break;case"long":const fr=mi(N,"longTime"),Xi=mi(N,"longDate");Q=Fi(Fe(N,gt.Long),[fr,Xi]);break;case"full":const pr=mi(N,"fullTime"),sr=mi(N,"fullDate");Q=Fi(Fe(N,gt.Full),[pr,sr])}return Q&&(Wt[it][ne]=Q),Q}function Fi(N,ne){return ne&&(N=N.replace(/\{([^}]+)}/g,function(it,Q){return null!=ne&&Q in ne?ne[Q]:it})),N}function Cn(N,ne,it="-",Q,He){let At="";(N<0||He&&N<=0)&&(He?N=1-N:(N=-N,At=it));let cn=String(N);for(;cn.length0||ri>-it)&&(ri+=it),N===ln.Hours)0===ri&&-12===it&&(ri=12);else if(N===ln.FractionalSeconds)return function Mn(N,ne){return Cn(N,3).substring(0,ne)}(ri,ne);const fr=St(cn,De.MinusSign);return Cn(ri,ne,fr,Q,He)}}function _n(N,ne,it=Le.Format,Q=!1){return function(He,At){return function Hi(N,ne,it,Q,He,At){switch(it){case ni.Months:return function hn(N,ne,it){const Q=(0,x.cg1)(N),At=Yt([Q[x.wAp.MonthsFormat],Q[x.wAp.MonthsStandalone]],ne);return Yt(At,it)}(ne,He,Q)[N.getMonth()];case ni.Days:return function _t(N,ne,it){const Q=(0,x.cg1)(N),At=Yt([Q[x.wAp.DaysFormat],Q[x.wAp.DaysStandalone]],ne);return Yt(At,it)}(ne,He,Q)[N.getDay()];case ni.DayPeriods:const cn=N.getHours(),ri=N.getMinutes();if(At){const Xi=function dt(N){const ne=(0,x.cg1)(N);return kt(ne),(ne[x.wAp.ExtraData][2]||[]).map(Q=>"string"==typeof Q?Ut(Q):[Ut(Q[0]),Ut(Q[1])])}(ne),pr=function Ot(N,ne,it){const Q=(0,x.cg1)(N);kt(Q);const At=Yt([Q[x.wAp.ExtraData][0],Q[x.wAp.ExtraData][1]],ne)||[];return Yt(At,it)||[]}(ne,He,Q),sr=Xi.findIndex(Vi=>{if(Array.isArray(Vi)){const[Tr,ho]=Vi,ao=cn>=Tr.hours&&ri>=Tr.minutes,ps=cn0?Math.floor(He/60):Math.ceil(He/60);switch(N){case vt.Short:return(He>=0?"+":"")+Cn(cn,2,At)+Cn(Math.abs(He%60),2,At);case vt.ShortGMT:return"GMT"+(He>=0?"+":"")+Cn(cn,1,At);case vt.Long:return"GMT"+(He>=0?"+":"")+Cn(cn,2,At)+":"+Cn(Math.abs(He%60),2,At);case vt.Extended:return 0===Q?"Z":(He>=0?"+":"")+Cn(cn,2,At)+":"+Cn(Math.abs(He%60),2,At);default:throw new Error(`Unknown zone width "${N}"`)}}}const ge=0,ve=4;function ft(N){return lr(N.getFullYear(),N.getMonth(),N.getDate()+(ve-N.getDay()))}function Ct(N,ne=!1){return function(it,Q){let He;if(ne){const At=new Date(it.getFullYear(),it.getMonth(),1).getDay()-1,cn=it.getDate();He=1+Math.floor((cn+At)/7)}else{const At=ft(it),cn=function Xe(N){const ne=lr(N,ge,1).getDay();return lr(N,0,1+(ne<=ve?ve:ve+7)-ne)}(At.getFullYear()),ri=At.getTime()-cn.getTime();He=1+Math.round(ri/6048e5)}return Cn(He,N,St(Q,De.MinusSign))}}function Bt(N,ne=!1){return function(it,Q){return Cn(ft(it).getFullYear(),N,St(Q,De.MinusSign),ne)}}const jt={};function Xt(N,ne){N=N.replace(/:/g,"");const it=Date.parse("Jan 01, 1970 00:00:00 "+N)/6e4;return isNaN(it)?ne:it}function xe(N){return N instanceof Date&&!isNaN(N.valueOf())}const be=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function Li(N){const ne=parseInt(N);if(isNaN(ne))throw new Error("Invalid integer literal when parsing "+N);return ne}function Ar(N,ne){ne=encodeURIComponent(ne);for(const it of N.split(";")){const Q=it.indexOf("="),[He,At]=-1==Q?[it,""]:[it.slice(0,Q),it.slice(Q+1)];if(He.trim()===ne)return decodeURIComponent(At)}return null}class yr{constructor(ne,it,Q,He){this.$implicit=ne,this.ngForOf=it,this.index=Q,this.count=He}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let xr=(()=>{var N;class ne{set ngForOf(Q){this._ngForOf=Q,this._ngForOfDirty=!0}set ngForTrackBy(Q){this._trackByFn=Q}get ngForTrackBy(){return this._trackByFn}constructor(Q,He,At){this._viewContainer=Q,this._template=He,this._differs=At,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(Q){Q&&(this._template=Q)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const Q=this._ngForOf;!this._differ&&Q&&(this._differ=this._differs.find(Q).create(this.ngForTrackBy))}if(this._differ){const Q=this._differ.diff(this._ngForOf);Q&&this._applyChanges(Q)}}_applyChanges(Q){const He=this._viewContainer;Q.forEachOperation((At,cn,ri)=>{if(null==At.previousIndex)He.createEmbeddedView(this._template,new yr(At.item,this._ngForOf,-1,-1),null===ri?void 0:ri);else if(null==ri)He.remove(null===cn?void 0:cn);else if(null!==cn){const fr=He.get(cn);He.move(fr,ri),Sr(fr,At)}});for(let At=0,cn=He.length;At{Sr(He.get(At.currentIndex),At)})}static ngTemplateContextGuard(Q,He){return!0}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.s_b),x.Y36(x.Rgc),x.Y36(x.ZZ4))},N.\u0275dir=x.lG2({type:N,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0}),ne})();function Sr(N,ne){N.context.$implicit=ne.item}let Eo=(()=>{var N;class ne{constructor(Q,He){this._viewContainer=Q,this._context=new to,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=He}set ngIf(Q){this._context.$implicit=this._context.ngIf=Q,this._updateView()}set ngIfThen(Q){Xn("ngIfThen",Q),this._thenTemplateRef=Q,this._thenViewRef=null,this._updateView()}set ngIfElse(Q){Xn("ngIfElse",Q),this._elseTemplateRef=Q,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(Q,He){return!0}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.s_b),x.Y36(x.Rgc))},N.\u0275dir=x.lG2({type:N,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0}),ne})();class to{constructor(){this.$implicit=null,this.ngIf=null}}function Xn(N,ne){if(ne&&!ne.createEmbeddedView)throw new Error(`${N} must be a TemplateRef, but received '${(0,x.AaK)(ne)}'.`)}let vn=(()=>{var N;class ne{constructor(Q){this._viewContainerRef=Q,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null,this.ngTemplateOutletInjector=null}ngOnChanges(Q){if(Q.ngTemplateOutlet||Q.ngTemplateOutletInjector){const He=this._viewContainerRef;if(this._viewRef&&He.remove(He.indexOf(this._viewRef)),this.ngTemplateOutlet){const{ngTemplateOutlet:At,ngTemplateOutletContext:cn,ngTemplateOutletInjector:ri}=this;this._viewRef=He.createEmbeddedView(At,cn,ri?{injector:ri}:void 0)}else this._viewRef=null}else this._viewRef&&Q.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.s_b))},N.\u0275dir=x.lG2({type:N,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},standalone:!0,features:[x.TTD]}),ne})();function In(N,ne){return new x.vHH(2100,!1)}const kr=new x.OlP("DATE_PIPE_DEFAULT_TIMEZONE"),To=new x.OlP("DATE_PIPE_DEFAULT_OPTIONS");let ds=(()=>{var N;class ne{constructor(Q,He,At){this.locale=Q,this.defaultTimezone=He,this.defaultOptions=At}transform(Q,He,At,cn){if(null==Q||""===Q||Q!=Q)return null;try{return er(Q,He??this.defaultOptions?.dateFormat??"mediumDate",cn||this.locale,At??this.defaultOptions?.timezone??this.defaultTimezone??void 0)}catch(ri){throw In()}}}return(N=ne).\u0275fac=function(Q){return new(Q||N)(x.Y36(x.soG,16),x.Y36(kr,24),x.Y36(To,24))},N.\u0275pipe=x.Yjl({name:"date",type:N,pure:!0,standalone:!0}),ne})(),Po=(()=>{var N;class ne{constructor(Q){this._locale=Q}transform(Q,He,At){if(!function bs(N){return!(null==N||""===N||N!=N)}(Q))return null;At=At||this._locale;try{return function mn(N,ne,it){return function Lt(N,ne,it,Q,He,At,cn=!1){let ri="",fr=!1;if(isFinite(N)){let Xi=function gi(N){let Q,He,At,cn,ri,ne=Math.abs(N)+"",it=0;for((He=ne.indexOf("."))>-1&&(ne=ne.replace(".","")),(At=ne.search(/e/i))>0?(He<0&&(He=At),He+=+ne.slice(At+1),ne=ne.substring(0,At)):He<0&&(He=ne.length),At=0;"0"===ne.charAt(At);At++);if(At===(ri=ne.length))Q=[0],He=1;else{for(ri--;"0"===ne.charAt(ri);)ri--;for(He-=At,Q=[],cn=0;At<=ri;At++,cn++)Q[cn]=Number(ne.charAt(At))}return He>22&&(Q=Q.splice(0,21),it=He-1,He=1),{digits:Q,exponent:it,integerLen:He}}(N);cn&&(Xi=function ti(N){if(0===N.digits[0])return N;const ne=N.digits.length-N.integerLen;return N.exponent?N.exponent+=2:(0===ne?N.digits.push(0,0):1===ne&&N.digits.push(0),N.integerLen+=2),N}(Xi));let pr=ne.minInt,sr=ne.minFrac,Vi=ne.maxFrac;if(At){const No=At.match(be);if(null===No)throw new Error(`${At} is not a valid digit info`);const fo=No[1],as=No[3],Ys=No[5];null!=fo&&(pr=Li(fo)),null!=as&&(sr=Li(as)),null!=Ys?Vi=Li(Ys):null!=as&&sr>Vi&&(Vi=sr)}!function _i(N,ne,it){if(ne>it)throw new Error(`The minimum number of digits after fraction (${ne}) is higher than the maximum (${it}).`);let Q=N.digits,He=Q.length-N.integerLen;const At=Math.min(Math.max(ne,He),it);let cn=At+N.integerLen,ri=Q[cn];if(cn>0){Q.splice(Math.max(N.integerLen,cn));for(let sr=cn;sr=5)if(cn-1<0){for(let sr=0;sr>cn;sr--)Q.unshift(0),N.integerLen++;Q.unshift(1),N.integerLen++}else Q[cn-1]++;for(;He=Xi?ho.pop():fr=!1),Vi>=10?1:0},0);pr&&(Q.unshift(pr),N.integerLen++)}(Xi,sr,Vi);let Tr=Xi.digits,ho=Xi.integerLen;const ao=Xi.exponent;let ps=[];for(fr=Tr.every(No=>!No);ho0?ps=Tr.splice(ho,Tr.length):(ps=Tr,Tr=[0]);const ss=[];for(Tr.length>=ne.lgSize&&ss.unshift(Tr.splice(-ne.lgSize,Tr.length).join(""));Tr.length>ne.gSize;)ss.unshift(Tr.splice(-ne.gSize,Tr.length).join(""));Tr.length&&ss.unshift(Tr.join("")),ri=ss.join(St(it,Q)),ps.length&&(ri+=St(it,He)+ps.join("")),ao&&(ri+=St(it,De.Exponential)+"+"+ao)}else ri=St(it,De.Infinity);return ri=N<0&&!fr?ne.negPre+ri+ne.negSuf:ne.posPre+ri+ne.posSuf,ri}(N,function En(N,ne="-"){const it={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},Q=N.split(";"),He=Q[0],At=Q[1],cn=-1!==He.indexOf(".")?He.split("."):[He.substring(0,He.lastIndexOf("0")+1),He.substring(He.lastIndexOf("0")+1)],ri=cn[0],fr=cn[1]||"";it.posPre=ri.substring(0,ri.indexOf("#"));for(let pr=0;pr{var N;class ne{}return(N=ne).\u0275fac=function(Q){return new(Q||N)},N.\u0275mod=x.oAB({type:N}),N.\u0275inj=x.cJS({}),ne})();const _o="browser",rs="server";function bo(N){return N===rs}let Xo=(()=>{var N;class ne{}return(N=ne).\u0275prov=(0,x.Yz7)({token:N,providedIn:"root",factory:()=>new os((0,x.LFG)(ie),window)}),ne})();class os{constructor(ne,it){this.document=ne,this.window=it,this.offset=()=>[0,0]}setOffset(ne){this.offset=Array.isArray(ne)?()=>ne:ne}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(ne){this.supportsScrolling()&&this.window.scrollTo(ne[0],ne[1])}scrollToAnchor(ne){if(!this.supportsScrolling())return;const it=function Br(N,ne){const it=N.getElementById(ne)||N.getElementsByName(ne)[0];if(it)return it;if("function"==typeof N.createTreeWalker&&N.body&&"function"==typeof N.body.attachShadow){const Q=N.createTreeWalker(N.body,NodeFilter.SHOW_ELEMENT);let He=Q.currentNode;for(;He;){const At=He.shadowRoot;if(At){const cn=At.getElementById(ne)||At.querySelector(`[name="${ne}"]`);if(cn)return cn}He=Q.nextNode()}}return null}(this.document,ne);it&&(this.scrollToElement(it),it.focus())}setHistoryScrollRestoration(ne){this.supportsScrolling()&&(this.window.history.scrollRestoration=ne)}scrollToElement(ne){const it=ne.getBoundingClientRect(),Q=it.left+this.window.pageXOffset,He=it.top+this.window.pageYOffset,At=this.offset();this.window.scrollTo(Q-At[0],He-At[1])}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}class ws{}},9862:(Nn,yt,k)=>{"use strict";k.d(yt,{JF:()=>be,TP:()=>kt,WM:()=>ee,eN:()=>Te});var x=k(2029),h=k(2096),y=k(7715),s=k(5592),J=k(6328),ie=k(2181),Y=k(7398),C=k(4716),Ne=k(4664),me=k(6814);class he{}class _e{}class ee{constructor(st){this.normalizedNames=new Map,this.lazyUpdate=null,st?"string"==typeof st?this.lazyInit=()=>{this.headers=new Map,st.split("\n").forEach(pn=>{const mn=pn.indexOf(":");if(mn>0){const En=pn.slice(0,mn),ti=En.toLowerCase(),gi=pn.slice(mn+1).trim();this.maybeSetNormalizedName(En,ti),this.headers.has(ti)?this.headers.get(ti).push(gi):this.headers.set(ti,[gi])}})}:typeof Headers<"u"&&st instanceof Headers?(this.headers=new Map,st.forEach((pn,mn)=>{this.setHeaderEntries(mn,pn)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(st).forEach(([pn,mn])=>{this.setHeaderEntries(pn,mn)})}:this.headers=new Map}has(st){return this.init(),this.headers.has(st.toLowerCase())}get(st){this.init();const pn=this.headers.get(st.toLowerCase());return pn&&pn.length>0?pn[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(st){return this.init(),this.headers.get(st.toLowerCase())||null}append(st,pn){return this.clone({name:st,value:pn,op:"a"})}set(st,pn){return this.clone({name:st,value:pn,op:"s"})}delete(st,pn){return this.clone({name:st,value:pn,op:"d"})}maybeSetNormalizedName(st,pn){this.normalizedNames.has(pn)||this.normalizedNames.set(pn,st)}init(){this.lazyInit&&(this.lazyInit instanceof ee?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(st=>this.applyUpdate(st)),this.lazyUpdate=null))}copyFrom(st){st.init(),Array.from(st.headers.keys()).forEach(pn=>{this.headers.set(pn,st.headers.get(pn)),this.normalizedNames.set(pn,st.normalizedNames.get(pn))})}clone(st){const pn=new ee;return pn.lazyInit=this.lazyInit&&this.lazyInit instanceof ee?this.lazyInit:this,pn.lazyUpdate=(this.lazyUpdate||[]).concat([st]),pn}applyUpdate(st){const pn=st.name.toLowerCase();switch(st.op){case"a":case"s":let mn=st.value;if("string"==typeof mn&&(mn=[mn]),0===mn.length)return;this.maybeSetNormalizedName(st.name,pn);const En=("a"===st.op?this.headers.get(pn):void 0)||[];En.push(...mn),this.headers.set(pn,En);break;case"d":const ti=st.value;if(ti){let gi=this.headers.get(pn);if(!gi)return;gi=gi.filter(_i=>-1===ti.indexOf(_i)),0===gi.length?(this.headers.delete(pn),this.normalizedNames.delete(pn)):this.headers.set(pn,gi)}else this.headers.delete(pn),this.normalizedNames.delete(pn)}}setHeaderEntries(st,pn){const mn=(Array.isArray(pn)?pn:[pn]).map(ti=>ti.toString()),En=st.toLowerCase();this.headers.set(En,mn),this.maybeSetNormalizedName(st,En)}forEach(st){this.init(),Array.from(this.normalizedNames.keys()).forEach(pn=>st(this.normalizedNames.get(pn),this.headers.get(pn)))}}class oe{encodeKey(st){return Ue(st)}encodeValue(st){return Ue(st)}decodeKey(st){return decodeURIComponent(st)}decodeValue(st){return decodeURIComponent(st)}}const Ie=/%(\d[a-f0-9])/gi,Ee={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function Ue(Lt){return encodeURIComponent(Lt).replace(Ie,(st,pn)=>Ee[pn]??st)}function et(Lt){return`${Lt}`}class le{constructor(st={}){if(this.updates=null,this.cloneFrom=null,this.encoder=st.encoder||new oe,st.fromString){if(st.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function Be(Lt,st){const pn=new Map;return Lt.length>0&&Lt.replace(/^\?/,"").split("&").forEach(En=>{const ti=En.indexOf("="),[gi,_i]=-1==ti?[st.decodeKey(En),""]:[st.decodeKey(En.slice(0,ti)),st.decodeValue(En.slice(ti+1))],Li=pn.get(gi)||[];Li.push(_i),pn.set(gi,Li)}),pn}(st.fromString,this.encoder)}else st.fromObject?(this.map=new Map,Object.keys(st.fromObject).forEach(pn=>{const mn=st.fromObject[pn],En=Array.isArray(mn)?mn.map(et):[et(mn)];this.map.set(pn,En)})):this.map=null}has(st){return this.init(),this.map.has(st)}get(st){this.init();const pn=this.map.get(st);return pn?pn[0]:null}getAll(st){return this.init(),this.map.get(st)||null}keys(){return this.init(),Array.from(this.map.keys())}append(st,pn){return this.clone({param:st,value:pn,op:"a"})}appendAll(st){const pn=[];return Object.keys(st).forEach(mn=>{const En=st[mn];Array.isArray(En)?En.forEach(ti=>{pn.push({param:mn,value:ti,op:"a"})}):pn.push({param:mn,value:En,op:"a"})}),this.clone(pn)}set(st,pn){return this.clone({param:st,value:pn,op:"s"})}delete(st,pn){return this.clone({param:st,value:pn,op:"d"})}toString(){return this.init(),this.keys().map(st=>{const pn=this.encoder.encodeKey(st);return this.map.get(st).map(mn=>pn+"="+this.encoder.encodeValue(mn)).join("&")}).filter(st=>""!==st).join("&")}clone(st){const pn=new le({encoder:this.encoder});return pn.cloneFrom=this.cloneFrom||this,pn.updates=(this.updates||[]).concat(st),pn}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(st=>this.map.set(st,this.cloneFrom.map.get(st))),this.updates.forEach(st=>{switch(st.op){case"a":case"s":const pn=("a"===st.op?this.map.get(st.param):void 0)||[];pn.push(et(st.value)),this.map.set(st.param,pn);break;case"d":if(void 0===st.value){this.map.delete(st.param);break}{let mn=this.map.get(st.param)||[];const En=mn.indexOf(et(st.value));-1!==En&&mn.splice(En,1),mn.length>0?this.map.set(st.param,mn):this.map.delete(st.param)}}}),this.cloneFrom=this.updates=null)}}class ct{constructor(){this.map=new Map}set(st,pn){return this.map.set(st,pn),this}get(st){return this.map.has(st)||this.map.set(st,st.defaultValue()),this.map.get(st)}delete(st){return this.map.delete(st),this}has(st){return this.map.has(st)}keys(){return this.map.keys()}}function Le(Lt){return typeof ArrayBuffer<"u"&&Lt instanceof ArrayBuffer}function ye(Lt){return typeof Blob<"u"&&Lt instanceof Blob}function gt(Lt){return typeof FormData<"u"&&Lt instanceof FormData}class Pe{constructor(st,pn,mn,En){let ti;if(this.url=pn,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=st.toUpperCase(),function ht(Lt){switch(Lt){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||En?(this.body=void 0!==mn?mn:null,ti=En):ti=mn,ti&&(this.reportProgress=!!ti.reportProgress,this.withCredentials=!!ti.withCredentials,ti.responseType&&(this.responseType=ti.responseType),ti.headers&&(this.headers=ti.headers),ti.context&&(this.context=ti.context),ti.params&&(this.params=ti.params)),this.headers||(this.headers=new ee),this.context||(this.context=new ct),this.params){const gi=this.params.toString();if(0===gi.length)this.urlWithParams=pn;else{const _i=pn.indexOf("?");this.urlWithParams=pn+(-1===_i?"?":_iDr.set(vi,st.setHeaders[vi]),Li)),st.setParams&&(bi=Object.keys(st.setParams).reduce((Dr,vi)=>Dr.set(vi,st.setParams[vi]),bi)),new Pe(pn,mn,ti,{params:bi,headers:Li,context:ir,reportProgress:_i,responseType:En,withCredentials:gi})}}var Ae=function(Lt){return Lt[Lt.Sent=0]="Sent",Lt[Lt.UploadProgress=1]="UploadProgress",Lt[Lt.ResponseHeader=2]="ResponseHeader",Lt[Lt.DownloadProgress=3]="DownloadProgress",Lt[Lt.Response=4]="Response",Lt[Lt.User=5]="User",Lt}(Ae||{});class Ye{constructor(st,pn=200,mn="OK"){this.headers=st.headers||new ee,this.status=void 0!==st.status?st.status:pn,this.statusText=st.statusText||mn,this.url=st.url||null,this.ok=this.status>=200&&this.status<300}}class _t extends Ye{constructor(st={}){super(st),this.type=Ae.ResponseHeader}clone(st={}){return new _t({headers:st.headers||this.headers,status:void 0!==st.status?st.status:this.status,statusText:st.statusText||this.statusText,url:st.url||this.url||void 0})}}class hn extends Ye{constructor(st={}){super(st),this.type=Ae.Response,this.body=void 0!==st.body?st.body:null}clone(st={}){return new hn({body:void 0!==st.body?st.body:this.body,headers:st.headers||this.headers,status:void 0!==st.status?st.status:this.status,statusText:st.statusText||this.statusText,url:st.url||this.url||void 0})}}class qt extends Ye{constructor(st){super(st,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${st.url||"(unknown url)"}`:`Http failure response for ${st.url||"(unknown url)"}: ${st.status} ${st.statusText}`,this.error=st.error||null}}function Ht(Lt,st){return{body:st,headers:Lt.headers,context:Lt.context,observe:Lt.observe,params:Lt.params,reportProgress:Lt.reportProgress,responseType:Lt.responseType,withCredentials:Lt.withCredentials}}let Te=(()=>{var Lt;class st{constructor(mn){this.handler=mn}request(mn,En,ti={}){let gi;if(mn instanceof Pe)gi=mn;else{let bi,ir;bi=ti.headers instanceof ee?ti.headers:new ee(ti.headers),ti.params&&(ir=ti.params instanceof le?ti.params:new le({fromObject:ti.params})),gi=new Pe(mn,En,void 0!==ti.body?ti.body:null,{headers:bi,context:ti.context,params:ir,reportProgress:ti.reportProgress,responseType:ti.responseType||"json",withCredentials:ti.withCredentials})}const _i=(0,h.of)(gi).pipe((0,J.b)(bi=>this.handler.handle(bi)));if(mn instanceof Pe||"events"===ti.observe)return _i;const Li=_i.pipe((0,ie.h)(bi=>bi instanceof hn));switch(ti.observe||"body"){case"body":switch(gi.responseType){case"arraybuffer":return Li.pipe((0,Y.U)(bi=>{if(null!==bi.body&&!(bi.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return bi.body}));case"blob":return Li.pipe((0,Y.U)(bi=>{if(null!==bi.body&&!(bi.body instanceof Blob))throw new Error("Response is not a Blob.");return bi.body}));case"text":return Li.pipe((0,Y.U)(bi=>{if(null!==bi.body&&"string"!=typeof bi.body)throw new Error("Response is not a string.");return bi.body}));default:return Li.pipe((0,Y.U)(bi=>bi.body))}case"response":return Li;default:throw new Error(`Unreachable: unhandled observe type ${ti.observe}}`)}}delete(mn,En={}){return this.request("DELETE",mn,En)}get(mn,En={}){return this.request("GET",mn,En)}head(mn,En={}){return this.request("HEAD",mn,En)}jsonp(mn,En){return this.request("JSONP",mn,{params:(new le).append(En,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(mn,En={}){return this.request("OPTIONS",mn,En)}patch(mn,En,ti={}){return this.request("PATCH",mn,Ht(ti,En))}post(mn,En,ti={}){return this.request("POST",mn,Ht(ti,En))}put(mn,En,ti={}){return this.request("PUT",mn,Ht(ti,En))}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(he))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();function Gt(Lt,st){return st(Lt)}function Zt(Lt,st){return(pn,mn)=>st.intercept(pn,{handle:En=>Lt(En,mn)})}const kt=new x.OlP(""),dt=new x.OlP(""),Ot=new x.OlP("");function pt(){let Lt=null;return(st,pn)=>{null===Lt&&(Lt=((0,x.f3M)(kt,{optional:!0})??[]).reduceRight(Zt,Gt));const mn=(0,x.f3M)(x.HDt),En=mn.add();return Lt(st,pn).pipe((0,C.x)(()=>mn.remove(En)))}}let Yt=(()=>{var Lt;class st extends he{constructor(mn,En){super(),this.backend=mn,this.injector=En,this.chain=null,this.pendingTasks=(0,x.f3M)(x.HDt)}handle(mn){if(null===this.chain){const ti=Array.from(new Set([...this.injector.get(dt),...this.injector.get(Ot,[])]));this.chain=ti.reduceRight((gi,_i)=>function Jt(Lt,st,pn){return(mn,En)=>pn.runInContext(()=>st(mn,ti=>Lt(ti,En)))}(gi,_i,this.injector),Gt)}const En=this.pendingTasks.add();return this.chain(mn,ti=>this.backend.handle(ti)).pipe((0,C.x)(()=>this.pendingTasks.remove(En)))}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(_e),x.LFG(x.lqb))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();const lr=/^\)\]\}',?\n/;let Fi=(()=>{var Lt;class st{constructor(mn){this.xhrFactory=mn}handle(mn){if("JSONP"===mn.method)throw new x.vHH(-2800,!1);const En=this.xhrFactory;return(En.\u0275loadImpl?(0,y.D)(En.\u0275loadImpl()):(0,h.of)(null)).pipe((0,Ne.w)(()=>new s.y(gi=>{const _i=En.build();if(_i.open(mn.method,mn.urlWithParams),mn.withCredentials&&(_i.withCredentials=!0),mn.headers.forEach((Kt,Wi)=>_i.setRequestHeader(Kt,Wi.join(","))),mn.headers.has("Accept")||_i.setRequestHeader("Accept","application/json, text/plain, */*"),!mn.headers.has("Content-Type")){const Kt=mn.detectContentTypeHeader();null!==Kt&&_i.setRequestHeader("Content-Type",Kt)}if(mn.responseType){const Kt=mn.responseType.toLowerCase();_i.responseType="json"!==Kt?Kt:"text"}const Li=mn.serializeBody();let bi=null;const ir=()=>{if(null!==bi)return bi;const Kt=_i.statusText||"OK",Wi=new ee(_i.getAllResponseHeaders()),rr=function mi(Lt){return"responseURL"in Lt&&Lt.responseURL?Lt.responseURL:/^X-Request-URL:/m.test(Lt.getAllResponseHeaders())?Lt.getResponseHeader("X-Request-URL"):null}(_i)||mn.url;return bi=new _t({headers:Wi,status:_i.status,statusText:Kt,url:rr}),bi},Dr=()=>{let{headers:Kt,status:Wi,statusText:rr,url:yr}=ir(),xr=null;204!==Wi&&(xr=typeof _i.response>"u"?_i.responseText:_i.response),0===Wi&&(Wi=xr?200:0);let Sr=Wi>=200&&Wi<300;if("json"===mn.responseType&&"string"==typeof xr){const Go=xr;xr=xr.replace(lr,"");try{xr=""!==xr?JSON.parse(xr):null}catch(Eo){xr=Go,Sr&&(Sr=!1,xr={error:Eo,text:xr})}}Sr?(gi.next(new hn({body:xr,headers:Kt,status:Wi,statusText:rr,url:yr||void 0})),gi.complete()):gi.error(new qt({error:xr,headers:Kt,status:Wi,statusText:rr,url:yr||void 0}))},vi=Kt=>{const{url:Wi}=ir(),rr=new qt({error:Kt,status:_i.status||0,statusText:_i.statusText||"Unknown Error",url:Wi||void 0});gi.error(rr)};let Ar=!1;const qi=Kt=>{Ar||(gi.next(ir()),Ar=!0);let Wi={type:Ae.DownloadProgress,loaded:Kt.loaded};Kt.lengthComputable&&(Wi.total=Kt.total),"text"===mn.responseType&&_i.responseText&&(Wi.partialText=_i.responseText),gi.next(Wi)},Bi=Kt=>{let Wi={type:Ae.UploadProgress,loaded:Kt.loaded};Kt.lengthComputable&&(Wi.total=Kt.total),gi.next(Wi)};return _i.addEventListener("load",Dr),_i.addEventListener("error",vi),_i.addEventListener("timeout",vi),_i.addEventListener("abort",vi),mn.reportProgress&&(_i.addEventListener("progress",qi),null!==Li&&_i.upload&&_i.upload.addEventListener("progress",Bi)),_i.send(Li),gi.next({type:Ae.Sent}),()=>{_i.removeEventListener("error",vi),_i.removeEventListener("abort",vi),_i.removeEventListener("load",Dr),_i.removeEventListener("timeout",vi),mn.reportProgress&&(_i.removeEventListener("progress",qi),null!==Li&&_i.upload&&_i.upload.removeEventListener("progress",Bi)),_i.readyState!==_i.DONE&&_i.abort()}})))}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(me.JF))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();const Cn=new x.OlP("XSRF_ENABLED"),qn=new x.OlP("XSRF_COOKIE_NAME",{providedIn:"root",factory:()=>"XSRF-TOKEN"}),_n=new x.OlP("XSRF_HEADER_NAME",{providedIn:"root",factory:()=>"X-XSRF-TOKEN"});class Hi{}let nt=(()=>{var Lt;class st{constructor(mn,En,ti){this.doc=mn,this.platform=En,this.cookieName=ti,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const mn=this.doc.cookie||"";return mn!==this.lastCookieString&&(this.parseCount++,this.lastToken=(0,me.Mx)(mn,this.cookieName),this.lastCookieString=mn),this.lastToken}}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)(x.LFG(me.K0),x.LFG(x.Lbi),x.LFG(qn))},Lt.\u0275prov=x.Yz7({token:Lt,factory:Lt.\u0275fac}),st})();function ge(Lt,st){const pn=Lt.url.toLowerCase();if(!(0,x.f3M)(Cn)||"GET"===Lt.method||"HEAD"===Lt.method||pn.startsWith("http://")||pn.startsWith("https://"))return st(Lt);const mn=(0,x.f3M)(Hi).getToken(),En=(0,x.f3M)(_n);return null!=mn&&!Lt.headers.has(En)&&(Lt=Lt.clone({headers:Lt.headers.set(En,mn)})),st(Lt)}var Xe=function(Lt){return Lt[Lt.Interceptors=0]="Interceptors",Lt[Lt.LegacyInterceptors=1]="LegacyInterceptors",Lt[Lt.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",Lt[Lt.NoXsrfProtection=3]="NoXsrfProtection",Lt[Lt.JsonpSupport=4]="JsonpSupport",Lt[Lt.RequestsMadeViaParent=5]="RequestsMadeViaParent",Lt[Lt.Fetch=6]="Fetch",Lt}(Xe||{});function ft(Lt,st){return{\u0275kind:Lt,\u0275providers:st}}function Ct(...Lt){const st=[Te,Fi,Yt,{provide:he,useExisting:Yt},{provide:_e,useExisting:Fi},{provide:dt,useValue:ge,multi:!0},{provide:Cn,useValue:!0},{provide:Hi,useClass:nt}];for(const pn of Lt)st.push(...pn.\u0275providers);return(0,x.MR2)(st)}const jt=new x.OlP("LEGACY_INTERCEPTOR_FN");let be=(()=>{var Lt;class st{}return(Lt=st).\u0275fac=function(mn){return new(mn||Lt)},Lt.\u0275mod=x.oAB({type:Lt}),Lt.\u0275inj=x.cJS({providers:[Ct(ft(Xe.LegacyInterceptors,[{provide:jt,useFactory:pt},{provide:dt,useExisting:jt,multi:!0}]))]}),st})()},2029:(Nn,yt,k)=>{"use strict";k.d(yt,{tb:()=>hv,AFp:()=>Xm,ip1:()=>u1,hGG:()=>fT,z2F:()=>Df,Ojb:()=>j_,sBO:()=>KE,Sil:()=>fE,EJc:()=>uE,Xts:()=>Ac,SBq:()=>yu,lqb:()=>la,qLn:()=>ad,vpe:()=>$c,XFs:()=>mi,OlP:()=>Gr,zs3:()=>qa,ZZ4:()=>yv,aQg:()=>vv,soG:()=>o_,YKP:()=>dx,h0i:()=>mh,PXZ:()=>jE,R0b:()=>ba,FiY:()=>Ii,Lbi:()=>Kh,g9A:()=>hp,Qsj:()=>ag,FYo:()=>va,JOm:()=>Zu,tp0:()=>Qc,Rgc:()=>im,dDg:()=>NE,eoX:()=>C1,GfV:()=>nf,s_b:()=>i_,ifc:()=>ir,VuI:()=>ET,LMc:()=>DT,MMx:()=>fx,Lck:()=>Yw,eFA:()=>I1,G48:()=>JE,Gpc:()=>et,f3M:()=>st,$WT:()=>Er,MR2:()=>pu,_c5:()=>hT,qFp:()=>IT,rg0:()=>pc,c2e:()=>d1,zSh:()=>Yh,HDt:()=>h1,wAp:()=>wf,vHH:()=>ye,lri:()=>b1,rWj:()=>w1,cg1:()=>Fy,kL8:()=>F0,dqk:()=>_n,Z0I:()=>Jn,eJc:()=>ev,QGY:()=>wy,F4k:()=>jv,RDi:()=>ya,AaK:()=>Ie,qOj:()=>_f,Xq5:()=>j,TTD:()=>N,_Bn:()=>ux,jDz:()=>px,xp6:()=>ic,uIk:()=>nn,ekj:()=>Sy,Suo:()=>Vx,Xpm:()=>go,lG2:()=>ds,Yz7:()=>Ut,cJS:()=>gn,oAB:()=>Jr,Yjl:()=>xo,Y36:()=>zl,_UZ:()=>xy,GkF:()=>by,BQk:()=>Wg,ynx:()=>Hg,qZA:()=>Gg,TgZ:()=>jl,EpF:()=>Zv,n5z:()=>mo,LFG:()=>Ui,$8M:()=>Ds,$Z:()=>dd,NdJ:()=>Cy,CRH:()=>$x,oxw:()=>Wv,ALo:()=>Ix,lcZ:()=>Mx,xi3:()=>Ax,Hsn:()=>Yv,F$t:()=>qv,Q6J:()=>Tu,s9C:()=>Ey,DdM:()=>bx,iGM:()=>Zx,MAs:()=>ua,KtG:()=>Gl,CHM:()=>sl,LSH:()=>Mc,P3R:()=>$m,Udp:()=>Ay,YNc:()=>yf,_uU:()=>y0,Oqu:()=>Oy,hij:()=>Jg,AsE:()=>Ry,lnq:()=>Ly,HOy:()=>ky,Gf:()=>jx});var x=k(8645),h=k(7394),y=k(5619),s=k(5592),J=k(7537),ie=k(4829),Y=k(6232),C=k(4564),Ne=k(7715),he=k(2096),_e=k(3020),ee=k(4664),ae=k(3997);function oe(t){for(let o in t)if(t[o]===oe)return o;throw Error("Could not find renamed property on target object.")}function Be(t,o){for(const l in o)o.hasOwnProperty(l)&&!t.hasOwnProperty(l)&&(t[l]=o[l])}function Ie(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(Ie).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const o=t.toString();if(null==o)return""+o;const l=o.indexOf("\n");return-1===l?o:o.substring(0,l)}function Ee(t,o){return null==t||""===t?null===o?"":o:null==o||""===o?t:t+" "+o}const Ue=oe({__forward_ref__:oe});function et(t){return t.__forward_ref__=et,t.toString=function(){return Ie(this())},t}function le(t){return ue(t)?t():t}function ue(t){return"function"==typeof t&&t.hasOwnProperty(Ue)&&t.__forward_ref__===et}function ct(t){return t&&!!t.\u0275providers}const Le="https://g.co/ng/security#xss";class ye extends Error{constructor(o,l){super(function gt(t,o){return`NG0${Math.abs(t)}${o?": "+o:""}`}(o,l)),this.code=o}}function De(t){return"string"==typeof t?t:null==t?"":String(t)}function hn(t,o){throw new ye(-201,!1)}function kt(t,o){null==t&&function dt(t,o,l,d){throw new Error(`ASSERTION ERROR: ${t}`+(null==d?"":` [Expected=> ${l} ${d} ${o} <=Actual]`))}(o,t,null,"!=")}function Ut(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function gn(t){return{providers:t.providers||[],imports:t.imports||[]}}function Ft(t){return Wt(t,ln)||Wt(t,er)}function Jn(t){return null!==Ft(t)}function Wt(t,o){return t.hasOwnProperty(o)?t[o]:null}function vt(t){return t&&(t.hasOwnProperty(ni)||t.hasOwnProperty(lr))?t[ni]:null}const ln=oe({\u0275prov:oe}),ni=oe({\u0275inj:oe}),er=oe({ngInjectableDef:oe}),lr=oe({ngInjectorDef:oe});var mi=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(mi||{});let Fi;function Mn(t){const o=Fi;return Fi=t,o}function qn(t,o,l){const d=Ft(t);return d&&"root"==d.providedIn?void 0===d.value?d.value=d.factory():d.value:l&mi.Optional?null:void 0!==o?o:void hn(Ie(t))}const _n=globalThis,pe={},ze="__NG_DI_FLAG__",xe="ngTempTokenPath",Ze=/\n/gm,bn="__source";let Kn;function wi(t){const o=Kn;return Kn=t,o}function cr(t,o=mi.Default){if(void 0===Kn)throw new ye(-203,!1);return null===Kn?qn(t,void 0,o):Kn.get(t,o&mi.Optional?null:void 0,o)}function Ui(t,o=mi.Default){return(function Cn(){return Fi}()||cr)(le(t),o)}function st(t,o=mi.Default){return Ui(t,pn(o))}function pn(t){return typeof t>"u"||"number"==typeof t?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function mn(t){const o=[];for(let l=0;lo){P=E-1;break}}}for(;EE?"":g[at+1].toLowerCase();const rn=8&d?Nt:null;if(rn&&-1!==xr(rn,re,0)||2&d&&re!==Nt){if(lt(d))return!1;P=!0}}}}else{if(!P&&!lt(d)&&!lt(V))return!1;if(P&<(V))continue;P=!1,d=V|1&d}}return lt(d)||P}function lt(t){return 0==(1&t)}function an(t,o,l,d){if(null===o)return-1;let g=0;if(d||!l){let E=!1;for(;g-1)for(l++;l0?'="'+F+'"':"")+"]"}else 8&d?g+="."+P:4&d&&(g+=" "+P);else""!==g&&!lt(P)&&(o+=di(E,g),g=""),d=P,E=E||!lt(d);l++}return""!==g&&(o+=di(E,g)),o}function go(t){return Li(()=>{const o=Gs(t),l={...o,decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection===bi.OnPush,directiveDefs:null,pipeDefs:null,dependencies:o.standalone&&t.dependencies||null,getStandaloneInjector:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||ir.Emulated,styles:t.styles||vi,_:null,schemas:t.schemas||null,tView:null,id:""};Po(l);const d=t.dependencies;return l.directiveDefs=Hr(d,!1),l.pipeDefs=Hr(d,!0),l.id=function bs(t){let o=0;const l=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,t.consts,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery].join("|");for(const g of l)o=Math.imul(31,o)+g.charCodeAt(0)<<0;return o+=2147483648,"c"+o}(l),l})}function co(t){return zi(t)||Fr(t)}function uo(t){return null!==t}function Jr(t){return Li(()=>({type:t.type,bootstrap:t.bootstrap||vi,declarations:t.declarations||vi,imports:t.imports||vi,exports:t.exports||vi,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null}))}function To(t,o){if(null==t)return Dr;const l={};for(const d in t)if(t.hasOwnProperty(d)){let g=t[d],E=g;Array.isArray(g)&&(E=g[1],g=g[0]),l[g]=d,o&&(o[g]=E)}return l}function ds(t){return Li(()=>{const o=Gs(t);return Po(o),o})}function xo(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,standalone:!0===t.standalone,onDestroy:t.type.prototype.ngOnDestroy||null}}function zi(t){return t[Ar]||null}function Fr(t){return t[qi]||null}function Or(t){return t[Bi]||null}function Er(t){const o=zi(t)||Fr(t)||Or(t);return null!==o&&o.standalone}function so(t,o){const l=t[Kt]||null;if(!l&&!0===o)throw new Error(`Type ${Ie(t)} does not have '\u0275mod' property.`);return l}function Gs(t){const o={};return{type:t.type,providersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:o,inputTransforms:null,inputConfig:t.inputs||Dr,exportAs:t.exportAs||null,standalone:!0===t.standalone,signals:!0===t.signals,selectors:t.selectors||vi,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:To(t.inputs,o),outputs:To(t.outputs)}}function Po(t){t.features?.forEach(o=>o(t))}function Hr(t,o){if(!t)return null;const l=o?Or:co;return()=>("function"==typeof t?t():t).map(d=>l(d)).filter(uo)}const gr=0,li=1,Zi=2,Rr=3,_o=4,rs=5,zr=6,ko=7,br=8,bo=9,Oo=10,Ti=11,Ns=12,Xo=13,os=14,Br=15,zs=16,ws=17,Fo=18,Ho=19,hr=20,Ps=21,Qo=22,hs=23,Cs=24,or=25,Os=1,ia=2,Ur=7,Do=9,Io=11;function Bo(t){return Array.isArray(t)&&"object"==typeof t[Os]}function yo(t){return Array.isArray(t)&&!0===t[Os]}function ra(t){return 0!=(4&t.flags)}function Rs(t){return t.componentOffset>-1}function Ls(t){return 1==(1&t.flags)}function ki(t){return!!t.template}function Ws(t){return 0!=(512&t[Zi])}function ha(t,o){return t.hasOwnProperty(Wi)?t[Wi]:null}let Na=_n.WeakRef??class fa{constructor(o){this.ref=o}deref(){return this.ref}},hc=0,Us=null,nl=!1;function Ao(t){const o=Us;return Us=t,o}class za{constructor(){this.id=hc++,this.ref=function xl(t){return new Na(t)}(this),this.producers=new Map,this.consumers=new Map,this.trackingVersion=0,this.valueVersion=0}consumerPollProducersForChange(){for(const[o,l]of this.producers){const d=l.producerNode.deref();if(null!=d&&l.atTrackingVersion===this.trackingVersion){if(d.producerPollStatus(l.seenValueVersion))return!0}else this.producers.delete(o),d?.consumers.delete(this.id)}return!1}producerMayHaveChanged(){const o=nl;nl=!0;try{for(const[l,d]of this.consumers){const g=d.consumerNode.deref();null!=g&&g.trackingVersion===d.atTrackingVersion?g.onConsumerDependencyMayHaveChanged():(this.consumers.delete(l),g?.producers.delete(this.id))}}finally{nl=o}}producerAccessed(){if(nl)throw new Error("");if(null===Us)return;let o=Us.producers.get(this.id);void 0===o?(o={consumerNode:Us.ref,producerNode:this.ref,seenValueVersion:this.valueVersion,atTrackingVersion:Us.trackingVersion},Us.producers.set(this.id,o),this.consumers.set(Us.id,o)):(o.seenValueVersion=this.valueVersion,o.atTrackingVersion=Us.trackingVersion)}get hasProducers(){return this.producers.size>0}get producerUpdatesAllowed(){return!1!==Us?.consumerAllowSignalWrites}producerPollStatus(o){return this.valueVersion!==o||(this.onProducerUpdateValueVersion(),this.valueVersion!==o)}}let Gc=null;function pc(t){const o=Ao(null);try{return t()}finally{Ao(o)}}const qs=()=>{};class Ta extends za{constructor(o,l,d){super(),this.watch=o,this.schedule=l,this.dirty=!1,this.cleanupFn=qs,this.registerOnCleanup=g=>{this.cleanupFn=g},this.consumerAllowSignalWrites=d}notify(){this.dirty||this.schedule(this),this.dirty=!0}onConsumerDependencyMayHaveChanged(){this.notify()}onProducerUpdateValueVersion(){}run(){if(this.dirty=!1,0!==this.trackingVersion&&!this.consumerPollProducersForChange())return;const o=Ao(this);this.trackingVersion++;try{this.cleanupFn(),this.cleanupFn=qs,this.watch(this.registerOnCleanup)}finally{Ao(o)}}cleanup(){this.cleanupFn()}}class Zs{constructor(o,l,d){this.previousValue=o,this.currentValue=l,this.firstChange=d}isFirstChange(){return this.firstChange}}function N(){return ne}function ne(t){return t.type.prototype.ngOnChanges&&(t.setInput=Q),it}function it(){const t=At(this),o=t?.current;if(o){const l=t.previous;if(l===Dr)t.previous=o;else for(let d in o)l[d]=o[d];t.current=null,this.ngOnChanges(o)}}function Q(t,o,l,d){const g=this.declaredInputs[l],E=At(t)||function cn(t,o){return t[He]=o}(t,{previous:Dr,current:null}),P=E.current||(E.current={}),F=E.previous,V=F[g];P[g]=new Zs(V&&V.currentValue,o,F===Dr),t[d]=o}N.ngInherit=!0;const He="__ngSimpleChanges__";function At(t){return t[He]||null}const Xi=function(t,o,l){};function Vi(t){for(;Array.isArray(t);)t=t[gr];return t}function ho(t,o){return Vi(o[t])}function ao(t,o){return Vi(o[t.index])}function ss(t,o){return t.data[o]}function No(t,o){return t[o]}function fo(t,o){const l=o[t];return Bo(l)?l:l[gr]}function ai(t,o){return null==o?null:t[o]}function Js(t){t[ws]=0}function Su(t){1024&t[Zi]||(t[Zi]|=1024,Cl(t,1))}function es(t){1024&t[Zi]&&(t[Zi]&=-1025,Cl(t,-1))}function Cl(t,o){let l=t[Rr];if(null===l)return;l[rs]+=o;let d=l;for(l=l[Rr];null!==l&&(1===o&&1===d[rs]||-1===o&&0===d[rs]);)l[rs]+=o,d=l,l=l[Rr]}const $i={lFrame:Ml(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function Tl(){return $i.bindingsEnabled}function rl(){return null!==$i.skipHydrationRootTNode}function jn(){return $i.lFrame.lView}function wr(){return $i.lFrame.tView}function sl(t){return $i.lFrame.contextLView=t,t[br]}function Gl(t){return $i.lFrame.contextLView=null,t}function Uo(){let t=yc();for(;null!==t&&64===t.type;)t=t.parent;return t}function yc(){return $i.lFrame.currentTNode}function ms(t,o){const l=$i.lFrame;l.currentTNode=t,l.isParent=o}function Hl(){return $i.lFrame.isParent}function vc(){$i.lFrame.isParent=!1}function gs(){const t=$i.lFrame;let o=t.bindingRootIndex;return-1===o&&(o=t.bindingRootIndex=t.tView.bindingStartIndex),o}function Da(){return $i.lFrame.bindingIndex}function Il(){return $i.lFrame.bindingIndex++}function pa(t){const o=$i.lFrame,l=o.bindingIndex;return o.bindingIndex=o.bindingIndex+t,l}function Ks(t,o){const l=$i.lFrame;l.bindingIndex=l.bindingRootIndex=t,Yc(o)}function Yc(t){$i.lFrame.currentDirectiveIndex=t}function Xs(){return $i.lFrame.currentQueryIndex}function Ia(t){$i.lFrame.currentQueryIndex=t}function Jc(t){const o=t[li];return 2===o.type?o.declTNode:1===o.type?t[zr]:null}function ui(t,o,l){if(l&mi.SkipSelf){let g=o,E=t;for(;!(g=g.parent,null!==g||l&mi.Host||(g=Jc(E),null===g||(E=E[os],10&g.type))););if(null===g)return!1;o=g,t=E}const d=$i.lFrame=Kc();return d.currentTNode=o,d.lView=t,!0}function xc(t){const o=Kc(),l=t[li];$i.lFrame=o,o.currentTNode=l.firstChild,o.lView=t,o.tView=l,o.contextLView=t,o.bindingIndex=l.bindingStartIndex,o.inI18n=!1}function Kc(){const t=$i.lFrame,o=null===t?null:t.child;return null===o?Ml(t):o}function Ml(t){const o={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=o),o}function al(){const t=$i.lFrame;return $i.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const R=al;function U(){const t=al();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function K(){return $i.lFrame.selectedIndex}function Me(t){$i.lFrame.selectedIndex=t}function Ge(){const t=$i.lFrame;return ss(t.tView,t.selectedIndex)}let po=!0;function f(){return po}function r(t){po=t}function m(t,o){for(let l=o.directiveStart,d=o.directiveEnd;l=d)break}else o[V]<0&&(t[ws]+=65536),(F>13>16&&(3&t[Zi])===o&&(t[Zi]+=8192,Z(F,E)):Z(F,E)}const W=-1;class se{constructor(o,l,d){this.factory=o,this.resolving=!1,this.canSeeViewProviders=l,this.injectImpl=d}}function ot(t){return t!==W}function Tt(t){return 32767&t}function Dt(t,o){let l=function Mt(t){return t>>16}(t),d=o;for(;l>0;)d=d[os],l--;return d}let $t=!0;function zt(t){const o=$t;return $t=t,o}const Vn=255,on=5;let Rn=0;const un={};function sn(t,o){const l=Gn(t,o);if(-1!==l)return l;const d=o[li];d.firstCreatePass&&(t.injectorIndex=o.length,An(d.data,t),An(o,null),An(d.blueprint,null));const g=Ln(t,o),E=t.injectorIndex;if(ot(g)){const P=Tt(g),F=Dt(g,o),V=F[li].data;for(let re=0;re<8;re++)o[E+re]=F[P+re]|V[P+re]}return o[E+8]=g,E}function An(t,o){t.push(0,0,0,0,0,0,0,0,o)}function Gn(t,o){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===o[t.injectorIndex+8]?-1:t.injectorIndex}function Ln(t,o){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let l=0,d=null,g=o;for(;null!==g;){if(d=Zo(g),null===d)return W;if(l++,g=g[os],-1!==d.injectorIndex)return d.injectorIndex|l<<16}return W}function Wn(t,o,l){!function Zn(t,o,l){let d;"string"==typeof l?d=l.charCodeAt(0)||0:l.hasOwnProperty(rr)&&(d=l[rr]),null==d&&(d=l[rr]=Rn++);const g=d&Vn;o.data[t+(g>>on)]|=1<=0?o&Vn:ja:o}(l);if("function"==typeof E){if(!ui(o,t,d))return d&mi.Host?Gi(g,0,d):hi(o,l,d,g);try{let P;if(P=E(d),null!=P||d&mi.Optional)return P;hn()}finally{R()}}else if("number"==typeof E){let P=null,F=Gn(t,o),V=W,re=d&mi.Host?o[Br][zr]:null;for((-1===F||d&mi.SkipSelf)&&(V=-1===F?Ln(t,o):o[F+8],V!==W&&qr(d,!1)?(P=o[li],F=Tt(V),o=Dt(V,o)):F=-1);-1!==F;){const Se=o[li];if(Wr(E,F,Se.data)){const at=dr(F,o,l,P,d,re);if(at!==un)return at}V=o[F+8],V!==W&&qr(d,o[li].data[F+8]===re)&&Wr(E,F,o)?(P=Se,F=Tt(V),o=Dt(V,o)):F=-1}}return g}function dr(t,o,l,d,g,E){const P=o[li],F=P.data[t+8],Se=xi(F,P,l,null==d?Rs(F)&&$t:d!=P&&0!=(3&F.type),g&mi.Host&&E===F);return null!==Se?Cr(o,P,Se,F):un}function xi(t,o,l,d,g){const E=t.providerIndexes,P=o.data,F=1048575&E,V=t.directiveStart,Se=E>>20,Nt=g?F+Se:t.directiveEnd;for(let rn=d?F:F+Se;rn=V&&kn.type===l)return rn}if(g){const rn=P[V];if(rn&&ki(rn)&&rn.type===l)return V}return null}function Cr(t,o,l,d){let g=t[l];const E=o.data;if(function Oe(t){return t instanceof se}(g)){const P=g;P.resolving&&function Ae(t,o){const l=o?`. Dependency path: ${o.join(" > ")} > ${t}`:"";throw new ye(-200,`Circular dependency in DI detected for ${t}${l}`)}(function Pe(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():De(t)}(E[l]));const F=zt(P.canSeeViewProviders);P.resolving=!0;const re=P.injectImpl?Mn(P.injectImpl):null;ui(t,d,mi.Default);try{g=t[l]=P.factory(void 0,E,t,d),o.firstCreatePass&&l>=d.directiveStart&&function c(t,o,l){const{ngOnChanges:d,ngOnInit:g,ngDoCheck:E}=o.type.prototype;if(d){const P=ne(o);(l.preOrderHooks??=[]).push(t,P),(l.preOrderCheckHooks??=[]).push(t,P)}g&&(l.preOrderHooks??=[]).push(0-t,g),E&&((l.preOrderHooks??=[]).push(t,E),(l.preOrderCheckHooks??=[]).push(t,E))}(l,E[l],o)}finally{null!==re&&Mn(re),zt(F),P.resolving=!1,R()}}return g}function Wr(t,o,l){return!!(l[o+(t>>on)]&1<{const o=t.prototype.constructor,l=o[Wi]||jr(o),d=Object.prototype;let g=Object.getPrototypeOf(t.prototype).constructor;for(;g&&g!==d;){const E=g[Wi]||jr(g);if(E&&E!==l)return E;g=Object.getPrototypeOf(g)}return E=>new E})}function jr(t){return ue(t)?()=>{const o=jr(le(t));return o&&o()}:ha(t)}function Zo(t){const o=t[li],l=o.type;return 2===l?o.declTNode:1===l?t[zr]:null}function Ds(t){return function Di(t,o){if("class"===o)return t.classes;if("style"===o)return t.styles;const l=t.attrs;if(l){const d=l.length;let g=0;for(;g{const d=function Wl(t){return function(...l){if(t){const d=t(...l);for(const g in d)this[g]=d[g]}}}(o);function g(...E){if(this instanceof g)return d.apply(this,E),this;const P=new g(...E);return F.annotation=P,F;function F(V,re,Se){const at=V.hasOwnProperty(ls)?V[ls]:Object.defineProperty(V,ls,{value:[]})[ls];for(;at.length<=Se;)at.push(null);return(at[Se]=at[Se]||[]).push(P),V}}return l&&(g.prototype=Object.create(l.prototype)),g.prototype.ngMetadataName=t,g.annotationCls=g,g})}function Xc(t,o){t.forEach(l=>Array.isArray(l)?Xc(l,o):o(l))}function am(t,o,l){o>=t.length?t.push(l):t.splice(o,0,l)}function Ch(t,o){return o>=t.length-1?t.pop():t.splice(o,1)[0]}function Td(t,o){const l=[];for(let d=0;d=0?t[1|d]=l:(d=~d,function ku(t,o,l,d){let g=t.length;if(g==o)t.push(l,d);else if(1===g)t.push(d,t[0]),t[0]=l;else{for(g--,t.push(t[g-1],t[g]);g>o;)t[g]=t[g-2],g--;t[o]=l,t[o+1]=d}}(t,d,o,l)),d}function Sl(t,o){const l=Sa(t,o);if(l>=0)return t[1|l]}function Sa(t,o){return function lm(t,o,l){let d=0,g=t.length>>l;for(;g!==d;){const E=d+(g-d>>1),P=t[E<o?g=E:d=E+1}return~(g<|^->||--!>|)/,Bf="\u200b$1\u200b";const Ha=new Map;let b_=0;const Od="__ngContext__";function Ro(t,o){Bo(o)?(t[Od]=o[Ho],function Pd(t){Ha.set(t[Ho],t)}(o)):t[Od]=o}let su;function Ld(t,o){return su(t,o)}function Ol(t){const o=t[Rr];return yo(o)?o[Rr]:o}function Vf(t){return xm(t[Ns])}function vm(t){return xm(t[_o])}function xm(t){for(;null!==t&&!yo(t);)t=t[_o];return t}function Rl(t,o,l,d,g){if(null!=d){let E,P=!1;yo(d)?E=d:Bo(d)&&(P=!0,d=d[gr]);const F=Vi(d);0===t&&null!==l?null==g?Cm(o,l,F):Dc(o,l,F,g||null,!0):1===t&&null!==l?Dc(o,l,F,g||null,!0):2===t?function Bl(t,o,l){const d=lu(t,o);d&&function au(t,o,l,d){t.removeChild(o,l,d)}(t,d,o,l)}(o,F,P):3===t&&o.destroyNode(F),null!=E&&function Tm(t,o,l,d,g){const E=l[Ur];E!==Vi(l)&&Rl(o,t,d,E,g);for(let F=Io;Fo.replace(ta,Bf))}(o))}function $u(t,o,l){return t.createElement(o,l)}function Is(t,o){const l=t[Do],d=l.indexOf(o);es(o),l.splice(d,1)}function Fd(t,o){if(t.length<=Io)return;const l=Io+o,d=t[l];if(d){const g=d[zs];null!==g&&g!==t&&Is(g,d),o>0&&(t[l-1][_o]=d[_o]);const E=Ch(t,Io+o);!function Ll(t,o){Nl(t,o,o[Ti],2,null,null),o[gr]=null,o[zr]=null}(d[li],d);const P=E[Fo];null!==P&&P.detachView(E[li]),d[Rr]=null,d[_o]=null,d[Zi]&=-129}return d}function Tc(t,o){if(!(256&o[Zi])){const l=o[Ti];o[hs]?.destroy(),o[Cs]?.destroy(),l.destroyNode&&Nl(t,o,l,3,null,null),function Oa(t){let o=t[Ns];if(!o)return Bd(t[li],t);for(;o;){let l=null;if(Bo(o))l=o[Ns];else{const d=o[Io];d&&(l=d)}if(!l){for(;o&&!o[_o]&&o!==t;)Bo(o)&&Bd(o[li],o),o=o[Rr];null===o&&(o=t),Bo(o)&&Bd(o[li],o),l=o&&o[_o]}o=l}}(o)}}function Bd(t,o){if(!(256&o[Zi])){o[Zi]&=-129,o[Zi]|=256,function $f(t,o){let l;if(null!=t&&null!=(l=t.destroyHooks))for(let d=0;d=0?d[P]():d[-P].unsubscribe(),E+=2}else l[E].call(d[l[E+1]]);null!==d&&(o[ko]=null);const g=o[Ps];if(null!==g){o[Ps]=null;for(let E=0;E-1){const{encapsulation:E}=t.data[d.directiveStart+g];if(E===ir.None||E===ir.Emulated)return null}return ao(d,l)}}(t,o.parent,l)}function Dc(t,o,l,d,g){t.insertBefore(o,l,d,g)}function Cm(t,o,l){t.appendChild(o,l)}function Fl(t,o,l,d,g){null!==d?Dc(t,o,l,d,g):Cm(t,o,l)}function lu(t,o){return t.parentNode(o)}function qf(t,o,l){return Yf(t,o,l)}let Jf,hl,Wu,Yf=function Em(t,o,l){return 40&t.type?ao(t,l):null};function Fh(t,o,l,d){const g=Gf(t,d,o),E=o[Ti],F=qf(d.parent||o[zr],d,o);if(null!=g)if(Array.isArray(l))for(let V=0;Vt,createScript:t=>t,createScriptURL:t=>t})}catch{}return Wu}()?.createScriptURL(t)||t}class zd{constructor(o){this.changingThisBreaksApplicationSecurity=o}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Le})`}}function Ic(t){return t instanceof zd?t.changingThisBreaksApplicationSecurity:t}function Zd(t,o){const l=function A_(t){return t instanceof zd&&t.getTypeName()||null}(t);if(null!=l&&l!==o){if("ResourceURL"===l&&"URL"===o)return!0;throw new Error(`Required a safe ${o}, got a ${l} (see ${Le})`)}return l===o}const Zh=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;var Kl=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}(Kl||{});function Mc(t){const o=hu();return o?o.sanitize(Kl.URL,t)||"":Zd(t,"URL")?Ic(t):function qu(t){return(t=String(t)).match(Zh)?t:"unsafe:"+t}(De(t))}function Zm(t){const o=hu();if(o)return zh(o.sanitize(Kl.RESOURCE_URL,t)||"");if(Zd(t,"ResourceURL"))return zh(Ic(t));throw new ye(904,!1)}function $m(t,o,l){return function Vm(t,o){return"src"===o&&("embed"===t||"frame"===t||"iframe"===t||"media"===t||"script"===t)||"href"===o&&("base"===t||"link"===t)?Zm:Mc}(o,l)(t)}function hu(){const t=jn();return t&&t[Oo].sanitizer}class Gr{constructor(o,l){this._desc=o,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof l?this.__NG_ELEMENT_ID__=l:void 0!==l&&(this.\u0275prov=Ut({token:this,providedIn:l.providedIn||"root",factory:l.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}const Ac=new Gr("ENVIRONMENT_INITIALIZER"),Gm=new Gr("INJECTOR",-1),Hm=new Gr("INJECTOR_DEF_TYPES");class fu{get(o,l=pe){if(l===pe){const d=new Error(`NullInjectorError: No provider for ${Ie(o)}!`);throw d.name="NullInjectorError",d}return l}}function pu(t){return{\u0275providers:t}}function Wm(...t){return{\u0275providers:Ku(0,t),\u0275fromNgModule:!0}}function Ku(t,...o){const l=[],d=new Set;let g;const E=P=>{l.push(P)};return Xc(o,P=>{const F=P;Hh(F,E,[],d)&&(g||=[],g.push(F))}),void 0!==g&&cp(g,E),l}function cp(t,o){for(let l=0;l{o(E,d)})}}function Hh(t,o,l,d){if(!(t=le(t)))return!1;let g=null,E=vt(t);const P=!E&&zi(t);if(E||P){if(P&&!P.standalone)return!1;g=t}else{const V=t.ngModule;if(E=vt(V),!E)return!1;g=V}const F=d.has(g);if(P){if(F)return!1;if(d.add(g),P.dependencies){const V="function"==typeof P.dependencies?P.dependencies():P.dependencies;for(const re of V)Hh(re,o,l,d)}}else{if(!E)return!1;{if(null!=E.imports&&!F){let re;d.add(g);try{Xc(E.imports,Se=>{Hh(Se,o,l,d)&&(re||=[],re.push(Se))})}finally{}void 0!==re&&cp(re,o)}if(!F){const re=ha(g)||(()=>new g);o({provide:g,useFactory:re,deps:vi},g),o({provide:Hm,useValue:g,multi:!0},g),o({provide:Ac,useValue:()=>Ui(g),multi:!0},g)}const V=E.providers;if(null!=V&&!F){const re=t;Wh(V,Se=>{o(Se,re)})}}}return g!==t&&void 0!==t.providers}function Wh(t,o){for(let l of t)ct(l)&&(l=l.\u0275providers),Array.isArray(l)?Wh(l,o):o(l)}const qm=oe({provide:String,useValue:oe});function qh(t){return null!==t&&"object"==typeof t&&qm in t}function mu(t){return"function"==typeof t}const Yh=new Gr("Set Injector scope."),gu={},Ym={};let Bs;function Sc(){return void 0===Bs&&(Bs=new fu),Bs}class la{}class Pc extends la{get destroyed(){return this._destroyed}constructor(o,l,d,g){super(),this.parent=l,this.source=d,this.scopes=g,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,Qu(o,P=>this.processProvider(P)),this.records.set(Gm,Xu(void 0,this)),g.has("environment")&&this.records.set(la,Xu(void 0,this));const E=this.records.get(Yh);null!=E&&"string"==typeof E.value&&this.scopes.add(E.value),this.injectorDefTypes=new Set(this.get(Hm.multi,vi,mi.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const l of this._ngOnDestroyHooks)l.ngOnDestroy();const o=this._onDestroyHooks;this._onDestroyHooks=[];for(const l of o)l()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear()}}onDestroy(o){return this.assertNotDestroyed(),this._onDestroyHooks.push(o),()=>this.removeOnDestroy(o)}runInContext(o){this.assertNotDestroyed();const l=wi(this),d=Mn(void 0);try{return o()}finally{wi(l),Mn(d)}}get(o,l=pe,d=mi.Default){if(this.assertNotDestroyed(),o.hasOwnProperty(yr))return o[yr](this);d=pn(d);const E=wi(this),P=Mn(void 0);try{if(!(d&mi.SkipSelf)){let V=this.records.get(o);if(void 0===V){const re=function Z_(t){return"function"==typeof t||"object"==typeof t&&t instanceof Gr}(o)&&Ft(o);V=re&&this.injectableDefInScope(re)?Xu(Jh(o),gu):null,this.records.set(o,V)}if(null!=V)return this.hydrate(o,V)}return(d&mi.Self?Sc():this.parent).get(o,l=d&mi.Optional&&l===pe?null:l)}catch(F){if("NullInjectorError"===F.name){if((F[xe]=F[xe]||[]).unshift(Ie(o)),E)throw F;return function gi(t,o,l,d){const g=t[xe];throw o[bn]&&g.unshift(o[bn]),t.message=function _i(t,o,l,d=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.slice(2):t;let g=Ie(o);if(Array.isArray(o))g=o.map(Ie).join(" -> ");else if("object"==typeof o){let E=[];for(let P in o)if(o.hasOwnProperty(P)){let F=o[P];E.push(P+":"+("string"==typeof F?JSON.stringify(F):Ie(F)))}g=`{${E.join(", ")}}`}return`${l}${d?"("+d+")":""}[${g}]: ${t.replace(Ze,"\n ")}`}("\n"+t.message,g,l,d),t.ngTokenPath=g,t[xe]=null,t}(F,o,"R3InjectorError",this.source)}throw F}finally{Mn(P),wi(E)}}resolveInjectorInitializers(){const o=wi(this),l=Mn(void 0);try{const g=this.get(Ac.multi,vi,mi.Self);for(const E of g)E()}finally{wi(o),Mn(l)}}toString(){const o=[],l=this.records;for(const d of l.keys())o.push(Ie(d));return`R3Injector[${o.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new ye(205,!1)}processProvider(o){let l=mu(o=le(o))?o:le(o&&o.provide);const d=function N_(t){return qh(t)?Xu(void 0,t.useValue):Xu(Km(t),gu)}(o);if(mu(o)||!0!==o.multi)this.records.get(l);else{let g=this.records.get(l);g||(g=Xu(void 0,gu,!0),g.factory=()=>mn(g.multi),this.records.set(l,g)),l=o,g.multi.push(o)}this.records.set(l,d)}hydrate(o,l){return l.value===gu&&(l.value=Ym,l.value=l.factory()),"object"==typeof l.value&&l.value&&function U_(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(l.value)&&this._ngOnDestroyHooks.add(l.value),l.value}injectableDefInScope(o){if(!o.providedIn)return!1;const l=le(o.providedIn);return"string"==typeof l?"any"===l||this.scopes.has(l):this.injectorDefTypes.has(l)}removeOnDestroy(o){const l=this._onDestroyHooks.indexOf(o);-1!==l&&this._onDestroyHooks.splice(l,1)}}function Jh(t){const o=Ft(t),l=null!==o?o.factory:ha(t);if(null!==l)return l;if(t instanceof Gr)throw new ye(204,!1);if(t instanceof Function)return function Jm(t){const o=t.length;if(o>0)throw Td(o,"?"),new ye(204,!1);const l=function wt(t){return t&&(t[ln]||t[er])||null}(t);return null!==l?()=>l.factory(t):()=>new t}(t);throw new ye(204,!1)}function Km(t,o,l){let d;if(mu(t)){const g=le(t);return ha(g)||Jh(g)}if(qh(t))d=()=>le(t.useValue);else if(function dp(t){return!(!t||!t.useFactory)}(t))d=()=>t.useFactory(...mn(t.deps||[]));else if(function up(t){return!(!t||!t.useExisting)}(t))d=()=>Ui(le(t.useExisting));else{const g=le(t&&(t.useClass||t.provide));if(!function z_(t){return!!t.deps}(t))return ha(g)||Jh(g);d=()=>new g(...mn(t.deps))}return d}function Xu(t,o,l=!1){return{factory:t,value:o,multi:l?[]:void 0}}function Qu(t,o){for(const l of t)Array.isArray(l)?Qu(l,o):l&&ct(l)?Qu(l.\u0275providers,o):o(l)}const Xm=new Gr("AppId",{providedIn:"root",factory:()=>Qm}),Qm="ng",hp=new Gr("Platform Initializer"),Kh=new Gr("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),j_=new Gr("CSP nonce",{providedIn:"root",factory:()=>function Hu(){if(void 0!==hl)return hl;if(typeof document<"u")return document;throw new ye(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let pp=(t,o,l)=>null;function ef(t,o,l=!1){return pp(t,o,l)}class rg{}class Wd{}class J_{resolveComponentFactory(o){throw function gp(t){const o=Error(`No component factory found for ${Ie(t)}.`);return o.ngComponent=t,o}(o)}}let qd=(()=>{class o{}return o.NULL=new J_,o})();function _p(){return ys(Uo(),jn())}function ys(t,o){return new yu(ao(t,o))}let yu=(()=>{class o{constructor(d){this.nativeElement=d}}return o.__NG_ELEMENT_ID__=_p,o})();function sg(t){return t instanceof yu?t.nativeElement:t}class va{}let ag=(()=>{class o{constructor(){this.destroyNode=null}}return o.__NG_ELEMENT_ID__=()=>function Yd(){const t=jn(),l=fo(Uo().index,t);return(Bo(l)?l:t)[Ti]}(),o})(),nd=(()=>{var t;class o{}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:()=>null}),o})();class nf{constructor(o){this.full=o,this.major=o.split(".")[0],this.minor=o.split(".")[1],this.patch=o.split(".").slice(2).join(".")}}const rf=new nf("16.2.2"),yp={};function vp(t,o=null,l=null,d){const g=xp(t,o,l,d);return g.resolveInjectorInitializers(),g}function xp(t,o=null,l=null,d,g=new Set){const E=[l||vi,Wm(t)];return d=d||("object"==typeof t?void 0:Ie(t)),new Pc(E,o||Sc(),d||null,g)}let qa=(()=>{var t;class o{static create(d,g){if(Array.isArray(d))return vp({name:""},g,d,"");{const E=d.name??"";return vp({name:E},d.parent,d.providers,E)}}}return(t=o).THROW_IF_NOT_FOUND=pe,t.NULL=new fu,t.\u0275prov=Ut({token:t,providedIn:"any",factory:()=>Ui(Gm)}),t.__NG_ELEMENT_ID__=-1,o})();function As(t){return t instanceof Function?t():t}let od=(()=>{var t;class o{constructor(){this.callbacks=new Set,this.deferredCallbacks=new Set,this.renderDepth=0,this.runningCallbacks=!1}begin(){if(this.runningCallbacks)throw new ye(102,!1);this.renderDepth++}end(){if(this.renderDepth--,0===this.renderDepth)try{this.runningCallbacks=!0;for(const d of this.callbacks)d.invoke()}finally{this.runningCallbacks=!1;for(const d of this.deferredCallbacks)this.callbacks.add(d);this.deferredCallbacks.clear()}}register(d){(this.runningCallbacks?this.deferredCallbacks:this.callbacks).add(d)}unregister(d){this.callbacks.delete(d),this.deferredCallbacks.delete(d)}ngOnDestroy(){this.callbacks.clear(),this.deferredCallbacks.clear()}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:()=>new t}),o})();function sd(t){for(;t;){t[Zi]|=64;const o=Ol(t);if(Ws(t)&&!o)return t;t=o}return null}function Tp(t){return t.ngOriginalError}class ad{constructor(){this._console=console}handleError(o){const l=this._findOriginalError(o);this._console.error("ERROR",o),l&&this._console.error("ORIGINAL ERROR",l)}_findOriginalError(o){let l=o&&Tp(o);for(;l&&Tp(l);)l=Tp(l);return l||null}}const gg=new Gr("",{providedIn:"root",factory:()=>!1});class Xd extends za{constructor(){super(...arguments),this.consumerAllowSignalWrites=!1,this._lView=null}set lView(o){this._lView=o}onConsumerDependencyMayHaveChanged(){sd(this._lView)}onProducerUpdateValueVersion(){}get hasReadASignal(){return this.hasProducers}runInContext(o,l,d){const g=Ao(this);this.trackingVersion++;try{o(l,d)}finally{Ao(g)}}destroy(){this.trackingVersion++}}let ud=null;function _g(){return ud??=new Xd,ud}function Sp(t,o){return t[o]??_g()}function kc(t,o){const l=_g();l.hasReadASignal&&(t[o]=ud,l.lView=t,ud=new Xd)}const _r={};function ic(t){yg(wr(),jn(),K()+t,!1)}function yg(t,o,l,d){if(!d)if(3==(3&o[Zi])){const E=t.preOrderCheckHooks;null!==E&&b(o,E,l)}else{const E=t.preOrderHooks;null!==E&&T(o,E,0,l)}Me(l)}function zl(t,o=mi.Default){const l=jn();return null===l?Ui(t,o):Pi(Uo(),l,le(t),o)}function dd(){throw new Error("invalid")}function Fc(t,o,l,d,g,E,P,F,V,re,Se){const at=o.blueprint.slice();return at[gr]=g,at[Zi]=140|d,(null!==re||t&&2048&t[Zi])&&(at[Zi]|=2048),Js(at),at[Rr]=at[os]=t,at[br]=l,at[Oo]=P||t&&t[Oo],at[Ti]=F||t&&t[Ti],at[bo]=V||t&&t[bo]||null,at[zr]=E,at[Ho]=function ru(){return b_++}(),at[Qo]=Se,at[hr]=re,at[Br]=2==o.type?t[Br]:at,at}function rc(t,o,l,d,g){let E=t.data[o];if(null===E)E=function Pp(t,o,l,d,g){const E=yc(),P=Hl(),V=t.data[o]=function df(t,o,l,d,g,E){let P=o?o.injectorIndex:-1,F=0;return rl()&&(F|=128),{type:l,index:d,insertBeforeIndex:null,injectorIndex:P,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:F,providerIndexes:0,value:g,attrs:E,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:o,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,P?E:E&&E.parent,l,o,d,g);return null===t.firstChild&&(t.firstChild=V),null!==E&&(P?null==E.child&&null!==V.parent&&(E.child=V):null===E.next&&(E.next=V,V.prev=E)),V}(t,o,l,d,g),function Cd(){return $i.lFrame.inI18n}()&&(E.flags|=32);else if(64&E.type){E.type=l,E.value=d,E.attrs=g;const P=function Dl(){const t=$i.lFrame,o=t.currentTNode;return t.isParent?o:o.parent}();E.injectorIndex=null===P?-1:P.injectorIndex}return ms(E,!0),E}function eh(t,o,l,d){if(0===l)return-1;const g=o.length;for(let E=0;Eor&&yg(t,o,or,!1),Xi(F?2:0,g),F)E.runInContext(l,d,g);else{const re=Ao(null);try{l(d,g)}finally{Ao(re)}}}finally{F&&null===o[hs]&&kc(o,hs),Me(P),Xi(F?3:1,g)}}function hd(t,o,l){if(ra(o)){const d=Ao(null);try{const E=o.directiveEnd;for(let P=o.directiveStart;Pnull;function th(t,o,l,d){for(let g in t)if(t.hasOwnProperty(g)){l=null===l?{}:l;const E=t[g];null===d?nh(l,o,g,E):d.hasOwnProperty(g)&&nh(l,o,d[g],E)}return l}function nh(t,o,l,d){t.hasOwnProperty(l)?t[l].push(o,d):t[l]=[o,d]}function ca(t,o,l,d,g,E,P,F){const V=ao(o,l);let Se,re=o.inputs;!F&&null!=re&&(Se=re[d])?(pf(t,l,Se,d,g),Rs(o)&&function Bc(t,o){const l=fo(o,t);16&l[Zi]||(l[Zi]|=64)}(l,o.index)):3&o.type&&(d=function kp(t){return"class"===t?"className":"for"===t?"htmlFor":"formaction"===t?"formAction":"innerHtml"===t?"innerHTML":"readonly"===t?"readOnly":"tabindex"===t?"tabIndex":t}(d),g=null!=P?P(g,o.value||"",d):g,E.setProperty(V,d,g))}function hf(t,o,l,d){if(Tl()){const g=null===d?null:{"":-1},E=function dy(t,o){const l=t.directiveRegistry;let d=null,g=null;if(l)for(let E=0;E0;){const l=t[--o];if("number"==typeof l&&l<0)return l}return 0})(P)!=F&&P.push(F),P.push(l,d,E)}}(t,o,d,eh(t,l,g.hostVars,_r),g)}function us(t,o,l,d,g,E){const P=ao(t,o);!function Ya(t,o,l,d,g,E,P){if(null==E)t.removeAttribute(o,g,l);else{const F=null==P?De(E):P(E,d||"",g);t.setAttribute(o,g,F,l)}}(o[Ti],P,E,t.value,l,d,g)}function Nc(t,o,l,d,g,E){const P=E[o];if(null!==P)for(let F=0;F{var t;class o{constructor(){this.all=new Set,this.queue=new Map}create(d,g,E){const P=typeof Zone>"u"?null:Zone.current,F=new Ta(d,Se=>{this.all.has(Se)&&this.queue.set(Se,P)},E);let V;this.all.add(F),F.notify();const re=()=>{F.cleanup(),V?.(),this.all.delete(F),this.queue.delete(F)};return V=g?.onDestroy(re),{destroy:re}}flush(){if(0!==this.queue.size)for(const[d,g]of this.queue)this.queue.delete(d),g?g.run(()=>d.run()):d.run()}get isQueueEmpty(){return 0===this.queue.size}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:()=>new t}),o})();function wu(t,o,l){let d=l?t.styles:null,g=l?t.classes:null,E=0;if(null!==o)for(let P=0;P0){mf(t,1);const g=t[li].components;null!==g&&Vp(t,g,1)}}function Vp(t,o,l){for(let d=0;d-1&&(Fd(o,d),Ch(l,d))}this._attachedToViewContainer=!1}Tc(this._lView[li],this._lView)}onDestroy(o){!function zo(t,o){if(256==(256&t[Zi]))throw new ye(911,!1);null===t[Ps]&&(t[Ps]=[]),t[Ps].push(o)}(this._lView,o)}markForCheck(){sd(this._cdRefInjectingView||this._lView)}detach(){this._lView[Zi]&=-129}reattach(){this._lView[Zi]|=128}detectChanges(){oc(this._lView[li],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new ye(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function dl(t,o){Nl(t,o,o[Ti],2,null,null)}(this._lView[li],this._lView)}attachToAppRef(o){if(this._attachedToViewContainer)throw new ye(902,!1);this._appRef=o}}class ah extends fd{constructor(o){super(o),this._view=o}detectChanges(){const o=this._view;oc(o[li],o,o[br],!1)}checkNoChanges(){}get context(){return null}}class lh extends qd{constructor(o){super(),this.ngModule=o}resolveComponentFactory(o){const l=zi(o);return new pd(l,this.ngModule)}}function $p(t){const o=[];for(let l in t)t.hasOwnProperty(l)&&o.push({propName:t[l],templateName:l});return o}class gy{constructor(o,l){this.injector=o,this.parentInjector=l}get(o,l,d){d=pn(d);const g=this.injector.get(o,yp,d);return g!==yp||l===yp?g:this.parentInjector.get(o,l,d)}}class pd extends Wd{get inputs(){const o=this.componentDef,l=o.inputTransforms,d=$p(o.inputs);if(null!==l)for(const g of d)l.hasOwnProperty(g.propName)&&(g.transform=l[g.propName]);return d}get outputs(){return $p(this.componentDef.outputs)}constructor(o,l){super(),this.componentDef=o,this.ngModule=l,this.componentType=o.type,this.selector=function Ni(t){return t.map(Ai).join(",")}(o.selectors),this.ngContentSelectors=o.ngContentSelectors?o.ngContentSelectors:[],this.isBoundToModule=!!l}create(o,l,d,g){let E=(g=g||this.ngModule)instanceof la?g:g?.injector;E&&null!==this.componentDef.getStandaloneInjector&&(E=this.componentDef.getStandaloneInjector(E)||E);const P=E?new gy(o,E):o,F=P.get(va,null);if(null===F)throw new ye(407,!1);const at={rendererFactory:F,sanitizer:P.get(nd,null),effectManager:P.get(Og,null),afterRenderEventManager:P.get(od,null)},Nt=F.createRenderer(null,this.componentDef),rn=this.componentDef.selectors[0][0]||"div",kn=d?function iy(t,o,l,d){const E=d.get(gg,!1)||l===ir.ShadowDom,P=t.selectRootElement(o,E);return function xg(t){bg(t)}(P),P}(Nt,d,this.componentDef.encapsulation,P):$u(Nt,rn,function Lg(t){const o=t.toLowerCase();return"svg"===o?"svg":"math"===o?"math":null}(rn)),ji=this.componentDef.signals?4608:this.componentDef.onPush?576:528;let ei=null;null!==kn&&(ei=ef(kn,P,!0));const mr=Lp(0,null,null,1,0,null,null,null,null,null,null),Pr=Fc(null,mr,null,ji,null,null,at,Nt,P,null,ei);let Co,Xa;xc(Pr);try{const Du=this.componentDef;let If,bv=null;Du.findHostDirectiveDefs?(If=[],bv=new Map,Du.findHostDirectiveDefs(Du,If,bv),If.push(Du)):If=[Du];const MT=function Fg(t,o){const l=t[li],d=or;return t[d]=o,rc(l,d,2,"#host",null)}(Pr,kn),AT=function _y(t,o,l,d,g,E,P){const F=g[li];!function Gp(t,o,l,d){for(const g of t)o.mergedAttrs=to(o.mergedAttrs,g.hostAttrs);null!==o.mergedAttrs&&(wu(o,o.mergedAttrs,!0),null!==l&&Dm(d,l,o))}(d,t,o,P);let V=null;null!==o&&(V=ef(o,g[bo]));const re=E.rendererFactory.createRenderer(o,l);let Se=16;l.signals?Se=4096:l.onPush&&(Se=64);const at=Fc(g,Rp(l),null,Se,g[t.index],t,E,re,null,null,V);return F.firstCreatePass&&bu(F,t,d.length-1),oh(g,at),g[t.index]=at}(MT,kn,Du,If,Pr,at,Nt);Xa=ss(mr,or),kn&&function Ng(t,o,l,d){if(d)Sr(t,l,["ng-version",rf.full]);else{const{attrs:g,classes:E}=function vr(t){const o=[],l=[];let d=1,g=2;for(;d0&&tp(t,l,E.join(" "))}}(Nt,Du,kn,d),void 0!==l&&function zg(t,o,l){const d=t.projection=[];for(let g=0;g=0;d--){const g=t[d];g.hostVars=o+=g.hostVars,g.hostAttrs=to(g.hostAttrs,l=to(l,g.hostAttrs))}}(d)}function md(t){return t===Dr?{}:t===vi?[]:t}function Ug(t,o){const l=t.viewQuery;t.viewQuery=l?(d,g)=>{o(d,g),l(d,g)}:o}function n(t,o){const l=t.contentQueries;t.contentQueries=l?(d,g,E)=>{o(d,g,E),l(d,g,E)}:o}function e(t,o){const l=t.hostBindings;t.hostBindings=l?(d,g)=>{o(d,g),l(d,g)}:o}function j(t){const o=t.inputConfig,l={};for(const d in o)if(o.hasOwnProperty(d)){const g=o[d];Array.isArray(g)&&g[2]&&(l[d]=g[2])}t.inputTransforms=l}function X(t){return!!ke(t)&&(Array.isArray(t)||!(t instanceof Map)&&Symbol.iterator in t)}function ke(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function mt(t,o,l){return t[o]=l}function ut(t,o,l){return!Object.is(t[o],l)&&(t[o]=l,!0)}function xt(t,o,l,d){const g=ut(t,o,l);return ut(t,o+1,d)||g}function nn(t,o,l,d){const g=jn();return ut(g,Il(),o)&&(wr(),us(Ge(),g,t,o,l,d)),nn}function Un(t,o,l,d){return ut(t,Il(),l)?o+De(l)+d:_r}function Pn(t,o,l,d,g,E,P,F){const re=function bt(t,o,l,d,g){const E=xt(t,o,l,d);return ut(t,o+2,g)||E}(t,Da(),l,g,P);return pa(3),re?o+De(l)+d+De(g)+E+De(P)+F:_r}function On(t,o,l,d,g,E,P,F,V,re){const at=function tn(t,o,l,d,g,E){const P=xt(t,o,l,d);return xt(t,o+2,g,E)||P}(t,Da(),l,g,P,V);return pa(4),at?o+De(l)+d+De(g)+E+De(P)+F+De(V)+re:_r}function yf(t,o,l,d,g,E,P,F){const V=jn(),re=wr(),Se=t+or,at=re.firstCreatePass?function Eu(t,o,l,d,g,E,P,F,V){const re=o.consts,Se=rc(o,t,4,P||null,ai(re,F));hf(o,l,Se,ai(re,V)),m(o,Se);const at=Se.tView=Lp(2,Se,d,g,E,o.directiveRegistry,o.pipeRegistry,null,o.schemas,re,null);return null!==o.queries&&(o.queries.template(o,Se),at.queries=o.queries.embeddedTView(Se)),Se}(Se,re,V,o,l,d,g,E,P):re.data[Se];ms(at,!1);const Nt=vf(re,V,at,t);f()&&Fh(re,V,Nt,at),Ro(Nt,V),oh(V,V[Se]=rh(Nt,V,Nt,at)),Ls(at)&&Op(re,V,at),null!=P&&uf(V,at,F)}let vf=function sc(t,o,l,d){return r(!0),o[Ti].createComment("")};function ua(t){return No(function _h(){return $i.lFrame.contextLView}(),or+t)}function Tu(t,o,l){const d=jn();return ut(d,Il(),o)&&ca(wr(),Ge(),d,t,o,d[Ti],l,!1),Tu}function hh(t,o,l,d,g){const P=g?"class":"style";pf(t,l,o.inputs[P],P,d)}function jl(t,o,l,d){const g=jn(),E=wr(),P=or+t,F=g[Ti],V=E.firstCreatePass?function $g(t,o,l,d,g,E){const P=o.consts,V=rc(o,t,2,d,ai(P,g));return hf(o,l,V,ai(P,E)),null!==V.attrs&&wu(V,V.attrs,!1),null!==V.mergedAttrs&&wu(V,V.mergedAttrs,!0),null!==o.queries&&o.queries.elementStart(o,V),V}(P,E,g,o,l,d):E.data[P],re=zv(E,g,V,F,o,t);g[P]=re;const Se=Ls(V);return ms(V,!0),Dm(F,re,V),32!=(32&V.flags)&&f()&&Fh(E,g,re,V),0===function bd(){return $i.lFrame.elementDepthCount}()&&Ro(re,g),function Hc(){$i.lFrame.elementDepthCount++}(),Se&&(Op(E,g,V),hd(E,V,g)),null!==d&&uf(g,V),jl}function Gg(){let t=Uo();Hl()?vc():(t=t.parent,ms(t,!1));const o=t;(function wd(t){return $i.skipHydrationRootTNode===t})(o)&&function Pu(){$i.skipHydrationRootTNode=null}(),function El(){$i.lFrame.elementDepthCount--}();const l=wr();return l.firstCreatePass&&(m(l,t),ra(t)&&l.queries.elementEnd(t)),null!=o.classesWithoutHost&&function Ke(t){return 0!=(8&t.flags)}(o)&&hh(l,o,jn(),o.classesWithoutHost,!0),null!=o.stylesWithoutHost&&function ce(t){return 0!=(16&t.flags)}(o)&&hh(l,o,jn(),o.stylesWithoutHost,!1),Gg}function xy(t,o,l,d){return jl(t,o,l,d),Gg(),xy}let zv=(t,o,l,d,g,E)=>(r(!0),$u(d,g,function ar(){return $i.lFrame.currentNamespace}()));function Hg(t,o,l){const d=jn(),g=wr(),E=t+or,P=g.firstCreatePass?function tb(t,o,l,d,g){const E=o.consts,P=ai(E,d),F=rc(o,t,8,"ng-container",P);return null!==P&&wu(F,P,!0),hf(o,l,F,ai(E,g)),null!==o.queries&&o.queries.elementStart(o,F),F}(E,g,d,o,l):g.data[E];ms(P,!0);const F=Uv(g,d,P,t);return d[E]=F,f()&&Fh(g,d,F,P),Ro(F,d),Ls(P)&&(Op(g,d,P),hd(g,P,d)),null!=l&&uf(d,P),Hg}function Wg(){let t=Uo();const o=wr();return Hl()?vc():(t=t.parent,ms(t,!1)),o.firstCreatePass&&(m(o,t),ra(t)&&o.queries.elementEnd(t)),Wg}function by(t,o,l){return Hg(t,o,l),Wg(),by}let Uv=(t,o,l,d)=>(r(!0),$r(o[Ti],""));function Zv(){return jn()}function wy(t){return!!t&&"function"==typeof t.then}function jv(t){return!!t&&"function"==typeof t.subscribe}function Cy(t,o,l,d){const g=jn(),E=wr(),P=Uo();return function $v(t,o,l,d,g,E,P){const F=Ls(d),re=t.firstCreatePass&&Np(t),Se=o[br],at=Mg(o);let Nt=!0;if(3&d.type||P){const oi=ao(d,o),yi=P?P(oi):oi,ji=at.length,ei=P?Pr=>P(Vi(Pr[d.index])):d.index;let mr=null;if(!P&&F&&(mr=function rb(t,o,l,d){const g=t.cleanup;if(null!=g)for(let E=0;EV?F[V]:null}"string"==typeof P&&(E+=2)}return null}(t,o,g,d.index)),null!==mr)(mr.__ngLastListenerFn__||mr).__ngNextListenerFn__=E,mr.__ngLastListenerFn__=E,Nt=!1;else{E=Hv(d,o,Se,E,!1);const Pr=l.listen(yi,g,E);at.push(E,Pr),re&&re.push(g,ei,ji,ji+1)}}else E=Hv(d,o,Se,E,!1);const rn=d.outputs;let kn;if(Nt&&null!==rn&&(kn=rn[g])){const oi=kn.length;if(oi)for(let yi=0;yi-1?fo(t.index,o):o);let V=Gv(o,l,d,P),re=E.__ngNextListenerFn__;for(;re;)V=Gv(o,l,re,P)&&V,re=re.__ngNextListenerFn__;return g&&!1===V&&P.preventDefault(),V}}function Wv(t=1){return function $(t){return($i.lFrame.contextLView=function z(t,o){for(;t>0;)o=o[os],t--;return o}(t,$i.lFrame.contextLView))[br]}(t)}function ob(t,o){let l=null;const d=function vn(t){const o=t.attrs;if(null!=o){const l=o.indexOf(5);if(!(1&l))return o[l+1]}return null}(t);for(let g=0;g>17&32767}function Dy(t){return 2|t}function fh(t){return(131068&t)>>2}function Iy(t,o){return-131069&t|o<<2}function My(t){return 1|t}function o0(t,o,l,d,g){const E=t[l+1],P=null===o;let F=d?_d(E):fh(E),V=!1;for(;0!==F&&(!1===V||P);){const Se=t[F+1];db(t[F],o)&&(V=!0,t[F+1]=d?My(Se):Dy(Se)),F=d?_d(Se):fh(Se)}V&&(t[l+1]=d?Dy(E):My(E))}function db(t,o){return null===t||null==o||(Array.isArray(t)?t[1]:t)===o||!(!Array.isArray(t)||"string"!=typeof o)&&Sa(t,o)>=0}function Ay(t,o,l){return ac(t,o,l,!1),Ay}function Sy(t,o){return ac(t,o,null,!0),Sy}function ac(t,o,l,d){const g=jn(),E=wr(),P=pa(2);E.firstUpdatePass&&function f0(t,o,l,d){const g=t.data;if(null===g[l+1]){const E=g[K()],P=function h0(t,o){return o>=t.expandoStartIndex}(t,l);(function _0(t,o){return 0!=(t.flags&(o?8:16))})(E,d)&&null===o&&!P&&(o=!1),o=function xb(t,o,l,d){const g=function js(t){const o=$i.lFrame.currentDirectiveIndex;return-1===o?null:t[o]}(t);let E=d?o.residualClasses:o.residualStyles;if(null===g)0===(d?o.classBindings:o.styleBindings)&&(l=Yp(l=Py(null,t,o,l,d),o.attrs,d),E=null);else{const P=o.directiveStylingLast;if(-1===P||t[P]!==g)if(l=Py(g,t,o,l,d),null===E){let V=function bb(t,o,l){const d=l?o.classBindings:o.styleBindings;if(0!==fh(d))return t[_d(d)]}(t,o,d);void 0!==V&&Array.isArray(V)&&(V=Py(null,t,o,V[1],d),V=Yp(V,o.attrs,d),function wb(t,o,l,d){t[_d(l?o.classBindings:o.styleBindings)]=d}(t,o,d,V))}else E=function Cb(t,o,l){let d;const g=o.directiveEnd;for(let E=1+o.directiveStylingLast;E0)&&(re=!0)):Se=l,g)if(0!==V){const Nt=_d(t[F+1]);t[d+1]=qg(Nt,F),0!==Nt&&(t[Nt+1]=Iy(t[Nt+1],d)),t[F+1]=function ab(t,o){return 131071&t|o<<17}(t[F+1],d)}else t[d+1]=qg(F,0),0!==F&&(t[F+1]=Iy(t[F+1],d)),F=d;else t[d+1]=qg(V,0),0===F?F=d:t[V+1]=Iy(t[V+1],d),V=d;re&&(t[d+1]=Dy(t[d+1])),o0(t,Se,d,!0),o0(t,Se,d,!1),function ub(t,o,l,d,g){const E=g?t.residualClasses:t.residualStyles;null!=E&&"string"==typeof o&&Sa(E,o)>=0&&(l[d+1]=My(l[d+1]))}(o,Se,t,d,E),P=qg(F,V),E?o.classBindings=P:o.styleBindings=P}(g,E,o,l,P,d)}}(E,t,P,d),o!==_r&&ut(g,P,o)&&function m0(t,o,l,d,g,E,P,F){if(!(3&o.type))return;const V=t.data,re=V[F+1],Se=function lb(t){return 1==(1&t)}(re)?g0(V,o,l,g,fh(re),P):void 0;Yg(Se)||(Yg(E)||function sb(t){return 2==(2&t)}(re)&&(E=g0(V,null,l,g,F,P)),function E_(t,o,l,d,g){if(o)g?t.addClass(l,d):t.removeClass(l,d);else{let E=-1===d.indexOf("-")?void 0:Zu.DashCase;null==g?t.removeStyle(l,d,E):("string"==typeof g&&g.endsWith("!important")&&(g=g.slice(0,-10),E|=Zu.Important),t.setStyle(l,d,g,E))}}(d,P,ho(K(),l),g,E))}(E,E.data[K()],g,g[Ti],t,g[P+1]=function Ib(t,o){return null==t||""===t||("string"==typeof o?t+=o:"object"==typeof t&&(t=Ie(Ic(t)))),t}(o,l),d,P)}function Py(t,o,l,d,g){let E=null;const P=l.directiveEnd;let F=l.directiveStylingLast;for(-1===F?F=l.directiveStart:F++;F0;){const V=t[g],re=Array.isArray(V),Se=re?V[1]:V,at=null===Se;let Nt=l[g+1];Nt===_r&&(Nt=at?vi:void 0);let rn=at?Sl(Nt,d):Se===d?Nt:void 0;if(re&&!Yg(rn)&&(rn=Sl(V,d)),Yg(rn)&&(F=rn,P))return F;const kn=t[g+1];g=P?_d(kn):fh(kn)}if(null!==o){let V=E?o.residualClasses:o.residualStyles;null!=V&&(F=Sl(V,d))}return F}function Yg(t){return void 0!==t}function y0(t,o=""){const l=jn(),d=wr(),g=t+or,E=d.firstCreatePass?rc(d,g,1,o,null):d.data[g],P=v0(d,l,E,o,t);l[g]=P,f()&&Fh(d,l,P,E),ms(E,!1)}let v0=(t,o,l,d,g)=>(r(!0),function kd(t,o){return t.createText(o)}(o[Ti],d));function Oy(t){return Jg("",t,""),Oy}function Jg(t,o,l){const d=jn(),g=Un(d,t,o,l);return g!==_r&&Ul(d,K(),g),Jg}function Ry(t,o,l,d,g){const E=jn(),P=function fn(t,o,l,d,g,E){const F=xt(t,Da(),l,g);return pa(2),F?o+De(l)+d+De(g)+E:_r}(E,t,o,l,d,g);return P!==_r&&Ul(E,K(),P),Ry}function Ly(t,o,l,d,g,E,P){const F=jn(),V=Pn(F,t,o,l,d,g,E,P);return V!==_r&&Ul(F,K(),V),Ly}function ky(t,o,l,d,g,E,P,F,V){const re=jn(),Se=On(re,t,o,l,d,g,E,P,F,V);return Se!==_r&&Ul(re,K(),Se),ky}const ph=void 0;var Yb=["en",[["a","p"],["AM","PM"],ph],[["AM","PM"],ph,ph],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],ph,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],ph,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",ph,"{1} 'at' {0}",ph],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function qb(t){const l=Math.floor(Math.abs(t)),d=t.toString().replace(/^[^.]*\.?/,"").length;return 1===l&&0===d?1:5}];let bf={};function Fy(t){const o=function Jb(t){return t.toLowerCase().replace(/_/g,"-")}(t);let l=B0(o);if(l)return l;const d=o.split("-")[0];if(l=B0(d),l)return l;if("en"===d)return Yb;throw new ye(701,!1)}function F0(t){return Fy(t)[wf.PluralCase]}function B0(t){return t in bf||(bf[t]=_n.ng&&_n.ng.common&&_n.ng.common.locales&&_n.ng.common.locales[t]),bf[t]}var wf=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}(wf||{});const Cf="en-US";let N0=Cf;function zy(t,o,l,d,g){if(t=le(t),Array.isArray(t))for(let E=0;E>20;if(mu(t)||!t.multi){const rn=new se(re,g,zl),kn=Zy(V,o,g?Se:Se+Nt,at);-1===kn?(Wn(sn(F,P),E,V),Uy(E,t,o.length),o.push(V),F.directiveStart++,F.directiveEnd++,g&&(F.providerIndexes+=1048576),l.push(rn),P.push(rn)):(l[kn]=rn,P[kn]=rn)}else{const rn=Zy(V,o,Se+Nt,at),kn=Zy(V,o,Se,Se+Nt),yi=kn>=0&&l[kn];if(g&&!yi||!g&&!(rn>=0&&l[rn])){Wn(sn(F,P),E,V);const ji=function qw(t,o,l,d,g){const E=new se(t,l,zl);return E.multi=[],E.index=o,E.componentProviders=0,cx(E,g,d&&!l),E}(g?Ww:Hw,l.length,g,d,re);!g&&yi&&(l[kn].providerFactory=ji),Uy(E,t,o.length,0),o.push(V),F.directiveStart++,F.directiveEnd++,g&&(F.providerIndexes+=1048576),l.push(ji),P.push(ji)}else Uy(E,t,rn>-1?rn:kn,cx(l[g?kn:rn],re,!g&&d));!g&&d&&yi&&l[kn].componentProviders++}}}function Uy(t,o,l,d){const g=mu(o),E=function B_(t){return!!t.useClass}(o);if(g||E){const V=(E?le(o.useClass):o).prototype.ngOnDestroy;if(V){const re=t.destroyHooks||(t.destroyHooks=[]);if(!g&&o.multi){const Se=re.indexOf(l);-1===Se?re.push(l,[d,V]):re[Se+1].push(d,V)}else re.push(l,V)}}}function cx(t,o,l){return l&&t.componentProviders++,t.multi.push(o)-1}function Zy(t,o,l,d){for(let g=l;g{l.providersResolver=(d,g)=>function Gw(t,o,l){const d=wr();if(d.firstCreatePass){const g=ki(t);zy(l,d.data,d.blueprint,g,!0),zy(o,d.data,d.blueprint,g,!1)}}(d,g?g(t):t,o)}}class mh{}class dx{}function Yw(t,o){return new Vy(t,o??null,[])}class Vy extends mh{constructor(o,l,d){super(),this._parent=l,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new lh(this);const g=so(o);this._bootstrapComponents=As(g.bootstrap),this._r3Injector=xp(o,l,[{provide:mh,useValue:this},{provide:qd,useValue:this.componentFactoryResolver},...d],Ie(o),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(o)}get injector(){return this._r3Injector}destroy(){const o=this._r3Injector;!o.destroyed&&o.destroy(),this.destroyCbs.forEach(l=>l()),this.destroyCbs=null}onDestroy(o){this.destroyCbs.push(o)}}class $y extends dx{constructor(o){super(),this.moduleType=o}create(o){return new Vy(this.moduleType,o,[])}}class hx extends mh{constructor(o){super(),this.componentFactoryResolver=new lh(this),this.instance=null;const l=new Pc([...o.providers,{provide:mh,useValue:this},{provide:qd,useValue:this.componentFactoryResolver}],o.parent||Sc(),o.debugName,new Set(["environment"]));this.injector=l,o.runEnvironmentInitializers&&l.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(o){this.injector.onDestroy(o)}}function fx(t,o,l=null){return new hx({providers:t,parent:o,debugName:l,runEnvironmentInitializers:!0}).injector}let Kw=(()=>{var t;class o{constructor(d){this._injector=d,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(d){if(!d.standalone)return null;if(!this.cachedInjectors.has(d)){const g=Ku(0,d.type),E=g.length>0?fx([g],this._injector,`Standalone[${d.type.name}]`):null;this.cachedInjectors.set(d,E)}return this.cachedInjectors.get(d)}ngOnDestroy(){try{for(const d of this.cachedInjectors.values())null!==d&&d.destroy()}finally{this.cachedInjectors.clear()}}}return(t=o).\u0275prov=Ut({token:t,providedIn:"environment",factory:()=>new t(Ui(la))}),o})();function px(t){t.getStandaloneInjector=o=>o.get(Kw).getOrCreateStandaloneInjector(t)}function bx(t,o,l){const d=gs()+t,g=jn();return g[d]===_r?mt(g,d,l?o.call(l):o()):function Qe(t,o){return t[o]}(g,d)}function tm(t,o){const l=t[o];return l===_r?void 0:l}function Ix(t,o){const l=wr();let d;const g=t+or;l.firstCreatePass?(d=function mC(t,o){if(o)for(let l=o.length-1;l>=0;l--){const d=o[l];if(t===d.name)return d}}(o,l.pipeRegistry),l.data[g]=d,d.onDestroy&&(l.destroyHooks??=[]).push(g,d.onDestroy)):d=l.data[g];const E=d.factory||(d.factory=ha(d.type)),F=Mn(zl);try{const V=zt(!1),re=E();return zt(V),function xa(t,o,l,d){l>=t.data.length&&(t.data[l]=null,t.blueprint[l]=null),o[l]=d}(l,jn(),g,re),re}finally{Mn(F)}}function Mx(t,o,l){const d=t+or,g=jn(),E=No(g,d);return nm(g,d)?function wx(t,o,l,d,g,E){const P=o+l;return ut(t,P,g)?mt(t,P+1,E?d.call(E,g):d(g)):tm(t,P+1)}(g,gs(),o,E.transform,l,E):E.transform(l)}function Ax(t,o,l,d){const g=t+or,E=jn(),P=No(E,g);return nm(E,g)?function Cx(t,o,l,d,g,E,P){const F=o+l;return xt(t,F,g,E)?mt(t,F+2,P?d.call(P,g,E):d(g,E)):tm(t,F+2)}(E,gs(),o,P.transform,l,d,P):P.transform(l,d)}function nm(t,o){return t[li].data[o].pure}function Hy(t){return o=>{setTimeout(t,void 0,o)}}const $c=class vC extends x.x{constructor(o=!1){super(),this.__isAsync=o}emit(o){super.next(o)}subscribe(o,l,d){let g=o,E=l||(()=>null),P=d;if(o&&"object"==typeof o){const V=o;g=V.next?.bind(V),E=V.error?.bind(V),P=V.complete?.bind(V)}this.__isAsync&&(E=Hy(E),g&&(g=Hy(g)),P&&(P=Hy(P)));const F=super.subscribe({next:g,error:E,complete:P});return o instanceof h.w0&&o.add(F),F}};function xC(){return this._results[Symbol.iterator]()}class Wy{get changes(){return this._changes||(this._changes=new $c)}constructor(o=!1){this._emitDistinctChangesOnly=o,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const l=Wy.prototype;l[Symbol.iterator]||(l[Symbol.iterator]=xC)}get(o){return this._results[o]}map(o){return this._results.map(o)}filter(o){return this._results.filter(o)}find(o){return this._results.find(o)}reduce(o,l){return this._results.reduce(o,l)}forEach(o){this._results.forEach(o)}some(o){return this._results.some(o)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(o,l){const d=this;d.dirty=!1;const g=function Aa(t){return t.flat(Number.POSITIVE_INFINITY)}(o);(this._changesDetected=!function wh(t,o,l){if(t.length!==o.length)return!1;for(let d=0;d0&&(l[g-1][_o]=o),d{class o{}return o.__NG_ELEMENT_ID__=TC,o})();const CC=im,EC=class extends CC{constructor(o,l,d){super(),this._declarationLView=o,this._declarationTContainer=l,this.elementRef=d}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(o,l){return this.createEmbeddedViewImpl(o,l)}createEmbeddedViewImpl(o,l,d){const g=function bC(t,o,l,d){const g=o.tView,F=Fc(t,g,l,4096&t[Zi]?4096:16,null,o,null,null,null,d?.injector??null,d?.hydrationInfo??null);F[zs]=t[o.index];const re=t[Fo];return null!==re&&(F[Fo]=re.createEmbeddedView(g)),Zl(g,F,l),F}(this._declarationLView,this._declarationTContainer,o,{injector:l,hydrationInfo:d});return new fd(g)}};function TC(){return t_(Uo(),jn())}function t_(t,o){return 4&t.type?new EC(o,t,ys(t,o)):null}let i_=(()=>{class o{}return o.__NG_ELEMENT_ID__=PC,o})();function PC(){return Fx(Uo(),jn())}const OC=i_,Lx=class extends OC{constructor(o,l,d){super(),this._lContainer=o,this._hostTNode=l,this._hostLView=d}get element(){return ys(this._hostTNode,this._hostLView)}get injector(){return new vo(this._hostTNode,this._hostLView)}get parentInjector(){const o=Ln(this._hostTNode,this._hostLView);if(ot(o)){const l=Dt(o,this._hostLView),d=Tt(o);return new vo(l[li].data[d+8],l)}return new vo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(o){const l=kx(this._lContainer);return null!==l&&l[o]||null}get length(){return this._lContainer.length-Io}createEmbeddedView(o,l,d){let g,E;"number"==typeof d?g=d:null!=d&&(g=d.index,E=d.injector);const F=o.createEmbeddedViewImpl(l||{},E,null);return this.insertImpl(F,g,false),F}createComponent(o,l,d,g,E){const P=o&&!function Ma(t){return"function"==typeof t}(o);let F;if(P)F=l;else{const oi=l||{};F=oi.index,d=oi.injector,g=oi.projectableNodes,E=oi.environmentInjector||oi.ngModuleRef}const V=P?o:new pd(zi(o)),re=d||this.parentInjector;if(!E&&null==V.ngModule){const yi=(P?re:this.parentInjector).get(la,null);yi&&(E=yi)}zi(V.componentType??{});const rn=V.create(re,g,null,E);return this.insertImpl(rn.hostView,F,false),rn}insert(o,l){return this.insertImpl(o,l,!1)}insertImpl(o,l,d){const g=o._lView;if(function mc(t){return yo(t[Rr])}(g)){const V=this.indexOf(o);if(-1!==V)this.detach(V);else{const re=g[Rr],Se=new Lx(re,re[zr],re[Rr]);Se.detach(Se.indexOf(o))}}const P=this._adjustIndex(l),F=this._lContainer;return wC(F,g,P,!d),o.attachToViewContainerRef(),am(qy(F),P,o),o}move(o,l){return this.insert(o,l)}indexOf(o){const l=kx(this._lContainer);return null!==l?l.indexOf(o):-1}remove(o){const l=this._adjustIndex(o,-1),d=Fd(this._lContainer,l);d&&(Ch(qy(this._lContainer),l),Tc(d[li],d))}detach(o){const l=this._adjustIndex(o,-1),d=Fd(this._lContainer,l);return d&&null!=Ch(qy(this._lContainer),l)?new fd(d):null}_adjustIndex(o,l=0){return o??this.length+l}};function kx(t){return t[8]}function qy(t){return t[8]||(t[8]=[])}function Fx(t,o){let l;const d=o[t.index];return yo(d)?l=d:(l=rh(d,o,null,t),o[t.index]=l,oh(o,l)),Bx(l,o,t,d),new Lx(l,t,o)}let Bx=function Nx(t,o,l,d){if(t[Ur])return;let g;g=8&l.type?Vi(d):function RC(t,o){const l=t[Ti],d=l.createComment(""),g=ao(o,t);return Dc(l,lu(l,g),d,function Wf(t,o){return t.nextSibling(o)}(l,g),!1),d}(o,l),t[Ur]=g};class Yy{constructor(o){this.queryList=o,this.matches=null}clone(){return new Yy(this.queryList)}setDirty(){this.queryList.setDirty()}}class Jy{constructor(o=[]){this.queries=o}createEmbeddedView(o){const l=o.queries;if(null!==l){const d=null!==o.contentQueries?o.contentQueries[0]:l.length,g=[];for(let E=0;E0)d.push(P[F/2]);else{const re=E[F+1],Se=o[-V];for(let at=Io;at{var t;class o{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((d,g)=>{this.resolve=d,this.reject=g}),this.appInits=st(u1,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const d=[];for(const E of this.appInits){const P=E();if(wy(P))d.push(P);else if(jv(P)){const F=new Promise((V,re)=>{P.subscribe({complete:V,error:re})});d.push(F)}}const g=()=>{this.done=!0,this.resolve()};Promise.all(d).then(()=>{g()}).catch(E=>{this.reject(E)}),0===d.length&&g(),this.initialized=!0}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})(),d1=(()=>{var t;class o{log(d){console.log(d)}warn(d){console.warn(d)}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"platform"}),o})();const o_=new Gr("LocaleId",{providedIn:"root",factory:()=>st(o_,mi.Optional|mi.SkipSelf)||function cE(){return typeof $localize<"u"&&$localize.locale||Cf}()}),uE=new Gr("DefaultCurrencyCode",{providedIn:"root",factory:()=>"USD"});let h1=(()=>{var t;class o{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new y.X(!1)}add(){this.hasPendingTasks.next(!0);const d=this.taskId++;return this.pendingTasks.add(d),d}remove(d){this.pendingTasks.delete(d),0===this.pendingTasks.size&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks.next(!1)}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();class hE{constructor(o,l){this.ngModuleFactory=o,this.componentFactories=l}}let fE=(()=>{var t;class o{compileModuleSync(d){return new $y(d)}compileModuleAsync(d){return Promise.resolve(this.compileModuleSync(d))}compileModuleAndAllComponentsSync(d){const g=this.compileModuleSync(d),P=As(so(d).declarations).reduce((F,V)=>{const re=zi(V);return re&&F.push(new pd(re)),F},[]);return new hE(g,P)}compileModuleAndAllComponentsAsync(d){return Promise.resolve(this.compileModuleAndAllComponentsSync(d))}clearCache(){}clearCacheFor(d){}getModuleId(d){}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();function g1(...t){}class ba{constructor({enableLongStackTrace:o=!1,shouldCoalesceEventChangeDetection:l=!1,shouldCoalesceRunChangeDetection:d=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new $c(!1),this.onMicrotaskEmpty=new $c(!1),this.onStable=new $c(!1),this.onError=new $c(!1),typeof Zone>"u")throw new ye(908,!1);Zone.assertZonePatched();const g=this;g._nesting=0,g._outer=g._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(g._inner=g._inner.fork(new Zone.TaskTrackingZoneSpec)),o&&Zone.longStackTraceZoneSpec&&(g._inner=g._inner.fork(Zone.longStackTraceZoneSpec)),g.shouldCoalesceEventChangeDetection=!d&&l,g.shouldCoalesceRunChangeDetection=d,g.lastRequestAnimationFrameId=-1,g.nativeRequestAnimationFrame=function RE(){const t="function"==typeof _n.requestAnimationFrame;let o=_n[t?"requestAnimationFrame":"setTimeout"],l=_n[t?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&o&&l){const d=o[Zone.__symbol__("OriginalDelegate")];d&&(o=d);const g=l[Zone.__symbol__("OriginalDelegate")];g&&(l=g)}return{nativeRequestAnimationFrame:o,nativeCancelAnimationFrame:l}}().nativeRequestAnimationFrame,function FE(t){const o=()=>{!function kE(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(_n,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,cv(t),t.isCheckStableRunning=!0,lv(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),cv(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(l,d,g,E,P,F)=>{try{return _1(t),l.invokeTask(g,E,P,F)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===E.type||t.shouldCoalesceRunChangeDetection)&&o(),y1(t)}},onInvoke:(l,d,g,E,P,F,V)=>{try{return _1(t),l.invoke(g,E,P,F,V)}finally{t.shouldCoalesceRunChangeDetection&&o(),y1(t)}},onHasTask:(l,d,g,E)=>{l.hasTask(g,E),d===g&&("microTask"==E.change?(t._hasPendingMicrotasks=E.microTask,cv(t),lv(t)):"macroTask"==E.change&&(t.hasPendingMacrotasks=E.macroTask))},onHandleError:(l,d,g,E)=>(l.handleError(g,E),t.runOutsideAngular(()=>t.onError.emit(E)),!1)})}(g)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!ba.isInAngularZone())throw new ye(909,!1)}static assertNotInAngularZone(){if(ba.isInAngularZone())throw new ye(909,!1)}run(o,l,d){return this._inner.run(o,l,d)}runTask(o,l,d,g){const E=this._inner,P=E.scheduleEventTask("NgZoneEvent: "+g,o,LE,g1,g1);try{return E.runTask(P,l,d)}finally{E.cancelTask(P)}}runGuarded(o,l,d){return this._inner.runGuarded(o,l,d)}runOutsideAngular(o){return this._outer.run(o)}}const LE={};function lv(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function cv(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function _1(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function y1(t){t._nesting--,lv(t)}class BE{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new $c,this.onMicrotaskEmpty=new $c,this.onStable=new $c,this.onError=new $c}run(o,l,d){return o.apply(l,d)}runGuarded(o,l,d){return o.apply(l,d)}runOutsideAngular(o){return o()}runTask(o,l,d,g){return o.apply(l,d)}}const v1=new Gr("",{providedIn:"root",factory:x1});function x1(){const t=st(ba);let o=!0;return function me(...t){const o=(0,C.yG)(t),l=(0,C._6)(t,1/0),d=t;return d.length?1===d.length?(0,ie.Xf)(d[0]):(0,J.J)(l)((0,Ne.D)(d,o)):Y.E}(new s.y(g=>{o=t.isStable&&!t.hasPendingMacrotasks&&!t.hasPendingMicrotasks,t.runOutsideAngular(()=>{g.next(o),g.complete()})}),new s.y(g=>{let E;t.runOutsideAngular(()=>{E=t.onStable.subscribe(()=>{ba.assertNotInAngularZone(),queueMicrotask(()=>{!o&&!t.hasPendingMacrotasks&&!t.hasPendingMicrotasks&&(o=!0,g.next(!0))})})});const P=t.onUnstable.subscribe(()=>{ba.assertInAngularZone(),o&&(o=!1,t.runOutsideAngular(()=>{g.next(!1)}))});return()=>{E.unsubscribe(),P.unsubscribe()}}).pipe((0,_e.B)()))}const b1=new Gr(""),w1=new Gr("");let uv,NE=(()=>{var t;class o{constructor(d,g,E){this._ngZone=d,this.registry=g,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,uv||(function zE(t){uv=t}(E),E.addToWindow(g)),this._watchAngularEvents(),d.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{ba.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let d=this._callbacks.pop();clearTimeout(d.timeoutId),d.doneCb(this._didWork)}this._didWork=!1});else{let d=this.getPendingTasks();this._callbacks=this._callbacks.filter(g=>!g.updateCb||!g.updateCb(d)||(clearTimeout(g.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(d=>({source:d.source,creationLocation:d.creationLocation,data:d.data})):[]}addCallback(d,g,E){let P=-1;g&&g>0&&(P=setTimeout(()=>{this._callbacks=this._callbacks.filter(F=>F.timeoutId!==P),d(this._didWork,this.getPendingTasks())},g)),this._callbacks.push({doneCb:d,timeoutId:P,updateCb:E})}whenStable(d,g,E){if(E&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(d,g,E),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(d){this.registry.registerApplication(d,this)}unregisterApplication(d){this.registry.unregisterApplication(d)}findProviders(d,g,E){return[]}}return(t=o).\u0275fac=function(d){return new(d||t)(Ui(ba),Ui(C1),Ui(w1))},t.\u0275prov=Ut({token:t,factory:t.\u0275fac}),o})(),C1=(()=>{var t;class o{constructor(){this._applications=new Map}registerApplication(d,g){this._applications.set(d,g)}unregisterApplication(d){this._applications.delete(d)}unregisterAllApplications(){this._applications.clear()}getTestability(d){return this._applications.get(d)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(d,g=!0){return uv?.findTestabilityInTree(this,d,g)??null}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"platform"}),o})(),yd=null;const E1=new Gr("AllowMultipleToken"),dv=new Gr("PlatformDestroyListeners"),hv=new Gr("appBootstrapListener");class jE{constructor(o,l){this.name=o,this.token=l}}function I1(t,o,l=[]){const d=`Platform: ${o}`,g=new Gr(d);return(E=[])=>{let P=fv();if(!P||P.injector.get(E1,!1)){const F=[...l,...E,{provide:g,useValue:!0}];t?t(F):function VE(t){if(yd&&!yd.get(E1,!1))throw new ye(400,!1);(function T1(){!function Au(t){Gc=t}(()=>{throw new ye(600,!1)})})(),yd=t;const o=t.get(A1);(function D1(t){t.get(hp,null)?.forEach(l=>l())})(t)}(function M1(t=[],o){return qa.create({name:o,providers:[{provide:Yh,useValue:"platform"},{provide:dv,useValue:new Set([()=>yd=null])},...t]})}(F,d))}return function GE(t){const o=fv();if(!o)throw new ye(401,!1);return o}()}}function fv(){return yd?.get(A1)??null}let A1=(()=>{var t;class o{constructor(d){this._injector=d,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(d,g){const E=function HE(t="zone.js",o){return"noop"===t?new BE:"zone.js"===t?new ba(o):t}(g?.ngZone,function S1(t){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:t?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:t?.runCoalescing??!1}}({eventCoalescing:g?.ngZoneEventCoalescing,runCoalescing:g?.ngZoneRunCoalescing}));return E.run(()=>{const P=function Jw(t,o,l){return new Vy(t,o,l)}(d.moduleType,this.injector,function k1(t){return[{provide:ba,useFactory:t},{provide:Ac,multi:!0,useFactory:()=>{const o=st(qE,{optional:!0});return()=>o.initialize()}},{provide:L1,useFactory:WE},{provide:v1,useFactory:x1}]}(()=>E)),F=P.injector.get(ad,null);return E.runOutsideAngular(()=>{const V=E.onError.subscribe({next:re=>{F.handleError(re)}});P.onDestroy(()=>{a_(this._modules,P),V.unsubscribe()})}),function P1(t,o,l){try{const d=l();return wy(d)?d.catch(g=>{throw o.runOutsideAngular(()=>t.handleError(g)),g}):d}catch(d){throw o.runOutsideAngular(()=>t.handleError(d)),d}}(F,E,()=>{const V=P.injector.get(ov);return V.runInitializers(),V.donePromise.then(()=>(function z0(t){kt(t,"Expected localeId to be defined"),"string"==typeof t&&(N0=t.toLowerCase().replace(/_/g,"-"))}(P.injector.get(o_,Cf)||Cf),this._moduleDoBootstrap(P),P))})})}bootstrapModule(d,g=[]){const E=O1({},g);return function UE(t,o,l){const d=new $y(l);return Promise.resolve(d)}(0,0,d).then(P=>this.bootstrapModuleFactory(P,E))}_moduleDoBootstrap(d){const g=d.injector.get(Df);if(d._bootstrapComponents.length>0)d._bootstrapComponents.forEach(E=>g.bootstrap(E));else{if(!d.instance.ngDoBootstrap)throw new ye(-403,!1);d.instance.ngDoBootstrap(g)}this._modules.push(d)}onDestroy(d){this._destroyListeners.push(d)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new ye(404,!1);this._modules.slice().forEach(g=>g.destroy()),this._destroyListeners.forEach(g=>g());const d=this._injector.get(dv,null);d&&(d.forEach(g=>g()),d.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}}return(t=o).\u0275fac=function(d){return new(d||t)(Ui(qa))},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"platform"}),o})();function O1(t,o){return Array.isArray(o)?o.reduce(O1,t):{...t,...o}}let Df=(()=>{var t;class o{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=st(L1),this.zoneIsStable=st(v1),this.componentTypes=[],this.components=[],this.isStable=st(h1).hasPendingTasks.pipe((0,ee.w)(d=>d?(0,he.of)(!1):this.zoneIsStable),(0,ae.x)(),(0,_e.B)()),this._injector=st(la)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(d,g){const E=d instanceof Wd;if(!this._injector.get(ov).done)throw!E&&Er(d),new ye(405,!1);let F;F=E?d:this._injector.get(qd).resolveComponentFactory(d),this.componentTypes.push(F.componentType);const V=function ZE(t){return t.isBoundToModule}(F)?void 0:this._injector.get(mh),Se=F.create(qa.NULL,[],g||F.selector,V),at=Se.location.nativeElement,Nt=Se.injector.get(b1,null);return Nt?.registerApplication(at),Se.onDestroy(()=>{this.detachView(Se.hostView),a_(this.components,Se),Nt?.unregisterApplication(at)}),this._loadComponent(Se),Se}tick(){if(this._runningTick)throw new ye(101,!1);try{this._runningTick=!0;for(let d of this._views)d.detectChanges()}catch(d){this.internalErrorHandler(d)}finally{this._runningTick=!1}}attachView(d){const g=d;this._views.push(g),g.attachToAppRef(this)}detachView(d){const g=d;a_(this._views,g),g.detachFromAppRef()}_loadComponent(d){this.attachView(d.hostView),this.tick(),this.components.push(d);const g=this._injector.get(hv,[]);g.push(...this._bootstrapListeners),g.forEach(E=>E(d))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(d=>d()),this._views.slice().forEach(d=>d.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(d){return this._destroyListeners.push(d),()=>a_(this._destroyListeners,d)}destroy(){if(this._destroyed)throw new ye(406,!1);const d=this._injector;d.destroy&&!d.destroyed&&d.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();function a_(t,o){const l=t.indexOf(o);l>-1&&t.splice(l,1)}const L1=new Gr("",{providedIn:"root",factory:()=>st(ad).handleError.bind(void 0)});function WE(){const t=st(ba),o=st(ad);return l=>t.runOutsideAngular(()=>o.handleError(l))}let qE=(()=>{var t;class o{constructor(){this.zone=st(ba),this.applicationRef=st(Df)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}}return(t=o).\u0275fac=function(d){return new(d||t)},t.\u0275prov=Ut({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();function JE(){}let KE=(()=>{class o{}return o.__NG_ELEMENT_ID__=XE,o})();function XE(t){return function QE(t,o,l){if(Rs(t)&&!l){const d=fo(t.index,o);return new fd(d,d)}return 47&t.type?new fd(o[Br],o):null}(Uo(),jn(),16==(16&t))}class z1{constructor(){}supports(o){return X(o)}create(o){return new oT(o)}}const rT=(t,o)=>o;class oT{constructor(o){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=o||rT}forEachItem(o){let l;for(l=this._itHead;null!==l;l=l._next)o(l)}forEachOperation(o){let l=this._itHead,d=this._removalsHead,g=0,E=null;for(;l||d;){const P=!d||l&&l.currentIndex{P=this._trackByFn(g,F),null!==l&&Object.is(l.trackById,P)?(d&&(l=this._verifyReinsertion(l,F,P,g)),Object.is(l.item,F)||this._addIdentityChange(l,F)):(l=this._mismatch(l,F,P,g),d=!0),l=l._next,g++}),this.length=g;return this._truncate(l),this.collection=o,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let o;for(o=this._previousItHead=this._itHead;null!==o;o=o._next)o._nextPrevious=o._next;for(o=this._additionsHead;null!==o;o=o._nextAdded)o.previousIndex=o.currentIndex;for(this._additionsHead=this._additionsTail=null,o=this._movesHead;null!==o;o=o._nextMoved)o.previousIndex=o.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(o,l,d,g){let E;return null===o?E=this._itTail:(E=o._prev,this._remove(o)),null!==(o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(d,null))?(Object.is(o.item,l)||this._addIdentityChange(o,l),this._reinsertAfter(o,E,g)):null!==(o=null===this._linkedRecords?null:this._linkedRecords.get(d,g))?(Object.is(o.item,l)||this._addIdentityChange(o,l),this._moveAfter(o,E,g)):o=this._addAfter(new sT(l,d),E,g),o}_verifyReinsertion(o,l,d,g){let E=null===this._unlinkedRecords?null:this._unlinkedRecords.get(d,null);return null!==E?o=this._reinsertAfter(E,o._prev,g):o.currentIndex!=g&&(o.currentIndex=g,this._addToMoves(o,g)),o}_truncate(o){for(;null!==o;){const l=o._next;this._addToRemovals(this._unlink(o)),o=l}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(o,l,d){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(o);const g=o._prevRemoved,E=o._nextRemoved;return null===g?this._removalsHead=E:g._nextRemoved=E,null===E?this._removalsTail=g:E._prevRemoved=g,this._insertAfter(o,l,d),this._addToMoves(o,d),o}_moveAfter(o,l,d){return this._unlink(o),this._insertAfter(o,l,d),this._addToMoves(o,d),o}_addAfter(o,l,d){return this._insertAfter(o,l,d),this._additionsTail=null===this._additionsTail?this._additionsHead=o:this._additionsTail._nextAdded=o,o}_insertAfter(o,l,d){const g=null===l?this._itHead:l._next;return o._next=g,o._prev=l,null===g?this._itTail=o:g._prev=o,null===l?this._itHead=o:l._next=o,null===this._linkedRecords&&(this._linkedRecords=new U1),this._linkedRecords.put(o),o.currentIndex=d,o}_remove(o){return this._addToRemovals(this._unlink(o))}_unlink(o){null!==this._linkedRecords&&this._linkedRecords.remove(o);const l=o._prev,d=o._next;return null===l?this._itHead=d:l._next=d,null===d?this._itTail=l:d._prev=l,o}_addToMoves(o,l){return o.previousIndex===l||(this._movesTail=null===this._movesTail?this._movesHead=o:this._movesTail._nextMoved=o),o}_addToRemovals(o){return null===this._unlinkedRecords&&(this._unlinkedRecords=new U1),this._unlinkedRecords.put(o),o.currentIndex=null,o._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=o,o._prevRemoved=null):(o._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=o),o}_addIdentityChange(o,l){return o.item=l,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=o:this._identityChangesTail._nextIdentityChange=o,o}}class sT{constructor(o,l){this.item=o,this.trackById=l,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class aT{constructor(){this._head=null,this._tail=null}add(o){null===this._head?(this._head=this._tail=o,o._nextDup=null,o._prevDup=null):(this._tail._nextDup=o,o._prevDup=this._tail,o._nextDup=null,this._tail=o)}get(o,l){let d;for(d=this._head;null!==d;d=d._nextDup)if((null===l||l<=d.currentIndex)&&Object.is(d.trackById,o))return d;return null}remove(o){const l=o._prevDup,d=o._nextDup;return null===l?this._head=d:l._nextDup=d,null===d?this._tail=l:d._prevDup=l,null===this._head}}class U1{constructor(){this.map=new Map}put(o){const l=o.trackById;let d=this.map.get(l);d||(d=new aT,this.map.set(l,d)),d.add(o)}get(o,l){const g=this.map.get(o);return g?g.get(o,l):null}remove(o){const l=o.trackById;return this.map.get(l).remove(o)&&this.map.delete(l),o}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Z1(t,o,l){const d=t.previousIndex;if(null===d)return d;let g=0;return l&&d{if(l&&l.key===g)this._maybeAddToChanges(l,d),this._appendAfter=l,l=l._next;else{const E=this._getOrCreateRecordForKey(g,d);l=this._insertBeforeOrAppend(l,E)}}),l){l._prev&&(l._prev._next=null),this._removalsHead=l;for(let d=l;null!==d;d=d._nextRemoved)d===this._mapHead&&(this._mapHead=null),this._records.delete(d.key),d._nextRemoved=d._next,d.previousValue=d.currentValue,d.currentValue=null,d._prev=null,d._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(o,l){if(o){const d=o._prev;return l._next=o,l._prev=d,o._prev=l,d&&(d._next=l),o===this._mapHead&&(this._mapHead=l),this._appendAfter=o,o}return this._appendAfter?(this._appendAfter._next=l,l._prev=this._appendAfter):this._mapHead=l,this._appendAfter=l,null}_getOrCreateRecordForKey(o,l){if(this._records.has(o)){const g=this._records.get(o);this._maybeAddToChanges(g,l);const E=g._prev,P=g._next;return E&&(E._next=P),P&&(P._prev=E),g._next=null,g._prev=null,g}const d=new cT(o);return this._records.set(o,d),d.currentValue=l,this._addToAdditions(d),d}_reset(){if(this.isDirty){let o;for(this._previousMapHead=this._mapHead,o=this._previousMapHead;null!==o;o=o._next)o._nextPrevious=o._next;for(o=this._changesHead;null!==o;o=o._nextChanged)o.previousValue=o.currentValue;for(o=this._additionsHead;null!=o;o=o._nextAdded)o.previousValue=o.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(o,l){Object.is(l,o.currentValue)||(o.previousValue=o.currentValue,o.currentValue=l,this._addToChanges(o))}_addToAdditions(o){null===this._additionsHead?this._additionsHead=this._additionsTail=o:(this._additionsTail._nextAdded=o,this._additionsTail=o)}_addToChanges(o){null===this._changesHead?this._changesHead=this._changesTail=o:(this._changesTail._nextChanged=o,this._changesTail=o)}_forEach(o,l){o instanceof Map?o.forEach(l):Object.keys(o).forEach(d=>l(o[d],d))}}class cT{constructor(o){this.key=o,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function V1(){return new yv([new z1])}let yv=(()=>{var t;class o{constructor(d){this.factories=d}static create(d,g){if(null!=g){const E=g.factories.slice();d=d.concat(E)}return new o(d)}static extend(d){return{provide:o,useFactory:g=>o.create(d,g||V1()),deps:[[o,new Qc,new Ii]]}}find(d){const g=this.factories.find(E=>E.supports(d));if(null!=g)return g;throw new ye(901,!1)}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:V1}),o})();function $1(){return new vv([new j1])}let vv=(()=>{var t;class o{constructor(d){this.factories=d}static create(d,g){if(g){const E=g.factories.slice();d=d.concat(E)}return new o(d)}static extend(d){return{provide:o,useFactory:g=>o.create(d,g||$1()),deps:[[o,new Qc,new Ii]]}}find(d){const g=this.factories.find(E=>E.supports(d));if(g)return g;throw new ye(901,!1)}}return(t=o).\u0275prov=Ut({token:t,providedIn:"root",factory:$1}),o})();const hT=I1(null,"core",[]);let fT=(()=>{var t;class o{constructor(d){}}return(t=o).\u0275fac=function(d){return new(d||t)(Ui(Df))},t.\u0275mod=Jr({type:t}),t.\u0275inj=gn({}),o})();function ET(t){return"boolean"==typeof t?t:null!=t&&"false"!==t}function DT(t,o){const l=zi(t),d=o.elementInjector||Sc();return new pd(l).create(d,o.projectableNodes,o.hostElement,o.environmentInjector)}function IT(t){const o=zi(t);if(!o)return null;const l=new pd(o);return{get selector(){return l.selector},get type(){return l.componentType},get inputs(){return l.inputs},get outputs(){return l.outputs},get ngContentSelectors(){return l.ngContentSelectors},get isStandalone(){return o.standalone},get isSignal(){return o.signals}}}},6223:(Nn,yt,k)=>{"use strict";k.d(yt,{Cf:()=>Ie,Fd:()=>Xo,Fj:()=>ae,JJ:()=>ii,JU:()=>C,On:()=>In,a5:()=>Ot,qQ:()=>Br,u5:()=>ki,wV:()=>Ai});var x=k(2029),h=k(6814),y=k(7715),s=k(9315),J=k(7398);let ie=(()=>{var v;class M{constructor(A,G){this._renderer=A,this._elementRef=G,this.onChange=It=>{},this.onTouched=()=>{}}setProperty(A,G){this._renderer.setProperty(this._elementRef.nativeElement,A,G)}registerOnTouched(A){this.onTouched=A}registerOnChange(A){this.onChange=A}setDisabledState(A){this.setProperty("disabled",A)}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(x.Qsj),x.Y36(x.SBq))},v.\u0275dir=x.lG2({type:v}),M})(),Y=(()=>{var v;class M extends ie{}return(v=M).\u0275fac=function(){let D;return function(G){return(D||(D=x.n5z(v)))(G||v)}}(),v.\u0275dir=x.lG2({type:v,features:[x.qOj]}),M})();const C=new x.OlP("NgValueAccessor"),he={provide:C,useExisting:(0,x.Gpc)(()=>ae),multi:!0},ee=new x.OlP("CompositionEventMode");let ae=(()=>{var v;class M extends ie{constructor(A,G,It){super(A,G),this._compositionMode=It,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function _e(){const v=(0,h.q)()?(0,h.q)().getUserAgent():"";return/android (\d+)/.test(v.toLowerCase())}())}writeValue(A){this.setProperty("value",A??"")}_handleInput(A){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(A)}_compositionStart(){this._composing=!0}_compositionEnd(A){this._composing=!1,this._compositionMode&&this.onChange(A)}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(x.Qsj),x.Y36(x.SBq),x.Y36(ee,8))},v.\u0275dir=x.lG2({type:v,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(A,G){1&A&&x.NdJ("input",function(Yn){return G._handleInput(Yn.target.value)})("blur",function(){return G.onTouched()})("compositionstart",function(){return G._compositionStart()})("compositionend",function(Yn){return G._compositionEnd(Yn.target.value)})},features:[x._Bn([he]),x.qOj]}),M})();function oe(v){return null==v||("string"==typeof v||Array.isArray(v))&&0===v.length}const Ie=new x.OlP("NgValidators"),Ee=new x.OlP("NgAsyncValidators");function Pe(v){return null}function Ae(v){return null!=v}function Ye(v){return(0,x.QGY)(v)?(0,y.D)(v):v}function _t(v){let M={};return v.forEach(D=>{M=null!=D?{...M,...D}:M}),0===Object.keys(M).length?null:M}function hn(v,M){return M.map(D=>D(v))}function Ht(v){return v.map(M=>function qt(v){return!v.validate}(M)?M:D=>M.validate(D))}function Je(v){return null!=v?function Te(v){if(!v)return null;const M=v.filter(Ae);return 0==M.length?null:function(D){return _t(hn(D,M))}}(Ht(v)):null}function Fe(v){return null!=v?function Re(v){if(!v)return null;const M=v.filter(Ae);return 0==M.length?null:function(D){const A=hn(D,M).map(Ye);return(0,s.D)(A).pipe((0,J.U)(_t))}}(Ht(v)):null}function St(v,M){return null===v?[M]:Array.isArray(v)?[...v,M]:[v,M]}function Qt(v){return v?Array.isArray(v)?v:[v]:[]}function Gt(v,M){return Array.isArray(v)?v.includes(M):v===M}function Zt(v,M){const D=Qt(M);return Qt(v).forEach(G=>{Gt(D,G)||D.push(G)}),D}function Jt(v,M){return Qt(M).filter(D=>!Gt(v,D))}class kt{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(M){this._rawValidators=M||[],this._composedValidatorFn=Je(this._rawValidators)}_setAsyncValidators(M){this._rawAsyncValidators=M||[],this._composedAsyncValidatorFn=Fe(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(M){this._onDestroyCallbacks.push(M)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(M=>M()),this._onDestroyCallbacks=[]}reset(M=void 0){this.control&&this.control.reset(M)}hasError(M,D){return!!this.control&&this.control.hasError(M,D)}getError(M,D){return this.control?this.control.getError(M,D):null}}class dt extends kt{get formDirective(){return null}get path(){return null}}class Ot extends kt{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class pt{constructor(M){this._cd=M}get isTouched(){return!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return!!this._cd?.submitted}}let ii=(()=>{var v;class M extends pt{constructor(A){super(A)}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(Ot,2))},v.\u0275dir=x.lG2({type:v,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(A,G){2&A&&x.ekj("ng-untouched",G.isUntouched)("ng-touched",G.isTouched)("ng-pristine",G.isPristine)("ng-dirty",G.isDirty)("ng-valid",G.isValid)("ng-invalid",G.isInvalid)("ng-pending",G.isPending)},features:[x.qOj]}),M})();const nt="VALID",ge="INVALID",ve="PENDING",Xe="DISABLED";function Et(v){return null!=v&&!Array.isArray(v)&&"object"==typeof v}class zn{constructor(M,D){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(M),this._assignAsyncValidators(D)}get validator(){return this._composedValidatorFn}set validator(M){this._rawValidators=this._composedValidatorFn=M}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(M){this._rawAsyncValidators=this._composedAsyncValidatorFn=M}get parent(){return this._parent}get valid(){return this.status===nt}get invalid(){return this.status===ge}get pending(){return this.status==ve}get disabled(){return this.status===Xe}get enabled(){return this.status!==Xe}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(M){this._assignValidators(M)}setAsyncValidators(M){this._assignAsyncValidators(M)}addValidators(M){this.setValidators(Zt(M,this._rawValidators))}addAsyncValidators(M){this.setAsyncValidators(Zt(M,this._rawAsyncValidators))}removeValidators(M){this.setValidators(Jt(M,this._rawValidators))}removeAsyncValidators(M){this.setAsyncValidators(Jt(M,this._rawAsyncValidators))}hasValidator(M){return Gt(this._rawValidators,M)}hasAsyncValidator(M){return Gt(this._rawAsyncValidators,M)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(M={}){this.touched=!0,this._parent&&!M.onlySelf&&this._parent.markAsTouched(M)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(M=>M.markAllAsTouched())}markAsUntouched(M={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(D=>{D.markAsUntouched({onlySelf:!0})}),this._parent&&!M.onlySelf&&this._parent._updateTouched(M)}markAsDirty(M={}){this.pristine=!1,this._parent&&!M.onlySelf&&this._parent.markAsDirty(M)}markAsPristine(M={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(D=>{D.markAsPristine({onlySelf:!0})}),this._parent&&!M.onlySelf&&this._parent._updatePristine(M)}markAsPending(M={}){this.status=ve,!1!==M.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!M.onlySelf&&this._parent.markAsPending(M)}disable(M={}){const D=this._parentMarkedDirty(M.onlySelf);this.status=Xe,this.errors=null,this._forEachChild(A=>{A.disable({...M,onlySelf:!0})}),this._updateValue(),!1!==M.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...M,skipPristineCheck:D}),this._onDisabledChange.forEach(A=>A(!0))}enable(M={}){const D=this._parentMarkedDirty(M.onlySelf);this.status=nt,this._forEachChild(A=>{A.enable({...M,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:M.emitEvent}),this._updateAncestors({...M,skipPristineCheck:D}),this._onDisabledChange.forEach(A=>A(!1))}_updateAncestors(M){this._parent&&!M.onlySelf&&(this._parent.updateValueAndValidity(M),M.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(M){this._parent=M}getRawValue(){return this.value}updateValueAndValidity(M={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===nt||this.status===ve)&&this._runAsyncValidator(M.emitEvent)),!1!==M.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!M.onlySelf&&this._parent.updateValueAndValidity(M)}_updateTreeValidity(M={emitEvent:!0}){this._forEachChild(D=>D._updateTreeValidity(M)),this.updateValueAndValidity({onlySelf:!0,emitEvent:M.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Xe:nt}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(M){if(this.asyncValidator){this.status=ve,this._hasOwnPendingAsyncValidator=!0;const D=Ye(this.asyncValidator(this));this._asyncValidationSubscription=D.subscribe(A=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(A,{emitEvent:M})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(M,D={}){this.errors=M,this._updateControlsErrors(!1!==D.emitEvent)}get(M){let D=M;return null==D||(Array.isArray(D)||(D=D.split(".")),0===D.length)?null:D.reduce((A,G)=>A&&A._find(G),this)}getError(M,D){const A=D?this.get(D):this;return A&&A.errors?A.errors[M]:null}hasError(M,D){return!!this.getError(M,D)}get root(){let M=this;for(;M._parent;)M=M._parent;return M}_updateControlsErrors(M){this.status=this._calculateStatus(),M&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(M)}_initObservables(){this.valueChanges=new x.vpe,this.statusChanges=new x.vpe}_calculateStatus(){return this._allControlsDisabled()?Xe:this.errors?ge:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ve)?ve:this._anyControlsHaveStatus(ge)?ge:nt}_anyControlsHaveStatus(M){return this._anyControls(D=>D.status===M)}_anyControlsDirty(){return this._anyControls(M=>M.dirty)}_anyControlsTouched(){return this._anyControls(M=>M.touched)}_updatePristine(M={}){this.pristine=!this._anyControlsDirty(),this._parent&&!M.onlySelf&&this._parent._updatePristine(M)}_updateTouched(M={}){this.touched=this._anyControlsTouched(),this._parent&&!M.onlySelf&&this._parent._updateTouched(M)}_registerOnCollectionChange(M){this._onCollectionChange=M}_setUpdateStrategy(M){Et(M)&&null!=M.updateOn&&(this._updateOn=M.updateOn)}_parentMarkedDirty(M){return!M&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(M){return null}_assignValidators(M){this._rawValidators=Array.isArray(M)?M.slice():M,this._composedValidatorFn=function Ct(v){return Array.isArray(v)?Je(v):v||null}(this._rawValidators)}_assignAsyncValidators(M){this._rawAsyncValidators=Array.isArray(M)?M.slice():M,this._composedAsyncValidatorFn=function jt(v){return Array.isArray(v)?Fe(v):v||null}(this._rawAsyncValidators)}}const Pt=new x.OlP("CallSetDisabledState",{providedIn:"root",factory:()=>bn}),bn="always";function Ci(v,M,D=bn){(function Lt(v,M){const D=function Ce(v){return v._rawValidators}(v);null!==M.validator?v.setValidators(St(D,M.validator)):"function"==typeof D&&v.setValidators([D]);const A=function Rt(v){return v._rawAsyncValidators}(v);null!==M.asyncValidator?v.setAsyncValidators(St(A,M.asyncValidator)):"function"==typeof A&&v.setAsyncValidators([A]);const G=()=>v.updateValueAndValidity();cr(M._rawValidators,G),cr(M._rawAsyncValidators,G)})(v,M),M.valueAccessor.writeValue(v.value),(v.disabled||"always"===D)&&M.valueAccessor.setDisabledState?.(v.disabled),function pn(v,M){M.valueAccessor.registerOnChange(D=>{v._pendingValue=D,v._pendingChange=!0,v._pendingDirty=!0,"change"===v.updateOn&&En(v,M)})}(v,M),function ti(v,M){const D=(A,G)=>{M.valueAccessor.writeValue(A),G&&M.viewToModelUpdate(A)};v.registerOnChange(D),M._registerOnDestroy(()=>{v._unregisterOnChange(D)})}(v,M),function mn(v,M){M.valueAccessor.registerOnTouched(()=>{v._pendingTouched=!0,"blur"===v.updateOn&&v._pendingChange&&En(v,M),"submit"!==v.updateOn&&v.markAsTouched()})}(v,M),function Ui(v,M){if(M.valueAccessor.setDisabledState){const D=A=>{M.valueAccessor.setDisabledState(A)};v.registerOnDisabledChange(D),M._registerOnDestroy(()=>{v._unregisterOnDisabledChange(D)})}}(v,M)}function cr(v,M){v.forEach(D=>{D.registerOnValidatorChange&&D.registerOnValidatorChange(M)})}function En(v,M){v._pendingDirty&&v.markAsDirty(),v.setValue(v._pendingValue,{emitModelToViewChange:!1}),M.viewToModelUpdate(v._pendingValue),v._pendingChange=!1}function Go(v,M){const D=v.indexOf(M);D>-1&&v.splice(D,1)}function Eo(v){return"object"==typeof v&&null!==v&&2===Object.keys(v).length&&"value"in v&&"disabled"in v}const to=class extends zn{constructor(M=null,D,A){super(function ft(v){return(Et(v)?v.validators:v)||null}(D),function Bt(v,M){return(Et(M)?M.asyncValidators:v)||null}(A,D)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(M),this._setUpdateStrategy(D),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Et(D)&&(D.nonNullable||D.initialValueIsDefault)&&(this.defaultValue=Eo(M)?M.value:M)}setValue(M,D={}){this.value=this._pendingValue=M,this._onChange.length&&!1!==D.emitModelToViewChange&&this._onChange.forEach(A=>A(this.value,!1!==D.emitViewToModelChange)),this.updateValueAndValidity(D)}patchValue(M,D={}){this.setValue(M,D)}reset(M=this.defaultValue,D={}){this._applyFormState(M),this.markAsPristine(D),this.markAsUntouched(D),this.setValue(this.value,D),this._pendingChange=!1}_updateValue(){}_anyControls(M){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(M){this._onChange.push(M)}_unregisterOnChange(M){Go(this._onChange,M)}registerOnDisabledChange(M){this._onDisabledChange.push(M)}_unregisterOnDisabledChange(M){Go(this._onDisabledChange,M)}_forEachChild(M){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(M){Eo(M)?(this.value=this._pendingValue=M.value,M.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=M}},vn={provide:Ot,useExisting:(0,x.Gpc)(()=>In)},Dn=(()=>Promise.resolve())();let In=(()=>{var v;class M extends Ot{constructor(A,G,It,Yn,pi,tr){super(),this._changeDetectorRef=pi,this.callSetDisabledState=tr,this.control=new to,this._registered=!1,this.name="",this.update=new x.vpe,this._parent=A,this._setValidators(G),this._setAsyncValidators(It),this.valueAccessor=function Kt(v,M){if(!M)return null;let D,A,G;return Array.isArray(M),M.forEach(It=>{It.constructor===ae?D=It:function qi(v){return Object.getPrototypeOf(v.constructor)===Y}(It)?A=It:G=It}),G||A||D||null}(0,Yn)}ngOnChanges(A){if(this._checkForErrors(),!this._registered||"name"in A){if(this._registered&&(this._checkName(),this.formDirective)){const G=A.name.previousValue;this.formDirective.removeControl({name:G,path:this._getPath(G)})}this._setUpControl()}"isDisabled"in A&&this._updateDisabled(A),function Ar(v,M){if(!v.hasOwnProperty("model"))return!1;const D=v.model;return!!D.isFirstChange()||!Object.is(M,D.currentValue)}(A,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(A){this.viewModel=A,this.update.emit(A)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Ci(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(A){Dn.then(()=>{this.control.setValue(A,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(A){const G=A.isDisabled.currentValue,It=0!==G&&(0,x.VuI)(G);Dn.then(()=>{It&&!this.control.disabled?this.control.disable():!It&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(A){return this._parent?function Kn(v,M){return[...M.path,v]}(A,this._parent):[A]}}return(v=M).\u0275fac=function(A){return new(A||v)(x.Y36(dt,9),x.Y36(Ie,10),x.Y36(Ee,10),x.Y36(C,10),x.Y36(x.sBO,8),x.Y36(Pt,8))},v.\u0275dir=x.lG2({type:v,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[x._Bn([vn]),x.qOj,x.TTD]}),M})();const di={provide:C,useExisting:(0,x.Gpc)(()=>Ai),multi:!0};let Ai=(()=>{var v;class M extends Y{writeValue(A){this.setProperty("value",A??"")}registerOnChange(A){this.onChange=G=>{A(""==G?null:parseFloat(G))}}}return(v=M).\u0275fac=function(){let D;return function(G){return(D||(D=x.n5z(v)))(G||v)}}(),v.\u0275dir=x.lG2({type:v,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(A,G){1&A&&x.NdJ("input",function(Yn){return G.onChange(Yn.target.value)})("blur",function(){return G.onTouched()})},features:[x._Bn([di]),x.qOj]}),M})(),go=(()=>{var v;class M{}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275mod=x.oAB({type:v}),v.\u0275inj=x.cJS({}),M})();function Oo(v){return"number"==typeof v?v:parseFloat(v)}let Ti=(()=>{var v;class M{constructor(){this._validator=Pe}ngOnChanges(A){if(this.inputName in A){const G=this.normalizeInput(A[this.inputName].currentValue);this._enabled=this.enabled(G),this._validator=this._enabled?this.createValidator(G):Pe,this._onChange&&this._onChange()}}validate(A){return this._validator(A)}registerOnValidatorChange(A){this._onChange=A}enabled(A){return null!=A}}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275dir=x.lG2({type:v,features:[x.TTD]}),M})();const Ns={provide:Ie,useExisting:(0,x.Gpc)(()=>Xo),multi:!0};let Xo=(()=>{var v;class M extends Ti{constructor(){super(...arguments),this.inputName="max",this.normalizeInput=A=>Oo(A),this.createValidator=A=>function ue(v){return M=>{if(oe(M.value)||oe(v))return null;const D=parseFloat(M.value);return!isNaN(D)&&D>v?{max:{max:v,actual:M.value}}:null}}(A)}}return(v=M).\u0275fac=function(){let D;return function(G){return(D||(D=x.n5z(v)))(G||v)}}(),v.\u0275dir=x.lG2({type:v,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(A,G){2&A&&x.uIk("max",G._enabled?G.max:null)},inputs:{max:"max"},features:[x._Bn([Ns]),x.qOj]}),M})();const os={provide:Ie,useExisting:(0,x.Gpc)(()=>Br),multi:!0};let Br=(()=>{var v;class M extends Ti{constructor(){super(...arguments),this.inputName="min",this.normalizeInput=A=>Oo(A),this.createValidator=A=>function le(v){return M=>{if(oe(M.value)||oe(v))return null;const D=parseFloat(M.value);return!isNaN(D)&&D{var v;class M{}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275mod=x.oAB({type:v}),v.\u0275inj=x.cJS({imports:[go]}),M})(),ki=(()=>{var v;class M{static withConfig(A){return{ngModule:M,providers:[{provide:Pt,useValue:A.callSetDisabledState??bn}]}}}return(v=M).\u0275fac=function(A){return new(A||v)},v.\u0275mod=x.oAB({type:v}),v.\u0275inj=x.cJS({imports:[Do]}),M})()},6593:(Nn,yt,k)=>{"use strict";k.d(yt,{Dx:()=>Jn,b2:()=>Yt,q6:()=>kt});var x=k(2029),h=k(6814);class y extends h.w_{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class s extends y{static makeCurrent(){(0,h.HT)(new s)}onAndCancel(ze,xe,be){return ze.addEventListener(xe,be),()=>{ze.removeEventListener(xe,be)}}dispatchEvent(ze,xe){ze.dispatchEvent(xe)}remove(ze){ze.parentNode&&ze.parentNode.removeChild(ze)}createElement(ze,xe){return(xe=xe||this.getDefaultDocument()).createElement(ze)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(ze){return ze.nodeType===Node.ELEMENT_NODE}isShadowRoot(ze){return ze instanceof DocumentFragment}getGlobalEventTarget(ze,xe){return"window"===xe?window:"document"===xe?ze:"body"===xe?ze.body:null}getBaseHref(ze){const xe=function ie(){return J=J||document.querySelector("base"),J?J.getAttribute("href"):null}();return null==xe?null:function C(pe){Y=Y||document.createElement("a"),Y.setAttribute("href",pe);const ze=Y.pathname;return"/"===ze.charAt(0)?ze:`/${ze}`}(xe)}resetBaseElement(){J=null}getUserAgent(){return window.navigator.userAgent}getCookie(ze){return(0,h.Mx)(document.cookie,ze)}}let Y,J=null,me=(()=>{var pe;class ze{build(){return new XMLHttpRequest}}return(pe=ze).\u0275fac=function(be){return new(be||pe)},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const he=new x.OlP("EventManagerPlugins");let _e=(()=>{var pe;class ze{constructor(be,Ze){this._zone=Ze,this._eventNameToPlugin=new Map,be.forEach(Pt=>{Pt.manager=this}),this._plugins=be.slice().reverse()}addEventListener(be,Ze,Pt){return this._findPluginFor(Ze).addEventListener(be,Ze,Pt)}getZone(){return this._zone}_findPluginFor(be){let Ze=this._eventNameToPlugin.get(be);if(Ze)return Ze;if(Ze=this._plugins.find(bn=>bn.supports(be)),!Ze)throw new x.vHH(5101,!1);return this._eventNameToPlugin.set(be,Ze),Ze}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(he),x.LFG(x.R0b))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();class ee{constructor(ze){this._doc=ze}}const ae="ng-app-id";let oe=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn={}){this.doc=be,this.appId=Ze,this.nonce=Pt,this.platformId=bn,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=(0,h.PM)(bn),this.resetHostNodes()}addStyles(be){for(const Ze of be)1===this.changeUsageCount(Ze,1)&&this.onStyleAdded(Ze)}removeStyles(be){for(const Ze of be)this.changeUsageCount(Ze,-1)<=0&&this.onStyleRemoved(Ze)}ngOnDestroy(){const be=this.styleNodesInDOM;be&&(be.forEach(Ze=>Ze.remove()),be.clear());for(const Ze of this.getAllStyles())this.onStyleRemoved(Ze);this.resetHostNodes()}addHost(be){this.hostNodes.add(be);for(const Ze of this.getAllStyles())this.addStyleToHost(be,Ze)}removeHost(be){this.hostNodes.delete(be)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(be){for(const Ze of this.hostNodes)this.addStyleToHost(Ze,be)}onStyleRemoved(be){const Ze=this.styleRef;Ze.get(be)?.elements?.forEach(Pt=>Pt.remove()),Ze.delete(be)}collectServerRenderedStyles(){const be=this.doc.head?.querySelectorAll(`style[${ae}="${this.appId}"]`);if(be?.length){const Ze=new Map;return be.forEach(Pt=>{null!=Pt.textContent&&Ze.set(Pt.textContent,Pt)}),Ze}return null}changeUsageCount(be,Ze){const Pt=this.styleRef;if(Pt.has(be)){const bn=Pt.get(be);return bn.usage+=Ze,bn.usage}return Pt.set(be,{usage:Ze,elements:[]}),Ze}getStyleElement(be,Ze){const Pt=this.styleNodesInDOM,bn=Pt?.get(Ze);if(bn?.parentNode===be)return Pt.delete(Ze),bn.removeAttribute(ae),bn;{const Kn=this.doc.createElement("style");return this.nonce&&Kn.setAttribute("nonce",this.nonce),Kn.textContent=Ze,this.platformIsServer&&Kn.setAttribute(ae,this.appId),Kn}}addStyleToHost(be,Ze){const Pt=this.getStyleElement(be,Ze);be.appendChild(Pt);const bn=this.styleRef,Kn=bn.get(Ze)?.elements;Kn?Kn.push(Pt):bn.set(Ze,{elements:[Pt],usage:1})}resetHostNodes(){const be=this.hostNodes;be.clear(),be.add(this.doc.head)}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0),x.LFG(x.AFp),x.LFG(x.Ojb,8),x.LFG(x.Lbi))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const Be={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},Ie=/%COMP%/g,ue=new x.OlP("RemoveStylesOnCompDestroy",{providedIn:"root",factory:()=>!1});function Le(pe,ze){return ze.map(xe=>xe.replace(Ie,pe))}let ye=(()=>{var pe;class ze{constructor(be,Ze,Pt,bn,Kn,Ci,wi,cr=null){this.eventManager=be,this.sharedStylesHost=Ze,this.appId=Pt,this.removeStylesOnCompDestroy=bn,this.doc=Kn,this.platformId=Ci,this.ngZone=wi,this.nonce=cr,this.rendererByCompId=new Map,this.platformIsServer=(0,h.PM)(Ci),this.defaultRenderer=new gt(be,Kn,wi,this.platformIsServer)}createRenderer(be,Ze){if(!be||!Ze)return this.defaultRenderer;this.platformIsServer&&Ze.encapsulation===x.ifc.ShadowDom&&(Ze={...Ze,encapsulation:x.ifc.Emulated});const Pt=this.getOrCreateRenderer(be,Ze);return Pt instanceof hn?Pt.applyToHost(be):Pt instanceof _t&&Pt.applyStyles(),Pt}getOrCreateRenderer(be,Ze){const Pt=this.rendererByCompId;let bn=Pt.get(Ze.id);if(!bn){const Kn=this.doc,Ci=this.ngZone,wi=this.eventManager,cr=this.sharedStylesHost,Ui=this.removeStylesOnCompDestroy,Lt=this.platformIsServer;switch(Ze.encapsulation){case x.ifc.Emulated:bn=new hn(wi,cr,Ze,this.appId,Ui,Kn,Ci,Lt);break;case x.ifc.ShadowDom:return new Ye(wi,cr,be,Ze,Kn,Ci,this.nonce,Lt);default:bn=new _t(wi,cr,Ze,Ui,Kn,Ci,Lt)}Pt.set(Ze.id,bn)}return bn}ngOnDestroy(){this.rendererByCompId.clear()}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(_e),x.LFG(oe),x.LFG(x.AFp),x.LFG(ue),x.LFG(h.K0),x.LFG(x.Lbi),x.LFG(x.R0b),x.LFG(x.Ojb))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();class gt{constructor(ze,xe,be,Ze){this.eventManager=ze,this.doc=xe,this.ngZone=be,this.platformIsServer=Ze,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(ze,xe){return xe?this.doc.createElementNS(Be[xe]||xe,ze):this.doc.createElement(ze)}createComment(ze){return this.doc.createComment(ze)}createText(ze){return this.doc.createTextNode(ze)}appendChild(ze,xe){(Ae(ze)?ze.content:ze).appendChild(xe)}insertBefore(ze,xe,be){ze&&(Ae(ze)?ze.content:ze).insertBefore(xe,be)}removeChild(ze,xe){ze&&ze.removeChild(xe)}selectRootElement(ze,xe){let be="string"==typeof ze?this.doc.querySelector(ze):ze;if(!be)throw new x.vHH(-5104,!1);return xe||(be.textContent=""),be}parentNode(ze){return ze.parentNode}nextSibling(ze){return ze.nextSibling}setAttribute(ze,xe,be,Ze){if(Ze){xe=Ze+":"+xe;const Pt=Be[Ze];Pt?ze.setAttributeNS(Pt,xe,be):ze.setAttribute(xe,be)}else ze.setAttribute(xe,be)}removeAttribute(ze,xe,be){if(be){const Ze=Be[be];Ze?ze.removeAttributeNS(Ze,xe):ze.removeAttribute(`${be}:${xe}`)}else ze.removeAttribute(xe)}addClass(ze,xe){ze.classList.add(xe)}removeClass(ze,xe){ze.classList.remove(xe)}setStyle(ze,xe,be,Ze){Ze&(x.JOm.DashCase|x.JOm.Important)?ze.style.setProperty(xe,be,Ze&x.JOm.Important?"important":""):ze.style[xe]=be}removeStyle(ze,xe,be){be&x.JOm.DashCase?ze.style.removeProperty(xe):ze.style[xe]=""}setProperty(ze,xe,be){ze[xe]=be}setValue(ze,xe){ze.nodeValue=xe}listen(ze,xe,be){if("string"==typeof ze&&!(ze=(0,h.q)().getGlobalEventTarget(this.doc,ze)))throw new Error(`Unsupported event target ${ze} for event ${xe}`);return this.eventManager.addEventListener(ze,xe,this.decoratePreventDefault(be))}decoratePreventDefault(ze){return xe=>{if("__ngUnwrap__"===xe)return ze;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>ze(xe)):ze(xe))&&xe.preventDefault()}}}function Ae(pe){return"TEMPLATE"===pe.tagName&&void 0!==pe.content}class Ye extends gt{constructor(ze,xe,be,Ze,Pt,bn,Kn,Ci){super(ze,Pt,bn,Ci),this.sharedStylesHost=xe,this.hostEl=be,this.shadowRoot=be.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const wi=Le(Ze.id,Ze.styles);for(const cr of wi){const Ui=document.createElement("style");Kn&&Ui.setAttribute("nonce",Kn),Ui.textContent=cr,this.shadowRoot.appendChild(Ui)}}nodeOrShadowRoot(ze){return ze===this.hostEl?this.shadowRoot:ze}appendChild(ze,xe){return super.appendChild(this.nodeOrShadowRoot(ze),xe)}insertBefore(ze,xe,be){return super.insertBefore(this.nodeOrShadowRoot(ze),xe,be)}removeChild(ze,xe){return super.removeChild(this.nodeOrShadowRoot(ze),xe)}parentNode(ze){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(ze)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class _t extends gt{constructor(ze,xe,be,Ze,Pt,bn,Kn,Ci){super(ze,Pt,bn,Kn),this.sharedStylesHost=xe,this.removeStylesOnCompDestroy=Ze,this.styles=Ci?Le(Ci,be.styles):be.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class hn extends _t{constructor(ze,xe,be,Ze,Pt,bn,Kn,Ci){const wi=Ze+"-"+be.id;super(ze,xe,be,Pt,bn,Kn,Ci,wi),this.contentAttr=function ct(pe){return"_ngcontent-%COMP%".replace(Ie,pe)}(wi),this.hostAttr=function ht(pe){return"_nghost-%COMP%".replace(Ie,pe)}(wi)}applyToHost(ze){this.applyStyles(),this.setAttribute(ze,this.hostAttr,"")}createElement(ze,xe){const be=super.createElement(ze,xe);return super.setAttribute(be,this.contentAttr,""),be}}let qt=(()=>{var pe;class ze extends ee{constructor(be){super(be)}supports(be){return!0}addEventListener(be,Ze,Pt){return be.addEventListener(Ze,Pt,!1),()=>this.removeEventListener(be,Ze,Pt)}removeEventListener(be,Ze,Pt){return be.removeEventListener(Ze,Pt)}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const Ht=["alt","control","meta","shift"],Te={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Je={alt:pe=>pe.altKey,control:pe=>pe.ctrlKey,meta:pe=>pe.metaKey,shift:pe=>pe.shiftKey};let Re=(()=>{var pe;class ze extends ee{constructor(be){super(be)}supports(be){return null!=ze.parseEventName(be)}addEventListener(be,Ze,Pt){const bn=ze.parseEventName(Ze),Kn=ze.eventCallback(bn.fullKey,Pt,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>(0,h.q)().onAndCancel(be,bn.domEventName,Kn))}static parseEventName(be){const Ze=be.toLowerCase().split("."),Pt=Ze.shift();if(0===Ze.length||"keydown"!==Pt&&"keyup"!==Pt)return null;const bn=ze._normalizeKey(Ze.pop());let Kn="",Ci=Ze.indexOf("code");if(Ci>-1&&(Ze.splice(Ci,1),Kn="code."),Ht.forEach(cr=>{const Ui=Ze.indexOf(cr);Ui>-1&&(Ze.splice(Ui,1),Kn+=cr+".")}),Kn+=bn,0!=Ze.length||0===bn.length)return null;const wi={};return wi.domEventName=Pt,wi.fullKey=Kn,wi}static matchEventFullKeyCode(be,Ze){let Pt=Te[be.key]||be.key,bn="";return Ze.indexOf("code.")>-1&&(Pt=be.code,bn="code."),!(null==Pt||!Pt)&&(Pt=Pt.toLowerCase()," "===Pt?Pt="space":"."===Pt&&(Pt="dot"),Ht.forEach(Kn=>{Kn!==Pt&&(0,Je[Kn])(be)&&(bn+=Kn+".")}),bn+=Pt,bn===Ze)}static eventCallback(be,Ze,Pt){return bn=>{ze.matchEventFullKeyCode(bn,be)&&Pt.runGuarded(()=>Ze(bn))}}static _normalizeKey(be){return"esc"===be?"escape":be}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0))},pe.\u0275prov=x.Yz7({token:pe,factory:pe.\u0275fac}),ze})();const kt=(0,x.eFA)(x._c5,"browser",[{provide:x.Lbi,useValue:h.bD},{provide:x.g9A,useValue:function Qt(){s.makeCurrent()},multi:!0},{provide:h.K0,useFactory:function Zt(){return(0,x.RDi)(document),document},deps:[]}]),dt=new x.OlP(""),Ot=[{provide:x.rWj,useClass:class Ne{addToWindow(ze){x.dqk.getAngularTestability=(be,Ze=!0)=>{const Pt=ze.findTestabilityInTree(be,Ze);if(null==Pt)throw new x.vHH(5103,!1);return Pt},x.dqk.getAllAngularTestabilities=()=>ze.getAllTestabilities(),x.dqk.getAllAngularRootElements=()=>ze.getAllRootElements(),x.dqk.frameworkStabilizers||(x.dqk.frameworkStabilizers=[]),x.dqk.frameworkStabilizers.push(be=>{const Ze=x.dqk.getAllAngularTestabilities();let Pt=Ze.length,bn=!1;const Kn=function(Ci){bn=bn||Ci,Pt--,0==Pt&&be(bn)};Ze.forEach(Ci=>{Ci.whenStable(Kn)})})}findTestabilityInTree(ze,xe,be){return null==xe?null:ze.getTestability(xe)??(be?(0,h.q)().isShadowRoot(xe)?this.findTestabilityInTree(ze,xe.host,!0):this.findTestabilityInTree(ze,xe.parentElement,!0):null)}},deps:[]},{provide:x.lri,useClass:x.dDg,deps:[x.R0b,x.eoX,x.rWj]},{provide:x.dDg,useClass:x.dDg,deps:[x.R0b,x.eoX,x.rWj]}],pt=[{provide:x.zSh,useValue:"root"},{provide:x.qLn,useFactory:function Gt(){return new x.qLn},deps:[]},{provide:he,useClass:qt,multi:!0,deps:[h.K0,x.R0b,x.Lbi]},{provide:he,useClass:Re,multi:!0,deps:[h.K0]},ye,oe,_e,{provide:x.FYo,useExisting:ye},{provide:h.JF,useClass:me,deps:[]},[]];let Yt=(()=>{var pe;class ze{constructor(be){}static withServerTransition(be){return{ngModule:ze,providers:[{provide:x.AFp,useValue:be.appId}]}}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(dt,12))},pe.\u0275mod=x.oAB({type:pe}),pe.\u0275inj=x.cJS({providers:[...pt,...Ot],imports:[h.ez,x.hGG]}),ze})(),Jn=(()=>{var pe;class ze{constructor(be){this._doc=be}getTitle(){return this._doc.title}setTitle(be){this._doc.title=be||""}}return(pe=ze).\u0275fac=function(be){return new(be||pe)(x.LFG(h.K0))},pe.\u0275prov=x.Yz7({token:pe,factory:function(be){let Ze=null;return Ze=be?new be:function Ft(){return new Jn((0,x.LFG)(h.K0))}(),Ze},providedIn:"root"}),ze})();typeof window<"u"&&window},6800:(Nn,yt,k)=>{"use strict";k.d(yt,{gz:()=>Po,y6:()=>To,OD:()=>Si,eC:()=>Ot,wN:()=>ho,F0:()=>es,rH:()=>Za,Bz:()=>Cd,Hx:()=>ve});var x=k(2029),h=k(2664),y=k(7715),s=k(2096),J=k(5619),ie=k(2572);const C=(0,k(2306).d)(R=>function(){R(this),this.name="EmptyError",this.message="no elements in sequence"});var Ne=k(5211),me=k(4911),he=k(8407),_e=k(5592),ee=k(4674);function ae(R,U){const $=(0,ee.m)(R)?R:()=>R,z=K=>K.error($());return new _e.y(U?K=>U.schedule(z,0,K):z)}var oe=k(6232),Be=k(7394),Ie=k(9360),Ee=k(8251);function Ue(){return(0,Ie.e)((R,U)=>{let $=null;R._refCount++;const z=(0,Ee.x)(U,void 0,void 0,void 0,()=>{if(!R||R._refCount<=0||0<--R._refCount)return void($=null);const K=R._connection,Me=$;$=null,K&&(!Me||K===Me)&&K.unsubscribe(),U.unsubscribe()});R.subscribe(z),z.closed||($=R.connect())})}class et extends _e.y{constructor(U,$){super(),this.source=U,this.subjectFactory=$,this._subject=null,this._refCount=0,this._connection=null,(0,Ie.A)(U)&&(this.lift=U.lift)}_subscribe(U){return this.getSubject().subscribe(U)}getSubject(){const U=this._subject;return(!U||U.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:U}=this;this._subject=this._connection=null,U?.unsubscribe()}connect(){let U=this._connection;if(!U){U=this._connection=new Be.w0;const $=this.getSubject();U.add(this.source.subscribe((0,Ee.x)($,void 0,()=>{this._teardown(),$.complete()},z=>{this._teardown(),$.error(z)},()=>this._teardown()))),U.closed&&(this._connection=null,U=Be.w0.EMPTY)}return U}refCount(){return Ue()(this)}}var le=k(8645),ue=k(6814),ct=k(7398),ht=k(4664),Le=k(8180),ye=k(4564),De=k(2181),Pe=k(1631);function Ae(R){return(0,Ie.e)((U,$)=>{let z=!1;U.subscribe((0,Ee.x)($,K=>{z=!0,$.next(K)},()=>{z||$.next(R),$.complete()}))})}function Ye(R=_t){return(0,Ie.e)((U,$)=>{let z=!1;U.subscribe((0,Ee.x)($,K=>{z=!0,$.next(K)},()=>z?$.complete():$.error(R())))})}function _t(){return new C}var hn=k(2737);function qt(R,U){const $=arguments.length>=2;return z=>z.pipe(R?(0,De.h)((K,Me)=>R(K,Me,z)):hn.y,(0,Le.q)(1),$?Ae(U):Ye(()=>new C))}var Ht=k(6328);function Te(R,U,$){const z=(0,ee.m)(R)||U||$?{next:R,error:U,complete:$}:R;return z?(0,Ie.e)((K,Me)=>{var Ge;null===(Ge=z.subscribe)||void 0===Ge||Ge.call(z);let en=!0;K.subscribe((0,Ee.x)(Me,$n=>{var xn;null===(xn=z.next)||void 0===xn||xn.call(z,$n),Me.next($n)},()=>{var $n;en=!1,null===($n=z.complete)||void 0===$n||$n.call(z),Me.complete()},$n=>{var xn;en=!1,null===(xn=z.error)||void 0===xn||xn.call(z,$n),Me.error($n)},()=>{var $n,xn;en&&(null===($n=z.unsubscribe)||void 0===$n||$n.call(z)),null===(xn=z.finalize)||void 0===xn||xn.call(z)}))}):hn.y}var Je=k(4829);function Re(R){return(0,Ie.e)((U,$)=>{let Me,z=null,K=!1;z=U.subscribe((0,Ee.x)($,void 0,void 0,Ge=>{Me=(0,Je.Xf)(R(Ge,Re(R)(U))),z?(z.unsubscribe(),z=null,Me.subscribe($)):K=!0})),K&&(z.unsubscribe(),z=null,Me.subscribe($))})}function Ce(R){return R<=0?()=>oe.E:(0,Ie.e)((U,$)=>{let z=[];U.subscribe((0,Ee.x)($,K=>{z.push(K),R{for(const K of z)$.next(K);$.complete()},void 0,()=>{z=null}))})}var Gt=k(4716),Zt=k(2420),kt=k(7537),dt=k(6593);const Ot="primary",pt=Symbol("RouteTitle");class Yt{constructor(U){this.params=U||{}}has(U){return Object.prototype.hasOwnProperty.call(this.params,U)}get(U){if(this.has(U)){const $=this.params[U];return Array.isArray($)?$[0]:$}return null}getAll(U){if(this.has(U)){const $=this.params[U];return Array.isArray($)?$:[$]}return[]}get keys(){return Object.keys(this.params)}}function Ut(R){return new Yt(R)}function ii(R,U,$){const z=$.path.split("/");if(z.length>R.length||"full"===$.pathMatch&&(U.hasChildren()||z.lengthz[Me]===K)}return R===U}function Wt(R){return R.length>0?R[R.length-1]:null}function wt(R){return(0,h.b)(R)?R:(0,x.QGY)(R)?(0,y.D)(Promise.resolve(R)):(0,s.of)(R)}const vt={exact:function lr(R,U,$){if(!nt(R.segments,U.segments)||!Mn(R.segments,U.segments,$)||R.numberOfChildren!==U.numberOfChildren)return!1;for(const z in U.children)if(!R.children[z]||!lr(R.children[z],U.children[z],$))return!1;return!0},subset:Fi},ln={exact:function er(R,U){return Ft(R,U)},subset:function mi(R,U){return Object.keys(U).length<=Object.keys(R).length&&Object.keys(U).every($=>Jn(R[$],U[$]))},ignored:()=>!0};function ni(R,U,$){return vt[$.paths](R.root,U.root,$.matrixParams)&&ln[$.queryParams](R.queryParams,U.queryParams)&&!("exact"===$.fragment&&R.fragment!==U.fragment)}function Fi(R,U,$){return Cn(R,U,U.segments,$)}function Cn(R,U,$,z){if(R.segments.length>$.length){const K=R.segments.slice(0,$.length);return!(!nt(K,$)||U.hasChildren()||!Mn(K,$,z))}if(R.segments.length===$.length){if(!nt(R.segments,$)||!Mn(R.segments,$,z))return!1;for(const K in U.children)if(!R.children[K]||!Fi(R.children[K],U.children[K],z))return!1;return!0}{const K=$.slice(0,R.segments.length),Me=$.slice(R.segments.length);return!!(nt(R.segments,K)&&Mn(R.segments,K,z)&&R.children[Ot])&&Cn(R.children[Ot],U,Me,z)}}function Mn(R,U,$){return U.every((z,K)=>ln[$](R[K].parameters,z.parameters))}class qn{constructor(U=new yn([],{}),$={},z=null){this.root=U,this.queryParams=$,this.fragment=z}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Ut(this.queryParams)),this._queryParamMap}toString(){return ft.serialize(this)}}class yn{constructor(U,$){this.segments=U,this.children=$,this.parent=null,Object.values($).forEach(z=>z.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Ct(this)}}class _n{constructor(U,$){this.path=U,this.parameters=$}get parameterMap(){return this._parameterMap||(this._parameterMap=Ut(this.parameters)),this._parameterMap}toString(){return ze(this)}}function nt(R,U){return R.length===U.length&&R.every(($,z)=>$.path===U[z].path)}let ve=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return new Xe},providedIn:"root"}),U})();class Xe{parse(U){const $=new Lt(U);return new qn($.parseRootSegment(),$.parseQueryParams(),$.parseFragment())}serialize(U){const $=`/${Bt(U.root,!0)}`,z=function be(R){const U=Object.keys(R).map($=>{const z=R[$];return Array.isArray(z)?z.map(K=>`${Et($)}=${Et(K)}`).join("&"):`${Et($)}=${Et(z)}`}).filter($=>!!$);return U.length?`?${U.join("&")}`:""}(U.queryParams);return`${$}${z}${"string"==typeof U.fragment?`#${function Xt(R){return encodeURI(R)}(U.fragment)}`:""}`}}const ft=new Xe;function Ct(R){return R.segments.map(U=>ze(U)).join("/")}function Bt(R,U){if(!R.hasChildren())return Ct(R);if(U){const $=R.children[Ot]?Bt(R.children[Ot],!1):"",z=[];return Object.entries(R.children).forEach(([K,Me])=>{K!==Ot&&z.push(`${K}:${Bt(Me,!1)}`)}),z.length>0?`${$}(${z.join("//")})`:$}{const $=function ge(R,U){let $=[];return Object.entries(R.children).forEach(([z,K])=>{z===Ot&&($=$.concat(U(K,z)))}),Object.entries(R.children).forEach(([z,K])=>{z!==Ot&&($=$.concat(U(K,z)))}),$}(R,(z,K)=>K===Ot?[Bt(R.children[Ot],!1)]:[`${K}:${Bt(z,!1)}`]);return 1===Object.keys(R.children).length&&null!=R.children[Ot]?`${Ct(R)}/${$[0]}`:`${Ct(R)}/(${$.join("//")})`}}function jt(R){return encodeURIComponent(R).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Et(R){return jt(R).replace(/%3B/gi,";")}function Sn(R){return jt(R).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function zn(R){return decodeURIComponent(R)}function pe(R){return zn(R.replace(/\+/g,"%20"))}function ze(R){return`${Sn(R.path)}${function xe(R){return Object.keys(R).map(U=>`;${Sn(U)}=${Sn(R[U])}`).join("")}(R.parameters)}`}const Ze=/^[^\/()?;#]+/;function Pt(R){const U=R.match(Ze);return U?U[0]:""}const bn=/^[^\/()?;=#]+/,Ci=/^[^=?&#]+/,cr=/^[^&#]+/;class Lt{constructor(U){this.url=U,this.remaining=U}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new yn([],{}):new yn([],this.parseChildren())}parseQueryParams(){const U={};if(this.consumeOptional("?"))do{this.parseQueryParam(U)}while(this.consumeOptional("&"));return U}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const U=[];for(this.peekStartsWith("(")||U.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),U.push(this.parseSegment());let $={};this.peekStartsWith("/(")&&(this.capture("/"),$=this.parseParens(!0));let z={};return this.peekStartsWith("(")&&(z=this.parseParens(!1)),(U.length>0||Object.keys($).length>0)&&(z[Ot]=new yn(U,$)),z}parseSegment(){const U=Pt(this.remaining);if(""===U&&this.peekStartsWith(";"))throw new x.vHH(4009,!1);return this.capture(U),new _n(zn(U),this.parseMatrixParams())}parseMatrixParams(){const U={};for(;this.consumeOptional(";");)this.parseParam(U);return U}parseParam(U){const $=function Kn(R){const U=R.match(bn);return U?U[0]:""}(this.remaining);if(!$)return;this.capture($);let z="";if(this.consumeOptional("=")){const K=Pt(this.remaining);K&&(z=K,this.capture(z))}U[zn($)]=zn(z)}parseQueryParam(U){const $=function wi(R){const U=R.match(Ci);return U?U[0]:""}(this.remaining);if(!$)return;this.capture($);let z="";if(this.consumeOptional("=")){const Ge=function Ui(R){const U=R.match(cr);return U?U[0]:""}(this.remaining);Ge&&(z=Ge,this.capture(z))}const K=pe($),Me=pe(z);if(U.hasOwnProperty(K)){let Ge=U[K];Array.isArray(Ge)||(Ge=[Ge],U[K]=Ge),Ge.push(Me)}else U[K]=Me}parseParens(U){const $={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const z=Pt(this.remaining),K=this.remaining[z.length];if("/"!==K&&")"!==K&&";"!==K)throw new x.vHH(4010,!1);let Me;z.indexOf(":")>-1?(Me=z.slice(0,z.indexOf(":")),this.capture(Me),this.capture(":")):U&&(Me=Ot);const Ge=this.parseChildren();$[Me]=1===Object.keys(Ge).length?Ge[Ot]:new yn([],Ge),this.consumeOptional("//")}return $}peekStartsWith(U){return this.remaining.startsWith(U)}consumeOptional(U){return!!this.peekStartsWith(U)&&(this.remaining=this.remaining.substring(U.length),!0)}capture(U){if(!this.consumeOptional(U))throw new x.vHH(4011,!1)}}function st(R){return R.segments.length>0?new yn([],{[Ot]:R}):R}function pn(R){const U={};for(const z of Object.keys(R.children)){const Me=pn(R.children[z]);if(z===Ot&&0===Me.segments.length&&Me.hasChildren())for(const[Ge,en]of Object.entries(Me.children))U[Ge]=en;else(Me.segments.length>0||Me.hasChildren())&&(U[z]=Me)}return function mn(R){if(1===R.numberOfChildren&&R.children[Ot]){const U=R.children[Ot];return new yn(R.segments.concat(U.segments),U.children)}return R}(new yn(R.segments,U))}function En(R){return R instanceof qn}function gi(R){let U;const K=st(function $(Me){const Ge={};for(const $n of Me.children){const xn=$($n);Ge[$n.outlet]=xn}const en=new yn(Me.url,Ge);return Me===R&&(U=en),en}(R.root));return U??K}function _i(R,U,$,z){let K=R;for(;K.parent;)K=K.parent;if(0===U.length)return ir(K,K,K,$,z);const Me=function Ar(R){if("string"==typeof R[0]&&1===R.length&&"/"===R[0])return new vi(!0,0,R);let U=0,$=!1;const z=R.reduce((K,Me,Ge)=>{if("object"==typeof Me&&null!=Me){if(Me.outlets){const en={};return Object.entries(Me.outlets).forEach(([$n,xn])=>{en[$n]="string"==typeof xn?xn.split("/"):xn}),[...K,{outlets:en}]}if(Me.segmentPath)return[...K,Me.segmentPath]}return"string"!=typeof Me?[...K,Me]:0===Ge?(Me.split("/").forEach((en,$n)=>{0==$n&&"."===en||(0==$n&&""===en?$=!0:".."===en?U++:""!=en&&K.push(en))}),K):[...K,Me]},[]);return new vi($,U,z)}(U);if(Me.toRoot())return ir(K,K,new yn([],{}),$,z);const Ge=function Bi(R,U,$){if(R.isAbsolute)return new qi(U,!0,0);if(!$)return new qi(U,!1,NaN);if(null===$.parent)return new qi($,!0,0);const z=Li(R.commands[0])?0:1;return function Kt(R,U,$){let z=R,K=U,Me=$;for(;Me>K;){if(Me-=K,z=z.parent,!z)throw new x.vHH(4005,!1);K=z.segments.length}return new qi(z,!1,K-Me)}($,$.segments.length-1+z,R.numberOfDoubleDots)}(Me,K,R),en=Ge.processChildren?yr(Ge.segmentGroup,Ge.index,Me.commands):rr(Ge.segmentGroup,Ge.index,Me.commands);return ir(K,Ge.segmentGroup,en,$,z)}function Li(R){return"object"==typeof R&&null!=R&&!R.outlets&&!R.segmentPath}function bi(R){return"object"==typeof R&&null!=R&&R.outlets}function ir(R,U,$,z,K){let Ge,Me={};z&&Object.entries(z).forEach(([$n,xn])=>{Me[$n]=Array.isArray(xn)?xn.map(Oi=>`${Oi}`):`${xn}`}),Ge=R===U?$:Dr(R,U,$);const en=st(pn(Ge));return new qn(en,Me,K)}function Dr(R,U,$){const z={};return Object.entries(R.children).forEach(([K,Me])=>{z[K]=Me===U?$:Dr(Me,U,$)}),new yn(R.segments,z)}class vi{constructor(U,$,z){if(this.isAbsolute=U,this.numberOfDoubleDots=$,this.commands=z,U&&z.length>0&&Li(z[0]))throw new x.vHH(4003,!1);const K=z.find(bi);if(K&&K!==Wt(z))throw new x.vHH(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class qi{constructor(U,$,z){this.segmentGroup=U,this.processChildren=$,this.index=z}}function rr(R,U,$){if(R||(R=new yn([],{})),0===R.segments.length&&R.hasChildren())return yr(R,U,$);const z=function xr(R,U,$){let z=0,K=U;const Me={match:!1,pathIndex:0,commandIndex:0};for(;K=$.length)return Me;const Ge=R.segments[K],en=$[z];if(bi(en))break;const $n=`${en}`,xn=z<$.length-1?$[z+1]:null;if(K>0&&void 0===$n)break;if($n&&xn&&"object"==typeof xn&&void 0===xn.outlets){if(!to($n,xn,Ge))return Me;z+=2}else{if(!to($n,{},Ge))return Me;z++}K++}return{match:!0,pathIndex:K,commandIndex:z}}(R,U,$),K=$.slice(z.commandIndex);if(z.match&&z.pathIndexMe!==Ot)&&R.children[Ot]&&1===R.numberOfChildren&&0===R.children[Ot].segments.length){const Me=yr(R.children[Ot],U,$);return new yn(R.segments,Me.children)}return Object.entries(z).forEach(([Me,Ge])=>{"string"==typeof Ge&&(Ge=[Ge]),null!==Ge&&(K[Me]=rr(R.children[Me],U,Ge))}),Object.entries(R.children).forEach(([Me,Ge])=>{void 0===z[Me]&&(K[Me]=Ge)}),new yn(R.segments,K)}}function Sr(R,U,$){const z=R.segments.slice(0,U);let K=0;for(;K<$.length;){const Me=$[K];if(bi(Me)){const $n=Go(Me.outlets);return new yn(z,$n)}if(0===K&&Li($[0])){z.push(new _n(R.segments[U].path,Eo($[0]))),K++;continue}const Ge=bi(Me)?Me.outlets[Ot]:`${Me}`,en=K<$.length-1?$[K+1]:null;Ge&&en&&Li(en)?(z.push(new _n(Ge,Eo(en))),K+=2):(z.push(new _n(Ge,{})),K++)}return new yn(z,{})}function Go(R){const U={};return Object.entries(R).forEach(([$,z])=>{"string"==typeof z&&(z=[z]),null!==z&&(U[$]=Sr(new yn([],{}),0,z))}),U}function Eo(R){const U={};return Object.entries(R).forEach(([$,z])=>U[$]=`${z}`),U}function to(R,U,$){return R==$.path&&Ft(U,$.parameters)}const Xn="imperative";class Ei{constructor(U,$){this.id=U,this.url=$}}class Si extends Ei{constructor(U,$,z="imperative",K=null){super(U,$),this.type=0,this.navigationTrigger=z,this.restoredState=K}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class we extends Ei{constructor(U,$,z){super(U,$),this.urlAfterRedirects=z,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class fe extends Ei{constructor(U,$,z,K){super(U,$),this.reason=z,this.code=K,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class je extends Ei{constructor(U,$,z,K){super(U,$),this.reason=z,this.code=K,this.type=16}}class lt extends Ei{constructor(U,$,z,K){super(U,$),this.error=z,this.target=K,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class an extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Vt extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class vn extends Ei{constructor(U,$,z,K,Me){super(U,$),this.urlAfterRedirects=z,this.state=K,this.shouldActivate=Me,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Dn extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class In extends Ei{constructor(U,$,z,K){super(U,$),this.urlAfterRedirects=z,this.state=K,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Fn{constructor(U){this.route=U,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class di{constructor(U){this.route=U,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Ai{constructor(U){this.snapshot=U,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ni{constructor(U){this.snapshot=U,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class vr{constructor(U){this.snapshot=U,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class go{constructor(U){this.snapshot=U,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Nr{constructor(U,$,z){this.routerEvent=U,this.position=$,this.anchor=z,this.type=15}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class co{}class uo{constructor(U){this.url=U}}class kr{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new To,this.attachRef=null}}let To=(()=>{var R;class U{constructor(){this.contexts=new Map}onChildOutletCreated(z,K){const Me=this.getOrCreateContext(z);Me.outlet=K,this.contexts.set(z,Me)}onChildOutletDestroyed(z){const K=this.getContext(z);K&&(K.outlet=null,K.attachRef=null)}onOutletDeactivated(){const z=this.contexts;return this.contexts=new Map,z}onOutletReAttached(z){this.contexts=z}getOrCreateContext(z){let K=this.getContext(z);return K||(K=new kr,this.contexts.set(z,K)),K}getContext(z){return this.contexts.get(z)||null}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();class ds{constructor(U){this._root=U}get root(){return this._root.value}parent(U){const $=this.pathFromRoot(U);return $.length>1?$[$.length-2]:null}children(U){const $=xo(U,this._root);return $?$.children.map(z=>z.value):[]}firstChild(U){const $=xo(U,this._root);return $&&$.children.length>0?$.children[0].value:null}siblings(U){const $=zi(U,this._root);return $.length<2?[]:$[$.length-2].children.map(K=>K.value).filter(K=>K!==U)}pathFromRoot(U){return zi(U,this._root).map($=>$.value)}}function xo(R,U){if(R===U.value)return U;for(const $ of U.children){const z=xo(R,$);if(z)return z}return null}function zi(R,U){if(R===U.value)return[U];for(const $ of U.children){const z=zi(R,$);if(z.length)return z.unshift(U),z}return[]}class Fr{constructor(U,$){this.value=U,this.children=$}toString(){return`TreeNode(${this.value})`}}function Or(R){const U={};return R&&R.children.forEach($=>U[$.value.outlet]=$),U}class Er extends ds{constructor(U,$){super(U),this.snapshot=$,li(this,U)}toString(){return this.snapshot.toString()}}function so(R,U){const $=function Gs(R,U){const Ge=new bs([],{},{},"",{},Ot,U,null,{});return new gr("",new Fr(Ge,[]))}(0,U),z=new J.X([new _n("",{})]),K=new J.X({}),Me=new J.X({}),Ge=new J.X({}),en=new J.X(""),$n=new Po(z,K,Ge,en,Me,Ot,U,$.root);return $n.snapshot=$.root,new Er(new Fr($n,[]),$)}class Po{constructor(U,$,z,K,Me,Ge,en,$n){this.urlSubject=U,this.paramsSubject=$,this.queryParamsSubject=z,this.fragmentSubject=K,this.dataSubject=Me,this.outlet=Ge,this.component=en,this._futureSnapshot=$n,this.title=this.dataSubject?.pipe((0,ct.U)(xn=>xn[pt]))??(0,s.of)(void 0),this.url=U,this.params=$,this.queryParams=z,this.fragment=K,this.data=Me}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe((0,ct.U)(U=>Ut(U)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe((0,ct.U)(U=>Ut(U)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Hr(R,U="emptyOnly"){const $=R.pathFromRoot;let z=0;if("always"!==U)for(z=$.length-1;z>=1;){const K=$[z],Me=$[z-1];if(K.routeConfig&&""===K.routeConfig.path)z--;else{if(Me.component)break;z--}}return function wa(R){return R.reduce((U,$)=>({params:{...U.params,...$.params},data:{...U.data,...$.data},resolve:{...$.data,...U.resolve,...$.routeConfig?.data,...$._resolvedData}}),{params:{},data:{},resolve:{}})}($.slice(z))}class bs{get title(){return this.data?.[pt]}constructor(U,$,z,K,Me,Ge,en,$n,xn){this.url=U,this.params=$,this.queryParams=z,this.fragment=K,this.data=Me,this.outlet=Ge,this.component=en,this.routeConfig=$n,this._resolve=xn}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Ut(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Ut(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(z=>z.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class gr extends ds{constructor(U,$){super($),this.url=U,li(this,$)}toString(){return Zi(this._root)}}function li(R,U){U.value._routerState=R,U.children.forEach($=>li(R,$))}function Zi(R){const U=R.children.length>0?` { ${R.children.map(Zi).join(", ")} } `:"";return`${R.value}${U}`}function Rr(R){if(R.snapshot){const U=R.snapshot,$=R._futureSnapshot;R.snapshot=$,Ft(U.queryParams,$.queryParams)||R.queryParamsSubject.next($.queryParams),U.fragment!==$.fragment&&R.fragmentSubject.next($.fragment),Ft(U.params,$.params)||R.paramsSubject.next($.params),function gn(R,U){if(R.length!==U.length)return!1;for(let $=0;$Ft($.parameters,U[z].parameters))}(R.url,U.url);return $&&!(!R.parent!=!U.parent)&&(!R.parent||_o(R.parent,U.parent))}let rs=(()=>{var R;class U{constructor(){this.activated=null,this._activatedRoute=null,this.name=Ot,this.activateEvents=new x.vpe,this.deactivateEvents=new x.vpe,this.attachEvents=new x.vpe,this.detachEvents=new x.vpe,this.parentContexts=(0,x.f3M)(To),this.location=(0,x.f3M)(x.s_b),this.changeDetector=(0,x.f3M)(x.sBO),this.environmentInjector=(0,x.f3M)(x.lqb),this.inputBinder=(0,x.f3M)(ko,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(z){if(z.name){const{firstChange:K,previousValue:Me}=z.name;if(K)return;this.isTrackedInParentContexts(Me)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(Me)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(z){return this.parentContexts.getContext(z)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const z=this.parentContexts.getContext(this.name);z?.route&&(z.attachRef?this.attach(z.attachRef,z.route):this.activateWith(z.route,z.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new x.vHH(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new x.vHH(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new x.vHH(4012,!1);this.location.detach();const z=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(z.instance),z}attach(z,K){this.activated=z,this._activatedRoute=K,this.location.insert(z.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(z.instance)}deactivate(){if(this.activated){const z=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(z)}}activateWith(z,K){if(this.isActivated)throw new x.vHH(4013,!1);this._activatedRoute=z;const Me=this.location,en=z.snapshot.component,$n=this.parentContexts.getOrCreateContext(this.name).children,xn=new zr(z,$n,Me.injector);this.activated=Me.createComponent(en,{index:Me.length,injector:xn,environmentInjector:K??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275dir=x.lG2({type:R,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[x.TTD]}),U})();class zr{constructor(U,$,z){this.route=U,this.childContexts=$,this.parent=z}get(U,$){return U===Po?this.route:U===To?this.childContexts:this.parent.get(U,$)}}const ko=new x.OlP("");let br=(()=>{var R;class U{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(z){this.unsubscribeFromRouteData(z),this.subscribeToRouteData(z)}unsubscribeFromRouteData(z){this.outletDataSubscriptions.get(z)?.unsubscribe(),this.outletDataSubscriptions.delete(z)}subscribeToRouteData(z){const{activatedRoute:K}=z,Me=(0,ie.a)([K.queryParams,K.params,K.data]).pipe((0,ht.w)(([Ge,en,$n],xn)=>($n={...Ge,...en,...$n},0===xn?(0,s.of)($n):Promise.resolve($n)))).subscribe(Ge=>{if(!z.isActivated||!z.activatedComponentRef||z.activatedRoute!==K||null===K.component)return void this.unsubscribeFromRouteData(z);const en=(0,x.qFp)(K.component);if(en)for(const{templateName:$n}of en.inputs)z.activatedComponentRef.setInput($n,Ge[$n]);else this.unsubscribeFromRouteData(z)});this.outletDataSubscriptions.set(z,Me)}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac}),U})();function Oo(R,U,$){if($&&R.shouldReuseRoute(U.value,$.value.snapshot)){const z=$.value;z._futureSnapshot=U.value;const K=function Ti(R,U,$){return U.children.map(z=>{for(const K of $.children)if(R.shouldReuseRoute(z.value,K.value.snapshot))return Oo(R,z,K);return Oo(R,z)})}(R,U,$);return new Fr(z,K)}{if(R.shouldAttach(U.value)){const Me=R.retrieve(U.value);if(null!==Me){const Ge=Me.route;return Ge.value._futureSnapshot=U.value,Ge.children=U.children.map(en=>Oo(R,en)),Ge}}const z=function Ns(R){return new Po(new J.X(R.url),new J.X(R.params),new J.X(R.queryParams),new J.X(R.fragment),new J.X(R.data),R.outlet,R.component,R)}(U.value),K=U.children.map(Me=>Oo(R,Me));return new Fr(z,K)}}const Xo="ngNavigationCancelingError";function os(R,U){const{redirectTo:$,navigationBehaviorOptions:z}=En(U)?{redirectTo:U,navigationBehaviorOptions:void 0}:U,K=Br(!1,0,U);return K.url=$,K.navigationBehaviorOptions=z,K}function Br(R,U,$){const z=new Error("NavigationCancelingError: "+(R||""));return z[Xo]=!0,z.cancellationCode=U,$&&(z.url=$),z}function ws(R){return R&&R[Xo]}let Fo=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275cmp=x.Xpm({type:R,selectors:[["ng-component"]],standalone:!0,features:[x.jDz],decls:1,vars:0,template:function(z,K){1&z&&x._UZ(0,"router-outlet")},dependencies:[rs],encapsulation:2}),U})();function ia(R){const U=R.children&&R.children.map(ia),$=U?{...R,children:U}:{...R};return!$.component&&!$.loadComponent&&(U||$.loadChildren)&&$.outlet&&$.outlet!==Ot&&($.component=Fo),$}function Ur(R){return R.outlet||Ot}function Do(R){if(!R)return null;if(R.routeConfig?._injector)return R.routeConfig._injector;for(let U=R.parent;U;U=U.parent){const $=U.routeConfig;if($?._loadedInjector)return $._loadedInjector;if($?._injector)return $._injector}return null}class el{constructor(U,$,z,K,Me){this.routeReuseStrategy=U,this.futureState=$,this.currState=z,this.forwardEvent=K,this.inputBindingEnabled=Me}activate(U){const $=this.futureState._root,z=this.currState?this.currState._root:null;this.deactivateChildRoutes($,z,U),Rr(this.futureState.root),this.activateChildRoutes($,z,U)}deactivateChildRoutes(U,$,z){const K=Or($);U.children.forEach(Me=>{const Ge=Me.value.outlet;this.deactivateRoutes(Me,K[Ge],z),delete K[Ge]}),Object.values(K).forEach(Me=>{this.deactivateRouteAndItsChildren(Me,z)})}deactivateRoutes(U,$,z){const K=U.value,Me=$?$.value:null;if(K===Me)if(K.component){const Ge=z.getContext(K.outlet);Ge&&this.deactivateChildRoutes(U,$,Ge.children)}else this.deactivateChildRoutes(U,$,z);else Me&&this.deactivateRouteAndItsChildren($,z)}deactivateRouteAndItsChildren(U,$){U.value.component&&this.routeReuseStrategy.shouldDetach(U.value.snapshot)?this.detachAndStoreRouteSubtree(U,$):this.deactivateRouteAndOutlet(U,$)}detachAndStoreRouteSubtree(U,$){const z=$.getContext(U.value.outlet),K=z&&U.value.component?z.children:$,Me=Or(U);for(const Ge of Object.keys(Me))this.deactivateRouteAndItsChildren(Me[Ge],K);if(z&&z.outlet){const Ge=z.outlet.detach(),en=z.children.onOutletDeactivated();this.routeReuseStrategy.store(U.value.snapshot,{componentRef:Ge,route:U,contexts:en})}}deactivateRouteAndOutlet(U,$){const z=$.getContext(U.value.outlet),K=z&&U.value.component?z.children:$,Me=Or(U);for(const Ge of Object.keys(Me))this.deactivateRouteAndItsChildren(Me[Ge],K);z&&(z.outlet&&(z.outlet.deactivate(),z.children.onOutletDeactivated()),z.attachRef=null,z.route=null)}activateChildRoutes(U,$,z){const K=Or($);U.children.forEach(Me=>{this.activateRoutes(Me,K[Me.value.outlet],z),this.forwardEvent(new go(Me.value.snapshot))}),U.children.length&&this.forwardEvent(new Ni(U.value.snapshot))}activateRoutes(U,$,z){const K=U.value,Me=$?$.value:null;if(Rr(K),K===Me)if(K.component){const Ge=z.getOrCreateContext(K.outlet);this.activateChildRoutes(U,$,Ge.children)}else this.activateChildRoutes(U,$,z);else if(K.component){const Ge=z.getOrCreateContext(K.outlet);if(this.routeReuseStrategy.shouldAttach(K.snapshot)){const en=this.routeReuseStrategy.retrieve(K.snapshot);this.routeReuseStrategy.store(K.snapshot,null),Ge.children.onOutletReAttached(en.contexts),Ge.attachRef=en.componentRef,Ge.route=en.route.value,Ge.outlet&&Ge.outlet.attach(en.componentRef,en.route.value),Rr(en.route.value),this.activateChildRoutes(U,null,Ge.children)}else{const en=Do(K.snapshot);Ge.attachRef=null,Ge.route=K,Ge.injector=en,Ge.outlet&&Ge.outlet.activateWith(K,Ge.injector),this.activateChildRoutes(U,null,Ge.children)}}else this.activateChildRoutes(U,null,z)}}class Bo{constructor(U){this.path=U,this.route=this.path[this.path.length-1]}}class yo{constructor(U,$){this.component=U,this.route=$}}function ra(R,U,$){const z=R._root;return ki(z,U?U._root:null,$,[z.value])}function Ls(R,U){const $=Symbol(),z=U.get(R,$);return z===$?"function"!=typeof R||(0,x.Z0I)(R)?U.get(R):R:z}function ki(R,U,$,z,K={canDeactivateChecks:[],canActivateChecks:[]}){const Me=Or(U);return R.children.forEach(Ge=>{(function Ws(R,U,$,z,K={canDeactivateChecks:[],canActivateChecks:[]}){const Me=R.value,Ge=U?U.value:null,en=$?$.getContext(R.value.outlet):null;if(Ge&&Me.routeConfig===Ge.routeConfig){const $n=function v(R,U,$){if("function"==typeof $)return $(R,U);switch($){case"pathParamsChange":return!nt(R.url,U.url);case"pathParamsOrQueryParamsChange":return!nt(R.url,U.url)||!Ft(R.queryParams,U.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!_o(R,U)||!Ft(R.queryParams,U.queryParams);default:return!_o(R,U)}}(Ge,Me,Me.routeConfig.runGuardsAndResolvers);$n?K.canActivateChecks.push(new Bo(z)):(Me.data=Ge.data,Me._resolvedData=Ge._resolvedData),ki(R,U,Me.component?en?en.children:null:$,z,K),$n&&en&&en.outlet&&en.outlet.isActivated&&K.canDeactivateChecks.push(new yo(en.outlet.component,Ge))}else Ge&&M(U,en,K),K.canActivateChecks.push(new Bo(z)),ki(R,null,Me.component?en?en.children:null:$,z,K)})(Ge,Me[Ge.value.outlet],$,z.concat([Ge.value]),K),delete Me[Ge.value.outlet]}),Object.entries(Me).forEach(([Ge,en])=>M(en,$.getContext(Ge),K)),K}function M(R,U,$){const z=Or(R),K=R.value;Object.entries(z).forEach(([Me,Ge])=>{M(Ge,K.component?U?U.children.getContext(Me):null:U,$)}),$.canDeactivateChecks.push(new yo(K.component&&U&&U.outlet&&U.outlet.isActivated?U.outlet.component:null,K))}function D(R){return"function"==typeof R}function oa(R){return R instanceof C||"EmptyError"===R?.name}const Es=Symbol("INITIAL_VALUE");function ks(){return(0,ht.w)(R=>(0,ie.a)(R.map(U=>U.pipe((0,Le.q)(1),function gt(...R){const U=(0,ye.yG)(R);return(0,Ie.e)(($,z)=>{(U?(0,Ne.z)(R,$,U):(0,Ne.z)(R,$)).subscribe(z)})}(Es)))).pipe((0,ct.U)(U=>{for(const $ of U)if(!0!==$){if($===Es)return Es;if(!1===$||$ instanceof qn)return $}return!0}),(0,De.h)(U=>U!==Es),(0,Le.q)(1)))}function Ca(R){return(0,he.z)(Te(U=>{if(En(U))throw os(0,U)}),(0,ct.U)(U=>!0===U))}class Ea{constructor(U){this.segmentGroup=U||null}}class dc{constructor(U){this.urlTree=U}}function fa(R){return ae(new Ea(R))}function Na(R){return ae(new dc(R))}class hc{constructor(U,$){this.urlSerializer=U,this.urlTree=$}noMatchError(U){return new x.vHH(4002,!1)}lineralizeSegments(U,$){let z=[],K=$.root;for(;;){if(z=z.concat(K.segments),0===K.numberOfChildren)return(0,s.of)(z);if(K.numberOfChildren>1||!K.children[Ot])return ae(new x.vHH(4e3,!1));K=K.children[Ot]}}applyRedirectCommands(U,$,z){return this.applyRedirectCreateUrlTree($,this.urlSerializer.parse($),U,z)}applyRedirectCreateUrlTree(U,$,z,K){const Me=this.createSegmentGroup(U,$.root,z,K);return new qn(Me,this.createQueryParams($.queryParams,this.urlTree.queryParams),$.fragment)}createQueryParams(U,$){const z={};return Object.entries(U).forEach(([K,Me])=>{if("string"==typeof Me&&Me.startsWith(":")){const en=Me.substring(1);z[K]=$[en]}else z[K]=Me}),z}createSegmentGroup(U,$,z,K){const Me=this.createSegments(U,$.segments,z,K);let Ge={};return Object.entries($.children).forEach(([en,$n])=>{Ge[en]=this.createSegmentGroup(U,$n,z,K)}),new yn(Me,Ge)}createSegments(U,$,z,K){return $.map(Me=>Me.path.startsWith(":")?this.findPosParam(U,Me,K):this.findOrReturn(Me,z))}findPosParam(U,$,z){const K=z[$.path.substring(1)];if(!K)throw new x.vHH(4001,!1);return K}findOrReturn(U,$){let z=0;for(const K of $){if(K.path===U.path)return $.splice(z),K;z++}return U}}const Us={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function nl(R,U,$,z,K){const Me=Ao(R,U,$);return Me.matched?(z=function Ho(R,U){return R.providers&&!R._injector&&(R._injector=(0,x.MMx)(R.providers,U,`Route: ${R.path}`)),R._injector??U}(U,z),function uc(R,U,$,z){const K=U.canMatch;if(!K||0===K.length)return(0,s.of)(!0);const Me=K.map(Ge=>{const en=Ls(Ge,R);return wt(function tr(R){return R&&D(R.canMatch)}(en)?en.canMatch(U,$):R.runInContext(()=>en(U,$)))});return(0,s.of)(Me).pipe(ks(),Ca())}(z,U,$).pipe((0,ct.U)(Ge=>!0===Ge?Me:{...Us}))):(0,s.of)(Me)}function Ao(R,U,$){if(""===U.path)return"full"===U.pathMatch&&(R.hasChildren()||$.length>0)?{...Us}:{matched:!0,consumedSegments:[],remainingSegments:$,parameters:{},positionalParamSegments:{}};const K=(U.matcher||ii)($,R,U);if(!K)return{...Us};const Me={};Object.entries(K.posParams??{}).forEach(([en,$n])=>{Me[en]=$n.path});const Ge=K.consumed.length>0?{...Me,...K.consumed[K.consumed.length-1].parameters}:Me;return{matched:!0,consumedSegments:K.consumed,remainingSegments:$.slice(K.consumed.length),parameters:Ge,positionalParamSegments:K.posParams??{}}}function za(R,U,$,z){return $.length>0&&function Vl(R,U,$){return $.some(z=>bl(R,U,z)&&Ur(z)!==Ot)}(R,$,z)?{segmentGroup:new yn(U,Ua(z,new yn($,R.children))),slicedSegments:[]}:0===$.length&&function sa(R,U,$){return $.some(z=>bl(R,U,z))}(R,$,z)?{segmentGroup:new yn(R.segments,Mu(R,0,$,z,R.children)),slicedSegments:$}:{segmentGroup:new yn(R.segments,R.children),slicedSegments:$}}function Mu(R,U,$,z,K){const Me={};for(const Ge of z)if(bl(R,$,Ge)&&!K[Ur(Ge)]){const en=new yn([],{});Me[Ur(Ge)]=en}return{...K,...Me}}function Ua(R,U){const $={};$[Ot]=U;for(const z of R)if(""===z.path&&Ur(z)!==Ot){const K=new yn([],{});$[Ur(z)]=K}return $}function bl(R,U,$){return(!(R.hasChildren()||U.length>0)||"full"!==$.pathMatch)&&""===$.path}class Au{constructor(U,$,z,K,Me,Ge,en){this.injector=U,this.configLoader=$,this.rootComponentType=z,this.config=K,this.urlTree=Me,this.paramsInheritanceStrategy=Ge,this.urlSerializer=en,this.allowRedirects=!0,this.applyRedirects=new hc(this.urlSerializer,this.urlTree)}noMatchError(U){return new x.vHH(4002,!1)}recognize(){const U=za(this.urlTree.root,[],[],this.config).segmentGroup;return this.processSegmentGroup(this.injector,this.config,U,Ot).pipe(Re($=>{if($ instanceof dc)return this.allowRedirects=!1,this.urlTree=$.urlTree,this.match($.urlTree);throw $ instanceof Ea?this.noMatchError($):$}),(0,ct.U)($=>{const z=new bs([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},Ot,this.rootComponentType,null,{}),K=new Fr(z,$),Me=new gr("",K),Ge=function ti(R,U,$=null,z=null){return _i(gi(R),U,$,z)}(z,[],this.urlTree.queryParams,this.urlTree.fragment);return Ge.queryParams=this.urlTree.queryParams,Me.url=this.urlSerializer.serialize(Ge),this.inheritParamsAndData(Me._root),{state:Me,tree:Ge}}))}match(U){return this.processSegmentGroup(this.injector,this.config,U.root,Ot).pipe(Re(z=>{throw z instanceof Ea?this.noMatchError(z):z}))}inheritParamsAndData(U){const $=U.value,z=Hr($,this.paramsInheritanceStrategy);$.params=Object.freeze(z.params),$.data=Object.freeze(z.data),U.children.forEach(K=>this.inheritParamsAndData(K))}processSegmentGroup(U,$,z,K){return 0===z.segments.length&&z.hasChildren()?this.processChildren(U,$,z):this.processSegment(U,$,z,z.segments,K,!0)}processChildren(U,$,z){const K=[];for(const Me of Object.keys(z.children))"primary"===Me?K.unshift(Me):K.push(Me);return(0,y.D)(K).pipe((0,Ht.b)(Me=>{const Ge=z.children[Me],en=function fs(R,U){const $=R.filter(z=>Ur(z)===U);return $.push(...R.filter(z=>Ur(z)!==U)),$}($,Me);return this.processSegmentGroup(U,en,Ge,Me)}),function St(R,U){return(0,Ie.e)(function Fe(R,U,$,z,K){return(Me,Ge)=>{let en=$,$n=U,xn=0;Me.subscribe((0,Ee.x)(Ge,Oi=>{const ar=xn++;$n=en?R($n,Oi,ar):(en=!0,Oi),z&&Ge.next($n)},K&&(()=>{en&&Ge.next($n),Ge.complete()})))}}(R,U,arguments.length>=2,!0))}((Me,Ge)=>(Me.push(...Ge),Me)),Ae(null),function Rt(R,U){const $=arguments.length>=2;return z=>z.pipe(R?(0,De.h)((K,Me)=>R(K,Me,z)):hn.y,Ce(1),$?Ae(U):Ye(()=>new C))}(),(0,Pe.z)(Me=>{if(null===Me)return fa(z);const Ge=il(Me);return function wl(R){R.sort((U,$)=>U.value.outlet===Ot?-1:$.value.outlet===Ot?1:U.value.outlet.localeCompare($.value.outlet))}(Ge),(0,s.of)(Ge)}))}processSegment(U,$,z,K,Me,Ge){return(0,y.D)($).pipe((0,Ht.b)(en=>this.processSegmentAgainstRoute(en._injector??U,$,en,z,K,Me,Ge).pipe(Re($n=>{if($n instanceof Ea)return(0,s.of)(null);throw $n}))),qt(en=>!!en),Re(en=>{if(oa(en))return function Gc(R,U,$){return 0===U.length&&!R.children[$]}(z,K,Me)?(0,s.of)([]):fa(z);throw en}))}processSegmentAgainstRoute(U,$,z,K,Me,Ge,en){return function vd(R,U,$,z){return!!(Ur(R)===z||z!==Ot&&bl(U,$,R))&&("**"===R.path||Ao(U,R,$).matched)}(z,K,Me,Ge)?void 0===z.redirectTo?this.matchSegmentAgainstRoute(U,K,z,Me,Ge,en):en&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(U,K,$,z,Me,Ge):fa(K):fa(K)}expandSegmentAgainstRouteUsingRedirect(U,$,z,K,Me,Ge){return"**"===K.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(U,z,K,Ge):this.expandRegularSegmentAgainstRouteUsingRedirect(U,$,z,K,Me,Ge)}expandWildCardWithParamsAgainstRouteUsingRedirect(U,$,z,K){const Me=this.applyRedirects.applyRedirectCommands([],z.redirectTo,{});return z.redirectTo.startsWith("/")?Na(Me):this.applyRedirects.lineralizeSegments(z,Me).pipe((0,Pe.z)(Ge=>{const en=new yn(Ge,{});return this.processSegment(U,$,en,Ge,K,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(U,$,z,K,Me,Ge){const{matched:en,consumedSegments:$n,remainingSegments:xn,positionalParamSegments:Oi}=Ao($,K,Me);if(!en)return fa($);const ar=this.applyRedirects.applyRedirectCommands($n,K.redirectTo,Oi);return K.redirectTo.startsWith("/")?Na(ar):this.applyRedirects.lineralizeSegments(K,ar).pipe((0,Pe.z)(po=>this.processSegment(U,z,$,po.concat(xn),Ge,!1)))}matchSegmentAgainstRoute(U,$,z,K,Me,Ge){let en;if("**"===z.path){const $n=K.length>0?Wt(K).parameters:{},xn=new bs(K,$n,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,pc(z),Ur(z),z.component??z._loadedComponent??null,z,qs(z));en=(0,s.of)({snapshot:xn,consumedSegments:[],remainingSegments:[]}),$.children={}}else en=nl($,z,K,U).pipe((0,ct.U)(({matched:$n,consumedSegments:xn,remainingSegments:Oi,parameters:ar})=>$n?{snapshot:new bs(xn,ar,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,pc(z),Ur(z),z.component??z._loadedComponent??null,z,qs(z)),consumedSegments:xn,remainingSegments:Oi}:null));return en.pipe((0,ht.w)($n=>null===$n?fa($):this.getChildConfig(U=z._injector??U,z,K).pipe((0,ht.w)(({routes:xn})=>{const Oi=z._loadedInjector??U,{snapshot:ar,consumedSegments:po,remainingSegments:f}=$n,{segmentGroup:r,slicedSegments:c}=za($,po,f,xn);if(0===c.length&&r.hasChildren())return this.processChildren(Oi,xn,r).pipe((0,ct.U)(b=>null===b?null:[new Fr(ar,b)]));if(0===xn.length&&0===c.length)return(0,s.of)([new Fr(ar,[])]);const m=Ur(z)===Me;return this.processSegment(Oi,xn,r,c,m?Ot:Me,!0).pipe((0,ct.U)(b=>[new Fr(ar,b)]))}))))}getChildConfig(U,$,z){return $.children?(0,s.of)({routes:$.children,injector:U}):$.loadChildren?void 0!==$._loadedRoutes?(0,s.of)({routes:$._loadedRoutes,injector:$._loadedInjector}):function ha(R,U,$,z){const K=U.canLoad;if(void 0===K||0===K.length)return(0,s.of)(!0);const Me=K.map(Ge=>{const en=Ls(Ge,R);return wt(function G(R){return R&&D(R.canLoad)}(en)?en.canLoad(U,$):R.runInContext(()=>en(U,$)))});return(0,s.of)(Me).pipe(ks(),Ca())}(U,$,z).pipe((0,Pe.z)(K=>K?this.configLoader.loadChildren(U,$).pipe(Te(Me=>{$._loadedRoutes=Me.routes,$._loadedInjector=Me.injector})):function Iu(R){return ae(Br(!1,3))}())):(0,s.of)({routes:[],injector:U})}}function $l(R){const U=R.value.routeConfig;return U&&""===U.path}function il(R){const U=[],$=new Set;for(const z of R){if(!$l(z)){U.push(z);continue}const K=U.find(Me=>z.value.routeConfig===Me.value.routeConfig);void 0!==K?(K.children.push(...z.children),$.add(K)):U.push(z)}for(const z of $){const K=il(z.children);U.push(new Fr(z.value,K))}return U.filter(z=>!$.has(z))}function pc(R){return R.data||{}}function qs(R){return R.resolve||{}}function He(R){return"string"==typeof R.title||null===R.title}function At(R){return(0,ht.w)(U=>{const $=R(U);return $?(0,y.D)($).pipe((0,ct.U)(()=>U)):(0,s.of)(U)})}const cn=new x.OlP("ROUTES");let ri=(()=>{var R;class U{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=(0,x.f3M)(x.Sil)}loadComponent(z){if(this.componentLoaders.get(z))return this.componentLoaders.get(z);if(z._loadedComponent)return(0,s.of)(z._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(z);const K=wt(z.loadComponent()).pipe((0,ct.U)(Xi),Te(Ge=>{this.onLoadEndListener&&this.onLoadEndListener(z),z._loadedComponent=Ge}),(0,Gt.x)(()=>{this.componentLoaders.delete(z)})),Me=new et(K,()=>new le.x).pipe(Ue());return this.componentLoaders.set(z,Me),Me}loadChildren(z,K){if(this.childrenLoaders.get(K))return this.childrenLoaders.get(K);if(K._loadedRoutes)return(0,s.of)({routes:K._loadedRoutes,injector:K._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(K);const Ge=this.loadModuleFactoryOrRoutes(K.loadChildren).pipe((0,ct.U)($n=>{this.onLoadEndListener&&this.onLoadEndListener(K);let xn,Oi;return Array.isArray($n)?Oi=$n:(xn=$n.create(z).injector,Oi=xn.get(cn,[],x.XFs.Self|x.XFs.Optional).flat()),{routes:Oi.map(ia),injector:xn}}),(0,Gt.x)(()=>{this.childrenLoaders.delete(K)})),en=new et(Ge,()=>new le.x).pipe(Ue());return this.childrenLoaders.set(K,en),en}loadModuleFactoryOrRoutes(z){return wt(z()).pipe((0,ct.U)(Xi),(0,Pe.z)(K=>K instanceof x.YKP||Array.isArray(K)?(0,s.of)(K):(0,y.D)(this.compiler.compileModuleAsync(K))))}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();function Xi(R){return function fr(R){return R&&"object"==typeof R&&"default"in R}(R)?R.default:R}let pr=(()=>{var R;class U{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new le.x,this.transitionAbortSubject=new le.x,this.configLoader=(0,x.f3M)(ri),this.environmentInjector=(0,x.f3M)(x.lqb),this.urlSerializer=(0,x.f3M)(ve),this.rootContexts=(0,x.f3M)(To),this.inputBindingEnabled=null!==(0,x.f3M)(ko,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>(0,s.of)(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=Me=>this.events.next(new di(Me)),this.configLoader.onLoadStartListener=Me=>this.events.next(new Fn(Me))}complete(){this.transitions?.complete()}handleNavigationRequest(z){const K=++this.navigationId;this.transitions?.next({...this.transitions.value,...z,id:K})}setupNavigations(z,K,Me){return this.transitions=new J.X({id:0,currentUrlTree:K,currentRawUrl:K,currentBrowserUrl:K,extractedUrl:z.urlHandlingStrategy.extract(K),urlAfterRedirects:z.urlHandlingStrategy.extract(K),rawUrl:K,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:Xn,restoredState:null,currentSnapshot:Me.snapshot,targetSnapshot:null,currentRouterState:Me,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe((0,De.h)(Ge=>0!==Ge.id),(0,ct.U)(Ge=>({...Ge,extractedUrl:z.urlHandlingStrategy.extract(Ge.rawUrl)})),(0,ht.w)(Ge=>{this.currentTransition=Ge;let en=!1,$n=!1;return(0,s.of)(Ge).pipe(Te(xn=>{this.currentNavigation={id:xn.id,initialUrl:xn.rawUrl,extractedUrl:xn.extractedUrl,trigger:xn.source,extras:xn.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),(0,ht.w)(xn=>{const Oi=xn.currentBrowserUrl.toString(),ar=!z.navigated||xn.extractedUrl.toString()!==Oi||Oi!==xn.currentUrlTree.toString();if(!ar&&"reload"!==(xn.extras.onSameUrlNavigation??z.onSameUrlNavigation)){const f="";return this.events.next(new je(xn.id,this.urlSerializer.serialize(xn.rawUrl),f,0)),xn.resolve(null),oe.E}if(z.urlHandlingStrategy.shouldProcessUrl(xn.rawUrl))return(0,s.of)(xn).pipe((0,ht.w)(f=>{const r=this.transitions?.getValue();return this.events.next(new Si(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),r!==this.transitions?.getValue()?oe.E:Promise.resolve(f)}),function Ta(R,U,$,z,K,Me){return(0,Pe.z)(Ge=>function fc(R,U,$,z,K,Me,Ge="emptyOnly"){return new Au(R,U,$,z,K,Ge,Me).recognize()}(R,U,$,z,Ge.extractedUrl,K,Me).pipe((0,ct.U)(({state:en,tree:$n})=>({...Ge,targetSnapshot:en,urlAfterRedirects:$n}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,z.config,this.urlSerializer,z.paramsInheritanceStrategy),Te(f=>{Ge.targetSnapshot=f.targetSnapshot,Ge.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const r=new an(f.id,this.urlSerializer.serialize(f.extractedUrl),this.urlSerializer.serialize(f.urlAfterRedirects),f.targetSnapshot);this.events.next(r)}));if(ar&&z.urlHandlingStrategy.shouldProcessUrl(xn.currentRawUrl)){const{id:f,extractedUrl:r,source:c,restoredState:m,extras:b}=xn,T=new Si(f,this.urlSerializer.serialize(r),c,m);this.events.next(T);const O=so(0,this.rootComponentType).snapshot;return this.currentTransition=Ge={...xn,targetSnapshot:O,urlAfterRedirects:r,extras:{...b,skipLocationChange:!1,replaceUrl:!1}},(0,s.of)(Ge)}{const f="";return this.events.next(new je(xn.id,this.urlSerializer.serialize(xn.extractedUrl),f,1)),xn.resolve(null),oe.E}}),Te(xn=>{const Oi=new Vt(xn.id,this.urlSerializer.serialize(xn.extractedUrl),this.urlSerializer.serialize(xn.urlAfterRedirects),xn.targetSnapshot);this.events.next(Oi)}),(0,ct.U)(xn=>(this.currentTransition=Ge={...xn,guards:ra(xn.targetSnapshot,xn.currentSnapshot,this.rootContexts)},Ge)),function Fa(R,U){return(0,Pe.z)($=>{const{targetSnapshot:z,currentSnapshot:K,guards:{canActivateChecks:Me,canDeactivateChecks:Ge}}=$;return 0===Ge.length&&0===Me.length?(0,s.of)({...$,guardsResult:!0}):function tl(R,U,$,z){return(0,y.D)(R).pipe((0,Pe.z)(K=>function cc(R,U,$,z,K){const Me=U&&U.routeConfig?U.routeConfig.canDeactivate:null;if(!Me||0===Me.length)return(0,s.of)(!0);const Ge=Me.map(en=>{const $n=Do(U)??K,xn=Ls(en,$n);return wt(function pi(R){return R&&D(R.canDeactivate)}(xn)?xn.canDeactivate(R,U,$,z):$n.runInContext(()=>xn(R,U,$,z))).pipe(qt())});return(0,s.of)(Ge).pipe(ks())}(K.component,K.route,$,U,z)),qt(K=>!0!==K,!0))}(Ge,z,K,R).pipe((0,Pe.z)(en=>en&&function A(R){return"boolean"==typeof R}(en)?function da(R,U,$,z){return(0,y.D)(U).pipe((0,Ht.b)(K=>(0,Ne.z)(function Ba(R,U){return null!==R&&U&&U(new Ai(R)),(0,s.of)(!0)}(K.route.parent,z),function yl(R,U){return null!==R&&U&&U(new vr(R)),(0,s.of)(!0)}(K.route,z),function Ts(R,U,$){const z=U[U.length-1],Me=U.slice(0,U.length-1).reverse().map(Ge=>function Rs(R){const U=R.routeConfig?R.routeConfig.canActivateChild:null;return U&&0!==U.length?{node:R,guards:U}:null}(Ge)).filter(Ge=>null!==Ge).map(Ge=>(0,me.P)(()=>{const en=Ge.guards.map($n=>{const xn=Do(Ge.node)??$,Oi=Ls($n,xn);return wt(function Yn(R){return R&&D(R.canActivateChild)}(Oi)?Oi.canActivateChild(z,R):xn.runInContext(()=>Oi(z,R))).pipe(qt())});return(0,s.of)(en).pipe(ks())}));return(0,s.of)(Me).pipe(ks())}(R,K.path,$),function vl(R,U,$){const z=U.routeConfig?U.routeConfig.canActivate:null;if(!z||0===z.length)return(0,s.of)(!0);const K=z.map(Me=>(0,me.P)(()=>{const Ge=Do(U)??$,en=Ls(Me,Ge);return wt(function It(R){return R&&D(R.canActivate)}(en)?en.canActivate(U,R):Ge.runInContext(()=>en(U,R))).pipe(qt())}));return(0,s.of)(K).pipe(ks())}(R,K.route,$))),qt(K=>!0!==K,!0))}(z,Me,R,U):(0,s.of)(en)),(0,ct.U)(en=>({...$,guardsResult:en})))})}(this.environmentInjector,xn=>this.events.next(xn)),Te(xn=>{if(Ge.guardsResult=xn.guardsResult,En(xn.guardsResult))throw os(0,xn.guardsResult);const Oi=new vn(xn.id,this.urlSerializer.serialize(xn.extractedUrl),this.urlSerializer.serialize(xn.urlAfterRedirects),xn.targetSnapshot,!!xn.guardsResult);this.events.next(Oi)}),(0,De.h)(xn=>!!xn.guardsResult||(this.cancelNavigationTransition(xn,"",3),!1)),At(xn=>{if(xn.guards.canActivateChecks.length)return(0,s.of)(xn).pipe(Te(Oi=>{const ar=new Dn(Oi.id,this.urlSerializer.serialize(Oi.extractedUrl),this.urlSerializer.serialize(Oi.urlAfterRedirects),Oi.targetSnapshot);this.events.next(ar)}),(0,ht.w)(Oi=>{let ar=!1;return(0,s.of)(Oi).pipe(function Zs(R,U){return(0,Pe.z)($=>{const{targetSnapshot:z,guards:{canActivateChecks:K}}=$;if(!K.length)return(0,s.of)($);let Me=0;return(0,y.D)(K).pipe((0,Ht.b)(Ge=>function N(R,U,$,z){const K=R.routeConfig,Me=R._resolve;return void 0!==K?.title&&!He(K)&&(Me[pt]=K.title),function ne(R,U,$,z){const K=function it(R){return[...Object.keys(R),...Object.getOwnPropertySymbols(R)]}(R);if(0===K.length)return(0,s.of)({});const Me={};return(0,y.D)(K).pipe((0,Pe.z)(Ge=>function Q(R,U,$,z){const K=Do(U)??z,Me=Ls(R,K);return wt(Me.resolve?Me.resolve(U,$):K.runInContext(()=>Me(U,$)))}(R[Ge],U,$,z).pipe(qt(),Te(en=>{Me[Ge]=en}))),Ce(1),function Qt(R){return(0,ct.U)(()=>R)}(Me),Re(Ge=>oa(Ge)?oe.E:ae(Ge)))}(Me,R,U,z).pipe((0,ct.U)(Ge=>(R._resolvedData=Ge,R.data=Hr(R,$).resolve,K&&He(K)&&(R.data[pt]=K.title),null)))}(Ge.route,z,R,U)),Te(()=>Me++),Ce(1),(0,Pe.z)(Ge=>Me===K.length?(0,s.of)($):oe.E))})}(z.paramsInheritanceStrategy,this.environmentInjector),Te({next:()=>ar=!0,complete:()=>{ar||this.cancelNavigationTransition(Oi,"",2)}}))}),Te(Oi=>{const ar=new In(Oi.id,this.urlSerializer.serialize(Oi.extractedUrl),this.urlSerializer.serialize(Oi.urlAfterRedirects),Oi.targetSnapshot);this.events.next(ar)}))}),At(xn=>{const Oi=ar=>{const po=[];ar.routeConfig?.loadComponent&&!ar.routeConfig._loadedComponent&&po.push(this.configLoader.loadComponent(ar.routeConfig).pipe(Te(f=>{ar.component=f}),(0,ct.U)(()=>{})));for(const f of ar.children)po.push(...Oi(f));return po};return(0,ie.a)(Oi(xn.targetSnapshot.root)).pipe(Ae(),(0,Le.q)(1))}),At(()=>this.afterPreactivation()),(0,ct.U)(xn=>{const Oi=function bo(R,U,$){const z=Oo(R,U._root,$?$._root:void 0);return new Er(z,U)}(z.routeReuseStrategy,xn.targetSnapshot,xn.currentRouterState);return this.currentTransition=Ge={...xn,targetRouterState:Oi},Ge}),Te(()=>{this.events.next(new co)}),((R,U,$,z)=>(0,ct.U)(K=>(new el(U,K.targetRouterState,K.currentRouterState,$,z).activate(R),K)))(this.rootContexts,z.routeReuseStrategy,xn=>this.events.next(xn),this.inputBindingEnabled),(0,Le.q)(1),Te({next:xn=>{en=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new we(xn.id,this.urlSerializer.serialize(xn.extractedUrl),this.urlSerializer.serialize(xn.urlAfterRedirects))),z.titleStrategy?.updateTitle(xn.targetRouterState.snapshot),xn.resolve(!0)},complete:()=>{en=!0}}),function Jt(R){return(0,Ie.e)((U,$)=>{(0,Je.Xf)(R).subscribe((0,Ee.x)($,()=>$.complete(),Zt.Z)),!$.closed&&U.subscribe($)})}(this.transitionAbortSubject.pipe(Te(xn=>{throw xn}))),(0,Gt.x)(()=>{en||$n||this.cancelNavigationTransition(Ge,"",1),this.currentNavigation?.id===Ge.id&&(this.currentNavigation=null)}),Re(xn=>{if($n=!0,ws(xn))this.events.next(new fe(Ge.id,this.urlSerializer.serialize(Ge.extractedUrl),xn.message,xn.cancellationCode)),function zs(R){return ws(R)&&En(R.url)}(xn)?this.events.next(new uo(xn.url)):Ge.resolve(!1);else{this.events.next(new lt(Ge.id,this.urlSerializer.serialize(Ge.extractedUrl),xn,Ge.targetSnapshot??void 0));try{Ge.resolve(z.errorHandler(xn))}catch(Oi){Ge.reject(Oi)}}return oe.E}))}))}cancelNavigationTransition(z,K,Me){const Ge=new fe(z.id,this.urlSerializer.serialize(z.extractedUrl),K,Me);this.events.next(Ge),z.resolve(!1)}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();function sr(R){return R!==Xn}let Vi=(()=>{var R;class U{buildTitle(z){let K,Me=z.root;for(;void 0!==Me;)K=this.getResolvedTitleForRoute(Me)??K,Me=Me.children.find(Ge=>Ge.outlet===Ot);return K}getResolvedTitleForRoute(z){return z.data[pt]}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return(0,x.f3M)(Tr)},providedIn:"root"}),U})(),Tr=(()=>{var R;class U extends Vi{constructor(z){super(),this.title=z}updateTitle(z){const K=this.buildTitle(z);void 0!==K&&this.title.setTitle(K)}}return(R=U).\u0275fac=function(z){return new(z||R)(x.LFG(dt.Dx))},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})(),ho=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return(0,x.f3M)(ps)},providedIn:"root"}),U})();class ao{shouldDetach(U){return!1}store(U,$){}shouldAttach(U){return!1}retrieve(U){return null}shouldReuseRoute(U,$){return U.routeConfig===$.routeConfig}}let ps=(()=>{var R;class U extends ao{}return(R=U).\u0275fac=function(){let $;return function(K){return($||($=x.n5z(R)))(K||R)}}(),R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();const ss=new x.OlP("",{providedIn:"root",factory:()=>({})});let No=(()=>{var R;class U{}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:function(){return(0,x.f3M)(fo)},providedIn:"root"}),U})(),fo=(()=>{var R;class U{shouldProcessUrl(z){return!0}extract(z){return z}merge(z,K){return z}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();var as=function(R){return R[R.COMPLETE=0]="COMPLETE",R[R.FAILED=1]="FAILED",R[R.REDIRECTING=2]="REDIRECTING",R}(as||{});function Ys(R,U){R.events.pipe((0,De.h)($=>$ instanceof we||$ instanceof fe||$ instanceof lt||$ instanceof je),(0,ct.U)($=>$ instanceof we||$ instanceof je?as.COMPLETE:$ instanceof fe&&(0===$.code||1===$.code)?as.REDIRECTING:as.FAILED),(0,De.h)($=>$!==as.REDIRECTING),(0,Le.q)(1)).subscribe(()=>{U()})}function mc(R){throw R}function ai(R,U,$){return U.parse("/")}const Js={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Su={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let es=(()=>{var R;class U{get navigationId(){return this.navigationTransitions.navigationId}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.location.getState()?.\u0275routerPageId??this.currentPageId}get events(){return this._events}constructor(){this.disposed=!1,this.currentPageId=0,this.console=(0,x.f3M)(x.c2e),this.isNgZoneEnabled=!1,this._events=new le.x,this.options=(0,x.f3M)(ss,{optional:!0})||{},this.pendingTasks=(0,x.f3M)(x.HDt),this.errorHandler=this.options.errorHandler||mc,this.malformedUriErrorHandler=this.options.malformedUriErrorHandler||ai,this.navigated=!1,this.lastSuccessfulId=-1,this.urlHandlingStrategy=(0,x.f3M)(No),this.routeReuseStrategy=(0,x.f3M)(ho),this.titleStrategy=(0,x.f3M)(Vi),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.config=(0,x.f3M)(cn,{optional:!0})?.flat()??[],this.navigationTransitions=(0,x.f3M)(pr),this.urlSerializer=(0,x.f3M)(ve),this.location=(0,x.f3M)(ue.Ye),this.componentInputBindingEnabled=!!(0,x.f3M)(ko,{optional:!0}),this.eventsSubscription=new Be.w0,this.isNgZoneEnabled=(0,x.f3M)(x.R0b)instanceof x.R0b&&x.R0b.isInAngularZone(),this.resetConfig(this.config),this.currentUrlTree=new qn,this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.routerState=so(0,null),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe(z=>{this.lastSuccessfulId=z.id,this.currentPageId=this.browserPageId},z=>{this.console.warn(`Unhandled Navigation Error: ${z}`)}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const z=this.navigationTransitions.events.subscribe(K=>{try{const{currentTransition:Me}=this.navigationTransitions;if(null===Me)return void(zo(K)&&this._events.next(K));if(K instanceof Si)sr(Me.source)&&(this.browserUrlTree=Me.extractedUrl);else if(K instanceof je)this.rawUrlTree=Me.rawUrl;else if(K instanceof an){if("eager"===this.urlUpdateStrategy){if(!Me.extras.skipLocationChange){const Ge=this.urlHandlingStrategy.merge(Me.urlAfterRedirects,Me.rawUrl);this.setBrowserUrl(Ge,Me)}this.browserUrlTree=Me.urlAfterRedirects}}else if(K instanceof co)this.currentUrlTree=Me.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(Me.urlAfterRedirects,Me.rawUrl),this.routerState=Me.targetRouterState,"deferred"===this.urlUpdateStrategy&&(Me.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,Me),this.browserUrlTree=Me.urlAfterRedirects);else if(K instanceof fe)0!==K.code&&1!==K.code&&(this.navigated=!0),(3===K.code||2===K.code)&&this.restoreHistory(Me);else if(K instanceof uo){const Ge=this.urlHandlingStrategy.merge(K.url,Me.currentRawUrl),en={skipLocationChange:Me.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||sr(Me.source)};this.scheduleNavigation(Ge,Xn,null,en,{resolve:Me.resolve,reject:Me.reject,promise:Me.promise})}K instanceof lt&&this.restoreHistory(Me,!0),K instanceof we&&(this.navigated=!0),zo(K)&&this._events.next(K)}catch(Me){this.navigationTransitions.transitionAbortSubject.next(Me)}});this.eventsSubscription.add(z)}resetRootComponentType(z){this.routerState.root.component=z,this.navigationTransitions.rootComponentType=z}initialNavigation(){if(this.setUpLocationChangeListener(),!this.navigationTransitions.hasRequestedNavigation){const z=this.location.getState();this.navigateToSyncWithBrowser(this.location.path(!0),Xn,z)}}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(z=>{const K="popstate"===z.type?"popstate":"hashchange";"popstate"===K&&setTimeout(()=>{this.navigateToSyncWithBrowser(z.url,K,z.state)},0)}))}navigateToSyncWithBrowser(z,K,Me){const Ge={replaceUrl:!0},en=Me?.navigationId?Me:null;if(Me){const xn={...Me};delete xn.navigationId,delete xn.\u0275routerPageId,0!==Object.keys(xn).length&&(Ge.state=xn)}const $n=this.parseUrl(z);this.scheduleNavigation($n,K,en,Ge)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(z){this.config=z.map(ia),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(z,K={}){const{relativeTo:Me,queryParams:Ge,fragment:en,queryParamsHandling:$n,preserveFragment:xn}=K,Oi=xn?this.currentUrlTree.fragment:en;let po,ar=null;switch($n){case"merge":ar={...this.currentUrlTree.queryParams,...Ge};break;case"preserve":ar=this.currentUrlTree.queryParams;break;default:ar=Ge||null}null!==ar&&(ar=this.removeEmptyProps(ar));try{po=gi(Me?Me.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof z[0]||!z[0].startsWith("/"))&&(z=[]),po=this.currentUrlTree.root}return _i(po,z,ar,Oi??null)}navigateByUrl(z,K={skipLocationChange:!1}){const Me=En(z)?z:this.parseUrl(z),Ge=this.urlHandlingStrategy.merge(Me,this.rawUrlTree);return this.scheduleNavigation(Ge,Xn,null,K)}navigate(z,K={skipLocationChange:!1}){return function Cl(R){for(let U=0;U{const Ge=z[Me];return null!=Ge&&(K[Me]=Ge),K},{})}scheduleNavigation(z,K,Me,Ge,en){if(this.disposed)return Promise.resolve(!1);let $n,xn,Oi;en?($n=en.resolve,xn=en.reject,Oi=en.promise):Oi=new Promise((po,f)=>{$n=po,xn=f});const ar=this.pendingTasks.add();return Ys(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(ar))}),this.navigationTransitions.handleNavigationRequest({source:K,restoredState:Me,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,currentBrowserUrl:this.browserUrlTree,rawUrl:z,extras:Ge,resolve:$n,reject:xn,promise:Oi,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),Oi.catch(po=>Promise.reject(po))}setBrowserUrl(z,K){const Me=this.urlSerializer.serialize(z);if(this.location.isCurrentPathEqualTo(Me)||K.extras.replaceUrl){const en={...K.extras.state,...this.generateNgRouterState(K.id,this.browserPageId)};this.location.replaceState(Me,"",en)}else{const Ge={...K.extras.state,...this.generateNgRouterState(K.id,this.browserPageId+1)};this.location.go(Me,"",Ge)}}restoreHistory(z,K=!1){if("computed"===this.canceledNavigationResolution){const Ge=this.currentPageId-this.browserPageId;0!==Ge?this.location.historyGo(Ge):this.currentUrlTree===this.getCurrentNavigation()?.finalUrl&&0===Ge&&(this.resetState(z),this.browserUrlTree=z.currentUrlTree,this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(K&&this.resetState(z),this.resetUrlToCurrentUrlTree())}resetState(z){this.routerState=z.currentRouterState,this.currentUrlTree=z.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,z.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(z,K){return"computed"===this.canceledNavigationResolution?{navigationId:z,\u0275routerPageId:K}:{navigationId:z}}}return(R=U).\u0275fac=function(z){return new(z||R)},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();function zo(R){return!(R instanceof co||R instanceof uo)}let Za=(()=>{var R;class U{constructor(z,K,Me,Ge,en,$n){this.router=z,this.route=K,this.tabIndexAttribute=Me,this.renderer=Ge,this.el=en,this.locationStrategy=$n,this.href=null,this.commands=null,this.onChanges=new le.x,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;const xn=en.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===xn||"area"===xn,this.isAnchorElement?this.subscription=z.events.subscribe(Oi=>{Oi instanceof we&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(z){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",z)}ngOnChanges(z){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(z){null!=z?(this.commands=Array.isArray(z)?z:[z],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(z,K,Me,Ge,en){return!!(null===this.urlTree||this.isAnchorElement&&(0!==z||K||Me||Ge||en||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(this.urlTree,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){this.href=null!==this.urlTree&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(this.urlTree)):null;const z=null===this.href?null:(0,x.P3R)(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",z)}applyAttributeValue(z,K){const Me=this.renderer,Ge=this.el.nativeElement;null!==K?Me.setAttribute(Ge,z,K):Me.removeAttribute(Ge,z)}get urlTree(){return null===this.commands?null:this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}}return(R=U).\u0275fac=function(z){return new(z||R)(x.Y36(es),x.Y36(Po),x.$8M("tabindex"),x.Y36(x.Qsj),x.Y36(x.SBq),x.Y36(ue.S$))},R.\u0275dir=x.lG2({type:R,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(z,K){1&z&&x.NdJ("click",function(Ge){return K.onClick(Ge.button,Ge.ctrlKey,Ge.shiftKey,Ge.altKey,Ge.metaKey)}),2&z&&x.uIk("target",K.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",relativeTo:"relativeTo",preserveFragment:["preserveFragment","preserveFragment",x.VuI],skipLocationChange:["skipLocationChange","skipLocationChange",x.VuI],replaceUrl:["replaceUrl","replaceUrl",x.VuI],routerLink:"routerLink"},standalone:!0,features:[x.Xq5,x.TTD]}),U})();class _c{}let El=(()=>{var R;class U{constructor(z,K,Me,Ge,en){this.router=z,this.injector=Me,this.preloadingStrategy=Ge,this.loader=en}setUpPreloading(){this.subscription=this.router.events.pipe((0,De.h)(z=>z instanceof we),(0,Ht.b)(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(z,K){const Me=[];for(const Ge of K){Ge.providers&&!Ge._injector&&(Ge._injector=(0,x.MMx)(Ge.providers,z,`Route: ${Ge.path}`));const en=Ge._injector??z,$n=Ge._loadedInjector??en;(Ge.loadChildren&&!Ge._loadedRoutes&&void 0===Ge.canLoad||Ge.loadComponent&&!Ge._loadedComponent)&&Me.push(this.preloadConfig(en,Ge)),(Ge.children||Ge._loadedRoutes)&&Me.push(this.processRoutes($n,Ge.children??Ge._loadedRoutes))}return(0,y.D)(Me).pipe((0,kt.J)())}preloadConfig(z,K){return this.preloadingStrategy.preload(K,()=>{let Me;Me=K.loadChildren&&void 0===K.canLoad?this.loader.loadChildren(z,K):(0,s.of)(null);const Ge=Me.pipe((0,Pe.z)(en=>null===en?(0,s.of)(void 0):(K._loadedRoutes=en.routes,K._loadedInjector=en.injector,this.processRoutes(en.injector??z,en.routes))));if(K.loadComponent&&!K._loadedComponent){const en=this.loader.loadComponent(K);return(0,y.D)([Ge,en]).pipe((0,kt.J)())}return Ge})}}return(R=U).\u0275fac=function(z){return new(z||R)(x.LFG(es),x.LFG(x.Sil),x.LFG(x.lqb),x.LFG(_c),x.LFG(ri))},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac,providedIn:"root"}),U})();const Tl=new x.OlP("");let rl=(()=>{var R;class U{constructor(z,K,Me,Ge,en={}){this.urlSerializer=z,this.transitions=K,this.viewportScroller=Me,this.zone=Ge,this.options=en,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},en.scrollPositionRestoration=en.scrollPositionRestoration||"disabled",en.anchorScrolling=en.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(z=>{z instanceof Si?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=z.navigationTrigger,this.restoredId=z.restoredState?z.restoredState.navigationId:0):z instanceof we?(this.lastId=z.id,this.scheduleScrollEvent(z,this.urlSerializer.parse(z.urlAfterRedirects).fragment)):z instanceof je&&0===z.code&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(z,this.urlSerializer.parse(z.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(z=>{z instanceof Nr&&(z.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(z.position):z.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(z.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(z,K){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new Nr(z,"popstate"===this.lastSource?this.store[this.restoredId]:null,K))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}}return(R=U).\u0275fac=function(z){x.$Z()},R.\u0275prov=x.Yz7({token:R,factory:R.\u0275fac}),U})();function aa(R,U){return{\u0275kind:R,\u0275providers:U}}function sl(){const R=(0,x.f3M)(x.zs3);return U=>{const $=R.get(x.z2F);if(U!==$.components[0])return;const z=R.get(es),K=R.get(Gl);1===R.get(Uo)&&z.initialNavigation(),R.get(Hl,null,x.XFs.Optional)?.setUpPreloading(),R.get(Tl,null,x.XFs.Optional)?.init(),z.resetRootComponentType($.componentTypes[0]),K.closed||(K.next(),K.complete(),K.unsubscribe())}}const Gl=new x.OlP("",{factory:()=>new le.x}),Uo=new x.OlP("",{providedIn:"root",factory:()=>1}),Hl=new x.OlP("");function vc(R){return aa(0,[{provide:Hl,useExisting:El},{provide:_c,useExisting:R}])}const ts=new x.OlP("ROUTER_FORROOT_GUARD"),Il=[ue.Ye,{provide:ve,useClass:Xe},es,To,{provide:Po,useFactory:function ol(R){return R.routerState.root},deps:[es]},ri,[]];function pa(){return new x.PXZ("Router",es)}let Cd=(()=>{var R;class U{constructor(z){}static forRoot(z,K){return{ngModule:U,providers:[Il,[],{provide:cn,multi:!0,useValue:z},{provide:ts,useFactory:Yc,deps:[[es,new x.FiY,new x.tp0]]},{provide:ss,useValue:K||{}},K?.useHash?{provide:ue.S$,useClass:ue.Do}:{provide:ue.S$,useClass:ue.b0},{provide:Tl,useFactory:()=>{const R=(0,x.f3M)(ue.EM),U=(0,x.f3M)(x.R0b),$=(0,x.f3M)(ss),z=(0,x.f3M)(pr),K=(0,x.f3M)(ve);return $.scrollOffset&&R.setOffset($.scrollOffset),new rl(K,z,R,U,$)}},K?.preloadingStrategy?vc(K.preloadingStrategy).\u0275providers:[],{provide:x.PXZ,multi:!0,useFactory:pa},K?.initialNavigation?js(K):[],K?.bindToComponentInputs?aa(8,[br,{provide:ko,useExisting:br}]).\u0275providers:[],[{provide:Xs,useFactory:sl},{provide:x.tb,multi:!0,useExisting:Xs}]]}}static forChild(z){return{ngModule:U,providers:[{provide:cn,multi:!0,useValue:z}]}}}return(R=U).\u0275fac=function(z){return new(z||R)(x.LFG(ts,8))},R.\u0275mod=x.oAB({type:R}),R.\u0275inj=x.cJS({}),U})();function Yc(R){return"guarded"}function js(R){return["disabled"===R.initialNavigation?aa(3,[{provide:x.ip1,multi:!0,useFactory:()=>{const U=(0,x.f3M)(es);return()=>{U.setUpLocationChangeListener()}}},{provide:Uo,useValue:2}]).\u0275providers:[],"enabledBlocking"===R.initialNavigation?aa(2,[{provide:Uo,useValue:0},{provide:x.ip1,multi:!0,deps:[x.zs3],useFactory:U=>{const $=U.get(ue.V_,Promise.resolve());return()=>$.then(()=>new Promise(z=>{const K=U.get(es),Me=U.get(Gl);Ys(K,()=>{z(!0)}),U.get(pr).afterPreactivation=()=>(z(!0),Me.closed?(0,s.of)(void 0):Me),K.initialNavigation()}))}}]).\u0275providers:[]]}const Xs=new x.OlP("")},9843:(Nn,yt,k)=>{"use strict";k.d(yt,{BX:()=>Cs,Br:()=>or,w:()=>Zt,dr:()=>vt,BJ:()=>ln,oU:()=>ni,cs:()=>Xo,yp:()=>lr,YG:()=>Cn,Sm:()=>Mn,PM:()=>qn,FN:()=>yn,Zi:()=>_n,hM:()=>ve,wI:()=>Xe,W2:()=>ft,IJ:()=>jt,W4:()=>Et,zq:()=>Xt,fr:()=>Sn,jY:()=>zn,Gu:()=>pe,gu:()=>ze,pK:()=>Pt,Ie:()=>bn,Q$:()=>Lt,q_:()=>st,yh:()=>pn,Uj:()=>hr,z0:()=>En,fG:()=>ti,zc:()=>gi,yf:()=>Qo,uN:()=>bi,I_:()=>qi,nJ:()=>Bi,Wo:()=>Kt,jP:()=>br,Nd:()=>xr,VI:()=>Sr,cJ:()=>Go,GO:()=>Eo,t9:()=>to,n0:()=>Xn,PQ:()=>Si,jI:()=>we,g2:()=>an,Bs:()=>Vt,wd:()=>vn,ho:()=>In,sr:()=>Fn,Pc:()=>ki,r4:()=>yo,HT:()=>Qa,IN:()=>Ur,SH:()=>co,X1:()=>To,as:()=>Jt,t4:()=>vr,YI:()=>Br,QI:()=>dt,j9:()=>Ot,yF:()=>Do});var x=k(5861),h=k(2029),y=k(6223),s=k(7582),J=k(2438),ie=k(8645),Y=k(5619),C=k(2572),Ne=k(2096),me=k(6800),oe=(k(1774),k(2650),k(1904),k(9203),k(2085)),Be=k(839),Ie=k(3365),Ee=k(1651),et=(k(5662),k(4988)),ct=(k(6225),k(619),k(1688)),Le=k(2181),ye=k(4664),gt=k(3997),De=k(6814);const Ae=oe.i,_t=["*"],Fe=v=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(v):"function"==typeof requestAnimationFrame?requestAnimationFrame(v):setTimeout(v);let St=(()=>{class v{constructor(D,A){this.injector=D,this.el=A,this.onChange=()=>{},this.onTouched=()=>{}}writeValue(D){this.el.nativeElement.value=this.lastValue=D,Ce(this.el)}handleValueChange(D,A){D===this.el.nativeElement&&(A!==this.lastValue&&(this.lastValue=A,this.onChange(A)),Ce(this.el))}_handleBlurEvent(D){D===this.el.nativeElement&&(this.onTouched(),Ce(this.el))}registerOnChange(D){this.onChange=D}registerOnTouched(D){this.onTouched=D}setDisabledState(D){this.el.nativeElement.disabled=D}ngOnDestroy(){this.statusChanges&&this.statusChanges.unsubscribe()}ngAfterViewInit(){let D;try{D=this.injector.get(y.a5)}catch{}if(!D)return;D.statusChanges&&(this.statusChanges=D.statusChanges.subscribe(()=>Ce(this.el)));const A=D.control;A&&["markAsTouched","markAllAsTouched","markAsUntouched","markAsDirty","markAsPristine"].forEach(It=>{if(typeof A[It]<"u"){const Yn=A[It].bind(A);A[It]=(...pi)=>{Yn(...pi),Ce(this.el)}}})}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,hostBindings:function(D,A){1&D&&h.NdJ("ionBlur",function(It){return A._handleBlurEvent(It.target)})}}),v})();const Ce=v=>{Fe(()=>{const M=v.nativeElement,D=null!=M.value&&M.value.toString().length>0,A=Rt(M);Qt(M,A);const G=M.closest("ion-item");G&&Qt(G,D?[...A,"item-has-value"]:A)})},Rt=v=>{const M=v.classList,D=[];for(let A=0;A{const D=v.classList;D.remove("ion-valid","ion-invalid","ion-touched","ion-untouched","ion-dirty","ion-pristine"),D.add(...M)},Gt=(v,M)=>v.substring(0,M.length)===M;let Zt=(()=>{class v extends St{constructor(D,A){super(D,A)}writeValue(D){this.el.nativeElement.checked=this.lastValue=D,Ce(this.el)}_handleIonChange(D){this.handleValueChange(D,D.checked)}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-checkbox"],["ion-toggle"]],hostBindings:function(D,A){1&D&&h.NdJ("ionChange",function(It){return A._handleIonChange(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})(),Jt=(()=>{class v extends St{constructor(D,A){super(D,A)}handleInputEvent(D){this.handleValueChange(D,D.value)}registerOnChange(D){super.registerOnChange(A=>{D(""===A?null:parseFloat(A))})}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-input","type","number"]],hostBindings:function(D,A){1&D&&h.NdJ("ionInput",function(It){return A.handleInputEvent(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})(),dt=(()=>{class v extends St{constructor(D,A){super(D,A)}_handleChangeEvent(D){this.handleValueChange(D,D.value)}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-range"],["ion-select"],["ion-radio-group"],["ion-segment"],["ion-datetime"]],hostBindings:function(D,A){1&D&&h.NdJ("ionChange",function(It){return A._handleChangeEvent(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})(),Ot=(()=>{class v extends St{constructor(D,A){super(D,A)}_handleInputEvent(D){this.handleValueChange(D,D.value)}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.zs3),h.Y36(h.SBq))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-input",3,"type","number"],["ion-textarea"],["ion-searchbar"]],hostBindings:function(D,A){1&D&&h.NdJ("ionInput",function(It){return A._handleInputEvent(It.target)})},features:[h._Bn([{provide:y.JU,useExisting:v,multi:!0}]),h.qOj]}),v})();const pt=(v,M)=>{const D=v.prototype;M.forEach(A=>{Object.defineProperty(D,A,{get(){return this.el[A]},set(G){this.z.runOutsideAngular(()=>this.el[A]=G)}})})},Yt=(v,M)=>{const D=v.prototype;M.forEach(A=>{D[A]=function(){const G=arguments;return this.z.runOutsideAngular(()=>this.el[A].apply(this.el,G))}})},Ut=(v,M,D)=>{D.forEach(A=>v[A]=(0,J.R)(M,A))};function gn(v){return function(D){const{defineCustomElementFn:A,inputs:G,methods:It}=v;return void 0!==A&&A(),G&&pt(D,G),It&&Yt(D,It),D}}let vt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-app"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),ln=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-avatar"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),ni=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-back-button"]],inputs:{color:"color",defaultHref:"defaultHref",disabled:"disabled",icon:"icon",mode:"mode",routerAnimation:"routerAnimation",text:"text",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","defaultHref","disabled","icon","mode","routerAnimation","text","type"]})],v),v})(),lr=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-badge"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode"]})],v),v})(),Cn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-button"]],inputs:{buttonType:"buttonType",color:"color",disabled:"disabled",download:"download",expand:"expand",fill:"fill",form:"form",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",shape:"shape",size:"size",strong:"strong",target:"target",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["buttonType","color","disabled","download","expand","fill","form","href","mode","rel","routerAnimation","routerDirection","shape","size","strong","target","type"]})],v),v})(),Mn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-buttons"]],inputs:{collapse:"collapse"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["collapse"]})],v),v})(),qn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-card"]],inputs:{button:"button",color:"color",disabled:"disabled",download:"download",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",target:"target",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["button","color","disabled","download","href","mode","rel","routerAnimation","routerDirection","target","type"]})],v),v})(),yn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-card-content"]],inputs:{mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["mode"]})],v),v})(),_n=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-card-header"]],inputs:{color:"color",mode:"mode",translucent:"translucent"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode","translucent"]})],v),v})(),ve=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-chip"]],inputs:{color:"color",disabled:"disabled",mode:"mode",outline:"outline"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","disabled","mode","outline"]})],v),v})(),Xe=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-col"]],inputs:{offset:"offset",offsetLg:"offsetLg",offsetMd:"offsetMd",offsetSm:"offsetSm",offsetXl:"offsetXl",offsetXs:"offsetXs",pull:"pull",pullLg:"pullLg",pullMd:"pullMd",pullSm:"pullSm",pullXl:"pullXl",pullXs:"pullXs",push:"push",pushLg:"pushLg",pushMd:"pushMd",pushSm:"pushSm",pushXl:"pushXl",pushXs:"pushXs",size:"size",sizeLg:"sizeLg",sizeMd:"sizeMd",sizeSm:"sizeSm",sizeXl:"sizeXl",sizeXs:"sizeXs"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["offset","offsetLg","offsetMd","offsetSm","offsetXl","offsetXs","pull","pullLg","pullMd","pullSm","pullXl","pullXs","push","pushLg","pushMd","pushSm","pushXl","pushXs","size","sizeLg","sizeMd","sizeSm","sizeXl","sizeXs"]})],v),v})(),ft=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionScrollStart","ionScroll","ionScrollEnd"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-content"]],inputs:{color:"color",forceOverscroll:"forceOverscroll",fullscreen:"fullscreen",scrollEvents:"scrollEvents",scrollX:"scrollX",scrollY:"scrollY"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","forceOverscroll","fullscreen","scrollEvents","scrollX","scrollY"],methods:["getScrollElement","scrollToTop","scrollToBottom","scrollByPoint","scrollToPoint"]})],v),v})(),jt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-fab"]],inputs:{activated:"activated",edge:"edge",horizontal:"horizontal",vertical:"vertical"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activated","edge","horizontal","vertical"],methods:["close"]})],v),v})(),Et=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-fab-button"]],inputs:{activated:"activated",closeIcon:"closeIcon",color:"color",disabled:"disabled",download:"download",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",show:"show",size:"size",target:"target",translucent:"translucent",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activated","closeIcon","color","disabled","download","href","mode","rel","routerAnimation","routerDirection","show","size","target","translucent","type"]})],v),v})(),Xt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-fab-list"]],inputs:{activated:"activated",side:"side"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activated","side"]})],v),v})(),Sn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-footer"]],inputs:{collapse:"collapse",mode:"mode",translucent:"translucent"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["collapse","mode","translucent"]})],v),v})(),zn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-grid"]],inputs:{fixed:"fixed"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["fixed"]})],v),v})(),pe=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-header"]],inputs:{collapse:"collapse",mode:"mode",translucent:"translucent"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["collapse","mode","translucent"]})],v),v})(),ze=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-icon"]],inputs:{color:"color",flipRtl:"flipRtl",icon:"icon",ios:"ios",lazy:"lazy",md:"md",mode:"mode",name:"name",sanitize:"sanitize",size:"size",src:"src"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","flipRtl","icon","ios","lazy","md","mode","name","sanitize","size","src"]})],v),v})(),Pt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionInput","ionChange","ionBlur","ionFocus"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-input"]],inputs:{accept:"accept",autocapitalize:"autocapitalize",autocomplete:"autocomplete",autocorrect:"autocorrect",autofocus:"autofocus",clearInput:"clearInput",clearOnEdit:"clearOnEdit",color:"color",counter:"counter",counterFormatter:"counterFormatter",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",errorText:"errorText",fill:"fill",helperText:"helperText",inputmode:"inputmode",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",max:"max",maxlength:"maxlength",min:"min",minlength:"minlength",mode:"mode",multiple:"multiple",name:"name",pattern:"pattern",placeholder:"placeholder",readonly:"readonly",required:"required",shape:"shape",size:"size",spellcheck:"spellcheck",step:"step",type:"type",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["accept","autocapitalize","autocomplete","autocorrect","autofocus","clearInput","clearOnEdit","color","counter","counterFormatter","debounce","disabled","enterkeyhint","errorText","fill","helperText","inputmode","label","labelPlacement","legacy","max","maxlength","min","minlength","mode","multiple","name","pattern","placeholder","readonly","required","shape","size","spellcheck","step","type","value"],methods:["setFocus","getInputElement"]})],v),v})(),bn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-item"]],inputs:{button:"button",color:"color",counter:"counter",counterFormatter:"counterFormatter",detail:"detail",detailIcon:"detailIcon",disabled:"disabled",download:"download",fill:"fill",href:"href",lines:"lines",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",shape:"shape",target:"target",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["button","color","counter","counterFormatter","detail","detailIcon","disabled","download","fill","href","lines","mode","rel","routerAnimation","routerDirection","shape","target","type"]})],v),v})(),Lt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-label"]],inputs:{color:"color",mode:"mode",position:"position"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode","position"]})],v),v})(),st=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-list"]],inputs:{inset:"inset",lines:"lines",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["inset","lines","mode"],methods:["closeSlidingItems"]})],v),v})(),pn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-list-header"]],inputs:{color:"color",lines:"lines",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","lines","mode"]})],v),v})(),En=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionWillOpen","ionWillClose","ionDidOpen","ionDidClose"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-menu"]],inputs:{contentId:"contentId",disabled:"disabled",maxEdgeStart:"maxEdgeStart",menuId:"menuId",side:"side",swipeGesture:"swipeGesture",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["contentId","disabled","maxEdgeStart","menuId","side","swipeGesture","type"],methods:["isOpen","isActive","open","close","toggle","setOpen"]})],v),v})(),ti=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-menu-button"]],inputs:{autoHide:"autoHide",color:"color",disabled:"disabled",menu:"menu",mode:"mode",type:"type"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["autoHide","color","disabled","menu","mode","type"]})],v),v})(),gi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-menu-toggle"]],inputs:{autoHide:"autoHide",menu:"menu"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["autoHide","menu"]})],v),v})(),bi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-note"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode"]})],v),v})(),qi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionInput","ionFocus","ionBlur","ionKnobMoveStart","ionKnobMoveEnd"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-range"]],inputs:{activeBarStart:"activeBarStart",color:"color",debounce:"debounce",disabled:"disabled",dualKnobs:"dualKnobs",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",max:"max",min:"min",mode:"mode",name:"name",pin:"pin",pinFormatter:"pinFormatter",snaps:"snaps",step:"step",ticks:"ticks",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["activeBarStart","color","debounce","disabled","dualKnobs","label","labelPlacement","legacy","max","min","mode","name","pin","pinFormatter","snaps","step","ticks","value"]})],v),v})(),Bi=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionRefresh","ionPull","ionStart"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-refresher"]],inputs:{closeDuration:"closeDuration",disabled:"disabled",pullFactor:"pullFactor",pullMax:"pullMax",pullMin:"pullMin",snapbackDuration:"snapbackDuration"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["closeDuration","disabled","pullFactor","pullMax","pullMin","snapbackDuration"],methods:["complete","cancel","getProgress"]})],v),v})(),Kt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-refresher-content"]],inputs:{pullingIcon:"pullingIcon",pullingText:"pullingText",refreshingSpinner:"refreshingSpinner",refreshingText:"refreshingText"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["pullingIcon","pullingText","refreshingSpinner","refreshingText"]})],v),v})(),xr=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-row"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),Sr=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionInput","ionChange","ionCancel","ionClear","ionBlur","ionFocus"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-searchbar"]],inputs:{animated:"animated",autocomplete:"autocomplete",autocorrect:"autocorrect",cancelButtonIcon:"cancelButtonIcon",cancelButtonText:"cancelButtonText",clearIcon:"clearIcon",color:"color",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",inputmode:"inputmode",mode:"mode",name:"name",placeholder:"placeholder",searchIcon:"searchIcon",showCancelButton:"showCancelButton",showClearButton:"showClearButton",spellcheck:"spellcheck",type:"type",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["animated","autocomplete","autocorrect","cancelButtonIcon","cancelButtonText","clearIcon","color","debounce","disabled","enterkeyhint","inputmode","mode","name","placeholder","searchIcon","showCancelButton","showClearButton","spellcheck","type","value"],methods:["setFocus","getInputElement"]})],v),v})(),Go=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-segment"]],inputs:{color:"color",disabled:"disabled",mode:"mode",scrollable:"scrollable",selectOnFocus:"selectOnFocus",swipeGesture:"swipeGesture",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","disabled","mode","scrollable","selectOnFocus","swipeGesture","value"]})],v),v})(),Eo=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-segment-button"]],inputs:{disabled:"disabled",layout:"layout",mode:"mode",type:"type",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["disabled","layout","mode","type","value"]})],v),v})(),to=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionCancel","ionDismiss","ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-select"]],inputs:{cancelText:"cancelText",color:"color",compareWith:"compareWith",disabled:"disabled",expandedIcon:"expandedIcon",fill:"fill",interface:"interface",interfaceOptions:"interfaceOptions",justify:"justify",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",mode:"mode",multiple:"multiple",name:"name",okText:"okText",placeholder:"placeholder",selectedText:"selectedText",shape:"shape",toggleIcon:"toggleIcon",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["cancelText","color","compareWith","disabled","expandedIcon","fill","interface","interfaceOptions","justify","label","labelPlacement","legacy","mode","multiple","name","okText","placeholder","selectedText","shape","toggleIcon","value"],methods:["open"]})],v),v})(),Xn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-select-option"]],inputs:{disabled:"disabled",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["disabled","value"]})],v),v})(),Si=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-spinner"]],inputs:{color:"color",duration:"duration",name:"name",paused:"paused"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","duration","name","paused"]})],v),v})(),we=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionSplitPaneVisible"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-split-pane"]],inputs:{contentId:"contentId",disabled:"disabled",when:"when"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["contentId","disabled","when"]})],v),v})(),an=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionInput","ionBlur","ionFocus"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-textarea"]],inputs:{autoGrow:"autoGrow",autocapitalize:"autocapitalize",autofocus:"autofocus",clearOnEdit:"clearOnEdit",color:"color",cols:"cols",counter:"counter",counterFormatter:"counterFormatter",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",errorText:"errorText",fill:"fill",helperText:"helperText",inputmode:"inputmode",label:"label",labelPlacement:"labelPlacement",legacy:"legacy",maxlength:"maxlength",minlength:"minlength",mode:"mode",name:"name",placeholder:"placeholder",readonly:"readonly",required:"required",rows:"rows",shape:"shape",spellcheck:"spellcheck",value:"value",wrap:"wrap"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["autoGrow","autocapitalize","autofocus","clearOnEdit","color","cols","counter","counterFormatter","debounce","disabled","enterkeyhint","errorText","fill","helperText","inputmode","label","labelPlacement","legacy","maxlength","minlength","mode","name","placeholder","readonly","required","rows","shape","spellcheck","value","wrap"],methods:["setFocus","getInputElement"]})],v),v})(),Vt=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-thumbnail"]],ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({})],v),v})(),vn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-title"]],inputs:{color:"color",size:"size"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","size"]})],v),v})(),In=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement,Ut(this,this.el,["ionChange","ionFocus","ionBlur"])}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-toggle"]],inputs:{checked:"checked",color:"color",disabled:"disabled",enableOnOffLabels:"enableOnOffLabels",justify:"justify",labelPlacement:"labelPlacement",legacy:"legacy",mode:"mode",name:"name",value:"value"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["checked","color","disabled","enableOnOffLabels","justify","labelPlacement","legacy","mode","name","value"]})],v),v})(),Fn=(()=>{let v=class{constructor(D,A,G){this.z=G,D.detach(),this.el=A.nativeElement}};return v.\u0275fac=function(D){return new(D||v)(h.Y36(h.sBO),h.Y36(h.SBq),h.Y36(h.R0b))},v.\u0275cmp=h.Xpm({type:v,selectors:[["ion-toolbar"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:_t,decls:1,vars:0,template:function(D,A){1&D&&(h.F$t(),h.Hsn(0))},encapsulation:2,changeDetection:0}),v=(0,s.gn)([gn({inputs:["color","mode"]})],v),v})(),di=(()=>{class v{get(D,A){const G=Ni();return G?G.get(D,A):null}getBoolean(D,A){const G=Ni();return!!G&&G.getBoolean(D,A)}getNumber(D,A){const G=Ni();return G?G.getNumber(D,A):0}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();const Ai=new h.OlP("USERCONFIG"),Ni=()=>{if(typeof window<"u"){const v=window.Ionic;if(v?.config)return v.config}return null};let vr=(()=>{class v{constructor(D,A){this.doc=D,this.backButton=new ie.x,this.keyboardDidShow=new ie.x,this.keyboardDidHide=new ie.x,this.pause=new ie.x,this.resume=new ie.x,this.resize=new ie.x,A.run(()=>{let G;this.win=D.defaultView,this.backButton.subscribeWithPriority=function(It,Yn){return this.subscribe(pi=>pi.register(It,tr=>A.run(()=>Yn(tr))))},Nr(this.pause,D,"pause"),Nr(this.resume,D,"resume"),Nr(this.backButton,D,"ionBackButton"),Nr(this.resize,this.win,"resize"),Nr(this.keyboardDidShow,this.win,"ionKeyboardDidShow"),Nr(this.keyboardDidHide,this.win,"ionKeyboardDidHide"),this._readyPromise=new Promise(It=>{G=It}),this.win?.cordova?D.addEventListener("deviceready",()=>{G("cordova")},{once:!0}):G("dom")})}is(D){return(0,oe.a)(this.win,D)}platforms(){return(0,oe.g)(this.win)}ready(){return this._readyPromise}get isRTL(){return"rtl"===this.doc.dir}getQueryParam(D){return go(this.win.location.href,D)}isLandscape(){return!this.isPortrait()}isPortrait(){return this.win.matchMedia?.("(orientation: portrait)").matches}testUserAgent(D){const A=this.win.navigator;return!!(A?.userAgent&&A.userAgent.indexOf(D)>=0)}url(){return this.win.location.href}width(){return this.win.innerWidth}height(){return this.win.innerHeight}}return v.\u0275fac=function(D){return new(D||v)(h.LFG(De.K0),h.LFG(h.R0b))},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();const go=(v,M)=>{M=M.replace(/[[\]\\]/g,"\\$&");const A=new RegExp("[\\?&]"+M+"=([^&#]*)").exec(v);return A?decodeURIComponent(A[1].replace(/\+/g," ")):null},Nr=(v,M,D)=>{M&&M.addEventListener(D,A=>{const G=A?.detail;v.next(G)})};let co=(()=>{class v{constructor(D,A,G,It){this.location=A,this.serializer=G,this.router=It,this.direction=Jr,this.animated=kr,this.guessDirection="forward",this.lastNavId=-1,It&&It.events.subscribe(Yn=>{if(Yn instanceof me.OD){const pi=Yn.restoredState?Yn.restoredState.navigationId:Yn.id;this.guessDirection=pi{this.pop(),Yn()})}navigateForward(D,A={}){return this.setDirection("forward",A.animated,A.animationDirection,A.animation),this.navigate(D,A)}navigateBack(D,A={}){return this.setDirection("back",A.animated,A.animationDirection,A.animation),this.navigate(D,A)}navigateRoot(D,A={}){return this.setDirection("root",A.animated,A.animationDirection,A.animation),this.navigate(D,A)}back(D={animated:!0,animationDirection:"back"}){return this.setDirection("back",D.animated,D.animationDirection,D.animation),this.location.back()}pop(){var D=this;return(0,x.Z)(function*(){let A=D.topOutlet;for(;A;){if(yield A.pop())return!0;A=A.parentOutlet}return!1})()}setDirection(D,A,G,It){this.direction=D,this.animated=uo(D,A,G),this.animationBuilder=It}setTopOutlet(D){this.topOutlet=D}consumeTransition(){let A,D="root";const G=this.animationBuilder;return"auto"===this.direction?(D=this.guessDirection,A=this.guessAnimation):(A=this.animated,D=this.direction),this.direction=Jr,this.animated=kr,this.animationBuilder=void 0,{direction:D,animation:A,animationBuilder:G}}navigate(D,A){if(Array.isArray(D))return this.router.navigate(D,A);{const G=this.serializer.parse(D.toString());return void 0!==A.queryParams&&(G.queryParams={...A.queryParams}),void 0!==A.fragment&&(G.fragment=A.fragment),this.router.navigateByUrl(G,A)}}}return v.\u0275fac=function(D){return new(D||v)(h.LFG(vr),h.LFG(De.Ye),h.LFG(me.Hx),h.LFG(me.F0,8))},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();const uo=(v,M,D)=>{if(!1!==M){if(void 0!==D)return D;if("forward"===v||"back"===v)return v;if("root"===v&&!0===M)return"forward"}},Jr="auto",kr=void 0;class To{constructor(M={}){this.data=M}get(M){return this.data[M]}}let ds=(()=>{class v{constructor(){this.zone=(0,h.f3M)(h.R0b),this.applicationRef=(0,h.f3M)(h.z2F)}create(D,A,G){return new xo(D,A,this.applicationRef,this.zone,G)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})();class xo{constructor(M,D,A,G,It){this.environmentInjector=M,this.injector=D,this.applicationRef=A,this.zone=G,this.elementReferenceKey=It,this.elRefMap=new WeakMap,this.elEventsMap=new WeakMap}attachViewToDom(M,D,A,G){return this.zone.run(()=>new Promise(It=>{const Yn={...A};void 0!==this.elementReferenceKey&&(Yn[this.elementReferenceKey]=M),It(zi(this.zone,this.environmentInjector,this.injector,this.applicationRef,this.elRefMap,this.elEventsMap,M,D,Yn,G,this.elementReferenceKey))}))}removeViewFromDom(M,D){return this.zone.run(()=>new Promise(A=>{const G=this.elRefMap.get(D);if(G){G.destroy(),this.elRefMap.delete(D);const It=this.elEventsMap.get(D);It&&(It(),this.elEventsMap.delete(D))}A()}))}}const zi=(v,M,D,A,G,It,Yn,pi,tr,Zr,Mo)=>{const oa=h.zs3.create({providers:so(tr),parent:D}),Es=(0,h.LMc)(pi,{environmentInjector:M,elementInjector:oa}),ks=Es.instance,Fa=Es.location.nativeElement;if(tr&&(Mo&&void 0!==ks[Mo]&&console.error(`[Ionic Error]: ${Mo} is a reserved property when using ${Yn.tagName.toLowerCase()}. Rename or remove the "${Mo}" property from ${pi.name}.`),Object.assign(ks,tr)),Zr)for(const da of Zr)Fa.classList.add(da);const tl=Or(v,ks,Fa);return Yn.appendChild(Fa),A.attachView(Es.hostView),G.set(Fa,Es),It.set(Fa,tl),Fa},Fr=[Ee.L,Ee.a,Ee.b,Ee.c,Ee.d],Or=(v,M,D)=>v.run(()=>{const A=Fr.filter(G=>"function"==typeof M[G]).map(G=>{const It=Yn=>M[G](Yn.detail);return D.addEventListener(G,It),()=>D.removeEventListener(G,It)});return()=>A.forEach(G=>G())}),Er=new h.OlP("NavParamsToken"),so=v=>[{provide:Er,useValue:v},{provide:To,useFactory:Gs,deps:[Er]}],Gs=v=>new To(v),Hr=(v,M)=>((v=v.filter(D=>D.stackId!==M.stackId)).push(M),v),gr=(v,M)=>{const D=v.createUrlTree(["."],{relativeTo:M});return v.serializeUrl(D)},li=(v,M)=>!M||v.stackId!==M.stackId,Zi=(v,M)=>{if(!v)return;const D=Rr(M);for(let A=0;A=v.length)return D[A];if(D[A]!==v[A])return}},Rr=v=>v.split("/").map(M=>M.trim()).filter(M=>""!==M),_o=v=>{v&&(v.ref.destroy(),v.unlistenEvents())};class rs{constructor(M,D,A,G,It,Yn){this.containerEl=D,this.router=A,this.navCtrl=G,this.zone=It,this.location=Yn,this.views=[],this.skipTransition=!1,this.nextId=0,this.tabsPrefix=void 0!==M?Rr(M):void 0}createView(M,D){const A=gr(this.router,D),G=M?.location?.nativeElement,It=Or(this.zone,M.instance,G);return{id:this.nextId++,stackId:Zi(this.tabsPrefix,A),unlistenEvents:It,element:G,ref:M,url:A}}getExistingView(M){const D=gr(this.router,M),A=this.views.find(G=>G.url===D);return A&&A.ref.changeDetectorRef.reattach(),A}setActive(M){const D=this.navCtrl.consumeTransition();let{direction:A,animation:G,animationBuilder:It}=D;const Yn=this.activeView,pi=li(M,Yn);pi&&(A="back",G=void 0);const tr=this.views.slice();let Zr;const Mo=this.router;Mo.getCurrentNavigation?Zr=Mo.getCurrentNavigation():Mo.navigations?.value&&(Zr=Mo.navigations.value),Zr?.extras?.replaceUrl&&this.views.length>0&&this.views.splice(-1,1);const oa=this.views.includes(M),Es=this.insertView(M,A);oa||M.ref.changeDetectorRef.detectChanges();const ks=M.animationBuilder;return void 0===It&&"back"===A&&!pi&&void 0!==ks&&(It=ks),Yn&&(Yn.animationBuilder=It),this.zone.runOutsideAngular(()=>this.wait(()=>(Yn&&Yn.ref.changeDetectorRef.detach(),M.ref.changeDetectorRef.reattach(),this.transition(M,Yn,G,this.canGoBack(1),!1,It).then(()=>zr(M,Es,tr,this.location,this.zone)).then(()=>({enteringView:M,direction:A,animation:G,tabSwitch:pi})))))}canGoBack(M,D=this.getActiveStackId()){return this.getStack(D).length>M}pop(M,D=this.getActiveStackId()){return this.zone.run(()=>{const A=this.getStack(D);if(A.length<=M)return Promise.resolve(!1);const G=A[A.length-M-1];let It=G.url;const Yn=G.savedData;if(Yn){const tr=Yn.get("primary");tr?.route?._routerState?.snapshot.url&&(It=tr.route._routerState.snapshot.url)}const{animationBuilder:pi}=this.navCtrl.consumeTransition();return this.navCtrl.navigateBack(It,{...G.savedExtras,animation:pi}).then(()=>!0)})}startBackTransition(){const M=this.activeView;if(M){const D=this.getStack(M.stackId),A=D[D.length-2],G=A.animationBuilder;return this.wait(()=>this.transition(A,M,"back",this.canGoBack(2),!0,G))}return Promise.resolve()}endBackTransition(M){M?(this.skipTransition=!0,this.pop(1)):this.activeView&&ko(this.activeView,this.views,this.views,this.location,this.zone)}getLastUrl(M){const D=this.getStack(M);return D.length>0?D[D.length-1]:void 0}getRootUrl(M){const D=this.getStack(M);return D.length>0?D[0]:void 0}getActiveStackId(){return this.activeView?this.activeView.stackId:void 0}getActiveView(){return this.activeView}hasRunningTask(){return void 0!==this.runningTask}destroy(){this.containerEl=void 0,this.views.forEach(_o),this.activeView=void 0,this.views=[]}getStack(M){return this.views.filter(D=>D.stackId===M)}insertView(M,D){return this.activeView=M,this.views=((v,M,D)=>"root"===D?Hr(v,M):"forward"===D?((v,M)=>(v.indexOf(M)>=0?v=v.filter(A=>A.stackId!==M.stackId||A.id<=M.id):v.push(M),v))(v,M):((v,M)=>v.indexOf(M)>=0?v.filter(A=>A.stackId!==M.stackId||A.id<=M.id):Hr(v,M))(v,M))(this.views,M,D),this.views.slice()}transition(M,D,A,G,It,Yn){if(this.skipTransition)return this.skipTransition=!1,Promise.resolve(!1);if(D===M)return Promise.resolve(!1);const pi=M?M.element:void 0,tr=D?D.element:void 0,Zr=this.containerEl;return pi&&pi!==tr&&(pi.classList.add("ion-page"),pi.classList.add("ion-page-invisible"),pi.parentElement!==Zr&&Zr.appendChild(pi),Zr.commit)?Zr.commit(pi,tr,{duration:void 0===A?0:void 0,direction:A,showGoBack:G,progressAnimation:It,animationBuilder:Yn}):Promise.resolve(!1)}wait(M){var D=this;return(0,x.Z)(function*(){void 0!==D.runningTask&&(yield D.runningTask,D.runningTask=void 0);const A=D.runningTask=M();return A.finally(()=>D.runningTask=void 0),A})()}}const zr=(v,M,D,A,G)=>"function"==typeof requestAnimationFrame?new Promise(It=>{requestAnimationFrame(()=>{ko(v,M,D,A,G),It()})}):Promise.resolve(),ko=(v,M,D,A,G)=>{G.run(()=>D.filter(It=>!M.includes(It)).forEach(_o)),M.forEach(It=>{const pi=A.path().split("?")[0].split("#")[0];if(It!==v&&It.url!==pi){const tr=It.element;tr.setAttribute("aria-hidden","true"),tr.classList.add("ion-page-hidden"),It.ref.changeDetectorRef.detach()}})};let br=(()=>{class v{constructor(D,A,G,It,Yn,pi,tr,Zr){this.parentOutlet=Zr,this.activatedView=null,this.proxyMap=new WeakMap,this.currentActivatedRoute$=new Y.X(null),this.activated=null,this._activatedRoute=null,this.name=me.eC,this.stackWillChange=new h.vpe,this.stackDidChange=new h.vpe,this.activateEvents=new h.vpe,this.deactivateEvents=new h.vpe,this.parentContexts=(0,h.f3M)(me.y6),this.location=(0,h.f3M)(h.s_b),this.environmentInjector=(0,h.f3M)(h.lqb),this.inputBinder=(0,h.f3M)(Oo,{optional:!0}),this.supportsBindingToComponentInputs=!0,this.config=(0,h.f3M)(di),this.navCtrl=(0,h.f3M)(co),this.nativeEl=It.nativeElement,this.name=D||me.eC,this.tabsPrefix="true"===A?gr(Yn,tr):void 0,this.stackCtrl=new rs(this.tabsPrefix,this.nativeEl,Yn,this.navCtrl,pi,G),this.parentContexts.onChildOutletCreated(this.name,this)}get activatedComponentRef(){return this.activated}set animation(D){this.nativeEl.animation=D}set animated(D){this.nativeEl.animated=D}set swipeGesture(D){this._swipeGesture=D,this.nativeEl.swipeHandler=D?{canStart:()=>this.stackCtrl.canGoBack(1)&&!this.stackCtrl.hasRunningTask(),onStart:()=>this.stackCtrl.startBackTransition(),onEnd:A=>this.stackCtrl.endBackTransition(A)}:void 0}ngOnDestroy(){this.stackCtrl.destroy(),this.inputBinder?.unsubscribeFromRouteData(this)}getContext(){return this.parentContexts.getContext(this.name)}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(!this.activated){const D=this.getContext();D?.route&&this.activateWith(D.route,D.injector)}new Promise(D=>(0,Be.c)(this.nativeEl,D)).then(()=>{void 0===this._swipeGesture&&(this.swipeGesture=this.config.getBoolean("swipeBackEnabled","ios"===this.nativeEl.mode))})}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){throw new Error("incompatible reuse strategy")}attach(D,A){throw new Error("incompatible reuse strategy")}deactivate(){if(this.activated){if(this.activatedView){const A=this.getContext();this.activatedView.savedData=new Map(A.children.contexts);const G=this.activatedView.savedData.get("primary");if(G&&A.route&&(G.route={...A.route}),this.activatedView.savedExtras={},A.route){const It=A.route.snapshot;this.activatedView.savedExtras.queryParams=It.queryParams,this.activatedView.savedExtras.fragment=It.fragment}}const D=this.component;this.activatedView=null,this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(D)}}activateWith(D,A){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=D;let G,It=this.stackCtrl.getExistingView(D);if(It){G=this.activated=It.ref;const pi=It.savedData;pi&&(this.getContext().children.contexts=pi),this.updateActivatedRouteProxy(G.instance,D)}else{const pi=D._futureSnapshot,tr=this.parentContexts.getOrCreateContext(this.name).children,Zr=new Y.X(null),Mo=this.createActivatedRouteProxy(Zr,D),oa=new bo(Mo,tr,this.location.injector);G=this.activated=this.location.createComponent(pi.routeConfig.component??pi.component,{index:this.location.length,injector:oa,environmentInjector:A??this.environmentInjector}),Zr.next(G.instance),It=this.stackCtrl.createView(this.activated,D),this.proxyMap.set(G.instance,Mo),this.currentActivatedRoute$.next({component:G.instance,activatedRoute:D})}this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activatedView=It,this.navCtrl.setTopOutlet(this);const Yn=this.stackCtrl.getActiveView();this.stackWillChange.emit({enteringView:It,tabSwitch:li(It,Yn)}),this.stackCtrl.setActive(It).then(pi=>{this.activateEvents.emit(G.instance),this.stackDidChange.emit(pi)})}canGoBack(D=1,A){return this.stackCtrl.canGoBack(D,A)}pop(D=1,A){return this.stackCtrl.pop(D,A)}getLastUrl(D){const A=this.stackCtrl.getLastUrl(D);return A?A.url:void 0}getLastRouteView(D){return this.stackCtrl.getLastUrl(D)}getRootView(D){return this.stackCtrl.getRootUrl(D)}getActiveStackId(){return this.stackCtrl.getActiveStackId()}createActivatedRouteProxy(D,A){const G=new me.gz;return G._futureSnapshot=A._futureSnapshot,G._routerState=A._routerState,G.snapshot=A.snapshot,G.outlet=A.outlet,G.component=A.component,G._paramMap=this.proxyObservable(D,"paramMap"),G._queryParamMap=this.proxyObservable(D,"queryParamMap"),G.url=this.proxyObservable(D,"url"),G.params=this.proxyObservable(D,"params"),G.queryParams=this.proxyObservable(D,"queryParams"),G.fragment=this.proxyObservable(D,"fragment"),G.data=this.proxyObservable(D,"data"),G}proxyObservable(D,A){return D.pipe((0,Le.h)(G=>!!G),(0,ye.w)(G=>this.currentActivatedRoute$.pipe((0,Le.h)(It=>null!==It&&It.component===G),(0,ye.w)(It=>It&&It.activatedRoute[A]),(0,gt.x)())))}updateActivatedRouteProxy(D,A){const G=this.proxyMap.get(D);if(!G)throw new Error("Could not find activated route proxy for view");G._futureSnapshot=A._futureSnapshot,G._routerState=A._routerState,G.snapshot=A.snapshot,G.outlet=A.outlet,G.component=A.component,this.currentActivatedRoute$.next({component:D,activatedRoute:A})}}return v.\u0275fac=function(D){return new(D||v)(h.$8M("name"),h.$8M("tabs"),h.Y36(De.Ye),h.Y36(h.SBq),h.Y36(me.F0),h.Y36(h.R0b),h.Y36(me.gz),h.Y36(v,12))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-router-outlet"]],inputs:{animated:"animated",animation:"animation",mode:"mode",swipeGesture:"swipeGesture",name:"name"},outputs:{stackWillChange:"stackWillChange",stackDidChange:"stackDidChange",activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),v})();class bo{constructor(M,D,A){this.route=M,this.childContexts=D,this.parent=A}get(M,D){return M===me.gz?this.route:M===me.y6?this.childContexts:this.parent.get(M,D)}}const Oo=new h.OlP("");let Ti=(()=>{class v{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(D){this.unsubscribeFromRouteData(D),this.subscribeToRouteData(D)}unsubscribeFromRouteData(D){this.outletDataSubscriptions.get(D)?.unsubscribe(),this.outletDataSubscriptions.delete(D)}subscribeToRouteData(D){const{activatedRoute:A}=D,G=(0,C.a)([A.queryParams,A.params,A.data]).pipe((0,ye.w)(([It,Yn,pi],tr)=>(pi={...It,...Yn,...pi},0===tr?(0,Ne.of)(pi):Promise.resolve(pi)))).subscribe(It=>{if(!D.isActivated||!D.activatedComponentRef||D.activatedRoute!==A||null===A.component)return void this.unsubscribeFromRouteData(D);const Yn=(0,h.qFp)(A.component);if(Yn)for(const{templateName:pi}of Yn.inputs)D.activatedComponentRef.setInput(pi,It[pi]);else this.unsubscribeFromRouteData(D)});this.outletDataSubscriptions.set(D,G)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})(),Xo=(()=>{class v{constructor(D,A,G){this.routerOutlet=D,this.navCtrl=A,this.config=G}onClick(D){const A=this.defaultHref||this.config.get("backButtonDefaultHref");this.routerOutlet?.canGoBack()?(this.navCtrl.setDirection("back",void 0,void 0,this.routerAnimation),this.routerOutlet.pop(),D.preventDefault()):null!=A&&(this.navCtrl.navigateBack(A,{animation:this.routerAnimation}),D.preventDefault())}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(br,8),h.Y36(co),h.Y36(di))},v.\u0275dir=h.lG2({type:v,selectors:[["ion-back-button"]],hostBindings:function(D,A){1&D&&h.NdJ("click",function(It){return A.onClick(It)})},inputs:{defaultHref:"defaultHref",routerAnimation:"routerAnimation"}}),v})(),Br=(()=>{class v{constructor(D,A,G,It,Yn){this.locationStrategy=D,this.navCtrl=A,this.elementRef=G,this.router=It,this.routerLink=Yn,this.routerDirection="forward"}ngOnInit(){this.updateTargetUrlAndHref()}ngOnChanges(){this.updateTargetUrlAndHref()}updateTargetUrlAndHref(){if(this.routerLink?.urlTree){const D=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));this.elementRef.nativeElement.href=D}}onClick(D){this.navCtrl.setDirection(this.routerDirection,void 0,void 0,this.routerAnimation),D.preventDefault()}}return v.\u0275fac=function(D){return new(D||v)(h.Y36(De.S$),h.Y36(co),h.Y36(h.SBq),h.Y36(me.F0),h.Y36(me.rH,8))},v.\u0275dir=h.lG2({type:v,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(D,A){1&D&&h.NdJ("click",function(It){return A.onClick(It)})},inputs:{routerDirection:"routerDirection",routerAnimation:"routerAnimation"},features:[h.TTD]}),v})();const Ho={provide:y.Cf,useExisting:(0,h.Gpc)(()=>hr),multi:!0};let hr=(()=>{class v extends y.Fd{}return v.\u0275fac=function(){let M;return function(A){return(M||(M=h.n5z(v)))(A||v)}}(),v.\u0275dir=h.lG2({type:v,selectors:[["ion-input","type","number","max","","formControlName",""],["ion-input","type","number","max","","formControl",""],["ion-input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(D,A){2&D&&h.uIk("max",A._enabled?A.max:null)},features:[h._Bn([Ho]),h.qOj]}),v})();const Ps={provide:y.Cf,useExisting:(0,h.Gpc)(()=>Qo),multi:!0};let Qo=(()=>{class v extends y.qQ{}return v.\u0275fac=function(){let M;return function(A){return(M||(M=h.n5z(v)))(A||v)}}(),v.\u0275dir=h.lG2({type:v,selectors:[["ion-input","type","number","min","","formControlName",""],["ion-input","type","number","min","","formControl",""],["ion-input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(D,A){2&D&&h.uIk("min",A._enabled?A.min:null)},features:[h._Bn([Ps]),h.qOj]}),v})();class hs{constructor(M){this.ctrl=M}create(M){return this.ctrl.create(M||{})}dismiss(M,D,A){return this.ctrl.dismiss(M,D,A)}getTop(){return this.ctrl.getTop()}}let Cs=(()=>{class v extends hs{constructor(){super(et.b)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})(),or=(()=>{class v extends hs{constructor(){super(et.a)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})(),Qa=(()=>{class v extends hs{constructor(){super(et.l)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})(),Ur=(()=>{class v extends hs{constructor(){super(et.m),this.angularDelegate=(0,h.f3M)(ds),this.injector=(0,h.f3M)(h.zs3),this.environmentInjector=(0,h.f3M)(h.lqb)}create(D){return super.create({...D,delegate:this.angularDelegate.create(this.environmentInjector,this.injector,"modal")})}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})(),fs=(()=>{class v extends hs{constructor(){super(et.c),this.angularDelegate=(0,h.f3M)(ds),this.injector=(0,h.f3M)(h.zs3),this.environmentInjector=(0,h.f3M)(h.lqb)}create(D){return super.create({...D,delegate:this.angularDelegate.create(this.environmentInjector,this.injector,"popover")})}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac}),v})(),Do=(()=>{class v extends hs{constructor(){super(et.t)}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275prov=h.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})();class yo{shouldDetach(M){return!1}shouldAttach(M){return!1}store(M,D){}retrieve(M){return null}shouldReuseRoute(M,D){if(M.routeConfig!==D.routeConfig)return!1;const A=M.params,G=D.params,It=Object.keys(A),Yn=Object.keys(G);if(It.length!==Yn.length)return!1;for(const pi of It)if(G[pi]!==A[pi])return!1;return!0}}const ra=(v,M,D)=>()=>{if(M.defaultView&&typeof window<"u"){(0,Ie.s)({...v,_zoneGate:It=>D.run(It)});const G="__zone_symbol__addEventListener"in M.body?"__zone_symbol__addEventListener":"addEventListener";return function Pe(){var v=[];if(typeof window<"u"){var M=window;(!M.customElements||M.Element&&(!M.Element.prototype.closest||!M.Element.prototype.matches||!M.Element.prototype.remove||!M.Element.prototype.getRootNode))&&v.push(k.e(6748).then(k.t.bind(k,3342,23))),("function"!=typeof Object.assign||!Object.entries||!Array.prototype.find||!Array.prototype.includes||!String.prototype.startsWith||!String.prototype.endsWith||M.NodeList&&!M.NodeList.prototype.forEach||!M.fetch||!function(){try{var A=new URL("b","http://a");return A.pathname="c%20d","http://a/c%20d"===A.href&&A.searchParams}catch{return!1}}()||typeof WeakMap>"u")&&v.push(k.e(2214).then(k.t.bind(k,2668,23)))}return Promise.all(v)}().then(()=>((v,M)=>{if(!(typeof window>"u"))return Ae(),(0,ct.b)(JSON.parse('[["ion-menu_3",[[33,"ion-menu-button",{"color":[513],"disabled":[4],"menu":[1],"autoHide":[4,"auto-hide"],"type":[1],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]],[33,"ion-menu",{"contentId":[513,"content-id"],"menuId":[513,"menu-id"],"type":[1025],"disabled":[1028],"side":[513],"swipeGesture":[4,"swipe-gesture"],"maxEdgeStart":[2,"max-edge-start"],"isPaneVisible":[32],"isEndSide":[32],"isOpen":[64],"isActive":[64],"open":[64],"close":[64],"toggle":[64],"setOpen":[64]},[[16,"ionSplitPaneVisible","onSplitPaneChanged"],[2,"click","onBackdropClick"],[0,"keydown","onKeydown"]]],[1,"ion-menu-toggle",{"menu":[1],"autoHide":[4,"auto-hide"],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]]]],["ion-fab_3",[[33,"ion-fab-button",{"color":[513],"activated":[4],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1],"show":[4],"translucent":[4],"type":[1],"size":[1],"closeIcon":[1,"close-icon"]}],[1,"ion-fab",{"horizontal":[1],"vertical":[1],"edge":[4],"activated":[1028],"close":[64],"toggle":[64]}],[1,"ion-fab-list",{"activated":[4],"side":[1]}]]],["ion-refresher_2",[[0,"ion-refresher-content",{"pullingIcon":[1025,"pulling-icon"],"pullingText":[1,"pulling-text"],"refreshingSpinner":[1025,"refreshing-spinner"],"refreshingText":[1,"refreshing-text"]}],[32,"ion-refresher",{"pullMin":[2,"pull-min"],"pullMax":[2,"pull-max"],"closeDuration":[1,"close-duration"],"snapbackDuration":[1,"snapback-duration"],"pullFactor":[2,"pull-factor"],"disabled":[4],"nativeRefresher":[32],"state":[32],"complete":[64],"cancel":[64],"getProgress":[64]}]]],["ion-back-button",[[33,"ion-back-button",{"color":[513],"defaultHref":[1025,"default-href"],"disabled":[516],"icon":[1],"text":[1],"type":[1],"routerAnimation":[16]}]]],["ion-toast",[[33,"ion-toast",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"color":[513],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"duration":[2],"header":[1],"layout":[1],"message":[1],"keyboardClose":[4,"keyboard-close"],"position":[1],"buttons":[16],"translucent":[4],"animated":[4],"icon":[1],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"revealContentToScreenReader":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-card_5",[[33,"ion-card",{"color":[513],"button":[4],"type":[1],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}],[32,"ion-card-content"],[33,"ion-card-header",{"color":[513],"translucent":[4]}],[33,"ion-card-subtitle",{"color":[513]}],[33,"ion-card-title",{"color":[513]}]]],["ion-item-option_3",[[33,"ion-item-option",{"color":[513],"disabled":[4],"download":[1],"expandable":[4],"href":[1],"rel":[1],"target":[1],"type":[1]}],[32,"ion-item-options",{"side":[1],"fireSwipeEvent":[64]}],[0,"ion-item-sliding",{"disabled":[4],"state":[32],"getOpenAmount":[64],"getSlidingRatio":[64],"open":[64],"close":[64],"closeOpened":[64]}]]],["ion-accordion_2",[[49,"ion-accordion",{"value":[1],"disabled":[4],"readonly":[4],"toggleIcon":[1,"toggle-icon"],"toggleIconSlot":[1,"toggle-icon-slot"],"state":[32],"isNext":[32],"isPrevious":[32]}],[33,"ion-accordion-group",{"animated":[4],"multiple":[4],"value":[1025],"disabled":[4],"readonly":[4],"expand":[1],"requestAccordionToggle":[64],"getAccordions":[64]},[[0,"keydown","onKeydown"]]]]],["ion-infinite-scroll_2",[[32,"ion-infinite-scroll-content",{"loadingSpinner":[1025,"loading-spinner"],"loadingText":[1,"loading-text"]}],[0,"ion-infinite-scroll",{"threshold":[1],"disabled":[4],"position":[1],"isLoading":[32],"complete":[64]}]]],["ion-reorder_2",[[33,"ion-reorder",null,[[2,"click","onClick"]]],[0,"ion-reorder-group",{"disabled":[4],"state":[32],"complete":[64]}]]],["ion-segment_2",[[33,"ion-segment-button",{"disabled":[1028],"layout":[1],"type":[1],"value":[8],"checked":[32],"setFocus":[64]}],[33,"ion-segment",{"color":[513],"disabled":[4],"scrollable":[4],"swipeGesture":[4,"swipe-gesture"],"value":[1032],"selectOnFocus":[4,"select-on-focus"],"activated":[32]},[[0,"keydown","onKeyDown"]]]]],["ion-tab-bar_2",[[33,"ion-tab-button",{"disabled":[4],"download":[1],"href":[1],"rel":[1],"layout":[1025],"selected":[1028],"tab":[1],"target":[1]},[[8,"ionTabBarChanged","onTabBarChanged"]]],[33,"ion-tab-bar",{"color":[513],"selectedTab":[1,"selected-tab"],"translucent":[4],"keyboardVisible":[32]}]]],["ion-chip",[[1,"ion-chip",{"color":[513],"outline":[4],"disabled":[4]}]]],["ion-datetime-button",[[33,"ion-datetime-button",{"color":[513],"disabled":[516],"datetime":[1],"datetimePresentation":[32],"dateText":[32],"timeText":[32],"datetimeActive":[32],"selectedButton":[32]}]]],["ion-input",[[38,"ion-input",{"color":[513],"accept":[1],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"clearOnEdit":[4,"clear-on-edit"],"counter":[4],"counterFormatter":[16],"debounce":[2],"disabled":[4],"enterkeyhint":[1],"errorText":[1,"error-text"],"fill":[1],"inputmode":[1],"helperText":[1,"helper-text"],"label":[1],"labelPlacement":[1,"label-placement"],"legacy":[4],"max":[8],"maxlength":[2],"min":[8],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"shape":[1],"spellcheck":[4],"step":[1],"size":[2],"type":[1],"value":[1032],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-searchbar",[[34,"ion-searchbar",{"color":[513],"animated":[4],"autocomplete":[1],"autocorrect":[1],"cancelButtonIcon":[1,"cancel-button-icon"],"cancelButtonText":[1,"cancel-button-text"],"clearIcon":[1,"clear-icon"],"debounce":[2],"disabled":[4],"inputmode":[1],"enterkeyhint":[1],"name":[1],"placeholder":[1],"searchIcon":[1,"search-icon"],"showCancelButton":[1,"show-cancel-button"],"showClearButton":[1,"show-clear-button"],"spellcheck":[4],"type":[1],"value":[1025],"focused":[32],"noAnimate":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-toggle",[[33,"ion-toggle",{"color":[513],"name":[1],"checked":[1028],"disabled":[4],"value":[1],"enableOnOffLabels":[4,"enable-on-off-labels"],"labelPlacement":[1,"label-placement"],"legacy":[4],"justify":[1],"activated":[32]}]]],["ion-nav_2",[[1,"ion-nav",{"delegate":[16],"swipeGesture":[1028,"swipe-gesture"],"animated":[4],"animation":[16],"rootParams":[16],"root":[1],"push":[64],"insert":[64],"insertPages":[64],"pop":[64],"popTo":[64],"popToRoot":[64],"removeIndex":[64],"setRoot":[64],"setPages":[64],"setRouteId":[64],"getRouteId":[64],"getActive":[64],"getByIndex":[64],"canGoBack":[64],"getPrevious":[64]}],[0,"ion-nav-link",{"component":[1],"componentProps":[16],"routerDirection":[1,"router-direction"],"routerAnimation":[16]}]]],["ion-textarea",[[38,"ion-textarea",{"color":[513],"autocapitalize":[1],"autofocus":[4],"clearOnEdit":[4,"clear-on-edit"],"debounce":[2],"disabled":[4],"fill":[1],"inputmode":[1],"enterkeyhint":[1],"maxlength":[2],"minlength":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"cols":[2],"rows":[2],"wrap":[1],"autoGrow":[516,"auto-grow"],"value":[1025],"counter":[4],"counterFormatter":[16],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"label":[1],"labelPlacement":[1,"label-placement"],"legacy":[4],"shape":[1],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-backdrop",[[33,"ion-backdrop",{"visible":[4],"tappable":[4],"stopPropagation":[4,"stop-propagation"]},[[2,"click","onMouseDown"]]]]],["ion-loading",[[34,"ion-loading",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"message":[1],"cssClass":[1,"css-class"],"duration":[2],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"spinner":[1025],"translucent":[4],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-breadcrumb_2",[[33,"ion-breadcrumb",{"collapsed":[4],"last":[4],"showCollapsedIndicator":[4,"show-collapsed-indicator"],"color":[1],"active":[4],"disabled":[4],"download":[1],"href":[1],"rel":[1],"separator":[4],"target":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16]}],[33,"ion-breadcrumbs",{"color":[513],"maxItems":[2,"max-items"],"itemsBeforeCollapse":[2,"items-before-collapse"],"itemsAfterCollapse":[2,"items-after-collapse"],"collapsed":[32],"activeChanged":[32]},[[0,"collapsedClick","onCollapsedClick"]]]]],["ion-modal",[[33,"ion-modal",{"hasController":[4,"has-controller"],"overlayIndex":[2,"overlay-index"],"delegate":[16],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"breakpoints":[16],"initialBreakpoint":[2,"initial-breakpoint"],"backdropBreakpoint":[2,"backdrop-breakpoint"],"handle":[4],"handleBehavior":[1,"handle-behavior"],"component":[1],"componentProps":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"animated":[4],"presentingElement":[16],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"keepContentsMounted":[4,"keep-contents-mounted"],"canDismiss":[4,"can-dismiss"],"presented":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64],"setCurrentBreakpoint":[64],"getCurrentBreakpoint":[64]}]]],["ion-route_4",[[0,"ion-route",{"url":[1],"component":[1],"componentProps":[16],"beforeLeave":[16],"beforeEnter":[16]}],[0,"ion-route-redirect",{"from":[1],"to":[1]}],[0,"ion-router",{"root":[1],"useHash":[4,"use-hash"],"canTransition":[64],"push":[64],"back":[64],"printDebug":[64],"navChanged":[64]},[[8,"popstate","onPopState"],[4,"ionBackButton","onBackButton"]]],[1,"ion-router-link",{"color":[513],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}]]],["ion-avatar_3",[[33,"ion-avatar"],[33,"ion-badge",{"color":[513]}],[1,"ion-thumbnail"]]],["ion-col_3",[[1,"ion-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]],[1,"ion-grid",{"fixed":[4]}],[1,"ion-row"]]],["ion-tab_2",[[1,"ion-tab",{"active":[1028],"delegate":[16],"tab":[1],"component":[1],"setActive":[64]}],[1,"ion-tabs",{"useRouter":[1028,"use-router"],"selectedTab":[32],"select":[64],"getTab":[64],"getSelected":[64],"setRouteId":[64],"getRouteId":[64]}]]],["ion-img",[[1,"ion-img",{"alt":[1],"src":[1],"loadSrc":[32],"loadError":[32]}]]],["ion-progress-bar",[[33,"ion-progress-bar",{"type":[1],"reversed":[4],"value":[2],"buffer":[2],"color":[513]}]]],["ion-range",[[33,"ion-range",{"color":[513],"debounce":[2],"name":[1],"label":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"pinFormatter":[16],"snaps":[4],"step":[2],"ticks":[4],"activeBarStart":[1026,"active-bar-start"],"disabled":[4],"value":[1026],"labelPlacement":[1,"label-placement"],"legacy":[4],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]]],["ion-split-pane",[[33,"ion-split-pane",{"contentId":[513,"content-id"],"disabled":[4],"when":[8],"visible":[32]}]]],["ion-text",[[1,"ion-text",{"color":[513]}]]],["ion-item_8",[[33,"ion-item-divider",{"color":[513],"sticky":[4]}],[32,"ion-item-group"],[1,"ion-skeleton-text",{"animated":[4]}],[32,"ion-list",{"lines":[1],"inset":[4],"closeSlidingItems":[64]}],[33,"ion-list-header",{"color":[513],"lines":[1]}],[49,"ion-item",{"color":[513],"button":[4],"detail":[4],"detailIcon":[1,"detail-icon"],"disabled":[4],"download":[1],"fill":[1],"shape":[1],"href":[1],"rel":[1],"lines":[1],"counter":[4],"routerAnimation":[16],"routerDirection":[1,"router-direction"],"target":[1],"type":[1],"counterFormatter":[16],"multipleInputs":[32],"focusable":[32],"counterString":[32]},[[0,"ionInput","handleIonInput"],[0,"ionColor","labelColorChanged"],[0,"ionStyle","itemStyle"]]],[34,"ion-label",{"color":[513],"position":[1],"noAnimate":[32]}],[33,"ion-note",{"color":[513]}]]],["ion-select_3",[[33,"ion-select",{"cancelText":[1,"cancel-text"],"color":[513],"compareWith":[1,"compare-with"],"disabled":[4],"fill":[1],"interface":[1],"interfaceOptions":[8,"interface-options"],"justify":[1],"label":[1],"labelPlacement":[1,"label-placement"],"legacy":[4],"multiple":[4],"name":[1],"okText":[1,"ok-text"],"placeholder":[1],"selectedText":[1,"selected-text"],"toggleIcon":[1,"toggle-icon"],"expandedIcon":[1,"expanded-icon"],"shape":[1],"value":[1032],"isExpanded":[32],"open":[64]}],[1,"ion-select-option",{"disabled":[4],"value":[8]}],[34,"ion-select-popover",{"header":[1],"subHeader":[1,"sub-header"],"message":[1],"multiple":[4],"options":[16]}]]],["ion-picker-internal",[[33,"ion-picker-internal",{"exitInputMode":[64]},[[1,"touchstart","preventTouchStartPropagation"]]]]],["ion-datetime_3",[[33,"ion-datetime",{"color":[1],"name":[1],"disabled":[4],"readonly":[4],"isDateEnabled":[16],"min":[1025],"max":[1025],"presentation":[1],"cancelText":[1,"cancel-text"],"doneText":[1,"done-text"],"clearText":[1,"clear-text"],"yearValues":[8,"year-values"],"monthValues":[8,"month-values"],"dayValues":[8,"day-values"],"hourValues":[8,"hour-values"],"minuteValues":[8,"minute-values"],"locale":[1],"firstDayOfWeek":[2,"first-day-of-week"],"titleSelectedDatesFormatter":[16],"multiple":[4],"highlightedDates":[16],"value":[1025],"showDefaultTitle":[4,"show-default-title"],"showDefaultButtons":[4,"show-default-buttons"],"showClearButton":[4,"show-clear-button"],"showDefaultTimeLabel":[4,"show-default-time-label"],"hourCycle":[1,"hour-cycle"],"size":[1],"preferWheel":[4,"prefer-wheel"],"showMonthAndYear":[32],"activeParts":[32],"workingParts":[32],"isTimePopoverOpen":[32],"confirm":[64],"reset":[64],"cancel":[64]}],[34,"ion-picker",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"columns":[16],"cssClass":[1,"css-class"],"duration":[2],"showBackdrop":[4,"show-backdrop"],"backdropDismiss":[4,"backdrop-dismiss"],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"presented":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64],"getColumn":[64]}],[32,"ion-picker-column",{"col":[16]}]]],["ion-radio_2",[[33,"ion-radio",{"color":[513],"name":[1],"disabled":[4],"value":[8],"labelPlacement":[1,"label-placement"],"legacy":[4],"justify":[1],"checked":[32],"buttonTabindex":[32],"setFocus":[64],"setButtonTabindex":[64]}],[0,"ion-radio-group",{"allowEmptySelection":[4,"allow-empty-selection"],"name":[1],"value":[1032]},[[4,"keydown","onKeydown"]]]]],["ion-ripple-effect",[[1,"ion-ripple-effect",{"type":[1],"addRipple":[64]}]]],["ion-button_2",[[33,"ion-button",{"color":[513],"buttonType":[1025,"button-type"],"disabled":[516],"expand":[513],"fill":[1537],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"download":[1],"href":[1],"rel":[1],"shape":[513],"size":[513],"strong":[4],"target":[1],"type":[1],"form":[1]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]}]]],["ion-action-sheet",[[34,"ion-action-sheet",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"header":[1],"subHeader":[1,"sub-header"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-alert",[[34,"ion-alert",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"hasController":[4,"has-controller"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"header":[1],"subHeader":[1,"sub-header"],"message":[1],"buttons":[16],"inputs":[1040],"backdropDismiss":[4,"backdrop-dismiss"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"isOpen":[4,"is-open"],"trigger":[1],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]},[[4,"keydown","onKeydown"]]]]],["ion-app_8",[[0,"ion-app",{"setFocus":[64]}],[1,"ion-content",{"color":[513],"fullscreen":[4],"forceOverscroll":[1028,"force-overscroll"],"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"scrollEvents":[4,"scroll-events"],"getScrollElement":[64],"getBackgroundElement":[64],"scrollToTop":[64],"scrollToBottom":[64],"scrollByPoint":[64],"scrollToPoint":[64]},[[8,"appload","onAppLoad"],[9,"resize","onResize"]]],[36,"ion-footer",{"collapse":[1],"translucent":[4],"keyboardVisible":[32]}],[36,"ion-header",{"collapse":[1],"translucent":[4]}],[1,"ion-router-outlet",{"mode":[1025],"delegate":[16],"animated":[4],"animation":[16],"swipeHandler":[16],"commit":[64],"setRouteId":[64],"getRouteId":[64]}],[33,"ion-title",{"color":[513],"size":[1]}],[33,"ion-toolbar",{"color":[513]},[[0,"ionStyle","childrenStyle"]]],[34,"ion-buttons",{"collapse":[4]}]]],["ion-picker-column-internal",[[33,"ion-picker-column-internal",{"items":[16],"value":[1032],"color":[513],"numericInput":[4,"numeric-input"],"isActive":[32],"scrollActiveItemIntoView":[64],"setValue":[64]}]]],["ion-popover",[[33,"ion-popover",{"hasController":[4,"has-controller"],"delegate":[16],"overlayIndex":[2,"overlay-index"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"keyboardClose":[4,"keyboard-close"],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"event":[8],"showBackdrop":[4,"show-backdrop"],"translucent":[4],"animated":[4],"htmlAttributes":[16],"triggerAction":[1,"trigger-action"],"trigger":[1],"size":[1],"dismissOnSelect":[4,"dismiss-on-select"],"reference":[1],"side":[1],"alignment":[1025],"arrow":[4],"isOpen":[4,"is-open"],"keyboardEvents":[4,"keyboard-events"],"keepContentsMounted":[4,"keep-contents-mounted"],"presented":[32],"presentFromTrigger":[64],"present":[64],"dismiss":[64],"getParentPopover":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-checkbox",[[33,"ion-checkbox",{"color":[513],"name":[1],"checked":[1028],"indeterminate":[1028],"disabled":[4],"value":[8],"labelPlacement":[1,"label-placement"],"justify":[1],"legacy":[4]}]]],["ion-spinner",[[1,"ion-spinner",{"color":[513],"duration":[2],"name":[1],"paused":[4]}]]]]'),M)})(0,{exclude:["ion-tabs","ion-tab"],syncQueue:!0,raf:Fe,jmp:It=>D.runOutsideAngular(It),ael(It,Yn,pi,tr){It[G](Yn,pi,tr)},rel(It,Yn,pi,tr){It.removeEventListener(Yn,pi,tr)}}))}};let ki=(()=>{class v{static forRoot(D){return{ngModule:v,providers:[{provide:Ai,useValue:D},{provide:h.ip1,useFactory:ra,multi:!0,deps:[Ai,De.K0,h.R0b]},{provide:Oo,useFactory:Ws,deps:[me.F0]}]}}}return v.\u0275fac=function(D){return new(D||v)},v.\u0275mod=h.oAB({type:v}),v.\u0275inj=h.cJS({providers:[ds,Ur,fs],imports:[De.ez]}),v})();function Ws(v){return v?.componentInputBindingEnabled?new Ti:null}},3999:(Nn,yt,k)=>{"use strict";k.d(yt,{Zw:()=>Ie,aw:()=>Je,X$:()=>Te,sK:()=>qt});var x=k(1180),h=k(2029),y=k(2096),s=k(2664),J=k(9315),ie=k(5211),Y=k(4911),C=k(8180),Ne=k(8645),me=k(4552);class he extends Ne.x{constructor(Fe=1/0,St=1/0,Ce=me.l){super(),this._bufferSize=Fe,this._windowTime=St,this._timestampProvider=Ce,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=St===1/0,this._bufferSize=Math.max(1,Fe),this._windowTime=Math.max(1,St)}next(Fe){const{isStopped:St,_buffer:Ce,_infiniteTimeWindow:Rt,_timestampProvider:Qt,_windowTime:Gt}=this;St||(Ce.push(Fe),!Rt&&Ce.push(Qt.now()+Gt)),this._trimBuffer(),super.next(Fe)}_subscribe(Fe){this._throwIfClosed(),this._trimBuffer();const St=this._innerSubscribe(Fe),{_infiniteTimeWindow:Ce,_buffer:Rt}=this,Qt=Rt.slice();for(let Gt=0;Gtnew he(Ce,Fe,St),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:Rt})}var ae=k(7398),oe=k(6328),Be=k(4664);class Ie{}let Ee=(()=>{var Re;class Fe extends Ie{getTranslation(Ce){return(0,y.of)({})}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(){let St;return function(Rt){return(St||(St=h.n5z(Re)))(Rt||Re)}}()),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();class Ue{}let et=(()=>{var Re;class Fe{handle(Ce){return Ce.key}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)}),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();function le(Re,Fe){if(Re===Fe)return!0;if(null===Re||null===Fe)return!1;if(Re!=Re&&Fe!=Fe)return!0;let Rt,Qt,Gt,St=typeof Re;if(St==typeof Fe&&"object"==St){if(!Array.isArray(Re)){if(Array.isArray(Fe))return!1;for(Qt in Gt=Object.create(null),Re){if(!le(Re[Qt],Fe[Qt]))return!1;Gt[Qt]=!0}for(Qt in Fe)if(!(Qt in Gt)&&typeof Fe[Qt]<"u")return!1;return!0}if(!Array.isArray(Fe))return!1;if((Rt=Re.length)==Fe.length){for(Qt=0;Qt{ct(Fe[Ce])?Ce in Re?St[Ce]=ht(Re[Ce],Fe[Ce]):Object.assign(St,{[Ce]:Fe[Ce]}):Object.assign(St,{[Ce]:Fe[Ce]})}),St}class Le{}let ye=(()=>{var Re;class Fe extends Le{constructor(...Ce){super(...Ce),(0,x.Z)(this,"templateMatcher",/{{\s?([^{}\s]*)\s?}}/g)}interpolate(Ce,Rt){let Qt;return Qt="string"==typeof Ce?this.interpolateString(Ce,Rt):"function"==typeof Ce?this.interpolateFunction(Ce,Rt):Ce,Qt}getValue(Ce,Rt){let Qt="string"==typeof Rt?Rt.split("."):[Rt];Rt="";do{Rt+=Qt.shift(),!ue(Ce)||!ue(Ce[Rt])||"object"!=typeof Ce[Rt]&&Qt.length?Qt.length?Rt+=".":Ce=void 0:(Ce=Ce[Rt],Rt="")}while(Qt.length);return Ce}interpolateFunction(Ce,Rt){return Ce(Rt)}interpolateString(Ce,Rt){return Rt?Ce.replace(this.templateMatcher,(Qt,Gt)=>{let Zt=this.getValue(Rt,Gt);return ue(Zt)?Zt:Qt}):Ce}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(){let St;return function(Rt){return(St||(St=h.n5z(Re)))(Rt||Re)}}()),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();class gt{}let De=(()=>{var Re;class Fe extends gt{compile(Ce,Rt){return Ce}compileTranslations(Ce,Rt){return Ce}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(){let St;return function(Rt){return(St||(St=h.n5z(Re)))(Rt||Re)}}()),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})();class Pe{constructor(){(0,x.Z)(this,"defaultLang",void 0),(0,x.Z)(this,"currentLang",this.defaultLang),(0,x.Z)(this,"translations",{}),(0,x.Z)(this,"langs",[]),(0,x.Z)(this,"onTranslationChange",new h.vpe),(0,x.Z)(this,"onLangChange",new h.vpe),(0,x.Z)(this,"onDefaultLangChange",new h.vpe)}}const Ae=new h.OlP("USE_STORE"),Ye=new h.OlP("USE_DEFAULT_LANG"),_t=new h.OlP("DEFAULT_LANGUAGE"),hn=new h.OlP("USE_EXTEND");let qt=(()=>{var Re;class Fe{get onTranslationChange(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange}get onLangChange(){return this.isolate?this._onLangChange:this.store.onLangChange}get onDefaultLangChange(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange}get defaultLang(){return this.isolate?this._defaultLang:this.store.defaultLang}set defaultLang(Ce){this.isolate?this._defaultLang=Ce:this.store.defaultLang=Ce}get currentLang(){return this.isolate?this._currentLang:this.store.currentLang}set currentLang(Ce){this.isolate?this._currentLang=Ce:this.store.currentLang=Ce}get langs(){return this.isolate?this._langs:this.store.langs}set langs(Ce){this.isolate?this._langs=Ce:this.store.langs=Ce}get translations(){return this.isolate?this._translations:this.store.translations}set translations(Ce){this.isolate?this._translations=Ce:this.store.translations=Ce}constructor(Ce,Rt,Qt,Gt,Zt,Jt=!0,kt=!1,dt=!1,Ot){(0,x.Z)(this,"store",void 0),(0,x.Z)(this,"currentLoader",void 0),(0,x.Z)(this,"compiler",void 0),(0,x.Z)(this,"parser",void 0),(0,x.Z)(this,"missingTranslationHandler",void 0),(0,x.Z)(this,"useDefaultLang",void 0),(0,x.Z)(this,"isolate",void 0),(0,x.Z)(this,"extend",void 0),(0,x.Z)(this,"loadingTranslations",void 0),(0,x.Z)(this,"pending",!1),(0,x.Z)(this,"_onTranslationChange",new h.vpe),(0,x.Z)(this,"_onLangChange",new h.vpe),(0,x.Z)(this,"_onDefaultLangChange",new h.vpe),(0,x.Z)(this,"_defaultLang",void 0),(0,x.Z)(this,"_currentLang",void 0),(0,x.Z)(this,"_langs",[]),(0,x.Z)(this,"_translations",{}),(0,x.Z)(this,"_translationRequests",{}),this.store=Ce,this.currentLoader=Rt,this.compiler=Qt,this.parser=Gt,this.missingTranslationHandler=Zt,this.useDefaultLang=Jt,this.isolate=kt,this.extend=dt,Ot&&this.setDefaultLang(Ot)}setDefaultLang(Ce){if(Ce===this.defaultLang)return;let Rt=this.retrieveTranslations(Ce);typeof Rt<"u"?(null==this.defaultLang&&(this.defaultLang=Ce),Rt.pipe((0,C.q)(1)).subscribe(Qt=>{this.changeDefaultLang(Ce)})):this.changeDefaultLang(Ce)}getDefaultLang(){return this.defaultLang}use(Ce){if(Ce===this.currentLang)return(0,y.of)(this.translations[Ce]);let Rt=this.retrieveTranslations(Ce);return typeof Rt<"u"?(this.currentLang||(this.currentLang=Ce),Rt.pipe((0,C.q)(1)).subscribe(Qt=>{this.changeLang(Ce)}),Rt):(this.changeLang(Ce),(0,y.of)(this.translations[Ce]))}retrieveTranslations(Ce){let Rt;return(typeof this.translations[Ce]>"u"||this.extend)&&(this._translationRequests[Ce]=this._translationRequests[Ce]||this.getTranslation(Ce),Rt=this._translationRequests[Ce]),Rt}getTranslation(Ce){this.pending=!0;const Rt=this.currentLoader.getTranslation(Ce).pipe(ee(1),(0,C.q)(1));return this.loadingTranslations=Rt.pipe((0,ae.U)(Qt=>this.compiler.compileTranslations(Qt,Ce)),ee(1),(0,C.q)(1)),this.loadingTranslations.subscribe({next:Qt=>{this.translations[Ce]=this.extend&&this.translations[Ce]?{...Qt,...this.translations[Ce]}:Qt,this.updateLangs(),this.pending=!1},error:Qt=>{this.pending=!1}}),Rt}setTranslation(Ce,Rt,Qt=!1){Rt=this.compiler.compileTranslations(Rt,Ce),this.translations[Ce]=(Qt||this.extend)&&this.translations[Ce]?ht(this.translations[Ce],Rt):Rt,this.updateLangs(),this.onTranslationChange.emit({lang:Ce,translations:this.translations[Ce]})}getLangs(){return this.langs}addLangs(Ce){Ce.forEach(Rt=>{-1===this.langs.indexOf(Rt)&&this.langs.push(Rt)})}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResult(Ce,Rt,Qt){let Gt;if(Rt instanceof Array){let Zt={},Jt=!1;for(let kt of Rt)Zt[kt]=this.getParsedResult(Ce,kt,Qt),(0,s.b)(Zt[kt])&&(Jt=!0);if(Jt){const kt=Rt.map(dt=>(0,s.b)(Zt[dt])?Zt[dt]:(0,y.of)(Zt[dt]));return(0,J.D)(kt).pipe((0,ae.U)(dt=>{let Ot={};return dt.forEach((pt,Yt)=>{Ot[Rt[Yt]]=pt}),Ot}))}return Zt}if(Ce&&(Gt=this.parser.interpolate(this.parser.getValue(Ce,Rt),Qt)),typeof Gt>"u"&&null!=this.defaultLang&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(Gt=this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang],Rt),Qt)),typeof Gt>"u"){let Zt={key:Rt,translateService:this};typeof Qt<"u"&&(Zt.interpolateParams=Qt),Gt=this.missingTranslationHandler.handle(Zt)}return typeof Gt<"u"?Gt:Rt}get(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');if(this.pending)return this.loadingTranslations.pipe((0,oe.b)(Qt=>(Qt=this.getParsedResult(Qt,Ce,Rt),(0,s.b)(Qt)?Qt:(0,y.of)(Qt))));{let Qt=this.getParsedResult(this.translations[this.currentLang],Ce,Rt);return(0,s.b)(Qt)?Qt:(0,y.of)(Qt)}}getStreamOnTranslationChange(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');return(0,ie.z)((0,Y.P)(()=>this.get(Ce,Rt)),this.onTranslationChange.pipe((0,Be.w)(Qt=>{const Gt=this.getParsedResult(Qt.translations,Ce,Rt);return"function"==typeof Gt.subscribe?Gt:(0,y.of)(Gt)})))}stream(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');return(0,ie.z)((0,Y.P)(()=>this.get(Ce,Rt)),this.onLangChange.pipe((0,Be.w)(Qt=>{const Gt=this.getParsedResult(Qt.translations,Ce,Rt);return(0,s.b)(Gt)?Gt:(0,y.of)(Gt)})))}instant(Ce,Rt){if(!ue(Ce)||!Ce.length)throw new Error('Parameter "key" required');let Qt=this.getParsedResult(this.translations[this.currentLang],Ce,Rt);if((0,s.b)(Qt)){if(Ce instanceof Array){let Gt={};return Ce.forEach((Zt,Jt)=>{Gt[Ce[Jt]]=Ce[Jt]}),Gt}return Ce}return Qt}set(Ce,Rt,Qt=this.currentLang){this.translations[Qt][Ce]=this.compiler.compile(Rt,Qt),this.updateLangs(),this.onTranslationChange.emit({lang:Qt,translations:this.translations[Qt]})}changeLang(Ce){this.currentLang=Ce,this.onLangChange.emit({lang:Ce,translations:this.translations[Ce]}),null==this.defaultLang&&this.changeDefaultLang(Ce)}changeDefaultLang(Ce){this.defaultLang=Ce,this.onDefaultLangChange.emit({lang:Ce,translations:this.translations[Ce]})}reloadLang(Ce){return this.resetLang(Ce),this.getTranslation(Ce)}resetLang(Ce){this._translationRequests[Ce]=void 0,this.translations[Ce]=void 0}getBrowserLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let Ce=window.navigator.languages?window.navigator.languages[0]:null;return Ce=Ce||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,typeof Ce>"u"?void 0:(-1!==Ce.indexOf("-")&&(Ce=Ce.split("-")[0]),-1!==Ce.indexOf("_")&&(Ce=Ce.split("_")[0]),Ce)}getBrowserCultureLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let Ce=window.navigator.languages?window.navigator.languages[0]:null;return Ce=Ce||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,Ce}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)(h.LFG(Pe),h.LFG(Ie),h.LFG(gt),h.LFG(Le),h.LFG(Ue),h.LFG(Ye),h.LFG(Ae),h.LFG(hn),h.LFG(_t))}),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})(),Te=(()=>{var Re;class Fe{constructor(Ce,Rt){(0,x.Z)(this,"translate",void 0),(0,x.Z)(this,"_ref",void 0),(0,x.Z)(this,"value",""),(0,x.Z)(this,"lastKey",null),(0,x.Z)(this,"lastParams",[]),(0,x.Z)(this,"onTranslationChange",void 0),(0,x.Z)(this,"onLangChange",void 0),(0,x.Z)(this,"onDefaultLangChange",void 0),this.translate=Ce,this._ref=Rt}updateValue(Ce,Rt,Qt){let Gt=Zt=>{this.value=void 0!==Zt?Zt:Ce,this.lastKey=Ce,this._ref.markForCheck()};if(Qt){let Zt=this.translate.getParsedResult(Qt,Ce,Rt);(0,s.b)(Zt.subscribe)?Zt.subscribe(Gt):Gt(Zt)}this.translate.get(Ce,Rt).subscribe(Gt)}transform(Ce,...Rt){if(!Ce||!Ce.length)return Ce;if(le(Ce,this.lastKey)&&le(Rt,this.lastParams))return this.value;let Qt;if(ue(Rt[0])&&Rt.length)if("string"==typeof Rt[0]&&Rt[0].length){let Gt=Rt[0].replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g,'"$2":').replace(/:(\s)?(\')(.*?)(\')/g,':"$3"');try{Qt=JSON.parse(Gt)}catch{throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${Rt[0]}`)}}else"object"==typeof Rt[0]&&!Array.isArray(Rt[0])&&(Qt=Rt[0]);return this.lastKey=Ce,this.lastParams=Rt,this.updateValue(Ce,Qt),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(Gt=>{this.lastKey&&Gt.lang===this.translate.currentLang&&(this.lastKey=null,this.updateValue(Ce,Qt,Gt.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(Gt=>{this.lastKey&&(this.lastKey=null,this.updateValue(Ce,Qt,Gt.translations))})),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(Ce,Qt))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onDefaultLangChange<"u"&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)}ngOnDestroy(){this._dispose()}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)(h.Y36(qt,16),h.Y36(h.sBO,16))}),(0,x.Z)(Fe,"\u0275pipe",h.Yjl({name:"translate",type:Re,pure:!1})),(0,x.Z)(Fe,"\u0275prov",h.Yz7({token:Re,factory:Re.\u0275fac})),Fe})(),Je=(()=>{var Re;class Fe{static forRoot(Ce={}){return{ngModule:Fe,providers:[Ce.loader||{provide:Ie,useClass:Ee},Ce.compiler||{provide:gt,useClass:De},Ce.parser||{provide:Le,useClass:ye},Ce.missingTranslationHandler||{provide:Ue,useClass:et},Pe,{provide:Ae,useValue:Ce.isolate},{provide:Ye,useValue:Ce.useDefaultLang},{provide:hn,useValue:Ce.extend},{provide:_t,useValue:Ce.defaultLanguage},qt]}}static forChild(Ce={}){return{ngModule:Fe,providers:[Ce.loader||{provide:Ie,useClass:Ee},Ce.compiler||{provide:gt,useClass:De},Ce.parser||{provide:Le,useClass:ye},Ce.missingTranslationHandler||{provide:Ue,useClass:et},{provide:Ae,useValue:Ce.isolate},{provide:Ye,useValue:Ce.useDefaultLang},{provide:hn,useValue:Ce.extend},{provide:_t,useValue:Ce.defaultLanguage},qt]}}}return Re=Fe,(0,x.Z)(Fe,"\u0275fac",function(Ce){return new(Ce||Re)}),(0,x.Z)(Fe,"\u0275mod",h.oAB({type:Re})),(0,x.Z)(Fe,"\u0275inj",h.cJS({})),Fe})()},5861:(Nn,yt,k)=>{"use strict";function x(y,s,J,ie,Y,C,Ne){try{var me=y[C](Ne),he=me.value}catch(_e){return void J(_e)}me.done?s(he):Promise.resolve(he).then(ie,Y)}function h(y){return function(){var s=this,J=arguments;return new Promise(function(ie,Y){var C=y.apply(s,J);function Ne(he){x(C,ie,Y,Ne,me,"next",he)}function me(he){x(C,ie,Y,Ne,me,"throw",he)}Ne(void 0)})}}k.d(yt,{Z:()=>h})},1180:(Nn,yt,k)=>{"use strict";function x(J){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(ie){return typeof ie}:function(ie){return ie&&"function"==typeof Symbol&&ie.constructor===Symbol&&ie!==Symbol.prototype?"symbol":typeof ie})(J)}function s(J,ie,Y){return(ie=function y(J){var ie=function h(J,ie){if("object"!==x(J)||null===J)return J;var Y=J[Symbol.toPrimitive];if(void 0!==Y){var C=Y.call(J,ie||"default");if("object"!==x(C))return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===ie?String:Number)(J)}(J,"string");return"symbol"===x(ie)?ie:String(ie)}(ie))in J?Object.defineProperty(J,ie,{value:Y,enumerable:!0,configurable:!0,writable:!0}):J[ie]=Y,J}k.d(yt,{Z:()=>s})},7582:(Nn,yt,k)=>{"use strict";function J(Te,Je,Re,Fe){var Rt,St=arguments.length,Ce=St<3?Je:null===Fe?Fe=Object.getOwnPropertyDescriptor(Je,Re):Fe;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)Ce=Reflect.decorate(Te,Je,Re,Fe);else for(var Qt=Te.length-1;Qt>=0;Qt--)(Rt=Te[Qt])&&(Ce=(St<3?Rt(Ce):St>3?Rt(Je,Re,Ce):Rt(Je,Re))||Ce);return St>3&&Ce&&Object.defineProperty(Je,Re,Ce),Ce}function _e(Te,Je,Re,Fe){return new(Re||(Re=Promise))(function(Ce,Rt){function Qt(Jt){try{Zt(Fe.next(Jt))}catch(kt){Rt(kt)}}function Gt(Jt){try{Zt(Fe.throw(Jt))}catch(kt){Rt(kt)}}function Zt(Jt){Jt.done?Ce(Jt.value):function St(Ce){return Ce instanceof Re?Ce:new Re(function(Rt){Rt(Ce)})}(Jt.value).then(Qt,Gt)}Zt((Fe=Fe.apply(Te,Je||[])).next())})}function le(Te){return this instanceof le?(this.v=Te,this):new le(Te)}function ue(Te,Je,Re){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var St,Fe=Re.apply(Te,Je||[]),Ce=[];return St={},Rt("next"),Rt("throw"),Rt("return"),St[Symbol.asyncIterator]=function(){return this},St;function Rt(dt){Fe[dt]&&(St[dt]=function(Ot){return new Promise(function(pt,Yt){Ce.push([dt,Ot,pt,Yt])>1||Qt(dt,Ot)})})}function Qt(dt,Ot){try{!function Gt(dt){dt.value instanceof le?Promise.resolve(dt.value.v).then(Zt,Jt):kt(Ce[0][2],dt)}(Fe[dt](Ot))}catch(pt){kt(Ce[0][3],pt)}}function Zt(dt){Qt("next",dt)}function Jt(dt){Qt("throw",dt)}function kt(dt,Ot){dt(Ot),Ce.shift(),Ce.length&&Qt(Ce[0][0],Ce[0][1])}}function ht(Te){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Re,Je=Te[Symbol.asyncIterator];return Je?Je.call(Te):(Te=function Be(Te){var Je="function"==typeof Symbol&&Symbol.iterator,Re=Je&&Te[Je],Fe=0;if(Re)return Re.call(Te);if(Te&&"number"==typeof Te.length)return{next:function(){return Te&&Fe>=Te.length&&(Te=void 0),{value:Te&&Te[Fe++],done:!Te}}};throw new TypeError(Je?"Object is not iterable.":"Symbol.iterator is not defined.")}(Te),Re={},Fe("next"),Fe("throw"),Fe("return"),Re[Symbol.asyncIterator]=function(){return this},Re);function Fe(Ce){Re[Ce]=Te[Ce]&&function(Rt){return new Promise(function(Qt,Gt){!function St(Ce,Rt,Qt,Gt){Promise.resolve(Gt).then(function(Zt){Ce({value:Zt,done:Qt})},Rt)}(Qt,Gt,(Rt=Te[Ce](Rt)).done,Rt.value)})}}}k.d(yt,{FC:()=>ue,KL:()=>ht,gn:()=>J,mG:()=>_e,qq:()=>le}),"function"==typeof SuppressedError&&SuppressedError}},Nn=>{Nn(Nn.s=3108)}]); \ No newline at end of file